Foros del Web

Foros del Web (http://www.forosdelweb.com/)
-   Sistemas de gestión de contenidos (http://www.forosdelweb.com/f54/)
-   -   Problemas con mod Linklist en phpBB (http://www.forosdelweb.com/f54/problemas-con-mod-linklist-phpbb-484983/)

HHnn 26/04/2007 03:56

Problemas con mod Linklist en phpBB
 
Hola,

Instale el mod Linklist en en phpBB que se encuentra en el siguiente link:
http://www.phpbbhacks.com/download/5498

Pero lo que hace es agregar una pagina extra donde se encuentran los links, pero yo quiero que los links se encuentren en una tabla a la izquierda de la tabla donde aparecen los contenidos del foro (como un menu vertical), entonces lo que hice fue copiar el contenido del .tpl que vino en el mod y pegarlo en los otros .tpl en el lugar donde quiero que aparezcan los links, pero no se ven, hay que modificar otro archivo??? algun .php, o .cfg del subsilver???

Espero respuesta.

Saludos y gracias

Zuker 28/04/2007 08:17

Re: Problemas con mod Linklist en phpBB
 
Siempre que modifiques un .tpl que tenga variables, si las queres llevar a otro tpl, vas a tener que hacer que las variables sean llamadas desde el php.

Salvo que este en el page_header.php y entonces esas sirven para todas las plantillas.

HHnn 03/05/2007 04:41

Re: Problemas con mod Linklist en phpBB
 
Hola Zuker, gracias por responder,

No se como pasar las variables del php de este mod al php del foro. En este mod vienen algunos arhivos, entre ellos viene un php (links.php) que seria el que tiene las variables del tpl, ese php trae el siguiente codigo:
Cita:

<?php
//Benötigte Dateien und Variablen von phpBB
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, LINKS);
init_userprefs($userdata);
if (!isset($HTTP_GET_VARS['id']) && !isset($HTTP_GET_VARS['vote'])) {
$page_title = 'Links';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'links_body.tpl'
)
);
$folder_weblink = $images['folder_weblink'];
$vote_link = $images['folder_weblink'];
$vote_weblink_up = $images['vote_weblink_up'];
$vote_weblink_down = $images['vote_weblink_down'];
$template->assign_block_vars('links', array(
'LINKS' => $lang['Links'],
'FOLDER_WEBLINK_IMG' => $folder_weblink,
'VOTE_WEBLINK_UP_IMG' => $vote_weblink_up,
'VOTE_WEBLINK_DOWN_IMG' => $vote_weblink_down,
'NAME_DESC' => $lang['Name_Desc'],
'VISITS' => $lang['Visits'],
'POINTS' => $lang['Points'],
));
$sql='SELECT * FROM ' . LINKS_TABLE . '';
if(!$result = $db->sql_query($sql)) {
message_die(GENERAL_ERROR, 'Could not obtain links', '', __LINE__, __FILE__, $sql);
}
while($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('links.linkrow', array(
'LINKNAME' => $row['name'],
'LINKDESCRIPTION' => $row['description'],
'LINKVISITS' => $row['visits'],
'LINKPOINTS' => $row['points'],
'SHOWLINK' => ''.$_SERVER['PHP_SELF'].'?id='.$row['id'].'',
'UPLINK' => ''.$_SERVER['PHP_SELF'].'?id='.$row['id'].'&amp;vote=up',
'DOWNLINK' => ''.$_SERVER['PHP_SELF'].'?id='.$row['id'].'&amp;vote=down',
));
}
$template->pparse('body');
//Footer - nur dann weglassen, wenn du auch den Header weglässt
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
elseif (isset($HTTP_GET_VARS['id']) && !isset($HTTP_GET_VARS['vote'])) {
$id = $HTTP_GET_VARS['id'];
$sql= 'SELECT visits,url FROM ' . LINKS_TABLE . ' WHERE id = '.$id.'';
if(!$result = $db->sql_query($sql)) {
message_die(GENERAL_ERROR, 'Could not obtain information for this link', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$url = $row['url'];
$old_visits = $row['visits'];
$new_visits = $old_visits + 1;
$sql = 'UPDATE '. LINKS_TABLE .'
SET visits = '.$new_visits.'
WHERE id = '.$id.'';

if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not obtain link information', '', __LINE__, __FILE__, $sql);
}
else {
header('Location:'.$url.'');
}


}
elseif (isset($HTTP_GET_VARS['vote'])) {
$id = $HTTP_GET_VARS['id'];
$vote = $HTTP_GET_VARS['vote'];
$sql= 'SELECT points FROM ' . LINKS_TABLE . ' WHERE id = '.$id.'';
if(!$result = $db->sql_query($sql)) {
message_die(GENERAL_ERROR, 'Could not obtain information for this link', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$points = $row['points'];
if ($vote == 'up') {
$new_points = $points + 1;
}
elseif ($vote == 'down') {
$new_points = $points - 1;
}
$sql = 'UPDATE '. LINKS_TABLE .'
SET points = '.$new_points.'
WHERE id = '.$id.'';

if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not obtain link information', '', __LINE__, __FILE__, $sql);
}
else {
header('Location:'.$_SERVER['PHP_SELF'].'');
}


}
?>
He intentado pegar ese codigo en el php correspondiente al foro (index.php), y luego el codigo del tpl de este mod tambien lo pegue en el tpl correspondiente al foro (index_body.tpl), pero no funciono.
Como puedo hacer para meter este codigo en el php del foro???

Espero respuesta.

Saludos y Gracias

HHnn 03/05/2007 22:27

Re: Problemas con mod Linklist en phpBB
 
Como puedo hacer???
Alguna ayuda


La zona horaria es GMT -6. Ahora son las 08:00.

Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.