vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Please help me fix a minor bug in my mod (https://vborg.vbsupport.ru/showthread.php?t=212878)

Chadi 05-04-2009 11:37 PM

Please help me fix a minor bug in my mod
 
I have released this mod a few weeks ago:

https://vborg.vbsupport.ru/showthread.php?t=211939

First...

I can't figure out how to get the # to show all threads that begin with a number. I basically want to add a "#" option so that it displays all threads that begin with a number. Problem is, I have no idea what the code/link is supposed to look like.

Fix minor bug...

I've been reported of a minor bug by two installers of my mod. The problem is that when a letter is clicked, it works fine but until you click another page number, it'll lose the effect or "criteria" as some call it, of the letter clicked.

For example, I click the letter A, it'll show the threads that begin with the letter A (which is right), 20 per page by VB's default setting. If you now click any other page number such as page 2 or 3, it'll show the default thread listing/view, for that page - completely losing the criteria of selecting a specific letter.

Thanks in advance for the help :)

Chadi 05-11-2009 02:13 PM

Would appreciate a hand on this please. Thanks.

Chadi 06-04-2009 12:56 AM

Would appreciate help on this. Thank you :)

Dylanblitz 06-04-2009 06:35 AM

The first part is easy, not sure how to do the second part, although I know what's wrong.

You want to stay away from using # as a value. I would add a line to the style like this

Quote:

<a rel="nofollow" href="forumdisplay.php?f=$foruminfo[forumid]&letter=num">#</a></td>
Then change the plugin to be this

Quote:

if($letter == 'num')
{
$hook = " AND LEFT(thread.title, 1) REGEXP ('[0-9]')";
} else {
$hook = " AND LEFT(thread.title, 1) = '$letter'";
}
The second part is happening because you are not adding the letter to the link. You need to add it to the pagenav, probably through the pagenav_complete hook, not sure exactly how you would do it though.

Another thing wrong I see. The page count is off when you select a letter. The page count is still counting all threads, even if they're not shown. So you might have 8 pages shown up top even if you only have 4 threads. I'm not sure if there's a hook to modify the total page count.

Sorry I couldn't help you more.

Chadi 06-04-2009 12:06 PM

Thanks. Your plugin code does not work though, tried it and nothing works.

Dylanblitz 06-04-2009 04:30 PM

1 Attachment(s)
Hmm, it works on my dev forum, are you sure it's in there right? I've edited your product xml, try this out.

Chadi 06-05-2009 04:04 AM

Odd that works. Thanks Dylan.

Hopefully someone else can figure out the pagination problem.


All times are GMT. The time now is 04:43 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
  • Page Generation 0.01106 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete