Página 1 de 2

[SOLUCIONADO] Problema con enlace al indice general...

Publicado: 23 Sep 2008, 06:56
por benditatuluz
Versión de phpBB: 3.0.2
Tipo de phpBB: phpBB estandar, (tambien llamado Vanilla) phpBB2 o phpBB3
MODs Instalados: Si
Tu conocimiento: Principiante
Enlace del Foro: http://brancamenta.co.cc

¿Qué recuerdas haber hecho en el foro antes de aparecer este error?
instalar seo mod

¿Qué has realizado para intentar resolver el problema?
nada, no lo quiero joder mas jeje

Descripción y Mensaje
* URL: http://brancamenta.co.cc" onclick="window.open(this.href);return false;
* Plantilla(s) usuada(s): prosilver
* MODs instalados: portal 1.0
* URL del MOD: phpbb-es.com
* Versión de phpBB: 3.0.2
* Servidor: eshost.com.ar

Hola gente soy nuevo por aquí, vi que tienen todas las respuestas siempre, y aqui va mi consulta: resulta que cuando instale el seo mod, luego no me dejaba ir al indice del foro pero si me lleva al portal...
esta es la imagen del foro los dos enlaces me llevan al portal (Portal » Indice general) , por que?? :roll:
Imagen
Gracias de antemano!!!

Re: Problema con enlace al indice general...

Publicado: 23 Sep 2008, 17:57
por angelismo
El enlace indice general lleva a http://brancamenta.co.cc/" onclick="window.open(this.href);return false; ,es decir al portal ,para que lleve al foro el enlace debe ser http://brancamenta.co.cc/index.php" onclick="window.open(this.href);return false;

Re: Problema con enlace al indice general...

Publicado: 23 Sep 2008, 22:05
por benditatuluz
Gracias por tu respuesta angelismo
Ahora, como hago porque si yo ingreso aqui http://brancamenta.co.cc/index.php" onclick="window.open(this.href);return false; me dirige al portal directamente, que modifico, :roll: si me pueden ayudar estare mas que agradecido. saludos!! :ok:

Re: Problema con enlace al indice general...

Publicado: 23 Sep 2008, 22:37
por angelismo
Algo has hecho más al instalar el seo mod ,revisala la instalación

Re: Problema con enlace al indice general...

Publicado: 23 Sep 2008, 23:25
por xoom
Revisa lo que hayas modificado en htaccess, seguramente ahí está el error.

Re: Problema con enlace al indice general...

Publicado: 24 Sep 2008, 05:38
por benditatuluz
gracias por responder, sigo con el problema, miren asi esta el .htacces si me dan una mano, no soy de molestar mucho pero necesito esa ayuda :mrgreen: saludos y gracias!!!

#
# @package phpBB3 Portal a.k.a canverPortal ( http://www.phpbb3portal.com" onclick="window.open(this.href);return false; )
# @version $Id: .htaccess,v 1.7 2008/02/09 08:18:13 angelside Exp $
# @copyright (c) Canver Software - http://www.canversoft.net" onclick="window.open(this.href);return false;
# @license http://opensource.org/licenses/gpl-license.php" onclick="window.open(this.href);return false; GNU Public License
#

DirectoryIndex portal.php index.php index.html index.htm

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
RewriteEngine on

Rewriterule ^(.+)-f([0-9]*).html-(.+)$ ./viewforum.php?f=$2&$3
Rewriterule ^(.+)-(t|p)([0-9]*).html-(.+)$ ./viewtopic.php?$2=$3&$4
Rewriterule ^(.+)-f([0-9]*)s([0-9]*).html-(.+)$ ./viewforum.php?f=$2&start=$3&$4
Rewriterule ^(.+)-(t|p)([0-9]*)s([0-9]*).html-(.+)$ ./viewtopic.php?$2=$3&start=$4&$5

Rewriterule ^(.+)-f([0-9]*).html$ ./viewforum.php?f=$2&$3
Rewriterule ^(.+)-(t|p)([0-9]*).html$ ./viewtopic.php?$2=$3&$4
Rewriterule ^(.+)-f([0-9]*)s([0-9]*).html$ ./viewforum.php?f=$2&start=$3&$4
Rewriterule ^(.+)-(t|p)([0-9]*)s([0-9]*).html$ ./viewtopic.php?$2=$3&start=$4&$5

Asi esta... :roll:

Re: Problema con enlace al indice general...

Publicado: 24 Sep 2008, 06:04
por mitch
Si borras esta linea

Código: Seleccionar todo

DirectoryIndex portal.php index.php index.html index.htm
como te va?

Re: Problema con enlace al indice general...

Publicado: 24 Sep 2008, 18:13
por benditatuluz
Lo tuyo mitch me funciono y gracias pero que pasa ahora borro esa linea y cuando pongo la direccion del dominio me lleva al indice general y no al portal... el problema esta en el .htaccess, como lo puedo solucionar :oops: :roll: ya estoy muy pesado... jeje bueno saludos y gracias...

Re: Problema con enlace al indice general...

Publicado: 24 Sep 2008, 18:55
por mitch
sabes inglés? http://www.phpbb-seo.com/boards/advance ... html#20126" onclick="window.open(this.href);return false; el segundo post, describe una duda igual a la tuya, y en el tercer post, se da una respuesta.

Me imagino estas usando ese MOD de seo para tu phpBB... sigue esos pasos, si entiendes claro,ahora voy de salida como para traducir todo eso. salu2.

Re: Problema con enlace al indice general...

Publicado: 24 Sep 2008, 20:33
por benditatuluz
no es ese mod el que estoy usando, seo mod dejo los archivos que tengo:
functions_seo.php:
Spoiler
<?php
/**
*
* @package phpBB3
* @version $Id: functions_seo.php 58 2007-11-09 02:21:30Z Handyman $
* @copyright (c) 2007 StarTrekGuide Group
* @license http://opensource.org/licenses/gpl-license.php" onclick="window.open(this.href);return false; GNU Public License
*
*/
/**
* @ignore
*/

if (!defined('IN_PHPBB'))
{
exit;
}

function format_url($name, $id, $start = 0, $xtra_params = false, $append = true)
{
global $phpbb_root_path, $config;

$name = clean_url($name);

$ext = '.html';
if (isset($config['seo_ext']))
{
$ext = '.' . $config['seo_ext'];
}

switch (substr($id, 0, 1))
{
case 'p':
if ($append)
{
return append_seo_sid($phpbb_root_path . $name . '-' . $id . (($start) ? "s$start" : '') . $ext, $xtra_params) . '#' . $id;
}
break;
case 't':
case 'f':
if ($append)
{
return append_seo_sid($phpbb_root_path . $name . '-' . $id . (($start) ? "s$start" : '') . $ext, $xtra_params);
}
break;
}
return $phpbb_root_path . $name . '-' . $id;
}

function clean_url($url)
{
$url = trim(str_replace(array('Re:', 're:'), '', $url));
$find = array('?', '#', '%', '?', '^', '.', '/', ' ', '_', ')', '(', '[', ']', ':', '.');
$url = str_replace($find, '-', censor_text($url));
$url = str_replace(array('---', '--'), '-', $url);

return utf8_clean_string($url);
}

function append_seo_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $config;

$append = '.html';
if (isset($config['seo_ext']))
{
$append = '.' . $config['seo_ext'];
}

// Assign sid if session id is not specified
if ($session_id === false)
{
$session_id = $_SID;
}

$amp_delim = ($is_amp) ? '&' : '&';
$url_delim = (strpos($url, $append . '-') === false) ? '-' : $amp_delim;

// Appending custom url parameter?
$append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : '';

// Use the short variant if possible ;)
if ($params === false)
{
// Append session id
if (!$session_id)
{
return $url;
}
else
{
return $url . $url_delim . 'sid=' . $session_id;
}
}

// Build string if parameters are specified as array
if (is_array($params))
{
$output = array();

foreach ($params as $key => $item)
{
if ($item === NULL)
{
continue;
}

$output[] = $key . '=' . $item;
}

$params = implode($amp_delim, $output);
}

// Append session id and parameters (even if they are empty)
// If parameters are empty, the developer can still append his/her parameters without caring about the delimiter
return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id);
}

function moved_forum($id, $start = 0)
{
global $phpbb_root_path, $phpEx, $db;

$path = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
if (substr($path, 1, 10 + strlen($phpEx)) == 'viewforum.' . $phpEx)
{
$sql = 'SELECT forum_name
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $id";

$result = $db->sql_query($sql);
$forum_name = clean_url($db->sql_fetchfield('forum_name'));
$db->sql_freeresult($result);

header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . format_url($forum_name, "f$id", $start));
exit();
}
return;
}

function moved_topic($id, $type, $start = 0)
{
global $phpbb_root_path, $phpEx, $db;

$path = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
if (substr($path, 1, 10 + strlen($phpEx)) == 'viewtopic.' . $phpEx)
{
if ($type == 'topic')
{
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . "
WHERE topic_id = $id";
$newid = "t$id";
}
else
{
$sql = 'SELECT t.topic_title
FROM ' . POSTS_TABLE . ' p
' . TOPICS_TABLE . " t
WHERE t.topic_id = p.topic_id
AND t.topic_id = $id";
$newid = "p$id";
}
$result = $db->sql_query($sql);
$topic_title = clean_url($db->sql_fetchfield('topic_title'));
$db->sql_freeresult($result);

header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . format_url($topic_title, $newid, $start));
exit();
}
return;
}

function generate_seo_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')
{
global $template, $user, $config, $phpEx;

$append = '.html';
if (isset($config['seo_ext']))
{
$append = '.' . $config['seo_ext'];
}

// Make sure $per_page is a valid value
$per_page = ($per_page <= 0) ? 1 : $per_page;

$seperator = '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
$total_pages = ceil($num_items / $per_page);

if ($total_pages == 1 || !$num_items)
{
return false;
}

$on_page = floor($start_item / $per_page) + 1;

$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . append_seo_sid($base_url . $append) . '">1</a>';

if ($total_pages > 5)
{
$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
$end_cnt = max(min($total_pages, $on_page + 4), 6);

$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;

for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
{
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . append_seo_sid($base_url . 's' . (($i - 1) * $per_page) . $append) . '">' . $i . '</a>';
if ($i < $end_cnt - 1)
{
$page_string .= $seperator;
}
}

$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;
}
else
{
$page_string .= $seperator;

for ($i = 2; $i < $total_pages; $i++)
{
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . append_seo_sid($base_url . 's' . (($i - 1) * $per_page) . $append) . '">' . $i . '</a>';
if ($i < $total_pages)
{
$page_string .= $seperator;
}
}
}

$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href="' . append_seo_sid($base_url . 's' . (($i - 1) * $per_page) . $append) . '">' . $total_pages . '</a>';

if ($add_prevnext_text)
{
if ($on_page != 1)
{
$page_string = '<a href="' . append_seo_sid($base_url . 's' . (($on_page - 2) * $per_page) . $append) . '">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;
}

if ($on_page != $total_pages)
{
$page_string .= '&nbsp;&nbsp;<a href="' . append_seo_sid($base_url . 's' . ($on_page * $per_page) . $append) . '">' . $user->lang['NEXT'] . '</a>';
}
}

$template->assign_vars(array(
$tpl_prefix . 'BASE_URL' => $base_url,
$tpl_prefix . 'PER_PAGE' => $per_page,

$tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : append_seo_sid($base_url . 's' . (($on_page - 2) * $per_page) . $append),
$tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : append_seo_sid($base_url . 's' . ($on_page * $per_page) . $append),
$tpl_prefix . 'TOTAL_PAGES' => $total_pages)
);

return $page_string;
}

function seo_footer()
{
global $template, $user;

global $phpbb_root_path, $phpEx;

$path = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');

if (substr($path, 1, 5) . ".$phpEx" === "index.$phpEx")
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . append_sid($phpbb_root_path));
exit();
}

$string = '<br />' . base64_decode('U0VPIE1PRCAmY29weTsgMjAwNyA8YSBocmVmPSJodHRwOi8vc3RhcnRyZWtndWlkZS5jb20iPlN0YXJUcmVrR3VpZGU8L2E+');
$template->assign_var('DEBUG_OUTPUT', (isset($template->_tpldata['.'][0]['DEBUG_OUTPUT'])) ? $template->_tpldata['.'][0]['DEBUG_OUTPUT'] . $string : $string);

return;
}

function topic_generate_seo_pagination($replies, $url)
{
global $config, $user, $phpEx;

$append = '.' . $phpEx;
if (isset($config['seo_append']))
{
$append = '.' . $config['seo_append'];
}
// Make sure $per_page is a valid value
$per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];

if (($replies + 1) > $per_page)
{
$total_pages = ceil(($replies + 1) / $per_page);
$pagination = '';

$times = 1;
for ($j = 0; $j < $replies + 1; $j += $per_page)
{
$pagination .= '<a href="' . append_seo_sid($url . 's' . $j . $append) . '">' . $times . '</a>';
if ($times == 1 && $total_pages > 5)
{
$pagination .= ' ... ';

// Display the last three pages
$times = $total_pages - 3;
$j += ($total_pages - 4) * $per_page;
}
else if ($times < $total_pages)
{
$pagination .= '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
}
$times++;
}
}
else
{
$pagination = '';
}

return $pagination;
}
?>
seo_mod_version.php
Spoiler
<?php
/**
*
* @package acp
* @version $Id: seo_mod_version.php 54 2007-11-09 00:55:27Z Handyman $
* @copyright (c) 2007 StarTrekGuide
* @license http://opensource.org/licenses/gpl-license.php" onclick="window.open(this.href);return false; GNU Public License
*
*/

if (!defined('IN_PHPBB'))
{
exit;
}

/**
* @package seo_mod
*/

class seo_mod_version
{
function version()
{
return array(
'author' => 'Handyman`',
'title' => 'SEO MOD',
'tag' => 'seo_mod',
'version' => '1.0.0',
'file' => array('startrekguide', 'updatecheck', 'mods101.xml'),
);
}
}

?>
bueno alguno de esos esta dando el problema, saludos!! :mrgreen: :mrgreen:

Re: Problema con enlace al indice general...

Publicado: 25 Sep 2008, 02:44
por mitch
Bueno... por eso mismo pedimos TODOS los datos... la idea era que dijeses que MOD de seo estabas usando, de donde lo bajaste, en fin :evil: ... mirando los archivos, supe que el MOD era este: http://startrekguide.com/community/view ... =27&t=1091" onclick="window.open(this.href);return false;

revise su install, y creo encontre lo que puede dar problemas, en includes/functions.php, el MOD te hace agregar estas lineas:

Código: Seleccionar todo

global $phpbb_root_path, $phpEx;

	if ($url === "{$phpbb_root_path}index.$phpEx")
	{
		return append_sid($phpbb_root_path);
	}
Buscalas y borralas.

Y vuelve a poner en el htaccess, la linea que te hize borrar antes.

Luego de esto, debería estar todo OK, creo yo. La pagina de inicio sería el portal.php nuevamente, y te dejaría entrar al índice.

Re: Problema con enlace al indice general...

Publicado: 25 Sep 2008, 06:03
por benditatuluz
nada, sigue igual :cry: me estoy resignando je... bueno cualquier otra cosa que se pueda hacer diganme, gracias mitch y disculpa por no haber puesto bien la version del mod (soy nuevo en esto)... saludos cualquier otra cosa que deba cambiar me avisan... saludos!!! :cerveza:

Re: Problema con enlace al indice general...

Publicado: 25 Sep 2008, 06:22
por mitch
Estas muy seguro?? te metiste a ese archivo, y borraste ese código, guardaste, y luego volviste a subir el archivo via FTP ??
y editaste luego el htaccess, agregando la linea antes quitada?

es que yo creo que es eso... ese código que te dije (recien) que borraras, lo que hace, es que si uno se mete al index.php, el SEO cambia la url, y deja la url de la web sola, sin el index.php

en vez de http://www.tuweb.com/index.php" onclick="window.open(this.href);return false;
la deja http://www.tuweb.com/" onclick="window.open(this.href);return false;

entonces, al querer ir al index, el SEO borra de la url el index.php, dejando la url de la web sola, y eso, el htaccess lo interpreta, y te manda al portal.php

Por lo tanto, borrando ese código que te indique en mi post anterior, se dejaría la url intacta (tuweb.com/index.php) y el htaccess ya no te llevaría de inmediato al portal...

Vuelve a verificar haber, a mi me hace bastante sentido lo que pensé... y si no pues bueno, haber si me animo la otra semana de probar este SEO y ver como se puede arreglar el asunto.

Re: Problema con enlace al indice general...

Publicado: 25 Sep 2008, 06:34
por benditatuluz
En functions_seo.php tengo algo parecido mira:
Spoiler
<?php
/**
*
* @package phpBB3
* @version $Id: functions_seo.php 58 2007-11-09 02:21:30Z Handyman $
* @copyright (c) 2007 StarTrekGuide Group
* @license http://opensource.org/licenses/gpl-license.php" onclick="window.open(this.href);return false; GNU Public License
*
*/
/**
* @ignore
*/

if (!defined('IN_PHPBB'))
{
exit;
}

function format_url($name, $id, $start = 0, $xtra_params = false, $append = true)
{
global $phpbb_root_path, $config;

$name = clean_url($name);

$ext = '.html';
if (isset($config['seo_ext']))
{
$ext = '.' . $config['seo_ext'];
}

switch (substr($id, 0, 1))
{
case 'p':
if ($append)
{
return append_seo_sid($phpbb_root_path . $name . '-' . $id . (($start) ? "s$start" : '') . $ext, $xtra_params) . '#' . $id;
}
break;
case 't':
case 'f':
if ($append)
{
return append_seo_sid($phpbb_root_path . $name . '-' . $id . (($start) ? "s$start" : '') . $ext, $xtra_params);
}
break;
}
return $phpbb_root_path . $name . '-' . $id;
}

function clean_url($url)
{
$url = trim(str_replace(array('Re:', 're:'), '', $url));
$find = array('?', '#', '%', '?', '^', '.', '/', ' ', '_', ')', '(', '[', ']', ':', '.');
$url = str_replace($find, '-', censor_text($url));
$url = str_replace(array('---', '--'), '-', $url);

return utf8_clean_string($url);
}

function append_seo_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $config;

$append = '.html';
if (isset($config['seo_ext']))
{
$append = '.' . $config['seo_ext'];
}

// Assign sid if session id is not specified
if ($session_id === false)
{
$session_id = $_SID;
}

$amp_delim = ($is_amp) ? '&' : '&';
$url_delim = (strpos($url, $append . '-') === false) ? '-' : $amp_delim;

// Appending custom url parameter?
$append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : '';

// Use the short variant if possible ;)
if ($params === false)
{
// Append session id
if (!$session_id)
{
return $url;
}
else
{
return $url . $url_delim . 'sid=' . $session_id;
}
}

// Build string if parameters are specified as array
if (is_array($params))
{
$output = array();

foreach ($params as $key => $item)
{
if ($item === NULL)
{
continue;
}

$output[] = $key . '=' . $item;
}

$params = implode($amp_delim, $output);
}

// Append session id and parameters (even if they are empty)
// If parameters are empty, the developer can still append his/her parameters without caring about the delimiter
return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id);
}

function moved_forum($id, $start = 0)
{
global $phpbb_root_path, $phpEx, $db;

$path = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
if (substr($path, 1, 10 + strlen($phpEx)) == 'viewforum.' . $phpEx)
{
$sql = 'SELECT forum_name
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $id";

$result = $db->sql_query($sql);
$forum_name = clean_url($db->sql_fetchfield('forum_name'));
$db->sql_freeresult($result);

header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . format_url($forum_name, "f$id", $start));
exit();
}
return;
}

function moved_topic($id, $type, $start = 0)
{
global $phpbb_root_path, $phpEx, $db;

$path = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
if (substr($path, 1, 10 + strlen($phpEx)) == 'viewtopic.' . $phpEx)
{
if ($type == 'topic')
{
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . "
WHERE topic_id = $id";
$newid = "t$id";
}
else
{
$sql = 'SELECT t.topic_title
FROM ' . POSTS_TABLE . ' p
' . TOPICS_TABLE . " t
WHERE t.topic_id = p.topic_id
AND t.topic_id = $id";
$newid = "p$id";
}
$result = $db->sql_query($sql);
$topic_title = clean_url($db->sql_fetchfield('topic_title'));
$db->sql_freeresult($result);

header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . format_url($topic_title, $newid, $start));
exit();
}
return;
}

function generate_seo_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')
{
global $template, $user, $config, $phpEx;

$append = '.html';
if (isset($config['seo_ext']))
{
$append = '.' . $config['seo_ext'];
}

// Make sure $per_page is a valid value
$per_page = ($per_page <= 0) ? 1 : $per_page;

$seperator = '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
$total_pages = ceil($num_items / $per_page);

if ($total_pages == 1 || !$num_items)
{
return false;
}

$on_page = floor($start_item / $per_page) + 1;

$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . append_seo_sid($base_url . $append) . '">1</a>';

if ($total_pages > 5)
{
$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
$end_cnt = max(min($total_pages, $on_page + 4), 6);

$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;

for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
{
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . append_seo_sid($base_url . 's' . (($i - 1) * $per_page) . $append) . '">' . $i . '</a>';
if ($i < $end_cnt - 1)
{
$page_string .= $seperator;
}
}

$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;
}
else
{
$page_string .= $seperator;

for ($i = 2; $i < $total_pages; $i++)
{
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . append_seo_sid($base_url . 's' . (($i - 1) * $per_page) . $append) . '">' . $i . '</a>';
if ($i < $total_pages)
{
$page_string .= $seperator;
}
}
}

$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href="' . append_seo_sid($base_url . 's' . (($i - 1) * $per_page) . $append) . '">' . $total_pages . '</a>';

if ($add_prevnext_text)
{
if ($on_page != 1)
{
$page_string = '<a href="' . append_seo_sid($base_url . 's' . (($on_page - 2) * $per_page) . $append) . '">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;
}

if ($on_page != $total_pages)
{
$page_string .= '&nbsp;&nbsp;<a href="' . append_seo_sid($base_url . 's' . ($on_page * $per_page) . $append) . '">' . $user->lang['NEXT'] . '</a>';
}
}

$template->assign_vars(array(
$tpl_prefix . 'BASE_URL' => $base_url,
$tpl_prefix . 'PER_PAGE' => $per_page,

$tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : append_seo_sid($base_url . 's' . (($on_page - 2) * $per_page) . $append),
$tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : append_seo_sid($base_url . 's' . ($on_page * $per_page) . $append),
$tpl_prefix . 'TOTAL_PAGES' => $total_pages)
);

return $page_string;
}

function seo_footer()
{
global $template, $user;

global $phpbb_root_path, $phpEx;

$path = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');

if (substr($path, 1, 5) . ".$phpEx" === "index.$phpEx")
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . append_sid($phpbb_root_path));
exit();
}

$string = '<br />' . base64_decode('U0VPIE1PRCAmY29weTsgMjAwNyA8YSBocmVmPSJodHRwOi8vc3RhcnRyZWtndWlkZS5jb20iPlN0YXJUcmVrR3VpZGU8L2E+');
$template->assign_var('DEBUG_OUTPUT', (isset($template->_tpldata['.'][0]['DEBUG_OUTPUT'])) ? $template->_tpldata['.'][0]['DEBUG_OUTPUT'] . $string : $string);

return;
}

function topic_generate_seo_pagination($replies, $url)
{
global $config, $user, $phpEx;

$append = '.' . $phpEx;
if (isset($config['seo_append']))
{
$append = '.' . $config['seo_append'];
}
// Make sure $per_page is a valid value
$per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];

if (($replies + 1) > $per_page)
{
$total_pages = ceil(($replies + 1) / $per_page);
$pagination = '';

$times = 1;
for ($j = 0; $j < $replies + 1; $j += $per_page)
{
$pagination .= '<a href="' . append_seo_sid($url . 's' . $j . $append) . '">' . $times . '</a>';
if ($times == 1 && $total_pages > 5)
{
$pagination .= ' ... ';

// Display the last three pages
$times = $total_pages - 3;
$j += ($total_pages - 4) * $per_page;
}
else if ($times < $total_pages)
{
$pagination .= '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
}
$times++;
}
}
else
{
$pagination = '';
}

return $pagination;
}
?>
Asi esta... :nolose:

Re: Problema con enlace al indice general...

Publicado: 25 Sep 2008, 06:41
por mitch
Bueno y que esperas :lol:
borra estas lineas

Código: Seleccionar todo

if (substr($path, 1, 5) . ".$phpEx" === "index.$phpEx")
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . append_sid($phpbb_root_path));
exit();
}
y el htaccess, como estaba... y haber que tal ahora.