Description: This modification will extend v2.1 new inline ad feature and also display the ad in showforum.php
Working Under: Fusion 2.1
Modification Status: Beta
Pre-requisites: v2.1
Author(s): Stephen
Date: 06/05/07
Credits:
Files Altered: showforum.php
showforum_t_row.php
New Files:
Database Altered: No
Instructions / Other Info: Open showforum.php
Find
Code:
$sql = "
SELECT forum_title,forum_active,forum_description,forum_topics,forum_sort,forum_parents,forum_is_cat,forum_children,forum_parent_id,forum_topic_age,forum_gallery,forum_insert,forum_link,forum_rss_feed,forum_css,forum_header,forum_footer,forum_calendar,forum_calendar_cache
FROM " . TABLE_PREFIX . "forums
WHERE forum_id = '".addslashes($fid)."'
";
if(!$results=$db->executeQuery($sql)) {
dieHere(1,$lang_str['BAD_QUERY'],__LINE__,__FILE__,$sql);
}
list ($ftitle,$factive,$fdesc,$total_topics,$forum_sort,$parents,$iscat,$children,$parentid,$topic_age,$gallery,$insert,$link,$rss_feed,$forum_skin,$forum_header,$forum_footer,$forum_calendar,$forum_calendar_cache) = $db->fetchRow($results);
$db->clearResults($results);
$forum_topics = $total_topics;
Replace:
Code:
$sql = "
SELECT forum_title,forum_active,forum_description,forum_topics,forum_sort,forum_parents,forum_is_cat,forum_children,forum_parent_id,forum_topic_age,forum_gallery,forum_insert,forum_link,forum_rss_feed,forum_css,forum_ad,forum_header,forum_footer,forum_calendar,forum_calendar_cache
FROM " . TABLE_PREFIX . "forums
WHERE forum_id = '".addslashes($fid)."'
";
if(!$results=$db->executeQuery($sql)) {
dieHere(1,$lang_str['BAD_QUERY'],__LINE__,__FILE__,$sql);
}
list ($ftitle,$factive,$fdesc,$total_topics,$forum_sort,$parents,$iscat,$children,$parentid,$topic_age,$gallery,$insert,$link,$rss_feed,$forum_skin,$forum_ad,$forum_header,$forum_footer,$forum_calendar,$forum_calendar_cache) = $db->fetchRow($results);
$db->clearResults($results);
$forum_topics = $total_topics;
Code:
Find:
$template->setTemplateVar("LAST_POSTER",$topic_data[$i]['topic_last_poster']);
$topics .= $template->processTemplate();
Code:
replace:
$template->setTemplateVar("LAST_POSTER",$topic_data[$i]['topic_last_poster']);
// INLINE ADS
if( $forum_ad ) {
if ($i == 12) { // indicate how many posts to display before showing the ad.
$template->setTemplateVar("INLINE_AD","<tr class ='color1'><td colspan=6 align='center' valign='middle' class ='color1'> $forum_ad </td></tr>");
}
}
$topics .= $template->processTemplate();
in showforum_t_row.php
add
<!--INLINE_AD-->
Disclaimer:
Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your Fusion code, you may be giving up your right for 'official' support from InteractivePHP, Inc..If you need official support, you'll need to restore unmodified files.