View Full Version : Collapse posts
MickDoneDee
01-29-2005, 07:16 AM
I get complaints from members about off-topic posts which can spoil their reading enjoyment. Is it possible to make posts collapsible to hide the off-topic posts so that an individual can control which posts are displayed in a thread?
Guy G
01-29-2005, 07:20 AM
hmm... thats a good idea.
shouldnt be hard, just a template mod.
see if vbt has it.
MickDoneDee
01-29-2005, 07:29 AM
Thanks, I've posted this to vB Templates:
http://www.vbulletintemplates.com/mods/showthread.php?p=57616#post57616
----------------------------------------------------------------------------
<!-- / user info -->
</td>
</tr>
<tbody id="collapseobj_my_table_$post[postid]" style="$vbcollapse[collapseobj_my_table_$post[postid]]">
<tr>
<td class="alt1">
<!-- message, attachments, sig -->
-----------------------------------------------------------------------------
I've added the yellow code to the postbit template and am getting this error:
The following error occurred when attempting to evaluate this template:
Parse error: parse error, unexpected T_VARIABLE, expecting ']' in /hsphere/local/home/worldate/world-a-team.com/includes/adminfunctions_template.php(3055) : eval()'d code on line 92
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
----------------------------------------------------------------------------------------
How do I correct this?
Guy G
01-29-2005, 09:44 AM
Have you touched any of the IF conditionals?
sabret00the
01-29-2005, 09:47 AM
this:
<tbody id="collapseobj_my_table_$post[postid]" style="$vbcollapse[collapseobj_my_table_$post[postid]]">
should be
<tbody id="collapseobj_my_table_$post[postid]" style="$vbcollapse[collapseobj_my_table_$post[postid]">
MickDoneDee
01-29-2005, 10:26 AM
Please see this (http://www.vbulletin.com/forum/showthread.php?t=127499) post to understand why I'm using a variable in the identifier.
Sabret00the, your code suggestion doesn't seem right.
style="$vbcollapse[collapseobj_my_table_$post[postid]">
There is a square bracket after $vbcollapse which must be closed.
I haven't touched any IF conditionals.
When I use my_table as the identifier I don't get any parse errors. However, the posts don't collapse. Each post must have a unique identifier which is why the postid is used. But it won't parse.
Looks like somebody else tried this a couple of years ago and had the same problem. http://www.vbulletintemplates.com/mods/showpost.php?p=46059&postcount=2
------------------------------------------------------------------
Okay, I managed to find a way to collapse both the member info and message text. They are two separate tables so each has to be collapsed individually. They both required different identifiers so I used postid for the message table and postcount for the user info table. Thanks to Mike Sullivan from vBulletin.com (http://www.vbulletin.com/forum/showthread.php?t=128311) for helping.
Additionally, the collapse state needs to be saved in a cookie somehow as it does for the collapsible tables elsewhere. Any help with this would be welcome. I've attached the postbit template as an .rtf wordpad document so that the code additions could be highlighted in bold and red.
You can visit my site as a guest to see how it works.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.