KID_1194 |
10-25-2009 10:00 PM |
Adding RSS and other options to Forum home page.
1 Attachment(s)
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
PHP 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
PHP Code:
<!-- Amin 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&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&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>
<!-- / Amin Mod -->
If you want to exclude these options in some forums, you can add the code with a condition
PHP Code:
<!-- Amin 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&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&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>
<!-- / Amin 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
https://vborg.vbsupport.ru/attachmen...1&d=1256565021
** To hide the Newthread and New post icons from visitors and leave the Rss feed icon only
check this post https://vborg.vbsupport.ru/showpost....0&postcount=16
** To show these options on the forumdisplay also ..
you have to edit forumhome_forumbit_level1_post tempalte
search for
PHP Code:
<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 ..
Updated (27 OCT 2009): "W3" 0 errors
Adding RSS next to forum title
Best regards
----------------------------------------------------------------
السلام عليكم
RSS هذا التعديل هو لإضافة ايقونة الـ
+ آخر المشاركات + إنشاء موضوع لكل قسم والذي سوف تظهر بجانب القسم في الصفحة الرئيسية
الآن .. نبدأ التعديل
أولاً .. القالب الذي سوف نقوم بالتعديل عليه هو قالب
forumhome_forumbit_level2_post
الخاص بالستايل
نقوم بفتح هذا القالب .. ثم نقوم بالبحث عن هذا الكود
PHP Code:
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
بعدها نقوم بإضافة هذا الكود أسفلة مباشرة ..
PHP Code:
<!-- Amin Mod -->
<table align="left" 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="إضافة موضوع" align="left" /></a>
</td>
<td width="15">
<a href="search.php?$session[sessionurl]do=getnew&f=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/newposts.png" border="0" width="14" height="14" hspace="0" alt="آخر المشاركات" align="left" /></a>
</td>
<td width="15">
<a target="_blank" href="external.php?type=RSS2&forumids=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/rss_rss.gif" border="0" width="14" height="14" hspace="0" alt="خدمة الـ Rss" align="left" /></a>
</td>
</tr>
</table>
<!-- / Amin Mod -->
واذا اردنا ان لا تظهر هذه الأيقونات بجانب بعض الأقسم مثل الأقسام الإدارية
فيمكننا استخدام هذا الكود
PHP Code:
<!-- Amin Mod -->
<if condition="!in_array($forumid, array(x,x,x,x))">
<table align="left" 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="إضافة موضوع" align="left" /></a>
</td>
<td width="15">
<a href="search.php?$session[sessionurl]do=getnew&f=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/newposts.png" border="0" width="14" height="14" hspace="0" alt="آخر المشاركات" align="left" /></a>
</td>
<td width="15">
<a target="_blank" href="external.php?type=RSS2&forumids=$forum[forumid]">
<img src="$stylevar[imgdir_misc]/rss_rss.gif" border="0" width="14" height="14" hspace="0" alt="خدمة الـ Rss" align="left" /></a>
</td>
</tr>
</table>
</if>
<!-- / Amin Mod -->
x من أعلى الكود نقوم بإستبدال علامة الـ
(forumid) بأرفام الأقسام التي لا نريد ان تظهر الأيقونات بجانبها
misc وفي النهاية نقوم برفع الأيقونات الموجودة في الأسفل ووضعها في ملف
الموجود بداخل ملفات الستايل
وهذا هو ما سنحصل عليه في النهاية
This is what its going to look like
https://vborg.vbsupport.ru/attachmen...1&d=1256565021
** إذا اردت إخفاء ايقوة إنشاء موضوع و آخر المشاركات عن الزوار
يرجى مراجعة هذا الرد
https://vborg.vbsupport.ru/showpost....0&postcount=16
** Forumdisplay إذا اردت ان تظهر هذه الأيقونات أيضاً في
forumhome_forumbit_level1_post قم بفتح قالب
وابحث عن
PHP Code:
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</table>
وقم بإضافة الكود أسفله مباشرة
Updated (27 OCT 2009): "W3" 0 errors
Adding RSS next to forum title
دمتم في حفظ الرحمن
|