[BETA] Collapsible Categories

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
hmartin
Registered User
Posts: 118
Joined: Mon Jun 06, 2005 2:49 am
Location: /home/
Contact:

[BETA] Collapsible Categories

Post by hmartin »

MOD Title: Collapsible Categories
MOD Description: This is a simple MOD that makes categories collapsible (i.e. when the user clicks on the category title, it will collapse and hide the list of the category's forums). A user's selection of collapsed and uncollapsed categories is saved with a simple JavaScript cookie
MOD Version: 0.1

Download: http://epfarms.org/~hmartin/Collapsible_Categories.zip
My MODs:
Multiple PM Recipients - Send PMs to multiple users simultaneously
Stylist - Users can modify a forum's appearance by uploading custom CSS files
Download All Attachments As Zip - Download multiple attachments in a single zip file.
Collapsible Categories - Cleanly collapse categories on the index page

gamerxgirl
Registered User
Posts: 379
Joined: Tue Feb 22, 2005 4:13 pm

Post by gamerxgirl »

DO you by any chance have a demo? Also would it be possible to have the category image be clicked to collapse/expand the category, as in other bulletin board systems?

deejaybet
Registered User
Posts: 1814
Joined: Thu Dec 08, 2005 2:01 pm
Location: Derry, Northern Ireland
Contact:

Post by deejaybet »

yey i was looking for this :) shall wait and see how it goes :)

hmartin
Registered User
Posts: 118
Joined: Mon Jun 06, 2005 2:49 am
Location: /home/
Contact:

Post by hmartin »

deejaybet wrote: shall wait and see how it goes :)

Don't worry, it's probably one of the easiest mods to install ever.
My MODs:
Multiple PM Recipients - Send PMs to multiple users simultaneously
Stylist - Users can modify a forum's appearance by uploading custom CSS files
Download All Attachments As Zip - Download multiple attachments in a single zip file.
Collapsible Categories - Cleanly collapse categories on the index page

VorowneTSG
Registered User
Posts: 257
Joined: Mon Sep 09, 2002 4:33 pm
Contact:

Post by VorowneTSG »

Fantastic! I've been waiting for something exactly like this. Thank you!

However, I'm having a problem after installing it. The collapsing function doesn't work, and I get an error that says "Effect not defined", seemingly regarding this part of the code:

Code: Select all

	if (all_cats[id_num] == 1) {
		Effect.BlindUp(id_num);
		document.getElementById("i_" + id_num).src = "images/arrow_left.gif";
		all_cats[id_num] = 0;
Which is a part of this:

Code: Select all

var all_cats = new Array();
var all_cats_names = new Array();
function toggle(id_num) {
	if (all_cats[id_num] == 1) {
		Effect.BlindUp(id_num);
		document.getElementById("i_" + id_num).src = "images/arrow_left.gif";
		all_cats[id_num] = 0;
	}
	else {
		Effect.BlindDown(id_num);
		document.getElementById("i_" + id_num).src = "images/arrow_down.gif";
		all_cats[id_num] = 1;
	}
	cookie_text = new String ();
	for (x = 0; x < all_cats_names.length; x++)
	{
		if (all_cats[all_cats_names[x]] == 0) {
			cookie_text = cookie_text + "," + all_cats_names[x];
		}
	}
	setCookie('hidden_rows', cookie_text,365)
}
</script>
Any help would be very much appreciated :)

deejaybet
Registered User
Posts: 1814
Joined: Thu Dec 08, 2005 2:01 pm
Location: Derry, Northern Ireland
Contact:

Post by deejaybet »

can you make a database version.. ie the users choice is saved in the database like IPB

hmartin
Registered User
Posts: 118
Joined: Mon Jun 06, 2005 2:49 am
Location: /home/
Contact:

Post by hmartin »

I'll look into making a DB version... although I think a cookie version is preferable from both a server and user perspective.

VorowneTSG, did you install the script.aculo.us files into javascripts/ ?
My MODs:
Multiple PM Recipients - Send PMs to multiple users simultaneously
Stylist - Users can modify a forum's appearance by uploading custom CSS files
Download All Attachments As Zip - Download multiple attachments in a single zip file.
Collapsible Categories - Cleanly collapse categories on the index page

deejaybet
Registered User
Posts: 1814
Joined: Thu Dec 08, 2005 2:01 pm
Location: Derry, Northern Ireland
Contact:

Post by deejaybet »

i think database version would be better since i go on forums from different computers a lot and if the data is saved on the database then categories remain hidden

VorowneTSG
Registered User
Posts: 257
Joined: Mon Sep 09, 2002 4:33 pm
Contact:

Post by VorowneTSG »

*smacks head* I completely missed that part! I have it installed now, and while the page loads without any errors now, I still receive the same error as before when I try to collapse a category.

hmartin
Registered User
Posts: 118
Joined: Mon Jun 06, 2005 2:49 am
Location: /home/
Contact:

Post by hmartin »

Could you PM me a link to your site so I can look at it?
My MODs:
Multiple PM Recipients - Send PMs to multiple users simultaneously
Stylist - Users can modify a forum's appearance by uploading custom CSS files
Download All Attachments As Zip - Download multiple attachments in a single zip file.
Collapsible Categories - Cleanly collapse categories on the index page

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

hmartin wrote: I'll look into making a DB version... although I think a cookie version is preferable from both a server and user perspective.

I use several different computers, and very much prefer that my "preferences" follow me from one to another. A database solution would do that, a cookie solution does not. ;-) Just my humble two {CURRENCY_TYPE} worth.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

VorowneTSG
Registered User
Posts: 257
Joined: Mon Sep 09, 2002 4:33 pm
Contact:

Post by VorowneTSG »

Do you have a better idea about my problem now, by any chance? I'm thinking it has something to do with the javascript files I had to download - the package they arrived in had them contained in a different folder than what was instructed in the mod file, and I'm not sure I moved of the required files into their proper location.

Briant
Registered User
Posts: 20
Joined: Thu Jun 19, 2003 4:00 pm

Post by Briant »

This isn't working for me. When it saves the cookie to collapsible and when you refresh, it won't expand or collapsible anymore. I've also used scriptaculous before wandering upon this thread and made it to work but I don't know how to code in the cookie for it to work properly.

My bad, it was because I'm using the newest version of phpbb but now I've got it to work. All thanks to your script. A++. Just needs to update version.

VorowneTSG
Registered User
Posts: 257
Joined: Mon Sep 09, 2002 4:33 pm
Contact:

Post by VorowneTSG »

Would you mind sharing how you got it to work with the latest phpBB version? I haven't been able to do so quite yet.

hmartin
Registered User
Posts: 118
Joined: Mon Jun 06, 2005 2:49 am
Location: /home/
Contact:

Post by hmartin »

Sorry, I haven't had time to update this lately. If you could post your update I'll incorporate it into the MOD. Thanks.
My MODs:
Multiple PM Recipients - Send PMs to multiple users simultaneously
Stylist - Users can modify a forum's appearance by uploading custom CSS files
Download All Attachments As Zip - Download multiple attachments in a single zip file.
Collapsible Categories - Cleanly collapse categories on the index page

Post Reply

Return to “[2.0.x] MODs in Development”