Topic: [Request] Collapse Category Extension?
Hello,
I know that there is one of these for 1.2.x, but it doesn't work on 1.3.x.
Just wondering if there is one for 1.3.x as I can not find it anywhere?
Thanks,
Danny.
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.3 extensions → [Request] Collapse Category Extension?
Hello,
I know that there is one of these for 1.2.x, but it doesn't work on 1.3.x.
Just wondering if there is one for 1.3.x as I can not find it anywhere?
Thanks,
Danny.
there is one of these for 1.2.x
Link to it?
http://www.punres.org/viewtopic.php?id=1883
Within the code on that webpage it says at the top:
Mod title: Collapsable Categories
##
## Mod version: 1.5
## Works on PunBB: 1.2.x ---- THERE WE GO KEYDOG - WORKS ON 1.2.x :)
we just need someone to tell you what to do at step 7 and 9
##
##
## Mod title: Collapsable Categories
##
## Mod version: 1.5
## Works on PunBB: 1.2.*
## Release date: 2006-08-27
## Author: Mike Lanman
##
## Description: Adds the abillity to collapse/expand categories. (like in Invision Power Board)
##
## Affected files: header.php
## index.php
##
## Affects DB: No
##
## Notes: 1.) There are 2 other sets of icons included if you dont
## like the default. just upload thoes to img/ insted of
## the default ones.
##
## 2.) Per style icons are avaible. just add them to
## "img/<your style>/" and keep the same file names.
##
## 3.) In this version there is no way to use text, only
## images. In a sub version, ill try to find a way to be
## able to use text.
##
## DISCLAIMER: Please note that "mods" are not officially supported by
## PunBB. Installation of this modification is done at your
## own risk. Backup your forum database and any and all
## applicable files before proceeding.
##
##
#
#---------[ 1. UPLOAD TO / ]---------------------------------------------------
#
img/
include/
#
#---------[ 2. OPEN ]----------------------------------------------------------
#
header.php
#
#---------[ 3. FIND (line:65)]-------------------------------------------------
#
<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
#
#---------[ 4. AFTER ADD ]-----------------------------------------------------
#
<script type="text/javascript" src="include/global.js"></script>
#
#---------[ 5. OPEN ]----------------------------------------------------------
#
index.php
#
#---------[ 6. FIND (line:45)]-------------------------------------------------
#
$cur_category = 0;
$cat_count = 0;
line 88
$forum_page['cur_category'] = $forum_page['cat_count'] = $forum_page['item_count'] = 0;
#
#---------[ 7. AFTER ADD ]-----------------------------------------------------
#
// stuff for toggling categories
$cat_ids = (isset($_COOKIE['collapseprefs']))? $_COOKIE['collapseprefs'].',': FALSE;
#
#---------[ 8. FIND (line:57)]-------------------------------------------------
#
?>
<div id="idx<?php echo $cat_count ?>" class="blocktable">
<h2><span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span></h2>
<div class="box">
lines 114-121?
?> <div class="main-head">
<h2 class="hn"><span><?php echo forum_htmlencode($cur_forum['cat_name']) ?></span></h2>
</div>
<div class="main-subhead">
<p class="item-summary"><span><?php printf($lang_index['Category subtitle'], implode(' ', $forum_page['item_header']['subject']), implode(', ', $forum_page['item_header']['info'])) ?></span></p>
</div>
<div id="category<?php echo $forum_page['cat_count'] ?>" class="main-content main-category">
<?php
#
#---------[ 9. REPLACE WITH ]--------------------------------------------------
#
// Setting varibles for toggling categories
$div_box = strstr($cat_ids, $cat_count.',')? ' style="display:none"' : '';
$exp_img = (is_file('img/'.$pun_user['style'].'/exp_down.png')? 'img/'.$pun_user['style'].'/': 'img/') . (strpos($div_box,'none') ? 'exp_down.png' : 'exp_up.png');
?>
<div id="idx<?php echo $cat_count ?>" class="blocktable">
<h2>
<span class="conr"><a href="javascript:togglecategory(<?php echo $cat_count?>);"><img src="<?php echo $exp_img?>" alt="Collapse" id="img_<?php echo $cat_count?>" /></a></span>
<span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span>
</h2>
<div class="box" id="box_<?php echo $cat_count ?>"<?php echo $div_box?>>
#
#---------[ 10. SAVE/UPLOAD ]--------------------------------------------------
#
Have you edited that to work for 1.3.x ? Why are there bits in red?
Have you edited that to work for 1.3.x ?
No
Why are there bits in red?
Those are what the code is in 1.3.x , black in this 1.2.x mod.
Ok fair dose.
Now we need someone to fix it for us!
Hope it's not to late, I did it like this and it works
#
#---------[ 1. UPLOAD TO / ]---------------------------------------------------
#
img/
include/
#
#---------[ 2. OPEN ]----------------------------------------------------------
#
header.php
#
#---------[ 3. FIND line:121]-------------------------------------------------
#
// Include stylesheets
require FORUM_ROOT.'style/'.$forum_user['style'].'/'.$forum_user['style'].'.php';
#
#---------[ 4. AFTER ADD ]-----------------------------------------------------
#
$forum_head['razsiri'] = '<script type="text/javascript" src="'.$base_url.'/include/global.js"></script>';
#
#---------[ 5. OPEN ]----------------------------------------------------------
#
index.php
#
#---------[ 6. FIND (line:88)]-------------------------------------------------
#
$forum_page['cur_category'] = $forum_page['cat_count'] = $forum_page['item_count'] = 0;
#
#---------[ 7. AFTER ADD ]-----------------------------------------------------
#
// stuff for toggling categories
$cat_ids = (isset($_COOKIE['collapseprefs']))? ','.$_COOKIE['collapseprefs'].',': FALSE;
#
#---------[ 8. FIND (line:117)]-------------------------------------------------
#
?>
<div class="main-head">
<h2 class="hn"><span><?php echo forum_htmlencode($cur_forum['cat_name']) ?></span></h2>
</div>
<div class="main-subhead">
<p class="item-summary"><span><?php printf($lang_index['Category subtitle'], implode(' ', $forum_page['item_header']['subject']), implode(', ', $forum_page['item_header']['info'])) ?></span></p>
</div>
<div id="category<?php echo $forum_page['cat_count'] ?>" class="main-content main-category">
#
#---------[ 9. REPLACE WITH ]--------------------------------------------------
#
// Setting varibles for toggling categories
$div_box = strstr($cat_ids, ','.$cat_count.',')? ' style="display:none"' : '';
$exp_img = (is_file('img/'.$pun_user['style'].'/exp_down.png')? 'img/'.$pun_user['style'].'/': 'img/') . (strpos($div_box,'none') ? 'exp_down.png' : 'exp_up.png');
?>
<div id="idx<?php echo $forum_page['cat_count'] ?>" class="blocktable">
<h2 class="hn">
<span class="conr"><a href="javascript:togglecategory(<?php echo $forum_page['cat_count']?>);"><img src="<?php echo $exp_img?>" alt="Collapse" id="img_<?php echo $forum_page['cat_count']?>" /></a></span>
<span><?php echo forum_htmlencode($cur_forum['cat_name']) ?></span>
</h2>
<div class="main-subhead">
<p class="item-summary"><span><?php printf($lang_index['Category subtitle'], implode(' ', $forum_page['item_header']['subject']), implode(', ', $forum_page['item_header']['info'])) ?></span></p>
</div>
<div class="main-content main-category" id="category<?php echo $forum_page['cat_count'] ?>" <?php echo $div_box?>>
#
#---------[ 10. SAVE/UPLOAD ]--------------------------------------------------
#
Hope it's not to late, I did it like this and it works
With things like pun_user set in code etc you have it working on PunBB 1.3.x?
Do you have a link to your site?
Killerius wrote:Hope it's not to late, I did it like this and it works
With things like pun_user set in code etc you have it working on PunBB 1.3.x?
Do you have a link to your site?
Yea have a look:
http://www.pokerpro.si/forum/index.php
Mine shows up fine, but it doesn't work!
Hello,
Any one knows a way to display the categories "collapsed" by default ?
Can't find the line of code.
Thank you.
Regards,
Nicolas
Thank you dimkalinux
In fact i am still running PunBB 1.2 and trying to find a way to adapt the code to it
is there a way to implement collapsable categories without index.php code modification?
I would like to implement collapsable categories, but don't want to fix index.php after every upgrade.
thanks
is there a way to implement collapsable categories without index.php code modification?
I would like to implement collapsable categories, but don't want to fix index.php after every upgrade.
thanks
I will try - check this topic after week.
wow, that was fast. I'll check in, sure.
Maybe we should suggest to dev team to add id attributes in code where they can, categories, forums, posts, etc. in way, you did it in modified code. think that that will help a lot, probably for other uses to, not just collapsable categories.
best regards
PunBB Forums → PunBB 1.3 extensions → [Request] Collapse Category Extension?
Powered by PunBB, supported by Informer Technologies, Inc.