Back to vBulletin 3.0 Add-Ons

Post Icons - drop down list (good for lots of icons!)
Mod Version: 1.00, by Gary King

This modification is in the archives.
vB Version: 3.0.0 Rating: (2 votes - 5.00 average) Installs: 17
Released: 16 Mar 2004 Last Update: Never Downloads: 1
Not Supported  

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

Download

No files for download.

Screenshots

 


vblts.ru supports vBulletin®, 2022-2024