Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
User Selectable "Maximum Displayed Threads Before Page Split" Details »»
User Selectable "Maximum Displayed Threads Before Page Split"
Version: 1.00, by Brent H Brent H is offline
Developer Last Online: Feb 2008 Show Printable Version Email this Page

Version: 3.5.2 Rating:
Released: 12-07-2005 Last Update: 12-07-2005 Installs: 6
Uses Plugins
 
No support by the author.

/*================================================= =====================*\
|| User Selectable "Maximum Displayed Threads Before Page Split"
|| Author : Brent Hegnauer (TheHeggy)
|| Works on : vBulletin 3.5.2
|| Released : Dec 08, 2005
||
|| Time required to install: 2 minutes
|| Difficulty: Easy
\*================================================ ======================*/

Description:

This plugin allows you to give your members control over how many threads are displayed on forumdisplay.php (via the Options page in their UserCP). I saw this requested somewhere on this site and figured I'd give it a shot.

Statistics:

Plugins: 1
Custom Profile Fields: 1

Installation:

1) Create a new Custom Profile Field with the following settings:

/*================================================= =====================*\

Profile Field Type: Single-Selection Radio Buttons

Title: Maximum Displayed Threads

Description: This setting allows you to set how many threads are listed per page.

Options: 20

Set Default: Yes

Display Order: (Doesn't matter!)

Field Required: No

Field Editable By User: Yes

Private Field: No

Field Searchable on Members List: No

Show on Members List: No

Allow user to input their own value for this option: Yes

Max length of allowed user input: 2

Display Size: 2

Regular Expression: [0-9]

Which page displays this option? Options: Thread Viewing

\*================================================ ======================*/

2) Submit and take note of the name of the field it displays... For me it's field5.

3) Upload the plugin.

4) Edit your plugin and change all instances of field5 to whatever yours happens to be.

Done!

It's vital that your field ID be correct, otherwise every forumdisplay.php will return MySQL errors!

Enjoy If there's any problems, I'll try to help. No guarantees though, as I manage 4 sites and don't have a lot of extra time. You're free to modify and redistribute this as you see fit.

Updates:

1.0 - Initial Release

1.1 - Added Marco's code to prevent users from breaking the forumdisplay by putting in a "0".

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-08-2005, 11:09 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I suggest changing:
PHP Code:
$vbulletin->options['maxthreads'] = $vbulletin->userinfo['field5']; 
to:
PHP Code:
$vbulletin->options['maxthreads'] = (intval($vbulletin->userinfo['field5']) > intval($vbulletin->userinfo['field5']) : $vbulletin->options['maxthreads']); 
Reply With Quote
  #3  
Old 12-08-2005, 11:24 AM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks man! Good idea
Reply With Quote
  #4  
Old 12-08-2005, 04:17 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, nice hack!
Reply With Quote
  #5  
Old 12-08-2005, 08:42 PM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Aftermath. Glad you like it!
Reply With Quote
  #6  
Old 12-08-2005, 10:22 PM
o1dirtydog o1dirtydog is offline
 
Join Date: Aug 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is nice man... surprised it's not already something vb does by default.

im ganna install this tomorrow
Reply With Quote
  #7  
Old 12-12-2005, 11:42 AM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice little addition! I shall install!
Reply With Quote
  #8  
Old 04-19-2006, 08:26 AM
tfw2005 tfw2005 is offline
 
Join Date: Sep 2004
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Getting an error with this when clicking the "Thread Starter" "Replies" and "Views" sorting links on the top of the thread display columns.

When i sort by Thread, Rating, or Last Post, it works fine.

Have a ton of other hacks installed, including personal stickies and seperated stickies.

However, the sorting works when this plugin is uninstalled, doesnt when they are uninstalled and this isn't, leads me to believe error is with this.

Anyone else having this issue?

Code:
Database error in vBulletin 3.5.4:

Invalid SQL:

		SELECT  threadid
			
		FROM thread AS thread
		
		WHERE forumid = 299
			AND sticky = 0
			AND threadid NOT IN (14462,15419)
			 AND visible IN (0,1,2)
			
			
			
			
		ORDER BY sticky DESC,  DESC
		LIMIT 0, 10;

MySQL Error  : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC
		LIMIT 0, 10' at line 13
Error Number : 1064
Date         : Wednesday, April 19th 2006 @ 05:23:11 AM
Script       : /forumdisplay.php?f=299&daysprune=-1&order=asc&sort=postusername
Referrer     :/forumdisplay.php?f=299
IP Address   : 
Username     : 
Classname    : vb_database
Reply With Quote
  #9  
Old 04-28-2006, 08:56 AM
tfw2005 tfw2005 is offline
 
Join Date: Sep 2004
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone else with this issue, or, anyone know of a quick fix? It breaks a core functionality of the site, can't continue using it if it stays like this. Thanks in advance.
Reply With Quote
Reply


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 08:25 PM.


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.04602 seconds
  • Memory Usage 2,290KB
  • Queries Executed 24 (?)
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)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete