Version: 1.00, by tgmorris
Developer Last Online: Oct 2013
Version: 3.0.0
Rating:
Released: 01-08-2004
Last Update: Never
Installs: 19
Is in Beta Stage
No support by the author.
Threaded Forum Views (Version 1.8)
Threaded Forum Views will allow the user to display an individual forum or search results in a fully threaded manner. To enable this support the user selects Enable from the new Threaded Forum Views section within Edit Options in the User CP. In addition to the Enable/Disable setting the user may also select Compact or Expanded modes as well as the number of characters to be displayed in the thread/post titles.
A minor oversight/bug is corrected by release of 1.1. A class="inlineimg" has been added to the <img> tags in order to make sure the line spacing is proper. The prior releases relied on the fact that the <img> tag was automatically assigned vertical alignment in the main CSS.
A bug involving unregistered users has been fixed with the release of version 1.2.
Version 1.3 corrects a template error.
Version 1.4 is verified to work with RC3 and corrects template name errors.
Version 1.5 is verified to work with RC4 and has some minor cleanup.
Version 1.6 corrects an error when announcements are used. This version also includes updated graphics that perform well with either light or dark backgrounds.
Version 1.7 limits the number of posts displayed in a thread in the Forum Display based on the Thread Age Cutoff. This is of value for active boards where threads can get very long over an extended period of time. No filtering is done on search results at this time. Also included as part of the graphics is an updated "new post" image to match vb3 Gold.
Version 1.7.1 fixes a minor template error dealing with the display of the date & time of the post. The only change from the prior release is to the 'threadedbit' template.
NEW: Version 1.8 supports limiting the number of posts in both Forum Display and in Search Results. Additionally, the code has been modified so that the number of places that depend on the new field names has been reduced. This should help reduce installation errors.
Features:
Functionality controlled via the Users CP.
Supports 2 display modes. Single line or Dual line.
Supports variable title lengths.
Works with the display of forums and search results.
Indicates which posts have been read and which are new.
Indicates which posts have attachments.
Handles Sticky posts - limits the thread to the opening post.
Displayed results may be sorted using the existing tools provided by forumdisplay.php
Tested with vBulletin 3.0.0 GOLD.
Caveats:
Some of the Administrator functions (such as thread maintenance on deleted threads) are not available while in this mode. While doing administrative tasks the Admin should disable Threaded Forum Views.
Feedback & Support:
If you have any problems or questions please post them on vb.org. I will be happy to help in any way I can - though I am definitely no expert at PHP.
Miscellaneous:
This is currently running on my live board.
To update existing users it is necessary to manually run an UPDATE query. I used
UPDATE userfield SET field5='Enable',field6='Compact',field7='30' where field5='';
to set the default values.
Also, a new field has been added to the search parameters. Because of this it is neccessary to erase the existing cached searches. This can be done using the following query
delete from search;
It is also possible to turn Threaded Forum Views on for guest users by setting the appropriate values into the $bbuserinfo fields in sessions.php.
Screen shots and directions for making the necessary modifications to the files and templates are attached as are the 5 new graphics in the ZIP file.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Yes, congratulations! I made my own hack, but yours is better. Still I have a few problems. 1) I couldn't decipher this bit in the instructions: "Find the call to "fetch_trimmed_title" in 2 places and add ", $bbuserinfo['field7']" to the argument list." What do you mean exactly? 2) There are some odd vertical spaces between some of the posts when in "Compact" mode?!?
EDIT: Oh yeah, it would be nice if you could switch between the two modes from the forumdisplay (like you can when you are reading a thread). Perhaps an idea for 1.5
I guess I'll need to clarify that a bit more in the instructions. All that's being done is adding the second argument to the fetch_trimmed_title function. The 2nd argument controls how many characters are being displayed in the title.
Can you send/post a screen shot of the vertical spacing problem and with which browser?
Quote:
Oh, another idea for future versions: Make it expandable so it only has the first post in the thread until you click on an icon.
As far as making it expandable that's not a bad idea. But, at least to me, that capability sort of exists already by using the hybrid/threaded modes in the standard release. How best to accomplish this will take a bit of thought...
function getbgclass() { global $bgcounter; if ($bgcounter++%2 == '0') { return 'alt2'; } else { return 'alt1'; } }
There is already a global declared called $bgclass and a function in functions.php to toggle it between two background colors.
PHP Code:
// ###################### Start altbgclass ####################### // reads in $bgclass and returns the alternate table class // $alternate allows us to have multiple classes on one page without them overwriting each other function exec_switch_bg($alternate = 0) ...
Also instead of refererncing field names throughout the code, making it more likely that errors will creep in when those field numbers do not match in individual installs, you can assign those values to constant defines in "init.php" which allows you to access the information via these constants in the other codes edits. This lowers the chance of errors being introduced while the hack is being installed.
function getbgclass()
{
global $bgcounter;
if ($bgcounter++%2 == '0')
{
return 'alt2';
}
else
{
return 'alt1';
}
}
There is already a global declared called $bgclass and a function in functions.php to toggle it between two background colors.
PHP Code:
// ###################### Start altbgclass #######################
// reads in $bgclass and returns the alternate table class
// $alternate allows us to have multiple classes on one page without them overwriting each other
function exec_switch_bg($alternate = 0)
...
Also instead of refererncing field names throughout the code, making it more likely that errors will creep in when those field numbers do not match in individual installs, you can assign those values to constant defines in "init.php" which allows you to access the information via these constants in the other codes edits. This lowers the chance of errors being introduced while the hack is being installed.
Thanks for the tips. Knowledge comes with experience and I've only been using vb for 2 months and am still learning my way around.
Perhaps when vb does the code for this feature it will be cleaner (he said with hope in his voice ).
Indent the next 2 "if" statements after which add the closing brace to the above "else" clause:
VVVVVVVVVVVVVVVV
}
^^^^^^^^^^^^^^^^
Locate the end of the file.
Insert BEFORE the closing comments
because I get these:
Parse error: parse error, expecting `')'' in /pub/home/includes/init.php on line 829
Parsing functions.php Time before: 1075677229.6479 Memory Before: 497KB Time after: 1075677229.6759 Time taken: 0.027982950210571 Memory After: 1,147KB Processing sessions.php Time before: 1075677229.677 Memory Before: 1,152KB Fatal error: Call to a member function on a non-object in /pub/home/includes/sessions.php on line 171
All that's being done is to close the newly added 'else' part of the conditional. The indenting of the 2 existing statements, while not really necessary, preserves the formatting.
The other way to look at it is that we're wrapping those 2 existing if statments in the 'else' portion of a new if ... else statment.
Morris, that is not the problem. I can't really understand this place in your instruction and if you want more fans of your hack, please re-write that place in a more detailed way. Don't write 2 lines next and 10 lines down - it's no good, just cut the code ...
Morris, that is not the problem. I can't really understand this place in your instruction and if you want more fans of your hack, please re-write that place in a more detailed way. Don't write 2 lines next and 10 lines down - it's no good, just cut the code ...
OK, now I understand . I've made that section a bit more clear and uploaded the new zip.