FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » "News"
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: "News" [message #40000 is a reply to message #37899] Tue, 01 January 2008 19:48 Go to previous message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma:
Senior Member
Perhaps you are looking for something like this:
http://www.ginnunga.org/forums/index.php?t=thread&frm_id=118

What I did was to add simple IF statements in the templates. In this case my code (you cant really use this, but it can give you a hint) looks like this:

Thread.tmpl -> thread_list and replace
{TEMPLATE-DATA: thread_list_table_data}

with
{IF: ($frm->id == 118)} <!-- IF NEWS -->
<tr><td style=""><img src="{THEME_IMAGE_ROOT}/news2.png" alt="News" align="left"><hr style="position: relative; left: -18px;top: 18px;border: 0px;border-bottom:1px dotted #aaaaaa;height: 1px;"><span style="font-size: 15pt; color: #660000;position: relative;top: -12px;">&nbsp;Ginnunga news&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
{TEMPLATE-DATA: thread_list_news_data}
{ELSE}
{IF: ($frm->id == 124)} <!-- IF DOWNLOADS -->
<tr><td style=""><img src="{THEME_IMAGE_ROOT}/news2.png" alt="News" align="left"><hr style="position: relative; left: -18px;top: 18px;border: 0px;border-bottom:1px dotted #aaaaaa;height: 1px;"><span style="font-size: 15pt; color: #660000;position: relative;top: -12px;">&nbsp;Ginnunga Downloads&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
{TEMPLATE-DATA: thread_list_downloads_data}
{ELSE} <!-- REGULAR FORUM -->
{TEMPLATE-DATA: thread_list_table_data}
{END}{END}


I also edited thread.php.t and after this line
	$thread_list_table_data .= '{TEMPLATE: thread_row}';

added this:
			$thread_list_news_data .= '{TEMPLATE: thread_news}';
			$thread_list_downloads_data .= '{TEMPLATE: thread_downloads}';


Then I just went ahead and created subsections in thread.tmpl which were copies of thread_list and just renamed them to thread_downloads and thread_news and modified them to fit my needs.


[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Zshare Embedding Plugin
Next Topic: API hooks into post moderation?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat May 11 09:07:00 GMT 2024

Total time taken to generate the page: 0.05289 seconds