Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by dabean dabean is offline
Developer Last Online: Dec 2003 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-08-2002 Last Update: Never Installs: 122
 
No support by the author.

This hack adds expansion and contraction support to the forum home page (index.php). The current version of this hack has been tested on vBulletin 2.3.2

Only supported browsers gain the ability to expand and collapse forum groups, non supported browsers do not gain anything, but no errors will be displayed.
Each users preference is saved to the database, additionally admins can select which forums are to be collapsed by default.

  • Browsers supported
  • Netscape6+/Mozilla0.6+
  • MS IE5+
  • Konqueror
  • Opera 7 support is included
  • Browsers unsupported
  • MS IE4 or earlier
  • Netscape 4 or earlier
  • Opera (version 6 and earlier)

Note: PHP 4.1.x or 4.2.x is required, PHP 4.0.x is now unsupported.

Instructions inside attachment.
Updated 4:18 PM 1/12/2002
- Packaged Post, Thread template Addon

Updated 7:53 PM 1/11/2002
- corrected installer

Updated 4:23 PM 1/11/2002
- Added DB support
- Added Per forum Collapsed Pref to admin cp

Updated 01/10/02 01:39am.
- Fixed missing line.

Updated 04/06/02 01:30am.
- Version 1.2
- PHP 4.1.x, 4.2.x support with or without register globals off.
- Performance tweeked javascript

Updated 06/06/02 11:20pm.
- Corrected templatecache bug

Updated 06/25/02
- Corrected formatting errors in readme

Updated 09/01/02
- vB 2.2.7 compatiblity statement, updated readme.

Updated 30/08/03
- vB 2.2.x and 2.3.x compatiblity statement, added new automatic testing script.

FAQ
Q: what exactly is Template_Option.txt?
A: Basically that exention was provided as a request to cover sites with the template modification that adds a "header" to each grouping.

Q: How do I show a forum depth greater than 2?
A: Open vB Admin cp set forum depth to your required level. Then create the additional templates. For template examples see https://vborg.vbsupport.ru/showthrea...465#post250465

Q: Can sub-forums be collapsed?
A: Yes. See the above answer for example templates.

Q: XYZ doesn't work help.
A: Check that all the template changes required have been made, 99% of problems are due to incorrect template alteration. Also use the cx_test.php to automatically check your installation!

Show Your Support

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

Comments
  #332  
Old 07-26-2003, 06:55 PM
dabean dabean is offline
 
Join Date: Oct 2001
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 08:34 PM jackomo said this in Post #330
Yes, that's what i did...it still doesn't work....

When i put the code in the level2_nopost, it works like a charm.

when i put the code in the new level3_nopost i created, it doesn't work.
Define doesn't work.

The level3 template doesn't appear?
The plus minus symbols don't appear but the level3 template does?
The level4 template doesn't appear?
Reply With Quote
  #333  
Old 07-26-2003, 07:08 PM
jackomo jackomo is offline
 
Join Date: Jul 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i created both level3_no post and level4_post templates and they appear under the custom templates.

These 2 templates were not there before, i only had level 1 and level 2, so i added them.

When i go back into the forums and click through each category, i see the templates, but no (+/-) symbols at the third level.

Example...

Canada (Category 1) - level 1 no post - i can see this page.
|
Computers (Category 2) - level 2 no post - i can see this page.
|
Hardware (Category 3) - level 3 no post - i can see this page but no (+/-) next to it.
|
Part 1, Part2,...(Postable forums) - level 4 post - i can see this page but it does not collapse
Reply With Quote
  #334  
Old 07-26-2003, 07:14 PM
dabean dabean is offline
 
Join Date: Oct 2001
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Define "click through each category", as this hack only applies to the main index page. It does not apply to any of the sub views inside forumdisplay.
Reply With Quote
  #335  
Old 07-26-2003, 07:34 PM
jackomo jackomo is offline
 
Join Date: Jul 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, when the main page comes up you will see Canada as a main category then Computers as a sub-category under it.

When i click on Computers, there is another sub-category called Hardware under that.

Hardware contains a bunch of parts that i would like to collapse.

Is this possible with your hack?
Reply With Quote
  #336  
Old 07-26-2003, 07:41 PM
dabean dabean is offline
 
Join Date: Oct 2001
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 09:34 PM jackomo said this in Post #334
Well, when the main page comes up you will see Canada as a main category then Computers as a sub-category under it.

When i click on Computers, there is another sub-category called Hardware under that.

Hardware contains a bunch of parts that i would like to collapse.

Is this possible with your hack?
If when you click on the category the url changes from index.php to forumdisplay.php then no.

This hack was designed for cases where lots of forums are required to be display on the home page.

Most of the installations using forums 3 or more levels deep with this hack alter the "depth of forums" setting to show all the required forums on the index page.

vBulletin Options > Forums Home Page Options > Depth of Forums
Reply With Quote
  #337  
Old 07-26-2003, 07:52 PM
jackomo jackomo is offline
 
Join Date: Jul 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

aahh...ok...the URL does change to forumdisplay.php

I changed the forum depth to 3 as you suggested.

Now the (+/-) appears...

Ok....well, thanks for all your help i really appreciate it.

Sorry to have wasted your time.
Reply With Quote
  #338  
Old 07-27-2003, 02:44 PM
jackomo jackomo is offline
 
Join Date: Jul 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Dabean,

How hard would it be to change this chack to work with Forum Display?
Reply With Quote
  #339  
Old 07-27-2003, 03:35 PM
dabean dabean is offline
 
Join Date: Oct 2001
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just copy paste the existing code into the correct places inside forumdisplay.php. No further template modifications are required.

Find
PHP Code:
function makeforumbit($forumid,$depth=1,$permissions='') {
  global 
$DB_site,$bbuserinfo,$iforumcache,$ipermcache,$imodcache,$session,$accesscache,$usergroupdef,$noperms;
  global 
$showlocks,$hideprivateforums,$showforumdescription,$forumdisplaydepth,$dateformat,$timeformat,$forumshown,$enableaccess;
  global 
$bbforumview
Below add
PHP Code:
// expand collapse hack
global $BrowserDOM$collapsedstate;
// end expand collapse hack 


Find
PHP Code:
if ($forum['cancontainthreads']==1) {
  
$tempext '_post';
} else {
  
$tempext '_nopost';

Below add
PHP Code:
// expand collapse hack
if ($BrowserDOM==True) {
  if ((!isset(
$z)) or ($depth==1)) {
    
$z=0;
  } else {
    
$z++;
  }
  
// get state of collapse
  
if ($forum[parentid]==-1) {
   
$collapsedstate=$forum['collapsed'];
  }
  
// auto collapse forums based on forum setting
  
if ($collapsedstate==1) {
   
$fhomeexpandstyle="style=\"visibility:hidden; display:none;\"";
  } else {
   
$fhomeexpandstyle="";
  }

  
// auto collapse forums for user
  
if (getViewSetting($forum['parentid'])==1) {
   
$fhomeexpandstyle="style=\"visibility:hidden; display:none;\"";
  } elseif (
getViewSetting($forum['parentid'])==2) {
   
$fhomeexpandstyle="";
  }

  
// display correct item (this can not be simplified into the block above
  // due to CSS2 defining special display values for tables, eg display:table-row;)
if ($collapsedstate==1) {
   
$divexpand "display: inline;visibility: visible;";
   
$divcollapse "display: none;visibility: hidden;";
} else {
   
$divexpand "display: none;visibility: hidden;";
   
$divcollapse "display: inline;visibility: visible;";
}

if (
getViewSetting($forum['forumid'])==1) {
   
$divexpand "display: inline;visibility: visible;";
   
$divcollapse "display: none;visibility: hidden;";
  } elseif (
getViewSetting($forum['forumid'])==2) {
   
$divexpand "display: none;visibility: hidden;";
   
$divcollapse "display: inline;visibility: visible;";
  }
  eval(
"\$expandcontract = \"".gettemplate("forumhome_expandcontract")."\";");
}
// end expand collapse hack 
Find:
PHP Code:
$forumbits=makeforumbit($forumid1$permissions); 
Above add:
PHP Code:
// expand collapse hack
$fviewcache=BuildViewSettingCache(); // create cache
// end expand collapse hack 

Find
PHP Code:
if ($forumshown==1) {
  eval(
"\$forumdisplay[forumslist] = \"".gettemplate('forumdisplay_forumslist')."\";");
} else {
  
$forumdisplay['forumslist']='';


Change it to:
PHP Code:
if ($forumshown==1) {
  
// expand collapse hack
  
if ($BrowserDOM==True) {
    eval(
"\$expandcontractscript = \"".gettemplate('forumhome_expandjscript')."\";");
  }
  
// end expand collapse hack
  
eval("\$forumdisplay[forumslist] = \"".gettemplate('forumdisplay_forumslist')."\";");
} else {
  
$forumdisplay['forumslist']='';


Alter:
PHP Code:
require('./global.php'); 
into:
PHP Code:
// expand collapse hack
require('./admin/getbrowser.php');
require(
'./admin/getforumview.php');
$BrowserDOM=GetBrowserDOM2();
$templatesused.=',forumhome_expandcontract,forumhome_expandjscript';
// end expand collapse hack

require('./global.php'); 
Reply With Quote
  #340  
Old 07-27-2003, 04:01 PM
jackomo jackomo is offline
 
Join Date: Jul 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok...made the changes to forumdisplay.php as you said and the (+/-) didn't show up.

so, i edited the forumdisplay_forumbit_level1_nopost, by adding the "$expandcontract" and the (+/-) shows up but it doesn't work.

so, i edited the forumdisplay_forumbit_level2_post, by changing to "<tr id="f$forum[parentid]z$z" $fhomeexpandstyle align="center">"

When i put my mouse over the (+/-), it says there is an error on the page.
Reply With Quote
  #341  
Old 07-28-2003, 01:59 PM
jackomo jackomo is offline
 
Join Date: Jul 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We have a winner!

I got it working...

i forgot to edit the forumdisplay template

I added the "$expandcontractscript" to the forumdisplay template and it is working perfect now.

Thanks for all your help....
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 03:08 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.06871 seconds
  • Memory Usage 2,350KB
  • Queries Executed 27 (?)
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
  • (10)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete