Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Custom Modules Pagination issue

Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon

Posted: 10/19/09 23:14 
For some reason my module is returning an invalid value for $TOTAL_PAGES. I placed an echo statement in the ranking script to see if there was an issue with the SQL Query. I copied the query over to phpMyAdmin and ran it, I see the results I expect to see.

I need to be able to place a <prev and next> link on the bottom of the ad results, for obvious reasons. currently the module's skin template contains the following code(for navigation through the SQL "pages")


  {if $TOTAL_PAGES > 1}
   <td class="blog-info">
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
     {if $PAGENUM > 1}
       <td align="left" width="33%"><a href="{$PREV_PAGE_URL}">< Prev</a></td>
       <td align="left" width="33%">&nbsp;</td>
       <td align="center" width="34%">{$PAGENUM} of {$TOTAL_PAGES}</td>
       <td align="right" width="33%"><a href="{$NEXT_PAGE_URL}">Next ></a></td>
       <td align="right" width="33%">&nbsp;</td>

It seems to work on most occasions. I did a {debug output="html"} for the category list query and looked at the results. Although there are only 6 categories returned(as I there should be) The debug info reports the value of $TOTAL_PAGES as 9. I imagine the issue is in the custom ranking script. The ranking script is basically modeled after the example ranking script.
Any ideas where to look to resolve this issue?

Back to top
Jamroom Team

Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 10/20/09 09:24 
It sounds like the "count" coming out of the counter query is different the the results coming from the actual "results" query. Can you show me your ranking query function?

Hope this helps!

- Brian

Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top

Joined: 20 Jun 2009
Posts: 344
Location: Portland Oregon

Posted: 10/20/09 20:22 
Thanks for the response. Just the suggestion of showing you the ranking query function led me to my issue. Since I decided to uses the order variable to give me query results from 2 different tables. Order 1-6 are for the ads table and 7 & 8 are for the categories table. I just needed to place the query that assigns the $GLOBALS['JR_RANK_COUNT_QUERY'][$ckey] into a switch so that order values of 1-6 get a count from the Ads table and order values of 7 or 8 would get counts from the categories table.

Thanks bigguy, as well as the rest of the jamroom forum. You have all been so helpful. A few more tests and I'll send this module off to support[at]jamroom.net, for help, listing it in the jamroom marketplace.

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
• Support Forum
• Documentation
• Support Center
• Contact Support
• Community Forum
• Member Sites
• Developers
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.