Прошу помощи разобраться с рекламным блоком.Как мне вставить рекламный блок так,что-бы он показывался после каждой новости сам.
Искал на форуме,нашёл похожее,но не то.
Версия системы: SLAED CMS 3.5 Pro
Версия PHP: PHP 5
Сервер: Сервер в интернете
Прошу помощи разобраться с рекламным блоком.Как мне вставить рекламный блок так,что-бы он показывался после каждой новости сам.
Искал на форуме,нашёл похожее,но не то.
я сделал вот так
В главной функции новостей перед запросом в базу вставляем
$banner_counter= 1;
ниже после basic($cid, $cimg, $ctitle,и так даллее);
if($banner_counter == 2 ){echo"Твоя реклама";}
$banner_counter++;
цифра 2 это значит что после второй новости выводить рекламу
ra55551
Большая просьба,опиши по подробней.
В каком файле
Перед или после какой строки вставлять $banner_counter= 1;
и так далее.
Я для модуля новостей и имел ввиду.
Вот сам код
<script type="text/javascript">
if(typeof teasernet=='undefined'){
var teasernet = new Array();
var teasernet_blockid = 14358;
}else
teasernet_blockid = 14358;
teasernet[teasernet_blockid] ={
'styles': {
'TABLE': 'border: 1px dashed #CCCCCC; width: 100%; background: #FFFFFF;',
'TD': 'text-align: center; border: 1px dotted #CCCCCC; background: #FFFFFF; font-size: 10px; color: #000000;',
'IMG': 'border:0; margin: 0 auto;',
'A': 'color:#0000CC; font-size: 10px;',
'AHOVER': 'color:#D50303; font-size: 10px;'
},
'padid': 5496,
'hor': 3,
'ver': 1,
'size': 60
};
document.write('<div id="teasernet_'+teasernet_blockid+'"></div><scr'+'ipt type="text/jav'+
'ascript" src="http://echo.teasernet.ru/step1.php?padid=5496&blockid='+teasernet_blockid+
'&count='+(teasernet[teasernet_blockid].hor*teasernet[teasernet_blockid].ver)+
'&ref='+escape(document.referrer)+'&'+Math.round(Math.random()
0000)+'"></scr'+
'ipt>');
</script>
не знаю на сколько это правильно но у меня работает
Тупо не копируй а смотри по своему файлу
0000)+'"></scr'+<br />
'ipt>');<br />
</script><br />
<br />
################конец твоего рекламного кода<br />
<br />
<?php<br />
}<br />
$banner_counter++;<br />
###########тут закончмили<br />
<br />
<br />
echo bb_decode($banner, $conf['name']);<br />
<br />
}<br />
num_article($conf['name'], $newnum, $field, "sid", "_stories", "catid", $ordernum);<br />
}<br />
foot();<br />
}Что-то не клеится у меня.таким образом.Вот мой код
function news() {
global $prefix, $db, $pagetitle, $conf, $confu, $confn, $admin_file, $home, $user, $currentlang;
$lang = ($conf['multilingual']) ? "AND (c.language='$currentlang' OR c.language='')" : "";
$newnum = (isset($user[3]) && $confu['news'] == 1) ? intval($user[3]) : intval($confn['newnum']);
$sbest = (isset($_GET['best'])) ? 1 : 0;
$shits = (isset($_GET['hits'])) ? 1 : 0;
$scat = (isset($_GET['cat'])) ? $_GET['cat'] : 0;
if ($sbest && $confn['newrate']) {
$caton = 0;
$field = "best=1&";
$order = "WHERE time <= now() AND status!='0' ".$lang." ORDER BY score DESC";
$ordernum = "time <= now() AND status!='0'";
$news_logo = ""._BEST."";
$pagetitle = "".$conf['defis']." "._NEWS." ".$conf['defis']." $news_logo";
} elseif ($shits && $confn['newrate']) {
$caton = 0;
$field = "hits=1&";
$order = "WHERE time <= now() AND status!='0' ".$lang." ORDER BY counter DESC";
$ordernum = "time <= now() AND status!='0'";
$news_logo = ""._POP."";
$pagetitle = "".$conf['defis']." "._NEWS." ".$conf['defis']." $news_logo";
} elseif ($scat) {
$caton = 1;
$field = "cat=$scat&";
list($cat_title, $cat_description) = $db->sql_fetchrow($db->sql_query("SELECT title, description FROM ".$prefix."_categories WHERE id='$scat'"));
$order = "WHERE catid='$scat' AND time <= now() AND status!='0' ".$lang." ORDER BY time DESC";
$ordernum = "catid='$scat' AND time <= now() AND status!='0'";
$pagetitle = "".$conf['defis']." "._NEWS." ".$conf['defis']." $cat_title";
} else {
$caton = 1;
$field = "";
$order = (!$home) ? "WHERE time <= now() AND status!='0' ".$lang." ORDER BY time DESC" : "WHERE ihome='0' AND time <= now() AND status!='0' ".$lang." ORDER BY time DESC";
$ordernum = (!$home) ? "time <= now() AND status!='0'" : "ihome='0' AND time <= now() AND status!='0'";
$news_logo = ""._NEWS."";
$pagetitle = "".$conf['defis']." $news_logo";
}
head();
if (!$home) {
if ($scat) {
menu($cat_title);
} else {
menu($news_logo);
}
if ($caton == 1) categories($conf['name'], $confn['newcol'], $confn['newsub'], $confn['newcatdesc'], $scat);
}
$num = isset($_GET['num']) ? intval($_GET['num']) : "1";
$offset = ($num-1) * $newnum;
$offset = intval($offset);
$result = $db->sql_query("SELECT s.sid, s.catid, s.aid, s.title, UNIX_TIMESTAMP(s.time) as formatted, s.hometext, s.comments, s.counter, s.acomm, s.score, s.ratings, c.id, c.title, c.description, c.img FROM ".$prefix."_stories AS s LEFT JOIN ".$prefix."_categories AS c ON (s.catid=c.id) ".$order." LIMIT $offset, $newnum");
if ($db->sql_numrows($result) > 0) {
while (list($sid, $catid, $aid, $stitle, $formatted, $hometext, $comments, $counter, $acomm, $score, $ratings, $cid, $ctitle, $cdescription, $cimg) = $db->sql_fetchrow($result)) {
$time = date(""._DATESTRING."", $formatted);
$title = "<a href=\"index.php?name=".$conf['name']."&op=view&id=$sid\" title=\"$stitle\">".$stitle."</a> ".new_graphic($formatted)."";
$read = "<a href=\"index.php?name=".$conf['name']."&op=view&id=$sid\" title=\"$stitle\">"._READMORE."</a>";
$post = " "._POSTEDBY.": ".user_info($aid, 1)."";
$ndate = ($confn['newdate']) ? " "._DATE.": ".$time."" : "";
$reads = ($confn['newread']) ? " "._READS.": ".$counter."" : "";
if (!$acomm) {
if ($comments == 0) {
$comm = " <a href=\"index.php?name=".$conf['name']."&op=view&id=$sid#$sid\" title=\"$stitle\">"._COMMENTS."</a>";
} elseif ($comments == 1) {
$comm = " <a href=\"index.php?name=".$conf['name']."&op=view&id=$sid#$sid\" title=\"$stitle\">"._COMMENT.": $comments</a>";
} elseif ($comments > 1) {
$comm = " <a href=\"index.php?name=".$conf['name']."&op=view&id=$sid#$sid\" title=\"$stitle\">"._COMMENTS.": $comments</a>";
}
} else {
$comm = "";
}
$arating = " ".ajax_rating(0, $sid, $conf['name'], $ratings, $score)."";
$print = " ".ad_print("index.php?name=".$conf['name']."&op=printe&id=".$sid."")."";
$admin = (is_moder($conf['name'])) ? " ".ad_edit("".$admin_file.".php?op=news_add&id=".$sid."")."" : "";
$cdescription = ($cdescription) ? $cdescription : $ctitle;
$cimg = ($cimg) ? "<a href=\"index.php?name=".$conf['name']."&cat=$cid\"><img src=\"images/categories/".$cimg."\" border=\"0\" alt=\"$cdescription\" title=\"$cdescription\" align=\"right\" hspace=\"10\" vspace=\"10\"></a>" : "";
$link = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"75%\" align=\"left\"><b>".$read."</b>".$post."".$ndate."".$reads."".$comm."</td><td>".$arating."</td><td align=\"right\">".$print."".$admin."</td></tr></table>";
basic($cid, $cimg, $ctitle, $sid, $title, bb_decode($hometext, $conf['name']), $link, $read, $post, $ndate, $reads, $comm, $arating, $print, $admin);
}
num_article($conf['name'], $newnum, $field, "sid", "_stories", "catid", $ordernum);
}
foot();
}
function liste() {мне нужно что-бы рекламный блок выводился после новости при просмотре "Подробнее" сразу после "Разместил"
Как идея - в теме создать basic-news-view.html, основу скопировать из basic.html, а в конец добавить код рекламы. Например:
<div class="basic"> <h3 class="btitle">$arg[4]</h3> <div class="morefield"> $arg[12] <span class="arg">$arg[8]</span> <span class="arg">$arg[9]</span> <span class="arg">$arg[10]</span> </div> <div class="maincont"> $arg[1] $arg[5] </div> <div class="morelink"> <b>$arg[7]</b><span class="argcom">$arg[11]</span><span class="baseicons">$arg[13]$arg[14]</span> </div> <div class="clr"></div> </div> <!--НАЧАЛО РЕКЛАМА--> Текст рекламы. Любой html код, либо переменная. <!--КОНЕЦ РЕКЛАМА-->
У меня basic.html вот какой код:
<table class="basic" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7"><img src="templates/$ThemeSel/images/basic_left_top.gif" width="7" height="7" alt="" /></td>
<td class="basic-top"><img src="templates/$ThemeSel/images/pixel.gif" width="1" height="7" alt="" /></td>
<td width="7"><img src="templates/$ThemeSel/images/basic_right_top.gif" width="7" height="7" alt="" /></td>
</tr>
<tr valign="top">
<td class="basic-left"></td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td valign="top">
<h3 id="titlebasic">$title</h3>
$topicimage $content
</td>
</tr>
<tr>
<td class="morelink">$arg[100] $morelink</td>
</tr></table>
</td>
<td class="basic-right"></td>
</tr>
<tr>
<td width="7"><img src="templates/$ThemeSel/images/basic_left_bottom.gif" width="7" height="7" alt="" /></td>
<td class="basic-bottom"><img src="templates/$ThemeSel/images/pixel.gif" width="1" height="7" alt="" /></td>
<td width="7"><img src="templates/$ThemeSel/images/basic_right_bottom.gif" width="7" height="7" alt="" /></td>
</tr>
</table><br />Форум
Контакты