SimplePortal

Support => International Support => Spanish => Topic started by: Zerito on October 11, 2010, 05:57:40 PM

Title: BoardNews constructPageIndex pagination.
Post by: Zerito on October 11, 2010, 05:57:40 PM
hi.. i got problem with this..
still does not work on my website.
i join:
http://www.miweb.net/?sa=news;start=8 (not work)
but y edit direction on browser:
http://www.miweb.net/index.php?sa=news;start=8 (yeah! work)

can help me please
ps: i do this editation: http://simpleportal.net/index.php?issue=374.0
still does not work
Title: Re: BoardNews constructPageIndex pagination.
Post by: 130860 on October 11, 2010, 09:58:59 PM
zerito,  muevo esto a la sección en español, dime si usas algun mod que modifique las url como pretty url o simple sef, dime los errores en el log de errores y una lista de los mods que tengas instalados.
Title: Re: BoardNews constructPageIndex pagination.
Post by: Topstarclub on October 11, 2010, 11:54:35 PM
Thank you and good knowledge.  :nervous-happy:
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 12, 2010, 11:28:52 AM
pues si, me parece que el problema es la incompatibilidad con el SimpleSEF, pues lo desactivo y funciona normal la paginación.
sin embargo me doy cuenta que al ingresar a la página web d esta manera:
http://www.miweb.net/
aún sigue direccionando de esta manera http://www.miweb.net/?sa=news;start=8 lo bueno es que si funciona pero sería mejor que la paginación nos diera esta dirección: http://www.miweb.net/index.php?sa=news;start=8
en todo caso.. podrían ayudarme para que suceda esto? aún teniendo el simpleSEF
Title: Re: BoardNews constructPageIndex pagination.
Post by: 130860 on October 12, 2010, 11:44:47 AM
no es un problema de SP   enteramente,   yo tengo SP y simpleSEF funcionando correctamente en mi foro, aun no me has dicho que erorres hay en tu log de errores, que version de sp usas y un link a tu foro.


revisa el tema de soporte de ese mod, quiza otro usuario haya tenido el mismo problema y una solucion ya se haya dado.
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 12, 2010, 12:19:06 PM
según mi log, el único error es el siguiente:
 MasterZero
 190.0.0.0   
Hoy a las 11:12:10
cda21098955b4149de8e2bdcccd659c3
Tipo de error: Indefinidos
http://www.tuxdescargas.net/index.php?http://www.tuxdescargas.net/
8: Undefined offset: 302
Archivo: /home/username/public_html/Sources/PortalBlocks.php
Línea: 1071

pero esa línea hacer referenia solamente al block 'Recent Posts/Topics'
traté de ingresar al tema del simple sef pero no lo encuentro en los foros de smf
Title: Re: BoardNews constructPageIndex pagination.
Post by: 130860 on October 12, 2010, 12:54:35 PM
http://www.simplemachines.org/community/index.php?topic=352351.0
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 12, 2010, 03:37:32 PM
SMF Version: 2 RC3
SP Version: 2.3.2

me pasie por las 43 paginas y ninguno hay referencia con el problema que tengo y nose como hacer para fixear ese problema
Title: Re: BoardNews constructPageIndex pagination.
Post by: 130860 on October 12, 2010, 05:32:16 PM
adjunta tu archivo  /Sources/PortalBlocks.php
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 12, 2010, 10:53:31 PM
archivo adjuntado
Title: Re: BoardNews constructPageIndex pagination.
Post by: 130860 on October 13, 2010, 10:27:04 AM
ok, usa este
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 13, 2010, 11:22:51 AM
me resulta esta dirección: http://www.miweb.net/?index.php?sa=news;start=8
Title: Re: BoardNews constructPageIndex pagination.
Post by: 130860 on October 13, 2010, 01:15:12 PM
necesito hacer pruebas en local para ver donde esta el conflicto, dame algo de tiempo para revisar bien.
Title: Re: BoardNews constructPageIndex pagination.
Post by: AngelinaBelle on October 13, 2010, 02:14:03 PM
algo como?
Code: (replace) [Select]
  $clean_url = preg_replace('~(;|\?)?sa=news;start=\d+~', '', $_SERVER['REQUEST_URL']);
  $clean_url = preg_replace('~(sa,news/start,\d+~', $clean_url);  // clean pretty URL
  $current_url = $clean_url .
                      ( strpos($clean_url, 'index.php' ) !== false ? '' : 'index.php' ) .   //  necesita index.php
                      (strpos($clean_url, '?') !== false ? ';' : '?');
  $page_index = constructPageIndex($current_url . 'sa=news', $start, $limit, $per_page);
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 13, 2010, 03:32:35 PM
hasta ahi vamos bien AngelinaBelle
quisiera saber que hace esto?:
Code: [Select]
$clean_url = preg_replace('~(sa,news/start,\d+~', $clean_url);
bien supongo que eso limpia las URL amigable de prettyurl o simplesef, sin embargo no sucede eso en la segunda página, para pasar a la tercera me resulta esta dirección:
http://www.miweb.net/sa,news/start,8/index.php?sa=news;start=16
Title: Re: BoardNews constructPageIndex pagination.
Post by: AngelinaBelle on October 13, 2010, 04:56:20 PM
Oh! I did not test it!
Code: [Select]
  $clean_url = preg_replace('~(;|\?)?sa=news;start=\d+~',  '',  $_SERVER['REQUEST_URL']);
  $clean_url = preg_replace('~(sa,news/start,\d+/~',          '',  $clean_url);  // clean pretty URL
  $current_url = $clean_url .
                      ( strpos($clean_url, 'index.php' ) !== false ? '' : 'index.php' ) .   //  necesita index.php
                      (strpos($clean_url, '?') !== false ? ';' : '?');
  $page_index = constructPageIndex($current_url . 'sa=news', $start, $limit, $per_page);
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 13, 2010, 05:06:59 PM
sigue sin funcionarme bien.. quizá puedas entrar a mi web y fijarte?
http://www.tuxdescargas.net/

arriba tienes mi archivo portalblocks.php y para que sepas, tengo instalado el SimpleSEF.. creo que ahí está el problema, pues cuando deshabilito el simplesef funciona normal
Title: Re: BoardNews constructPageIndex pagination.
Post by: AngelinaBelle on October 13, 2010, 07:17:17 PM
I am sorry I jumped in with an untested idea.  I should have waited until I had time to test.  Maybe a couple of days :)
 
Perhaps '~sa,news/start,\d+/~' is the correct regexp.
 
Simple SEF and SimplePortal are simply not compatable here.
What is needed is a tiny little mod to bridge the gap for boardnews and articles pagination.
 
My apologies. 
http://php.net/manual/en/function.preg-replace.php (http://php.net/manual/en/function.preg-replace.php)
http://www.php.net/manual/es/function.preg-replace.php (http://www.php.net/manual/es/function.preg-replace.php)
http://www.php.net/manual/es/reference.pcre.pattern.syntax.php (http://www.php.net/manual/es/reference.pcre.pattern.syntax.php)
Title: Re: BoardNews constructPageIndex pagination.
Post by: AngelinaBelle on October 14, 2010, 07:16:45 AM
Finally -- I tested the search string (in a custom php block)
Code: [Select]
$starturl='http://www.miweb.net/sa,news/start,8/';
$clean_url = preg_replace('~sa,news/start,\d+/~',          '',  $starturl); 
echo 'starturl ' , $starturl , '<br/>cleanurl ' , $clean_url;
So this ought to work in your PortalBlocks.php:
Code: [Select]
  $clean_url = preg_replace('~(;|\?)?sa=news;start=\d+~',  '',  $_SERVER['REQUEST_URL']);
  $clean_url = preg_replace('~sa,news/start,\d+/~',          '',  $clean_url);  // clean pretty URL
  $current_url = $clean_url .
                      ( strpos($clean_url, 'index.php' ) !== false ? '' : 'index.php' ) .   //  necesita index.php
                      (strpos($clean_url, '?') !== false ? ';' : '?');
  $page_index = constructPageIndex($current_url . 'sa=news', $start, $limit, $per_page);

regexps always hurt my eyes!
Title: Re: BoardNews constructPageIndex pagination.
Post by: Zerito on October 14, 2010, 11:00:09 AM
AngelinaBelle you are my Queen!!
works perfectly! thanks alot.

gracias también a 130860 eres un gran helper  :D
SimplePortal 2.3.8 © 2008-2024, SimplePortal