[ABD] Collapsible Categories

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53636
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: [Beta] Collapsible Categories

Post by Brf »

Why do you have the javascript inserted inside the forumrow? That renders multiple copies of that code.

You re also totally missing the section that adds the button to the category header. You only added the one for no_cat
Blanky
Registered User
Posts: 253
Joined: Wed Aug 23, 2006 4:25 pm

Re: [Beta] Collapsible Categories

Post by Blanky »

Brf wrote:Why do you have the javascript inserted inside the forumrow? That renders multiple copies of that code.
The only modification I did to your mod is because that in my template, i have this:

Code: Select all

<table class="tablebg" onMouseOver="this.className='tablebg2'" onMouseOut="this.className='tablebg'" cellspacing="1" width="100%">
Instead of

Code: Select all

<table class="tablebg" cellspacing="1" width="100%">
So I changed

Code: Select all

<script type="text/javascript">
// <![CDATA[
function flipf(btn, thiscat)
{
	rnd = Math.random().toString().substring(2);
    myurl = "{S_AJAX_COLLAPSE_ACTION}" + "&rnd=" + rnd;
	if (btn.value=="-")
	{
		btn.value="+";
		document.getElementById('flist'+thiscat).style.display="none";
		myurl = myurl + "&cset=" + thiscat;
	}
	else
	{
		btn.value="-";
		document.getElementById('flist'+thiscat).style.display="";
		myurl = myurl + "&cunset=" + thiscat;
	}
	// alert (myurl);
	var myajax=ajaxobject();
	myajax.open('GET',myurl,true);
	myajax.onreadystatechange = function()
		{
			if (myajax.readyState == 4)
			{
				if (myoutput = myajax.responseXML)
					{
						// Discard
						return;
					}
			}		
		}
	myajax.send(null);
}
function ajaxobject()
{
	try
	{
		var http_request = false;
		if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
				http_request.overrideMimeType('text/xml');
			}
		}
		else if (window.ActiveXObject)
		{ // IE
			try
			{
				http_request = new ActiveXObject('Msxml2.XMLHTTP');
			}
			catch (e)
			{
				try
				{
					http_request = new ActiveXObject('Microsoft.XMLHTTP');
				}
				catch (e)
				{
				}
			}
		}

		if (!http_request)
		{
			 return false;
		}
		else
		{
			return http_request;
	}	
	}
	catch (e)
	{
		handle(e);
		return false;
	}
}

//]]>
</script>
<table class="tablebg" cellspacing="1" width="100%">
<tbody>
To

Code: Select all

<script type="text/javascript">
// <![CDATA[
function flipf(btn, thiscat)
{
	rnd = Math.random().toString().substring(2);
    myurl = "{S_AJAX_COLLAPSE_ACTION}" + "&rnd=" + rnd;
	if (btn.value=="-")
	{
		btn.value="+";
		document.getElementById('flist'+thiscat).style.display="none";
		myurl = myurl + "&cset=" + thiscat;
	}
	else
	{
		btn.value="-";
		document.getElementById('flist'+thiscat).style.display="";
		myurl = myurl + "&cunset=" + thiscat;
	}
	// alert (myurl);
	var myajax=ajaxobject();
	myajax.open('GET',myurl,true);
	myajax.onreadystatechange = function()
		{
			if (myajax.readyState == 4)
			{
				if (myoutput = myajax.responseXML)
					{
						// Discard
						return;
					}
			}		
		}
	myajax.send(null);
}
function ajaxobject()
{
	try
	{
		var http_request = false;
		if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
				http_request.overrideMimeType('text/xml');
			}
		}
		else if (window.ActiveXObject)
		{ // IE
			try
			{
				http_request = new ActiveXObject('Msxml2.XMLHTTP');
			}
			catch (e)
			{
				try
				{
					http_request = new ActiveXObject('Microsoft.XMLHTTP');
				}
				catch (e)
				{
				}
			}
		}

		if (!http_request)
		{
			 return false;
		}
		else
		{
			return http_request;
	}	
	}
	catch (e)
	{
		handle(e);
		return false;
	}
}

//]]>
</script>
<table class="tablebg" onMouseOver="this.className='tablebg2'" onMouseOut="this.className='tablebg'" cellspacing="1" width="100%">
<tbody>
Brf wrote:You re also totally missing the section that adds the button to the category header. You only added the one for no_cat
I have no idea what that means ^^ I have editing everything accordingly to the instructions I think.. What am I missing?

EDIT: Okay something is wrong. You probably know ALOT more than me about this, but I think you amde a mistake.. posting it in 1 sec.

Okay.. So first of all you ask to edit

Code: Select all

			<td class="catdiv" colspan="3">&nbsp;</td>
		</tr>
Wich is found here

Code: Select all

		<!-- IF forumrow.S_NO_CAT -->
			<tr>
				<td class="cat" colspan="2"><h4>{L_FORUM}</h4></td>
				<td class="catdiv" colspan="3">&nbsp;</td>
			</tr>
		<!-- ENDIF -->
You ask to replace

Code: Select all

			<td class="catdiv" colspan="3">&nbsp;</td>
		</tr>
that with

Code: Select all

			<td class="catdiv" colspan="3" align="right"><input type="button" class="button2" value="{forumrow.COLLAPSE_SIGN}" onclick="flipf(this,'{forumrow.FORUM_ID}');" style="width: 20px !important"/></td>
		</tr>
		<tbody id="flist{forumrow.FORUM_ID}" {forumrow.S_COLLAPSE}>
Wich would make that little part

Code: Select all

		<!-- IF forumrow.S_NO_CAT -->
			<tr>
				<td class="cat" colspan="2"><h4>{L_FORUM}</h4></td>
			<td class="catdiv" colspan="3" align="right"><input type="button" class="button2" value="{forumrow.COLLAPSE_SIGN}" onclick="flipf(this,'{forumrow.FORUM_ID}');" style="width: 20px !important"/></td>
		</tr>
		<tbody id="flist{forumrow.FORUM_ID}" {forumrow.S_COLLAPSE}>
		<!-- ENDIF -->
Right?

But then, you ask to find

Code: Select all

		<!-- IF forumrow.S_NO_CAT -->
			<tr>
				<td class="cat" colspan="2"><h4>{L_FORUM}</h4></td>
				<td class="catdiv" colspan="3">&nbsp;</td>
			</tr>
		<!-- ENDIF -->
And replace it with

Code: Select all

		<!-- IF forumrow.S_NO_CAT -->
			</tbody>
			<tr>
				<td class="cat" colspan="2"><h4>{L_FORUM}</h4></td>
				<td class="catdiv" colspan="3" align="right"><input type="button" class="button2" value="{forumrow.COLLAPSE_SIGN}" onclick="flipf(this,'{forumrow.FORUM_ID}');" style="width: 20px !important"/></td>
			</tr>
			<tbody id="flist{forumrow.FORUM_ID}" {forumrow.S_COLLAPSE}>
		<!-- ENDIF -->
How is that possible? I just edited the first part!
Last edited by Blanky on Wed Jan 16, 2008 11:05 pm, edited 4 times in total.
User avatar
*Christian*
I've Been Banned!
Posts: 884
Joined: Sat Nov 03, 2007 1:35 pm
Location: Location, Location.

Re: [Beta] Collapsible Categories

Post by *Christian* »

Resize tag worked magic :)

i've set the button to 10px square, how do i go about changing the font size of the button value?
Proud owner of Bertie 3.0
:: No support via PM or IM ::
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53636
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: [Beta] Collapsible Categories

Post by Brf »

Blanky wrote:The only modification I did
subsilver2 has the forumlist all in one big table.
Yours does not.
Therefore, you cannot follow the subsilver2 template rules for yours.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53636
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: [Beta] Collapsible Categories

Post by Brf »

*Christian* wrote:i've set the button to 10px square, how do i go about changing the font size of the button value?
forms.css uses:

Code: Select all

input.button1, input.button2 {
	font-size: 1em;
}
So you could try

Code: Select all

font-size: 0.8em;
in there with the width and height tags you changed, or even a fixed px size like:

Code: Select all

font-size: 8px;
Blanky
Registered User
Posts: 253
Joined: Wed Aug 23, 2006 4:25 pm

Re: [Beta] Collapsible Categories

Post by Blanky »

Brf wrote:
Blanky wrote:The only modification I did
subsilver2 has the forumlist all in one big table.
Yours does not.
Therefore, you cannot follow the subsilver2 template rules for yours.
I see.. So I can't add this mod on my template?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53636
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: [Beta] Collapsible Categories

Post by Brf »

Blanky wrote: I see.. So I can't add this mod on my template?
Not as written. Your style is a hodgepodge of tables. I would have to break it down into its pieces to see where the code goes. I am betting it will be closer to the prosilver version , than the subsilver one.
Blanky
Registered User
Posts: 253
Joined: Wed Aug 23, 2006 4:25 pm

Re: [Beta] Collapsible Categories

Post by Blanky »

Brf wrote:
Blanky wrote: I see.. So I can't add this mod on my template?
Not as written. Your style is a hodgepodge of tables. I would have to break it down into its pieces to see where the code goes. I am betting it will be closer to the prosilver version , than the subsilver one.

I see.. How hard would it be to make it work on my template?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53636
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: [Beta] Collapsible Categories

Post by Brf »

I dont know.
Like I said, I will have to break down your style and see how the pieces fit.

OK... I took a good close look at your style, and I think I will not be able to make mods for broken styles.
Take a look at this code that is repeated throughout your index page:

Code: Select all

<table id="bx" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
<table width="100%" height="44" border="0" cellpadding="0" cellspacing="0">

		<td> ...</td>
		<td ... </td>
		<td ... </td>
		<td ... </td>
		<td> ...</td>
</table>
	</tr>
<table 
You see, you have nested tables here with missing tags.
The outer table has no "TD" tags and the inner one has no "TR"s.

Once you get your style author to clean it up, we can talk about modding it.
xxxopenxxx
Registered User
Posts: 34
Joined: Thu Jan 10, 2008 11:07 pm

Re: [Beta] Collapsible Categories

Post by xxxopenxxx »

What does the following code do, and is it required for subsilver2? It seemed to make no difference with or without it.

Code: Select all

Browse to ACP / Users & Groups / Users / Custom profile fields
Type "fcol" (without the quotes) into the Add box
Select Textarea in the dropdown
Click Create new field
Select "No" for Display profile field
Select "Hide profile field" for Visibility Option
Type "Forum Collapse Data" (without quotes) for Field name/title
Type "Comma-delimited list of categories to collapse" (without quotes) for Field description.
Leave Default value blank.
Click Save.
Leave profile specific options at default values.
Click Save.
Is it possible for the board to remember which categories you collapsed so that when yo post a reply and go back to the index the categories remain collapsed? (It seems like the code is supposed to do just that and I did something wrong?)

- I will be checking to see if I did something wrong shorty, and then I will modify my post -
^ Nothing seemed to change :cry:

Thank you! (Great mod, btw)
Freak46
Registered User
Posts: 19
Joined: Thu Dec 27, 2007 12:03 pm

Re: [Beta] Collapsible Categories

Post by Freak46 »

Great! I shall try it on my forum
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53636
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: [Beta] Collapsible Categories

Post by Brf »

xxxopenxxx wrote:What does the following code do, and is it required for subsilver2? It seemed to make no difference with or without it.
Yes it is required.
It is setting up the custom profile field that saves which categories you collapsed, so when you browse back to the index or subforum-view the categories are still collapsed.

If it isnt working for you, make sure you have named the field

Code: Select all

fcol
and that you have uploaded the ajax_update_collapse.php to your forum's root forder.
xxxopenxxx
Registered User
Posts: 34
Joined: Thu Jan 10, 2008 11:07 pm

Re: [Beta] Collapsible Categories

Post by xxxopenxxx »

Brf wrote: Yes it is required.
It is setting up the custom profile field that saves which categories you collapsed, so when you browse back to the index or subforum-view the categories are still collapsed.
I installed the mod, twice, on subsilver2 and it does not seem to save the categories that were collapsed. I did name it fcol and have the file uploaded in the root of the forums. Could there be a global setting I have off?


Thank you, I really appreciate the help!
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53636
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: [Beta] Collapsible Categories

Post by Brf »

Did you do the updates to functions_display?
xxxopenxxx
Registered User
Posts: 34
Joined: Thu Jan 10, 2008 11:07 pm

Re: [Beta] Collapsible Categories

Post by xxxopenxxx »

Brf wrote:Did you do the updates to functions_display?
Yes I did, and redid them again just now to test.

Return to “[3.0.x] Abandoned MODs”