![]() |
Set and change Post Icon path by styleset or by forum
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:
PHP Code:
/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 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:
And that concludes the "hack." If you find it useful, please click install. I'm vain, I'll admit it. |
Or you could just use replacements to achieve this.. ;)
|
May I be the first to say THANK YOU!! Ive been trying to do this myself for a good while and eventually gave up due to it being a total pain in the bottom.
I can now finally start to convert Artorgs older styles back up with there original post icons :) Joy!! :D:D:D:D You got yourself at least 1 big fat install :) |
Quote:
In any event, this modification is faster and more efficient than using a replacement variable. |
All times are GMT. The time now is 12:36 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|