Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 04 May 2012, 12:43
career career is offline
 
Join Date: Feb 2009
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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This code i put into form


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


In test.php i have required code for working page navigation


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #2  
Old 04 May 2012, 12:58
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


and then where the link is:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #3  
Old 04 May 2012, 13:29
career career is offline
 
Join Date: Feb 2009
I assume there's more than one place $sorturl is used
Yes, it's also used for sorting on page, standart vb code from my template:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thanks for your advice, kh99. But I didn't plan to use javascript.

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 04 May 2012 at 13:32 ---------------

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.
Reply With Quote
  #4  
Old 04 May 2012, 13:43
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by career View Post
Thanks for your advice, kh99. But I didn't plan to use javascript.

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.
I see. But of course all the data needed to display the page has to be passed from one page to the next, and if it's not part of the url then the only other way is to post it as a form. I suppose if it's just the url length you're worried about you could somehow encode the info into one parameter, like maybe:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Then something like:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.

Last edited by kh99 : 04 May 2012 at 14:14.
Reply With Quote
  #5  
Old 04 May 2012, 13:53
career career is offline
 
Join Date: Feb 2009
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!
Reply With Quote
  #6  
Old 04 May 2012, 14:16
kh99's Avatar
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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).
__________________
Please don't PM me - post your questions in the appropriate forum.
Please don't PM me to ask me to read your thread.
Reply With Quote
  #7  
Old 05 May 2012, 09:13
career career is offline
 
Join Date: Feb 2009
Also I should mention that you'd want to be careful to force those parameters to be integers
Thanks, once i'm done it i'll write back here
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 09:08.

Layout Options | Width: Wide Color: