vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Collapsable forums on forum home (https://vborg.vbsupport.ru/showthread.php?t=33961)

cnczone 05-19-2003 02:37 AM

Does it work with 2.3.0 ?

Splitfyre 06-22-2003 10:59 PM

Waiting to find out if it works fine on 2.30 before installing.

dabean 06-23-2003 10:09 AM

Works fine with 2.3.0

raxafarian 07-13-2003 10:37 PM

thank you!

installed on vb2.3, no probs with install.

jackomo 07-25-2003 05:38 PM

hey guys,

my forum doesn't contain the

'forumhome_forumbit_level3_post' template.

should i create a new one?

If so, how do i create it under Forum Home Page Templates?

jackomo 07-26-2003 02:01 PM

Hey guys,

How do i get this working in the sub-sub forums?

This is my structure...

Main Category
|
Sub Category
|
Sub Category <- How do i get the (+/-) here?
|
All Postable Forums

Please help...

dabean 07-26-2003 05:07 PM

Main Category <??

Sub Category < level1_nopost

Sub Category <- level2_post or nopost, depending on if you have the subcategory as postable.

All Postable Forums < level3_post


Each category template that needs to have the expand contract icons by adding $expandcontract, also the standard level2 modifications need to be made.

As an example a complete level2_nopost template would look like.

PHP Code:

<tr class="cat" id="f$forum[parentid]z$z$fhomeexpandstyle>
  <
td bgcolor="{categorybackcolor}"><smallfont>&nbsp;</smallfont></td>
  <
td bgcolor="{categorybackcolor}" colspan="5">
   
$expandcontract
   
<a href="forumdisplay.php?s=$session[sessionhash]&amp;forumid=$forum[forumid]"><normalfont color="{categoryfontcolor}"><b>$forum[title]</b></normalfont></a>
   <
br><smallfont color="{categoryfontcolor}">$forum[description]</smallfont></td>
</
tr


The complete level3_post template would then look like.

PHP Code:

tr id="f$forum[parentid]z$z$fhomeexpandstyle align="center">
    <
td bgcolor="{secondaltcolor}" valign="top"><img src="{imagesfolder}/$forum[onoff].gif" border="0" alt=""></td>
    <
td bgcolor="{firstaltcolor}" align="left"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont><b>$forum[title]</b></normalfont></a>
    <
br><smallfont>$forum[description]</smallfont></td>
    <
td bgcolor="{secondaltcolor}"><normalfont>$forum[replycount]</normalfont></td>
    <
td bgcolor="{firstaltcolor}"><normalfont>$forum[threadcount]</normalfont></td>
    <
td bgcolor="{secondaltcolor}"><smallfont>$forum[lastpostinfo]</smallfont></td>
    <
td bgcolor="{firstaltcolor}"><smallfont>$forum[moderators]</smallfont></td>
</
tr

Extra templates are added by clicking "add template" inside the admincp. Custom templates are always placed at the top of the templates list under "custom templates".
This hack in no way alters vB behavour in that area.

jackomo 07-26-2003 06:16 PM

ok...i understand how it works now...

This i what im trying to do....

Main Category (level 1 no post)
|
Sub Category (level 2 no post)
|
Sub Category (level 3 no post)<- How do i get the (+/-) here?
|
All Postable Forums (level 4 post)

I created the Level 3 no post template and the level 4 post template but it still doesn't work.

The new templates i created don't show up under the Forum Home Page templates with the others, they appear at the very top under custom templates.

Any ideas?

dabean 07-26-2003 06:31 PM

Place the contents of the level2_nopost template in post 327 inside your level3_nopost template.

The new templates will not show up under "Forum Home Page templates", as only the templates included with vB by default appear there.

jackomo 07-26-2003 06:34 PM

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.

dabean 07-26-2003 06:55 PM

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?

jackomo 07-26-2003 07:08 PM

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

dabean 07-26-2003 07:14 PM

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.

jackomo 07-26-2003 07:34 PM

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?

dabean 07-26-2003 07:41 PM

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

jackomo 07-26-2003 07:52 PM

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.

jackomo 07-27-2003 02:44 PM

Hey Dabean,

How hard would it be to change this chack to work with Forum Display?

dabean 07-27-2003 03:35 PM

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'); 


jackomo 07-27-2003 04:01 PM

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.

jackomo 07-28-2003 01:59 PM

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....

StarBuG 08-18-2003 05:51 PM

One BIG question!

Will this hack be converted to fit into vBB 3.0????
That would be so awesome!!!!

Greetings

StarBuG

dabean 08-18-2003 06:57 PM

A vB 3.0 version may be released at some point after vB 3 RC1. I haven't yet decided if I'll wait until vB 3.0 final before releasing.

StarBuG 08-19-2003 07:25 AM

You are the greatest!!

Can hardly wait till RC1!

Greetings

Star

ps: Did you noticed after you released the hack it spreat over thousands of boards and was also rewritten for many other forum softwares hehe!!!

poetic 08-24-2003 02:31 PM

this dosnt work with 2.3.2 or something the + and - are there and i click it the - changes to a - but the forum doesnt collpaseis there anyone who can make it work please

poetic 08-30-2003 07:20 PM

come on please someone im really stuck

dabean 08-30-2003 09:11 PM

The attached file will test your installation for correctness, including template modifications.

The file will explain what actions you need to take to correct any problems.

MaDCaT75 08-30-2003 10:55 PM

omg like the coolest thing evar!

Papino 09-05-2003 01:09 PM

hi debean, sorry but i'm able to get it working

by using the new testfile, it seems strange, but no errors occured
http://forum.rts-games.it/admin/cx_test.php

sorry again
thx

y2krazy 10-25-2003 09:55 PM

Is there a way to use this script for other non-vB pages? Or is this script simply for vB-only pages...?

What I'm asking is if this script is available to use seperate from the vBulletin forum pages, and if so, where can it be found?

Thanks,
y2krazy

Mathiau 10-28-2003 06:48 PM

Anyone have this running on 2.3.2 successfully?


please check my site - u cans ee my error - i went over all the code but could not really locate where i went wrong..

The "Testing" should look like the Main forum, but is not :(

http://200.12.238.21/ppcf/index.php

i tried deleting the categorya nd redoing it but no go - help please!

Deska 01-18-2004 04:46 PM

Any update for vB3 yet?

SVTBlackLight01 01-19-2004 04:02 AM

Quote:

Originally Posted by Deska
Any update for vB3 yet?

Which version? Isn't this a vb3 feature?

Zachery 01-19-2004 04:20 AM

Quote:

Originally Posted by Deska
Any update for vB3 yet?

Standard vB3 feature :)

coolmile 02-04-2004 04:20 AM

work great now... visit my site at http://www.tarantulas.us

John Diver 03-18-2004 02:30 PM

Can this hide specific forums within a category?
I want to allow members to hide forums as well as categories

Thanks

cnczone 05-05-2004 03:51 AM

me tooo

CFF RA's 12-24-2005 04:52 PM

Okay, here is my issue. I followed the instructions right down to the letter and now not only do the collapsable not appearing but the entire forums are appearing, all you see is the Who's Online and the Private Message bar.

I'm running version 2.3.7

Thanks.


All times are GMT. The time now is 04:17 AM.

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.01757 seconds
  • Memory Usage 1,874KB
  • 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
  • (12)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete