Back to vBulletin 3.8 Template Modifications

New button when new thread/post is made
Mod Version: 1.00, by pein87

vB Version: 3.8.x Rating: (5 votes - 4.60 average) Installs: 33
Released: 20 Feb 2009 Last Update: 26 Feb 2009 Downloads: 295
Not Supported Template Edits Re-usable Code  

My partner had a request for this mod on another site and I finally got around to doing it.

This is a simple edit that adds an icon to the end of each thread if theres a new post. I have added all possible options in which someone would use this edit for. Included is adding the new icon to the end of your threads title, replacing the lastposted by icon in the forumdisplay.php page, changing the icon of last posted in the index.php page, and switching out the small square with and arrow icon for a new one. I inluced the icon I used in the examples. I`ll post it here for those who wont to try it now and add a zip for those who will try it later on. Remember if you install show your support and click installed.

Adding a new thread icon on only the the post would add add
some sparkel to a dull forum. I have found the way thanks to
a fellow coder and a bit of searching in templates.This makes the new image a link to the new post for that thread. By default every newly created thread has a new post as well so this will show on new threads and posts.Make sure if you use this mod exactly as shown here to add the icon to the images/button dirctory or the button directory of the skin your doing this template mod for. If not make sure to add it to the images/misc or that styles misc directory and change the $stylevar[imgdir_misc]

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Open the template named: threadbit

find:

PHP Code:
            <if condition="$show['gotonewpost']"><a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]id="thread_gotonew_$thread[realthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]border="0" /></a></if>
            
$thread[movedprefix]
            
$thread[typeprefix]
            
$thread[moderatedprefix]
            
$thread[prefix_rich]
            <
a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]id="thread_title_$thread[realthreadid]"<if condition="$show['gotonewpost']"style="font-weight:bold"</if>>$thread[threadtitle]</a
Add after:

PHP Code:
<!-- start new post/thread icon set up -->
<!-- 
add or subtract a code &nbspto add spacing just how you wont it to be -->
&
nbsp;&nbsp;<if condition="$show['gotonewpost']"><img src="<!-- add your own directory and delete this comment before you save this template -->$stylevar[imgdir_misc]/new_thread.gif" alt="" border="0" /></if>
<!-- /
start new post/thread icon set up --> 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Theres more then one way to skin this cat and it really depends on your personal taste. You can always add this to the beginning to replace the icon that shows when theres a new post.

Open the template named: threadbit

Find:

PHP Code:
            <if condition="$show['gotonewpost']"><a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]id="thread_gotonew_$thread[realthreadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]border="0" /></a></if> 
In there find:

PHP Code:
<img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]border="0" /> 
change:

PHP Code:
firstnew.gif 
To:

what ever image you wont to show instead of the default image.

If you dont wont a link simply delete this from the above code.

Find:

PHP Code:
<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]id="thread_gotonew_$thread[realthreadid]"
Delete this

Find:

</if>

Delete the </a> before this tag.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If you like this idea and wont to change the image for the last posted as well if you havent saved the template add this else open the template named: threadbit

Find:

PHP Code:
<a href="showthread.php?$session[sessionurl]p=$thread[lastpostid]$thread[highlight]#post$thread[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]border="0" /></a
Find in:

PHP Code:
src="$stylevar[imgdir_button]/lastpost.gif" 
Change the lastpost.gif to your desired image and save the template.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If your really feeling this idea or just wont to change the icon for last posted on the index.php page this is how you would do that.

Open the template named: forumhome_lastpostedby

Find:(should be near the end)

PHP Code:
    <div align="$stylevar[right]style="white-space:nowrap">
        
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
        <
a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]#post$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]border="0" /></a>
    </
div>
</
div>
<else />
<
div class="smallfont" align="$stylevar[right]">
    
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
    <
a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]border="0" /></a>
</
div
Find:

If its easier search for two instances of this:

PHP Code:
$stylevar[imgdir_button]/lastpost.gif 
find all the instances(all the times you see) lastpost.gif and change this to the image you would like to be shown there instead. Remember to check the directory this follows the same rules as I stated at the top of the doc.

UPDATE:::::::revision by alexD)

inorder to get the image to appear infront of the extra info from a thread you must follow this program it shows you how to get the results of the image: new_thing

open your threadbit template and delete the info you added to which ever add on you did or leve it if you wont two images showing.

Find:

PHP Code:
            <if condition="$thread['pagenav']">$stylevar[dirmark]<span class="smallfont" style="white-space:nowrap">(<img class="inlineimg" src="$stylevar[imgdir_misc]/multipage.gif" alt="$vbphrase[multipage_thread]border="0" /> $thread[pagenav]<if condition="$show[pagenavmore]"> ... <a href="showthread.php?$session[sessionurl]t=$thread[threadid]&amp;page=$thread[totalpages]$thread[highlight]">$vbphrase[last_page]</a></if>)</span></if>

        [
B]</div>[/B
Add before the last </div> (at the end of the code to add)

PHP Code:
<!-- start new post/thread icon set up -->
<!-- 
add or subtract a code &nbspto add spacing just how you wont it to be -->
<if 
condition="$show['gotonewpost']"><img src="<!-- add your director or path and delete this comment -->$styleva[imgdir_misc]new_thread.gif" alt="" border="0" /></if>
<!-- /
start new post/thread icon set up --> 
there you go that fixes the issue of it showing up before the extra thread info and not after.

Left this out but you can incase the above img src in <a> tags to make it a link to the new post.

find:

PHP Code:
<img src="<!-- add your director or path and delete this comment -->$styleva[imgdir_misc]new_thread.gif" alt="" border="0" /> 
Add before:

PHP Code:
<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]id="thread_gotonew_$thread[realthreadid]"
Add after the above find:

</a>

UPDATED:02-27-09 Icons to inlude german version.
Please note that i did not do the original icon.

Download

File Type: %1$s newthread_and_post_icon.zip (280.7 KB, 259 downloads)
File Type: %1$s icons.zip (11.3 KB, 153 downloads)

Supporters / CoAuthors

  • AlexD

Screenshots

Click image for larger version
Name:	new-thread-icon.jpg
Views:	1172
Size:	60.9 KB
ID:	95241   Click image for larger version
Name:	new-thread-icon2.jpg
Views:	741
Size:	54.1 KB
ID:	95242   Click image for larger version
Name:	new-thread-icon3.jpg
Views:	591
Size:	56.1 KB
ID:	95243   Click image for larger version
Name:	new-thread-icon4.jpg
Views:	585
Size:	54.3 KB
ID:	95244  

Click image for larger version
Name:	new-thread-icon5.jpg
Views:	616
Size:	33.1 KB
ID:	95245   Click image for larger version
Name:	new_thing.JPG
Views:	1347
Size:	85.4 KB
ID:	95251  


vblts.ru supports vBulletin®, 2022-2024