Set and change Post Icon path by styleset or by forum
This modification is in the archives.
This modification principly works through templates, but you also need to write some code into your PHPINCLUDE_START template. What it does is make the path to your post icons swapable by styleset or by forum. However many alternate post icon sets you create make SURE they all have the same # of icons with the same names or this won't work. It's also recommended you create a default icons and put it in every post icon set.
A total of 5 template modifications are required as well as changes in your post icon settings. STEP 1: EDIT TEMPLATES. EDITPOST Search for: HTML Code:
<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td> HTML Code:
<td><img id="display_posticon" src="$stylevar[post_icon_path]/$selectedicon[src]" alt="$selectedicon[alt]" /></td> THREADBIT Search for: HTML Code:
<td class="alt2"><if condition="$show['threadicon']"><img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else /> </if></td> HTML Code:
<td class="alt2"><if condition="$show['threadicon']"><img src="$stylevar[post_icon_path]/$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /><else /> </if></td> POSTICONBIT Search for: HTML Code:
<td width="12%"><label for="rb_iconid_$iconid"><img src="$iconpath" alt="$alttext" id="pi_$iconid" onclick="rb_iconid_$iconid.click()" /></label></td> HTML Code:
<td width="12%"><label for="rb_iconid_$iconid"><img src="$stylevar[post_icon_path]/$iconpath" alt="$alttext" id="pi_$iconid" onclick="rb_iconid_$iconid.click()" /></label></td> POSTBIT and POSTBIT_LEGACY (Same code and replacement in each) Search for: HTML Code:
<if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if> HTML Code:
<if condition="$show['messageicon']"><img class="inlineimg" src="$stylevar[post_icon_path]/$post[iconpath]" alt="$post[icontitle]" border="0" /></if> STEP 2: EDIT POST ICON PATHS 1. Open your post icon editor. 2. Delete the path information for every post icon - leave only the image's name. This will break the path to the image for the editor so you want be able to review it in the admincp unless you hack the icon editor file. 3. Go to vboptions >> Thread Display Options (showthread) 4. Strip the path to the default icon, again leave only the file name. STEP 3: CODING THE PHPINCLUDE_START TEMPLATE. Ok, easy parts over. Now comes the fun part. You need to define $stylevar['post_icon_path']. If you went to the effort to do this you presumably want it's definition to change by styleset or by forum. The first part is to merge the new stylevar in with the other stylevars. Put the following code at the very start of your PHPINCLUDE_START template. PHP Code:
$stylevar = array_merge($stylevar,
PHP Code:
$stylevar['post_icon_path'] = 'DIRECTORY CONTAINING YOUR POST ICONS FOR THIS STYLE';
/images/icons/style1 Don't put an ending / character on the path. Now, if you want to have forums have specific sets you'll need to do the following conditional: PHP Code:
if ($foruminfo['forumid'] == X)
If you want multiple forums to have the same set you'll either need a conditional for each one or use an in_array call. PHP Code:
$special_forums = array('X', 'Y', 'Z');
And that concludes the "hack." If you find it useful, please click install. I'm vain, I'll admit it. Download No files for download. |