Tarih: 2008-07-11, 22:20:02 Mesaj konusu: sağ ve sol bloklar farklı renkte nasıl olur
örnek bu arkadaşlar
blocks.html yerine blockleft.html ve blockright.html oluşturdum
theme.php içine nasıl bir kod eklemeliyimki sol block olduğunda blockleft.html çağırsın, sağ blok olduğunda blockright.html çağırsın
/************************************************************/
/* Function themeheader() */
/* */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks */
/* function for left side with: blocks(left); */
/************************************************************/
function themeheader() {
global $admin, $user, $banners, $sitename, $slogan, $c o o k i e, $prefix, $db, $nukeurl, $anonymous, $Version_Num, $blockside;
if ($Version_Num > "7.7") {
$showbanners = ads(0);
} else {
if ($banners == 1) {
$numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_banner WHERE type='0' AND active='1'"));
/* Get a random banner if exist any. */
/* More efficient random stuff, thanks to Cristian Arroyo from http://www.planetalinux.com.ar */
if (!is_admin($admin)) {
$db->sql_query("UPDATE ".$prefix."_banner SET impmade=impmade+1 WHERE bid='$bid'");
}
if($numrows>0) {
$sql2 = "SELECT cid, imptotal, impmade, clicks, date FROM ".$prefix."_banner WHERE bid='$bid'";
$result2 = $db->sql_query($sql2);
$row2 = $db->sql_fetchrow($result2);
$cid = $row2[cid];
$imptotal = $row2[imptotal];
$impmade = $row2[impmade];
$clicks = $row2[clicks];
$date = $row2[date];
/* Check if this impression is the last one and print the banner */
if (($imptotal <= $impmade) AND ($imptotal != 0)) {
$db->sql_query("UPDATE ".$prefix."_banner SET active='0' WHERE bid='$bid'");
$sql3 = "SELECT name, contact, email FROM ".$prefix."_bannerclient WHERE cid='$cid'";
$result3 = $db->sql_query($sql3);
$row3 = $db->sql_fetchrow($result3);
$c_name = $row3[name];
$c_contact = $row3[contact];
$c_email = $row3[email];
if ($c_email != "") {
$from = "$sitename <$adminmail>";
$to = "$c_contact <$c_email>";
$message = ""._HELLO." $c_contact:\n\n";
$message .= ""._THISISAUTOMATED."\n\n";
$message .= ""._THERESULTS."\n\n";
$message .= ""._TOTALIMPRESSIONS." $imptotal\n";
$message .= ""._CLICKSRECEIVED." $clicks\n";
$message .= ""._IMAGEURL." $imageurl\n";
$message .= ""._CLICKURL." $clickurl\n";
$message .= ""._ALTERNATETEXT." $alttext\n\n";
$message .= ""._HOPEYOULIKED."\n\n";
$message .= ""._THANKSUPPORT."\n\n";
$message .= "- $sitename "._TEAM."\n";
$message .= "$nukeurl";
$subject = "$sitename: "._BANNERSFINNISHED."";
mail($to, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
}
}
$showbanners = "<a href=\"banners.php?op=click&bid=$bid\" target=\"_blank\"><img src=\"$imageurl\" border=\"0\" alt='$alttext' title='$alttext'></a>";
}
}
}
c o o k i edecode($user);
$username = $c o o k i e[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"#FFFFFF\" text=\"#000000\" leftmargin=\"10\" topmargin=\"10\" marginwidth=\"10\" marginheight=\"10\">";
if ($username == "Anonymous") {
$theuser = " <a href=\"modules.php?name=Your_Account\">"._LOGIN."</a>/<a href=\"modules.php?name=Your_Account&op=new_user\">"._BREG."</a>";
} else {
$theuser = " "._BWEL." $username!";
}
$datetime = "<script type=\"text/j a v a s c r i p t\">\n\n"
."<!-- // Array ofmonth Names\n"
."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n"
."var now = new Date();\n"
."thisYear = now.getYear()+543;\n"
."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
."document.write(now.getDate() + \" \" + monthNames[now.getMonth()] + \" \" + thisYear);\n"
."// -->\n\n"
."</script>";
$public_msg = public_message();
$tmpl_file = "themes/Nuke23-nov-07/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($thefile);
print $r_file;
$blockside="l";
blocks(left);
$tmpl_file = "themes/Nuke23-nov-07/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($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 $index, $foot1, $foot2, $foot3, $foot4, $copyright, $totaltime, $footer_message, $blockside;
if (defined('INDEX_FILE') || ($index == 1)) {
$tmpl_file = "themes/Nuke23-nov-07/center_right.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($thefile);
print $r_file;
$blockside="r";
blocks(right);
}
$tmpl_file = "themes/Nuke23-nov-07/footer.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($thefile);
print $r_file;
//echo "<center>\n";
//$footer_message = footmsg();
// echo "</center>\n";
//echo "<br>\n";
}
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the Homepage */
/************************************************************/
/************************************************************/
/* Function themearticle() */
/* */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home */
/************************************************************/
/************************************************************/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************************/
function themesidebox($title, $content) {
global $blockside;
if ($blockside=="l") {
$tmpl_file = "themes/Nuke23-nov-07/blockleft.html";
} else {
$tmpl_file = "themes/Nuke23-nov-07/blockright.html";
}
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($thefile);
print $r_file;
}
?>
En son mersoy tarafından 2009-03-28, 21:56:03 tarihinde değiştirildi, toplam 1 kere değiştirildi
Sana daha iyi bir kod yazayim istedigin her blogun rengini ayri ayri renklerde yap istersen arka renklerinide degisik degisik renkler kullan örnek asagidaki gibidir
Kod:
function themesidebox($title, $content) {
$ThemeSel = get_theme();
if ($title == "Site Menüsü") {
$tmpl_file = "themes/TEMANIN ADI/block_menu.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($thefile);
print $r_file;
} else
if ($title == "Dosyalar") {
$tmpl_file = "themes/TEMANIN ADI/block_dosyalar.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($thefile);
print $r_file;
} else {
$tmpl_file = "themes/TEMANIN ADI/blocks.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
e v a l($thefile);
print $r_file;
}
}
en alttaki kod orjinal block icindir yani bir block olusturdun ama temada o blogun dosyasi yoksa orjinal block yerine cikar blocks.html dosyasi, ayrica editleyecegin blocklarda block_dosyalar.html ve block_menu.html Frontpage ile basit bir sekilde editleyebilirsin umarim yardimci olabilmisimdir.
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız