Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-04-2009, 11:37 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-11-2009, 02:13 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would appreciate a hand on this please. Thanks.
Reply With Quote
  #3  
Old 06-04-2009, 12:56 AM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would appreciate help on this. Thank you
Reply With Quote
  #4  
Old 06-04-2009, 06:35 AM
Dylanblitz Dylanblitz is offline
 
Join Date: Oct 2005
Location: OC, California
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-04-2009, 12:06 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. Your plugin code does not work though, tried it and nothing works.
Reply With Quote
  #6  
Old 06-04-2009, 04:30 PM
Dylanblitz Dylanblitz is offline
 
Join Date: Oct 2005
Location: OC, California
Posts: 732
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, it works on my dev forum, are you sure it's in there right? I've edited your product xml, try this out.
Attached Files
File Type: xml product-abc-thread-listing.xml (824 Bytes, 13 views)
Reply With Quote
  #7  
Old 06-05-2009, 04:04 AM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Odd that works. Thanks Dylan.

Hopefully someone else can figure out the pagination problem.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04517 seconds
  • Memory Usage 2,232KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (1)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete