Laatste pagina [forum]

Gestart doorMarvinn4 reacties25 weergaven

5 berichten · pagina 1 van 1

Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi
Ik ben bezig met een forum die af is. Alleen nog 1 ding ik heb zon pagina systeem met 5 reacties bijvoorbeeld, alleen het probleem is hoe krijg ik voor elkaar als ik een reactie plaatst dat hij op de laatste pagina komt.

Pagina navigatie code:

[COLOR= #0000BB]<?php[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$first_last_link[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href=?p=forum&cat="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&b="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]b[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&start=0>&lt;&lt;</a>&nbsp;"[/COLOR][COLOR= #007700];
}[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href=?p=forum&cat="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&b="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]b[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&start="[/COLOR][COLOR= #007700].([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]start[/COLOR][COLOR= #007700]] -[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]">&lt;</a>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"&nbsp;"[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$j[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$pagina[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$j[/COLOR][COLOR= #007700]<[/COLOR][COLOR= #0000BB]$pagina[/COLOR][COLOR= #007700]+[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$j[/COLOR][COLOR= #007700]++) {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$j[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]0[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$j[/COLOR] [COLOR= #007700]<=[/COLOR] [COLOR= #0000BB]$paginas[/COLOR][COLOR= #007700]) {[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$j[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]$pagina[/COLOR][COLOR= #007700]) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<strong>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$pagina[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</strong>"[/COLOR][COLOR= #007700];
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href=?p=forum&cat="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&b="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]b[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&start="[/COLOR] [COLOR= #007700]. (([/COLOR][COLOR= #0000BB]$j[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700])*[/COLOR][COLOR= #0000BB]$per_pagina[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]">"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$j[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]"</a>"[/COLOR][COLOR= #007700];
        }[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"&nbsp;"[/COLOR][COLOR= #007700];
    }
}[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href=?p=forum&cat="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&b="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]b[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&start="[/COLOR][COLOR= #007700].([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]start[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]">&gt;</a>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"&nbsp;"[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$first_last_link[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href=?p=forum&cat="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&b="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]b[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"&start="[/COLOR] [COLOR= #007700]. (([/COLOR][COLOR= #0000BB]$paginas[/COLOR][COLOR= #007700]-[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700])*[/COLOR][COLOR= #0000BB]$per_pagina[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]">&gt;&gt;</a>"[/COLOR][COLOR= #007700];
}[/COLOR]
?>


< = pagina terug
<< = eerste pagina
> = pagina verder
>> = laatste pagina

Dit is van reactie plaatsen:

<form name="form1" action="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]PHP_SELF[/COLOR][COLOR= #007700]];[/COLOR] ?>?p=forum&cat=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat[/COLOR][COLOR= #007700]];[/COLOR] ?>&b=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]b[/COLOR][COLOR= #007700]];[/COLOR] ?>&a=reactie" method="post">


Zo link krijg je als je naar een volgende pagina gaat: ?p=forum&cat=6&b=21&start=10

Ik hoop dat iemand me kan helpen want ik kom er niet meer uit sadley.
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Als je hem post met header of gewoon met html laten doorlinken naar de laatste?nopompom
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit is hoe het kan maar niet de beste manier :

Eerst laat je het aantalreacties bereken.
dan laat je dat delen door 5 en min 1 (omdat pagina 1 0 is)
dan zet je daar round op
Dan doorlinken.

Eens proberen
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hhm krijg het niet voor me kaar. Kan iemand me daarbij helpen?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
waarom niet gwn ?page=paginanummer
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren