Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Post Icons - drop down list (good for lots of icons!) Details »»
Post Icons - drop down list (good for lots of icons!)
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-15-2004 Last Update: Never Installs: 17
 
No support by the author.

This hack will put all the post icons into a dropdown list instead, which will save lots of space especially if you have lots of post icons available (or WANT to have a lot of post icons available )

Look at attached screenshot to see how it looks like
If you have a suggestion, let me know!

Anyways, here we go

Please make sure that all your icons have a title because this title will be shown in the dropdown menu! Otherwise it will be blank; it will still work and people can select it, but it doesn't help in knowing what the icon will show

Instructions

Open up includes/functions_newpost.php and find
PHP Code:
        if ($seliconid == $iconid)
        {
            
$iconchecked HTML_CHECKED;
            
$selectedicon = array('src' => $iconpath'alt' => $alttext);
        }
        else
        {
            
$iconchecked '';
        } 
Replace with
PHP Code:
    if ($seliconid == $iconid
    { 
        if (
$show['dropdownicons']) 
        { 
            
$iconselect " selected"
        } 
        else 
        { 
            
$iconchecked HTML_CHECKED
            
$selectedicon = array('src' => $iconpath'alt' => $alttext); 
        } 
    } 
    else 
    { 
        if (
$show['dropdownicons']) 
        { 
            
$iconselect ''
        } 
        else 
        { 
            
$iconchecked ''
        } 
    } 
Find:
PHP Code:
    $show['posticons'] = false
Below, add
PHP Code:
    $show['dropdownicons'] = 1;

    if (
$show['dropdownicons'])
    {
        
$posticondropdown '<option value="0">' $vbphrase[no_icon] . '</option>';

    } 
Find:
PHP Code:
        eval('$posticonbits .= "' fetch_template('posticonbit') . '";'); 
Below, add
PHP Code:
        eval('$posticondropdown .= "' fetch_template('posticon_dropdown') . '";'); 
Open up posticons template and find
HTML Code:
				<td width="12%" nowrap="nowrap"><label for="rb_iconid_0"><input type="radio" name="iconid" value="0" id="rb_iconid_0" tabindex="1" onclick="swap_posticon(null)" $iconchecked />$vbphrase[no_icon] &nbsp; &nbsp;</label></td>
				$posticonbits
Replace it with
HTML Code:
				<if condition="$show['dropdownicons']"><td><select name="iconid" id="iconid" onchange="changeImage(this.value)">$posticondropdown</select> <img id="posticonimage" /></td><else /><td width="12%" nowrap="nowrap"><label for="rb_iconid_0"><input type="radio" name="iconid" value="0" id="rb_iconid_0" tabindex="1" onclick="swap_posticon(null)" $iconchecked />$vbphrase[no_icon] &nbsp; &nbsp;</label></td>$posticonbits</if>
Find
HTML Code:
	// -->
Above, add
HTML Code:
	<if condition="$show['dropdownicons']">
function changeImage(selVal)
{
if (selVal != 0)
{
 document.getElementById('posticonimage').src = selVal;
}
else
{
document.getElementById('posticonimage').src = 'clear.gif';
}
}
	</if>
Create a new template called posticon_dropdown with the following content:
HTML Code:
<option value="$iconpath"$iconselect>$alttext</option>
All done! Now if you ever want to turn this off and use the old way of viewing post icons, then just change $show['dropdownicons'] = 1; in includes/functions_newpost.php to $show['dropdownicons'] = 0; (basically just change 1 to 0.)

I hope you enjoy this hack

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-17-2004, 06:32 AM
Owen Owen is offline
 
Join Date: Jan 2002
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah nifty, forgot to think you could load the image next to it.

Good Work.
Reply With Quote
  #13  
Old 03-20-2004, 11:53 AM
Fibe Fibe is offline
 
Join Date: Oct 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason, i now have dropdown AND the original list to chose from.

Any idea what could be wrong?
Reply With Quote
  #14  
Old 03-20-2004, 01:14 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fibe
For some reason, i now have dropdown AND the original list to chose from.

Any idea what could be wrong?
You didn't follow instructions properly then

The code you did wrong was in the posticons template.
Reply With Quote
  #15  
Old 03-20-2004, 02:00 PM
Fibe Fibe is offline
 
Join Date: Oct 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm i just double checked and everything is like it should be. afaik
Quote:
<if condition="$show['posticons']">
<script type="text/javascript">
<!--
function swap_posticon(imgid)
{
out = fetch_object("display_posticon");
img = fetch_object(imgid);
if (img)
{
out.src = img.src;
out.alt = img.alt;
}
else
{
out.src = "$vboptions[cleargifurl]";
out.alt = "";
}
}
<if condition="$show['dropdownicons']">
function changeImage(selVal)
{
if (selVal != 0)
{
document.getElementById('posticonimage').src = selVal;
}
else
{
document.getElementById('posticonimage').src = 'clear.gif';
}
}
</if>
// -->
</script>
<fieldset class="fieldset" style="margin:10px 0px 0px 0px">
<legend>$vbphrase[post_icons]</legend>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="95%">
<tr>
<td colspan="15"><div style="margin-bottom:$stylevar[formspacer]px">$vbphrase[may_choose_icon_for_message]:</div></td>
</tr>
<tr>
<if condition="$show['dropdownicons']"><td><select name="iconid" id="iconid" onchange="changeImage(this.value)">$posticondropdo wn</select> <img id="posticonimage" /></td><else /><td width="12%" nowrap="nowrap"><label for="rb_iconid_0"><input type="radio" name="iconid" value="0" id="rb_iconid_0" tabindex="1" onclick="swap_posticon(null)" $iconchecked />$vbphrase[no_icon] &nbsp; &nbsp;</label></td>$posticonbits</if>


$posticonbits
<if condition="$show['addedspan']"><td colspan="$remainingspan">&nbsp;</td></if>
</tr>
</table>
</div>
</fieldset>
<else />
<input type="hidden" name="iconid" value="0" />
</if>
Reply With Quote
  #16  
Old 03-20-2004, 04:06 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fibe
hmm i just double checked and everything is like it should be. afaik
Can I please see your forums then.
Reply With Quote
  #17  
Old 03-20-2004, 04:22 PM
Fibe Fibe is offline
 
Join Date: Oct 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://forums.soi-guild.org" target="_blank">http://forums.soi-guild.org</a>

test/test u can login with !

and thanks !
Reply With Quote
  #18  
Old 03-20-2004, 04:26 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Weird, maybe a problem with Gold? Although I sincerely doubt it; it looks like it has something to do with the conditionals but that should be fine.

How it is right now is that you can change between the two, but to fix this for you, simply do the following then:

open the posticons template, find:

HTML Code:
<td width="12%" nowrap="nowrap"><label for="rb_iconid_0"><input type="radio" name="iconid" value="0" id="rb_iconid_0" tabindex="1" onclick="swap_posticon(null)" $iconchecked />$vbphrase[no_icon] &nbsp; &nbsp;</label></td>$posticonbits
And then just delete that
Reply With Quote
  #19  
Old 03-20-2004, 04:27 PM
Fibe Fibe is offline
 
Join Date: Oct 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

u are god ! thanks man.
one last question when u click on new thread

no icon is picked this gif file logol shows up. how can i get rid of this?"
Reply With Quote
  #20  
Old 03-20-2004, 04:32 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean? Please make a screenshot and circle it.
Reply With Quote
  #21  
Old 03-20-2004, 04:38 PM
Fibe Fibe is offline
 
Join Date: Oct 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As you can see they are still there And i circled the gif thing.


Code:
<if condition="$show['dropdownicons']"><td><select name="iconid" id="iconid" onchange="changeImage(this.value)">$posticondropdown</select> <img id="posticonimage" /></td></if>
thats whats i got in posticon template now.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:09 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06512 seconds
  • Memory Usage 2,341KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (6)bbcode_html
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete