The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Hide/Show Forum Categories (PHPBB2) in Board Index

View previous topic View next topic Go down

Solved Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on October 29th 2013, 12:13 pm

Hi all,
How can i put a collapse/expand (toggle) button in my forum categories? My forum version is PHPBB2. I mean something like this

Spoiler:

I 've read this topic http://help.forumotion.com/t127149-category-show-hide?highlight=hide+categories and I want to make it in phpbb2.



Best Regards,
Dark-Avenger


Last edited by Dark-Avenger on November 7th 2013, 8:15 pm; edited 4 times in total

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Ikerepc on October 29th 2013, 12:16 pm

Hi,

can you make screenshot what you think, or can you please explain better?

Ikerepc
Active Poster

Male Posts : 1114
Reputation : 152
Language : Croatian, HTML, CSS, jQuery, JavaScript, PHP, SQL, Bascom, Python, C, FBD & LAD for PLC and more... Little English :D
Location : Around electronics and progmamming ;)

http://help.forumotion.com

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on October 30th 2013, 7:11 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on October 31st 2013, 9:57 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on November 2nd 2013, 6:17 pm

bump?

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on November 3rd 2013, 7:38 pm

Bump

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Kaizer Lee on November 4th 2013, 3:58 am

Well, I guess I have to gamble this post since I don't wanna receive another warning for unhelpful posting.

Anyway, there was a guy who came up with a code but he was banned a long time ago. A guy with a gaming avatar or something.

His other account here is Mr. Easy BB or something like that.

I suggest you ask an administrator which account he was originally in because the code he did for this was really helpful.

I'd show you but I couldn't find his post nor can I remember his name, so I'm sorry about that.

P.S. Inb4 I receive a warning.

Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Ange Tuteur on November 4th 2013, 4:01 am

Is this the topic you're referring to Kaizer Lee?

Try this Dark-Avenger:
http://help.forumotion.com/t114673-toggle-category-for-phpbb2-forum

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on November 4th 2013, 10:56 am

SethC1995 wrote:Is this the topic you're referring to Kaizer Lee?

Try this Dark-Avenger:
http://help.forumotion.com/t114673-toggle-category-for-phpbb2-forum
Hi all,
I have change my code of template Index_Box following this tutorial http://help.forumotion.com/t114673-toggle-category-for-phpbb2-forum like this:

Code of Index_box:
Spoiler:

Code:

<script type="text/javascript">
$(document).ready(function() {
$(".slidingDiv").hide();
$('.secondarytitle').click(function() {
$(this).closest('tr').siblings('.slidingDiv').slideToggle();
});
});

</script>
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<span class="gensmall">{LAST_VISIT_DATE}<br />
{CURRENT_TIME}<br />
</span>
<!-- END switch_user_logged_in -->
<div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
</td>
<td class="gensmall" align="right" valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
<a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
<!-- END switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
</td>
</tr>
</table>

<!-- BEGIN catrow --><!-- BEGIN tablehead --><table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" style="cursor:pointer;" class="secondarytitle">{catrow.tablehead.L_FORUM}</th>
<th nowrap="nowrap" width="50">{L_TOPICS}</th>
<th nowrap="nowrap" width="50">{L_POSTS}</th>
<th nowrap="nowrap" width="150"><div style="width:150px;">{L_LASTPOST}</div></th>
</tr>
<!-- END tablehead -->

<!-- BEGIN cathead -->
<tr>
<!-- BEGIN inc -->
<td class="{catrow.cathead.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
<!-- END inc -->
<td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%">
<h{catrow.cathead.LEVEL} class="hierarchy">
<span class="cattitle">
<a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a>
</span>
</h{catrow.cathead.LEVEL}>
</td>
<td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"></td>
</tr>
<!-- END cathead -->
<!-- BEGIN forumrow -->
<tr class="slidingDiv">
<!-- BEGIN inc -->
<td class="{catrow.forumrow.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" alt="." /></td>
<!-- END inc -->
<td class="{catrow.forumrow.INC_CLASS}" align="center" valign="middle">
<img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
</td>
<td class="row1 over" colspan="{catrow.forumrow.INC_SPAN}" valign="top" width="100%" height="50">
<h{catrow.forumrow.LEVEL} class="hierarchy">
<span class="forumlink">
<a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a><br />
</span>
</h{catrow.forumrow.LEVEL}>
<span class="genmed">{catrow.forumrow.FORUM_DESC}</span>
<span class="gensmall">
<!-- BEGIN switch_moderators_links -->
{catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
<!-- END switch_moderators_links -->
{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
</span>
</td>
<td class="row3" align="center" valign="middle" height="50">
<span class="gensmall">{catrow.forumrow.TOPICS}</span>
</td>
<td class="row2" align="center" valign="middle" height="50">
<span class="gensmall">{catrow.forumrow.POSTS}</span>
</td>
<td class="row3 over" align="center" valign="middle" height="50">
<span class="gensmall">{catrow.forumrow.LAST_POST}</span>
</td>
</tr>
<!-- END forumrow -->
<!-- BEGIN catfoot -->
<tr>
<!-- BEGIN inc -->
<td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
<!-- END inc -->
<td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>
</tr>
<!-- END catfoot -->
<!-- BEGIN tablefoot -->
</table><img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot --><!-- END catrow -->

and its not working. Could you check it?

Best Regards,
Dark-Avenger

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by SLGray on November 4th 2013, 6:26 pm

After saving the changes, did you publish the template?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2444
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Kaizer Lee on November 4th 2013, 7:27 pm

SethC1995 wrote:Is this the topic you're referring to Kaizer Lee?

Try this Dark-Avenger:
http://help.forumotion.com/t114673-toggle-category-for-phpbb2-forum
Yeah, that's the one I'm talking about.

But yeah, it worked for me in my test forum.

Did you try and see if there are errors with anything DA?

Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on November 5th 2013, 12:45 pm

@SLGray wrote:After saving the changes, did you publish the template?
Yes SLGRray I have publish the template and the result was to show the categories collapsed in board index without expand button. Could you check the code which I was posted here please?

Best Regards,
Dark-Avenger

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on November 7th 2013, 2:59 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Kaizer Lee on November 7th 2013, 4:44 pm

Hello

Please try this code instead:

Make sure to tick it in home page!

Code:
        $(function(){
        $('#content-container .secondarytitle').parent().append('<span class="toggles"><img src="http://illiweb.com/fa/m/tabs_less1.gif"/></span>');
        var heads = $('#content-container .secondarytitle').parent();
        for(var i=0;i<heads.length;i++){
        $(heads[i]).attr({
        id:'cat'+i,
        class: 'parent'
        });
        }
        var cookie = ReadCookie('catTog').split(',');
        for(var j=0;j<cookie.length;j++){
        $(cookie[j]).nextAll('tr').css('display','none');
        $(cookie[j]).find('.toggles').children('img').attr('src','http://illiweb.com/fa/subsilver/tabs_more.gif');
        }
        $('.toggles').on('click',function() {
        var g = $(this).closest('.parent').nextAll('tr').css('display');
        cookieList = ReadCookie('catTog');
        if(g == "table-row") {
        var cid= $(this).closest('.parent').attr('id');
        $(this).closest('.parent').nextAll('tr').hide();
        SetCookie("catTog",cookieList+",#"+cid,1000);
        $(this).children('img').attr('src','http://illiweb.com/fa/subsilver/tabs_more.gif');
        } else {
        KillCookie("catTog");
        var newCookie=[],
        a= $('.parent').nextAll('tr').filter(":hidden"),
        c = $.map(a,function(n,i){
        return "#"+$(a).closest('.parent').attr('id');
        });
        newCookie= c.join(',');
            SetCookie('catTog',newCookie, 100);
        $(this).children('img').attr('src','http://illiweb.com/fa/m/tabs_less1.gif').parent().parent().parent().children('tr').not(":eq(0)").show();
        }
        });
        });
        function SetCookie(cookieName,cookieValue,nDays) {
        var today = new Date();
        var expire = new Date();
        if (nDays===null || nDays===0) nDays=1;
        expire.setTime(today.getTime() + 3600000*24*nDays);
        document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString();
        }
        function ReadCookie(cookieName) {
        var theCookie=""+document.cookie;
        var ind=theCookie.indexOf(cookieName+"=");
        if (ind===-1 || cookieName==="") return "";
        var ind1=theCookie.indexOf(";",ind);
        if (ind1==-1) ind1=theCookie.length;
        return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
        }
        function KillCookie(cookieName){SetCookie(cookieName,"",-1);}
CSS:

Code:
        .toggles {
        position: absolute;
        right: 5px;
        top: 5px;
        }
        .forumline {
        position:relative;
        }
Just adjust the CSS for the position of the "Toggle" sign or customize it in the modification of the former ^^

Hope that helps.

Best Regards,
Kaizer Lee


Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Sir Chivas™ on November 7th 2013, 4:47 pm

Hi,

If the answer provided above gives you the correct answer, please make sure to edit your first post and mark it as "Solved."

Thank you.
Sir Chivas.

Sir Chivas™
Support Moderator
Support Moderator

Male Posts : 6783
Reputation : 430
Language : EN, FR, ES
Location : || CSS || HTML || Graphics Designs || Support ||

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Van-Helsing on November 7th 2013, 8:14 pm

Yes its Working Guys. Thanks a lot.

Best Regards,
Dark-Avenger

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Hide/Show Forum Categories (PHPBB2) in Board Index

Post by Ange Tuteur on November 7th 2013, 8:21 pm

Topic Solved and Archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum