The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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> <select name="forum[]" id="select_forum" size="4" style="display:block" multiple="multiple"> <option value="0" $noforumselected>All forums</option> <option value="91">Test forum1 with forumid 91</option> <option value="95">Test forum2 with forumid 95</option> <option value="99">Test forum2 with forumid 99</option> </select> Code:
<form action="test.php?do=show" method="post"> <input type="hidden" name="s" value="$session[sessionhash]" /> <input type="hidden" name="page" value="$pagenumber" /> <input type="hidden" name="pp" value="$perpage" /> <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" /> <input type="hidden" name="do" value="viewthreads" /> <label for="select_forum">Choose forum</label> <select name="forum[]" id="select_forum" size="4" style="display:block" multiple="multiple"> <option value="0" $noforumselected>All forums</option> <option value="91">Test forum1 with forumid 91</option> <option value="95">Test forum2 with forumid 95</option> <option value="99">Test forum2 with forumid 99</option> </select> </form> In test.php i have required code for working page navigation PHP Code:
|
#2
|
|||
|
|||
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> |
#3
|
|||
|
|||
Quote:
HTML Code:
<a href="$sorturl&order=desc&sort=voteavg" rel="nofollow">$vbphrase[rating]</a> $sortarrow[voteavg]</span> .... <a href="$sorturl&order=asc&sort=title" rel="nofollow">$vbphrase[thread]</a> $sortarrow[title] / .... <a href="$sorturl&order=asc&sort=postusername" rel="nofollow"> ..... 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. |
#4
|
|||
|
|||
Quote:
Code:
test.php?do=show¶ms=20,2,91,95,99 Then something like: Code:
$vbulletin->input->clean_gpc('r', 'params', TYPE_STR); $params = split(',', $vbulletin->GPC['params']); $pp = $params[0]; $page = $params[1]; $forum = array_slice($params, 2); |
#5
|
|||
|
|||
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! |
#6
|
|||
|
|||
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). |
#7
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|