![]() |
PHP multiselect and page navigation
Good day
Need a little help or advice. How not to show long list of forum ids when changing pages? Because now when choose several forums and press page 2, the link is test.php?do=show&pp=20&page2&forum[]=91&forum[]=95&forum[]=99. Is there a way I can hide from url such string '&forum[]=91&forum[]=95&forum[]=99' and keep work page navigation? For one of my new pages I use Multiselect, i mean something like this in template Code:
<label for="select_forum">Choose forum</label> Code:
In test.php i have required code for working page navigation PHP Code:
|
I don't know if I follow everything you're doing. I assume there's more than one place $sorturl is used, to sort in different ways? Anyway, maybe you could do something like change the form to:
Code:
<form name="sortform" method="post"> and then where the link is: Code:
<a href="javascript:document.sortform.submit()">Sort</a> |
Quote:
HTML Code:
<a href="$sorturl&order=desc&sort=voteavg" rel="nofollow">$vbphrase[rating]</a> $sortarrow[voteavg]</span> Just can't realize how to make construct_page_nav() work without long url and so many vars in it. Would be great to have a working url for 2nd page like test.php?do=show&page=2 or something but not containing too much variables like now. --------------- Added [DATE]1336134729[/DATE] at [TIME]1336134729[/TIME] --------------- btw, this code just modified mostly from moderation.php and template "moderation_threads". VB 3.8 I've added multiselect for choosing multiple forums, that's it. |
Quote:
Code:
test.php?do=show¶ms=20,2,91,95,99 Then something like: Code:
$vbulletin->input->clean_gpc('r', 'params', TYPE_STR); |
Thanks! I'll try this way.
Another way I thought I could rewrite construct_page_nav() for myself needs. I mean, by default it is construct_page_nav($pagenumber, $perpage, $results, $address, $address2 = '', $anchor = '') but if I change it to construct_page_nav2($pagenumber, $perpage, $new_var_forums, $results, $address, $address2 = '', $anchor = '') would that help me to pass forum array from one page to the next? Thanks kh99! |
Yes, you could do that.
Also I should mention that you'd want to be careful to force those parameters to be integers (which I didn't do in my example code above). |
Quote:
|
All times are GMT. The time now is 10:41 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|