vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Small pagination problem (https://vborg.vbsupport.ru/showthread.php?t=186999)

veenuisthebest 08-02-2008 03:39 AM

Small pagination problem
 
please check this page and perform category search at the bottom with "Chats and Forums".

1. I am limiting 8 records to show on the search results per page. But the categories that have more than 8 records (for ex. Chats and Forums) do show the navigation bar, counts the records BUT on click/navigate, it shows empty. I think its loosing the session somehow. This is what I am doing to construct page nav:-

PHP Code:

//construct the page nav
$pagenav construct_page_nav($pagenumber$perpage$linkcount['linkcount'], 'links.php?do=search' $vbulletin->session->vars['sessionurl'] . '&view');
//End construct page nav 

2. Also, how can I carry the search results form data to the next page ? Currently it resets on every page load.

Please test the above problems here

Thank You

Lynne 08-02-2008 01:12 PM

It seems to be working for me. Did you fix it?

veenuisthebest 08-02-2008 02:12 PM

it isn't working fine !! I think you are talking about the main links page. Its fine there.

The problem is at the search results page. Just make a search for "Chats and Forums" category and then try to navigate, you would notice the second page says empty which actually isn't.

Thanks

Lynne 08-02-2008 02:52 PM

Ah, OK. Notice the link when you go to page 2: http://www.vinayaks.com/testvb/links.php?do=search&view&page=2 You are not passing anything for view. I think, though, you need to pass the category id somehow - set it as a hidden input?

veenuisthebest 08-02-2008 02:56 PM

ya.. but how do i append the category ID to the URL ??

--------------- Added [DATE]1217696802[/DATE] at [TIME]1217696802[/TIME] ---------------

I am sure it has to do something with this

PHP Code:

$pagenav construct_page_nav($pagenumber$perpage$linkcount['linkcount'], 'links.php?do=search' $vbulletin->session->vars['sessionurl'] . '&view'); 


Lynne 08-02-2008 03:14 PM

What is the variable name you are using for the category? I think you want to put that instead of the 'view' in your line. Something like "&category=Chats%20and%20Forums" ? You also need to pass the parameter for descending/ascending.

(Sorry veenu, forms aren't my strongpoint. I think I've said before that I code by trial and error. :/ )

veenuisthebest 08-02-2008 03:32 PM

even I code by trial and error lol ;)

see variable name is $searchcat that contains the category name that is searched for on links.php?do=search

I understand what I wanna do but not able to append category name. When I am putting something like $amp;category=$searchcat , it displays the variable name instead.

I then created a hidden field $searched to store the value of $searchcat, and I notice in source code that it does contain the searched value, but still it shows just the variable instead of the value in the URL.

Thanks

MoT3rror 08-02-2008 03:58 PM

Well in your first post you had this code.
PHP Code:

$pagenav construct_page_nav($pagenumber$perpage$linkcount['linkcount'], 'links.php?do=search' $vbulletin->session->vars['sessionurl'] . '&view'); 

Which view is being put at the end of the url then vbulletin will add the &page=X. So if you aren't using view you can just remove &view. If you want to use view just do something like this.
PHP Code:

$pagenav construct_page_nav($pagenumber$perpage$linkcount['linkcount'], 'links.php?do=search' $vbulletin->session->vars['sessionurl'] . '&view=' $variable); 

Also here is a article if you haven't found it yet.

veenuisthebest 08-02-2008 04:07 PM

thanks for replying.. well I had already gone through that article..

PHP Code:

//construct page nav
$pagenav construct_page_nav($pagenumber$perpage$linkcount['linkcount'], 'links.php?do=search' $vbulletin->session->vars['sessionurl'] . '&view=' $searchcat);
//end construct page nav 

This code helped me to append the category to the URL.. but still can't make it to view that second page.. please check it once again.

Thanks

--------------- Added [DATE]1217701132[/DATE] at [TIME]1217701132[/TIME] ---------------

ahhh... got it !!! DONE :up:

Now, last thing:-

How do I carry the search data onto the next page ?? say I searched for "Chats and Forums" in "Ascending" , so I want that both should be selected on the next page and should not reset to default.

Thanks

Lynne 08-02-2008 04:51 PM

Are you using searchid at all? If so, that has those variables in it (this is how vb does it). Or, I suppose you can either a)pass them in the url in your "construct_page_nav" call, or b)make them hidden and then make sure you grab them, and spit them out as hidden again, in your search page.


All times are GMT. The time now is 09:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01913 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete