vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Post Icon Collapse/Expand (https://vborg.vbsupport.ru/showthread.php?t=113853)

Princeton 04-22-2006 10:00 PM

Post Icon Collapse/Expand
 
A site I'm working on has about 50+ post icons ... the post icons are used as "tags". As you might have expected, it's a bit annoying waiting for all these icons to load.

So, I edited the posticons template to offer a collapse/expand feature. :) Just one template edit and the feature is visible everywhere posticons are enabled.

REPLACE posticons TEMPLATE WITH:
HTML Code:

<if condition="$show['posticons']">
    <script type="text/javascript">
    <!--
    function swap_posticon(imgid)
    {
        var out = fetch_object("display_posticon");
        var img = fetch_object(imgid);
        if (img)
        {
            out.src = img.src;
            out.alt = img.alt;
        }
        else
        {
            out.src = "$vboptions[cleargifurl]";
            out.alt = "";
        }
    }
    // -->

    </script>
<br />
    <table class="tborder" style="background-color:#E1E4F2" cellpadding="2" cellspacing="0" border="0" width="100%">
    <thead>
        <tr>
            <td class="tcat" colspan="15" style="padding:4px">
            <div class="smallfont"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('gtposticons')"><img id="collapseimg_gtposticons" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_gtposticons].gif" alt="" border="0" /></a>
            $xvbphrase[may_choose_icon_for_message]<strong>Post Icon</strong><label for="rb_iconid_0"><input type="radio" name="iconid" value="0" id="rb_iconid_0" style="margin:0px;" tabindex="1" onclick="swap_posticon(null)" $iconchecked /> $vbphrase[no_icon]</label></div></td>
        </tr>       
    </thead>
    <tbody id="collapseobj_gtposticons" style="$vbcollapse[collapseobj_gtposticons]">
        <tr>
            <td class="" style="width:0px">&nbsp;</td>
            $posticonbits
            <if condition="$show['addedspan']"><td class="" colspan="$remainingspan">&nbsp;</td></if>
        </tr>
    </tbody>
    </table>
<else />
    <input type="hidden" name="iconid" value="0" />
</if>

TIPS
- change background color (style="background-color:#E1E4F2") of table to fit your site

COBRAws 04-23-2006 03:10 PM

Princeton, your da man =D

I have around 25post icons :S

Atakan KOC 04-23-2006 04:35 PM

Very Nice. Thanks.

Muellmann 01-04-2007 08:22 PM

you are a genius! :knockedout:
This is very useful to me because i have around 40 posticons.
The same for the smilies would be much appreciated ;)

Princeton 01-09-2007 07:05 PM

I suggest moving the smilies below the editor.
You will be able to display more but I recommend 30 max per row ... the rest can be displayed in the smilies popup window.

check out my smilies below editor mod

DiSpy 05-21-2007 03:37 PM

Installed and working on v3.6.7.

THANKS! :)

713JunctionP 06-01-2007 05:01 PM

as always, great mod. helps keep the site looking cleaner.

and again, although this mod was made on vB 3.5.x it worked on my 3.6.7 version! :up:

boatdesign 10-21-2007 05:21 AM

I was looking for something exactly like this; but I'm seeing a glitch. If I click the icon to hide the post icons, the setting isn't remembered so the next time I click on New Thread the post icons are all displayed again. The up / down ( show / hide ) setting isn't remembered like vBulletin remembers whether to hide or show the posting rules box (and once you hide it, keeps it hidden as you navigate through the site.)

I replaced my posticons template with the code shown, so I don't see how I could have messed this up; am I the only one seeing this behavior?

Tim Skellett 11-11-2007 06:52 PM

What changes do I need to make to the above script to make it automatically collapsed, so that it is only uncollapsed if people click the relevant button?

Many thanks in advance for all help.

nyunyu 11-12-2007 08:06 AM

installed and working great. thanks for the hack.

lostgirl815 01-14-2008 08:23 PM

Excellent! Thanks so much!

Jasem 04-25-2008 07:51 AM

Thank you, Nice share

VikesRule 09-25-2008 01:16 AM

Quote:

Originally Posted by Tim Skellett (Post 1380517)
What changes do I need to make to the above script to make it automatically collapsed, so that it is only uncollapsed if people click the relevant button?

Many thanks in advance for all help.

Same question!

compact123 10-05-2008 11:34 PM

yhnaks sir, nice mod

mmorse 04-03-2009 02:02 PM

Quote:

Originally Posted by VikesRule (Post 1629674)
Quote:

Originally Posted by Tim Skellett (Post 1380517)
What changes do I need to make to the above script to make it automatically collapsed, so that it is only uncollapsed if people click the relevant button?

Many thanks in advance for all help.

Same question!

Change:
PHP Code:

<tbody id="collapseobj_gtposticons" style="$vbcollapse[collapseobj_gtposticons]"

To:
PHP Code:

<tbody id="collapseobj_gtposticons" style="display:none"


lm3a.net 05-20-2009 08:37 AM

that's cool

thank you,,

vijayninel 03-08-2010 12:48 AM

thanks working well in 3.8.4

Kimberley 04-25-2010 08:04 AM

Can someone tell me how to align it so its centered and not cut off to the right please

screenshot below

snowlion 04-25-2010 08:41 AM

Quote:

Originally Posted by Kimberley (Post 2026926)
Can someone tell me how to align it so its centered and not cut off to the right please

screenshot below

It's centered, just decrease the width of your images :D

Kimberley 04-25-2010 01:19 PM

then can it be aligned left so i dont have to remake my images so smaller?


All times are GMT. The time now is 10:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02467 seconds
  • Memory Usage 1,767KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete