PDA

View Full Version : Adding RSS and other options to Forum home page



admin
01-11-2009, 08:56 PM
Dear everyone,

This modification adds an RSS + New post + Newthread next to each forum shown in the main page "Home".


Now lets see how we can do that ...!


First .. the only template that we are going to edit is "forumhome_forumbit_level2_post" ..

So we open the forumhome_forumbit_level2_post template of the style that we want to add these options to !

We search for this line code

<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>

And then we add this code directly under it

<!-- itvnn.net Mod -->
<table align="right" border="0">
<tr>
<td width="15">
<a href="newthread.php?$session[sessionurl]f=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/newthread.png" border="0" width="14" height="14" hspace="0" alt="New thread" align="left" /></a>
</td>
<td width="15">
<a href="search.php?$session[sessionurl]do=getnew&amp;f=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/newposts.png" border="0" width="14" height="14" hspace="0" alt="New posts" align="left" /></a>
</td>
<td width="15">
<a target="_blank" href="external.php?type=RSS2&amp;forumids=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/rss_rss.gif" border="0" width="14" height="14" hspace="0" alt="Rss feed" align="left" /></a>
</td>
</tr>
</table>
<!-- / itvnn.net Mod -->

If you want to exclude these options in some forums, you can add the code with a condition

<!-- itvnn.net Mod -->
<if condition="!in_array($forumid, array(x,x,x,x))">
<table align="right" border="0">
<tr>
<td width="15">
<a href="newthread.php?$session[sessionurl]f=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/newthread.png" border="0" width="14" height="14" hspace="0" alt="New thread" align="left" /></a>
</td>
<td width="15">
<a href="search.php?$session[sessionurl]do=getnew&amp;f=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/newposts.png" border="0" width="14" height="14" hspace="0" alt="New posts" align="left" /></a>
</td>
<td width="15">
<a target="_blank" href="external.php?type=RSS2&amp;forumids=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/rss_rss.gif" border="0" width="14" height="14" hspace="0" alt="Rss feed" align="left" /></a>
</td>
</tr>
</table>
</if>
<!-- / itvnn.net Mod -->

on the top of the code, instead of x put the number of the forum (forumid).

At the end upload the attached icons to the misc folder which is inside images folder

This is what its going to look like

http://img.photo.zing.vn/file_uploads/gallery/sources/2009/11/01/10/46831257089754.jpg

** To hide the Newthread and New post icons from visitors and leave the Rss feed icon only
check this post http://www.vbulletin.org/forum/showp...0&postcount=16 (http://www.vbulletin.org/forum/showpost.php?p=1908250&postcount=16)

** To show these options on the forumdisplay also ..
you have to edit forumhome_forumbit_level1_post tempalte

search for

<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</table>

then put the code directly under it ..

gala8x
09-04-2010, 09:13 AM
Mình đã làm được cho vbb 4.0 nhưng mà làm cho nó nằm dọc như diễn đàn mình thì làm thế nào nhỉ?

belunhugo
09-04-2010, 11:50 PM
Không biết cái này có chạy trên host win được không nhỉ ?

gala8x
18-04-2010, 07:57 PM
Mình đã làm được cho vbb 4.0 nhưng mà làm cho nó nằm dọc như diễn đàn mình thì làm thế nào nhỉ?

Tiện thể admin đang online có thể ghé qua trả lời giúp với được hok? Thank trước nha

gala8x
19-04-2010, 10:31 PM
Không có ai giúp à? Admin ơi :(