echopros
New Member


Joined: Oct 04, 2007
Posts: 22
|
Posted:
Mon Feb 18, 2008 7:29 pm |
|
hello everyone
im asking about how to insert the code adsense in the header beside the logo.gif (in the right side) of the theme NewsBlack
here is the file theme.php
| Quote: | <?php
$bgcolor1 = "#303030";
$bgcolor2 = "#666666";
$bgcolor3 = "#000000";
$bgcolor4 = "#303030";
$textcolor1 = "#FFFFFF";
$textcolor2 = "#333333";
include("themes/NewsBlack/tables.php");
/************************************************************/
/* Function themeheader() */
/* BODY tag and in some part of the code call the blocks */
/* function for left side with: blocks(left); */
/************************************************************/
function themeheader() {
global $DataBanners, $user, $tname, $banners, $sitename, $slogan, $cookie, $prefix, $name, $dbi, $db, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2;
cookiedecode($user);
// theme name
$tname = "NewsBlack";
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
include("themes/$tname/data.php");
echo "<body bgcolor=\"$bgcolor1\" text=\"$textcolor1\" link=\"$textcolor1\" vlink=\"$textcolor1\" alink=\"$textcolor1\">";
echo "<br>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width=750>
<TR>
<TD width=\"750\" bgcolor=\"$bgcolor2\"><TABLE bgcolor=\"$bgcolor3\" border=0 cellPadding=0 cellSpacing=0 width=\"100%\">
<TR>
<TD><TABLE border=0 cellPadding=4 cellSpacing=0 width=\"100%\">
<TR bgcolor=\"$bgcolor2\">
<TD width=\"100%\" colspan=\"2\"><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">
<tr>
<td height=\"60\" bgcolor=\"$bgcolor3\"><div align=\"center\"><a href=\"index.php\"><img src=\"themes/$tname/images/logo.gif\" alt=\"$sitename\" width=\"260\" height=\"60\" border=\"0\"></a></div></td>
<td width=\"480\" height=\"60\" bgcolor=\"$bgcolor2\"><div align=\"center\">";
// ads
$ads = ads(0);
echo "$ads";
$topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = sql_query("select topicid, topictext from ".$prefix."_topics order by topictext", $dbi);
while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
if ($topicid==$topic) { $sel = "selected "; }
$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
$sel = "";
}
if ($username == "Anonymous") {
$theuser = " [<a href=\"account-new_user.html\">"._BREG."</a>]";
$nouser = " "._BWEL." <strong>$username</strong> <img src=\"themes/$tname/images/hi3.gif\" border=\"0\" align=\"absmiddle\">";
} else {
$theuser = " <img src=\"themes/$tname/images/hi2.gif\" border=\"0\" align=\"absmiddle\"> "._BWEL." <strong>$username!</strong>";
$hiuser = "[<a href=\"modules.php?name=Your_Account&op=edituser\">"._CHANGEYOURINFO."</a>]
[<a href=\"modules.php?name=Your_Account&op=edithome\">"._CHANGEHOME."</a>]
[<a href=\"modules.php?name=Journal&file=edit\">"._JOURNAL."</a>]
<img src=\"themes/$tname/images/hi.gif\" border=\"0\" align=\"absmiddle\">
[<a href=\"modules.php?name=Your_Account&op=chgtheme\">"._SELECTTHETHEME."</a>]
[<a href=\"messages.html\">"._PRIVATEMESSAGES."</a>]
[<a href=\"account-logout.html\">"._LOGOUT."</a>]";
}
$public_msg = public_message();
$tmpl_file = "themes/$tname/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
// No left blocks
if ($name=='Forums') {
/* Don't display left blocks. */ }
elseif ($name=='Weekly Articles'){
/* Don't display left blocks. */ }
elseif ($name=='Private Messages'){
/* Don't display left blocks. */ }
elseif ($name=='Members List'){
/* Don't display left blocks. */ }
elseif ($name=='Your Account'){
/* Don't display left blocks. */ }
elseif ($name=='Submit News'){
/* Don't display left blocks. */ }
elseif ($name=='Statistics'){
/* Don't display left blocks. */ }
elseif ($name=='Surveys'){
/* Don't display left blocks. */ }
elseif ($name=='Feedback'){
/* Don't display left blocks. */ }
elseif ($name=='Web Links'){
/* Don't display left blocks. */ }
elseif ($name=='Search'){
/* Don't display left blocks. */ }
elseif ($name=='Stories Archive'){
/* Don't display left blocks. */ }
elseif ($name=='Top'){
/* Don't display left blocks. */ }
elseif ($name=='Topics'){
/* Don't display left blocks. */ }
elseif ($name=='Content'){
/* Don't display left blocks. */ }
elseif ($name=='Advertising'){
/* Don't display left blocks. */ }
elseif ($name=='Recommend Us'){
/* Don't display left blocks. */ }
// admin
elseif ($_SERVER['REQUEST_URI']=="/admin.php?op=adminStory"){
/* Don't display left blocks. */ }
elseif ($_SERVER['REQUEST_URI']=="/admin.php?op=content"){
/* Don't display left blocks. */ }
else {
echo "<td bgcolor=\"$bgcolor3\"> </td><td bgcolor=\"$bgcolor3\" width=\"150\" valign=\"top\">";
blocks("left");
}
$tmpl_file = "themes/$tname/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themefooter() */
/* */
/* Control the footer for your site. You don't need to */
/* close BODY and HTML tags at the end. In some part call */
/* the function for right blocks with: blocks(right); */
/* Also, $index variable need to be global and is used to */
/* determine if the page your're viewing is the Homepage or */
/* and internal one. */
/************************************************************/
function themefooter() {
global $name, $tname, $index, $foot1, $foot2, $foot3, $copyright, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $db, $prefix, $title;
// theme name
$tname = "NewsBlack";
if (defined('INDEX_FILE')) {
$DataRight = date("F • d • Y");
$tmpl_file = "themes/$tname/center_right.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks("right");
}
include("themes/$tname/data.php");
$copyrightfooter = base64_decode('VGhlbWUgJmNvcHk7IDxhIGhyZWY9Imh0dHA6Ly93d3cuamFuaXRvcmlhbHNlcnZpY2UudXMiIHRhcmdldD0iX2JsYW5rIj5JPC9hPjxhIGhyZWY9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vYT48YSBocmVmPSJodHRwOi8vd3d3LmNoaWNhZ29sYW5kLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPmU8L2E+PGEgaHJlZj0iaHR0cDovL3d3dy5ld2VhdGhlci5iaXoiIHRhcmdldD0iX2JsYW5rIj5zPC9hPjxhIGhyZWY9Imh0dHA6Ly93d3cucG9sb25pYS5pbmZvIiB0YXJnZXQ9Il9ibGFuayI+aTwvYT48YSBocmVmPSJodHRwOi8vd3d3LmludGVybmV0aW50bC5jb20iIHRhcmdldD0iX2JsYW5rIj5nPC9hPjxhIGhyZWY9Imh0dHA6Ly93d3cuZXllLmNjIiB0YXJnZXQ9Il9ibGFuayI+bjwvYT4=');
echo "</td><td bgcolor=\"$bgcolor3\"> </td></tr></table>
<hr width=\"750\" size=\"1\" noshade>
<table width=\"750\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td height=\"20\" colspan=\"3\" bgcolor=\"$bgcolor3\"><div align=\"center\">: <a href=\"index.php\">Home</a> : $DataMenu<br>
</div></td>
</tr>
<tr>
<td width=\"30%\" height=\"15\" bgcolor=\"$bgcolor4\">$copyrightfooter</td>
<td width=\"40%\" bgcolor=\"$bgcolor4\"><div align=\"center\">$DataTotalHits $DataSub</div></td>
<td width=\"30%\" bgcolor=\"$bgcolor4\"><div align=\"right\"><strong>$name <a href=\"#top\">Top</a> ^ </strong></div></td>
</tr>
</table>";
$tmpl_file = "themes/$tname/footer.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the Homepage */
/************************************************************/
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $tname, $anonymous, $tipath, $bgcolor1, $bgcolor2, $bgcolor3;
// theme name
$tname = "NewsBlack";
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
if ($notes != "") {
$notes = "<br><br><strong>"._NOTE."</strong> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$posted = ""._POSTEDBY." ";
$posted .= get_author($aid);
$posted .= " "._ON." $time $timezone ($counter "._READS.")";
$tmpl_file = "themes/$tname/story_home.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themearticle() */
/* */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home */
/************************************************************/
function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
global $tname, $admin, $sid, $tipath, $bgcolor1, $bgcolor2, $bgcolor3;
// theme name
$tname = "NewsBlack";
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
$posted = ""._POSTEDON." $datetime "._BY." ";
$posted .= get_author($aid);
if ($notes != "") {
$notes = "<br><br><strong>"._NOTE."</strong> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$tmpl_file = "themes/$tname/story_page.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************************/
function themesidebox($title, $content) {
global $tname, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;
// theme name
$tname = "NewsBlack";
// customize your bloks here
switch ($title) {
case "Survey":
$tmpl_file = "themes/$tname/survey.html";
break;
default:
$tmpl_file = "themes/$tname/blocks.html";
}
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
?> |
thanks in advance |
| |
|