Current location: Hot Scripts Forums » Programming Languages » PHP » cpgNUKE theme edit


cpgNUKE theme edit

Reply
  #1 (permalink)  
Old 06-10-04, 04:09 PM
thomasjojo thomasjojo is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Norway
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
cpgNUKE theme edit

i editing this theme.php in cpg nuke:

start php
# $Author: Pitcher $
# $Date: 2004/03/21 33:12:00 $
# $version: 2.1.1 $
if ($_SERVER['HTTP_USER_AGENT'] == "-") {
include 'noID.php';
die();
}
if ($_SERVER['HTTP_USER_AGENT'] == "") {
include 'noID.php';
die();
}
/************************************************** **********/
/* Theme Name: PH v2 */
/* Theme Design: Pitcher (www.pitcherathome.com) */
/************************************************** **********/
/************************************************** **********/
/* Theme Colors Definition */
/* */
/* Define colors for your web site. $bgcolor2 is generaly */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the */
/* other two bgcolor variables follows the same criteria. */
/* $texcolor1 and 2 are for tables internal texts */
/************************************************** **********/
$bgcolor1 = "#ffffff";
$bgcolor2 = "#ffffff";
$bgcolor3 = "#ffffff";
$bgcolor4 = "#ffffff";
$textcolor1 = "#000000";
$textcolor2 = "#252525";
function OpenTable() {
global $bgcolor1, $bgcolor2;
echo "<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">"
."<tr><td class=\"opentable2\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\"><tr><td>"
."<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\"><tr><td class=\"opentable1\">";
}
function CloseTable() {
echo "</td></tr></table>"
."</td></tr></table></td>"
." </tr>"
."</table>"
."";
}
function OpenTable2() {
global $bgcolor1, $bgcolor2;
echo"<table width=\"100%\" border=\"0\" cellspacing=\"5\" cellpadding=\"0\">"
. "<tr><td class=\"opentable2\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">"
. "<tr><td>"
. "<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\">"
. "<tr><td class=\"opentable1\">"
."";
}
function CloseTable2() {
echo"</td>"
. " </tr>"
. " </table></td></tr></table></td>"
. " </tr>"
. "</table>"
."";
}

/************************************************** **********/
/* 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, $banners, $sitename, $prefix, $db, $nukeurl, $anonymous, $index, $blockside, $mainindex;

/* Check of right block on/off */
if ($index == 1) {
$topblock = "<td width=\"194\"></td>";
} else {
$topblock = "<td width=\"194\" class=\"mtop_block\"></td>";
}
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 ($numrows>1) {
$numrows = $numrows-1;
mt_srand((double)microtime()*1000000);
$bannum = mt_rand(0, $numrows);
} else {
$bannum = 0;
}
$sql = "SELECT bid, imageurl, clickurl, alttext FROM ".$prefix."_banner WHERE type='0' AND active='1' LIMIT $bannum,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$bid = $row[bid];
$imageurl = $row[imageurl];
$clickurl = $row[clickurl];
$alttext = $row[alttext];
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>";
}
}
echo "<body>\n";
$public_msg = public_message();
// Header
echo "<table align=\"left\" width=\"920\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"
."<tr><td width=\"20\"></td><td align=\"left\" colspan=\"2\">"
."<img src=\"themes/PH2/images/rio_logo_all.gif\" width=\"473\" height=\"61\" vspace=\"5\" border=\"0\"><br>"
."</td><td align=\"center\" width=\"226\"><img src=\"themes/PH2/images/ressurstxt.gif\" alt=\"\" width=\"206\" height=\"49\" border=\"0\"></td></tr><tr><td width=\"20\"></td><td width=\"674\" class=\"menutd\" colspan=\"2\">"
." &nbsp; <a href=\"$mainindex\">Forside</a> &nbsp; | &nbsp; <a href=\"?id=100\">Om RiO</a> &nbsp; | &nbsp; <a href=\"?id=200\">Media</a> &nbsp; | &nbsp; <a href=\"?id=300\">Hva skjer</a> &nbsp; | &nbsp; <a href=\"?id=400\">F&aring; hjelp</a> &nbsp; | &nbsp; <a href=\"?id=500\">Arkiv</a> &nbsp; | &nbsp; <a href=\"?id=600\">Meninger</a> &nbsp; | &nbsp; <a href=\"?id=610\">Kontakt oss</a> &nbsp; | &nbsp; <a href=\"".getlink("Search")."\">S&oslash;k</a> &nbsp; | &nbsp;"
."</td><td></td></tr></table>"
."<table width=\"920\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"left\">"
."<tr valign=\"top\"><td valign=\"top\" class=\"blockleft\">";

$blockside="l";
blocks(left);
// Left Center
//echo "<td align=\"center\" bgcolor=\"#FFFFFF\" valign=\"top\" width=\"100%\">";
}
function themefooter() {
global $index, $foot1, $foot2, $blockside;
if ($index == 1) {

echo "</td><td valign=\"top\" width=\"194\" class=\"blockright\">";
$blockside="r";
blocks(right);
}

echo "</td></table>";
echo "<table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td class=\"bottomline\" align=\"right\"></td></tr>\n";
echo"<tr><td bgcolor=\"$bgcolor4\" align=\"center\">";
footmsg();
echo "</td></tr></table>";
}
/************************************************** **********/
/* 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 $anonymous, $tipath;
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> $notes\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&amp;op=userin fo&amp;username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES.": $thetext$notes\n";
}
$posted = ""._POSTEDBY." ";
$posted .= get_author($aid);
$posted .= " "._ON." $time $timezone ($counter "._READS.")";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">"
." <tr>"
." <td>"
." <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">"
." <td bgcolor=\"#FFFFFF\">"
." <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">"
." <tr>"
." <td width=\"100%\" class=\"newsbar_top\">&nbsp;"
." <font class=\"storytitle\"><b>$title</b></font>"
." </td>"
." </tr>"
." <tr>"
." <td bgcolor=\"#ffffff\"><a href=\"modules.php?name=News&amp;new_topic=$topic\ "><img src=\"$tipath$topicimage\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" align=\"right\" hspace=\"10\" vspace=\"10\"></a>$content</td>"
." </tr>"
." <tr>"
." <td class=\"newsbar_bottom\" align=\"center\"><font class=\"content\">$posted</font><br>"
." <font class=\"content\">$morelink</font></td>"
." </table>"
." </td>"
." </tr>"
." </table>"
." </td>"
." </tr>"
."</table><br>";


}
/************************************************** **********/
/* 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, $time, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
global $admin, $sid, $tipath;
$posted = ""._POSTEDON." $time $timezone "._BY." ";
$posted .= get_author($aid);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> $notes\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&amp;op=userin fo&amp;username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES.": $thetext$notes\n";
}

}
/************************************************** **********/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************** **********/
function themesidebox($title, $content, $bid=0) {
global $blockside;
$display[0] = "";
$display[1] = "none";
$display[2] = "themes/PH2/images/minus.gif";
if (isset($_COOKIE["block".$bid])) {
if ($_COOKIE["block".$bid] == "yes") {
//block is collapsed so hide it
$display[0] = "none";
$display[1] = "";
$display[2] = "themes/PH2/images/plus.gif";
}
}
if ($blockside=="l") {
// Block Left
echo "<table width=\"194\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
."<tr>"
."<td class=\"blockleft_header\">&nbsp;&nbsp;&nbsp;<img alt=\"[x]\" title=\"Show/hide content\" id=\"pic$bid\" src=\"$display[2]\" onclick=\"xyzswitch('$bid');\" style=\"cursor:pointer\"><font class=\"block-title\">&nbsp;<strong>$title</strong></font>"
."</td>"
."</tr><tr>"
."<td><img src=\"themes/PH2/images/block_left_shaddow.jpg\" height=\"2\" alt=\"\"></td>"
."</tr><tr>"
."<td class=\"blockleft\">"
."<div id=\"pe$bid\" style=\"display:$display[0];\">\n"
."<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
."<tr>"
."<td><table align=\"center\" width=\"165\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><font class=\"content\">$content</font></td></tr></table>"
."<br></td>"
."</tr>"
."</table>"
."</div>\n"
."<div id=\"ph$bid\" style=\"display:$display[1];\"> </div>\n"
."</td>"
."</tr>"
."</table>";
} else {
// Block Right
echo "<table width=\"194\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
."<tr>"
."<td class=\"blockright_header\">&nbsp;&nbsp;&nbsp;<img alt=\"[x]\" title=\"Show/hide content\" id=\"pic$bid\" src=\"$display[2]\" onclick=\"xyzswitch('$bid');\" style=\"cursor:pointer\"><font class=\"block-title\">&nbsp;<strong>$title</strong></font>"
."</td>"
."</tr><tr>"
."<td><img src=\"themes/PH2/images/block_right_shaddow.jpg\" height=\"2\" alt=\"\"></td>"
."</tr><tr>"
."<td class=\"blockright\">"
."<div id=\"pe$bid\" style=\"display:$display[0];\">\n"
."<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
."<tr>"
."<td><table align=\"center\" width=\"165\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><font class=\"content\">$content</font></td></tr></table>"
."<br></td>"
."</tr>"
."</table>"
."</div>\n"
."<div id=\"ph$bid\" style=\"display:$display[1];\"> </div>\n"
."</td>"
."</tr>"
."</table>"
."$topblock";
}
}
end script


ops, i did something, its going wrong: www.taon.no/nuke/

but I want this table to be the one that have the codes in;

<table align="left" width="920" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="20"></td>
<td align="left" colspan="2"><img src="gifs/rio_logo_all.gif" alt="" width="473" height="61" vspace="5" border="0"><br>
</td>
<td align="center" width="226"><img src="gifs/ressurstxt.gif" alt="" width="206" height="49" border="0"></td>
</tr>
<tr>
<td width="20"></td>
<td width="674" class="menutd" colspan="2"><?php include "includes/horizm.incl" ?></td>
<td></td>
</tr>
<tr valign="top">
<td width="20"></td>
<td width="130"><br>
insert left blocks


</td>
<td width="545"><br>

insert center blocks




</td>
<td><img src="gifs/img_demo.gif" alt="" width="226" height="197" border="0"><br>
<br>


insert right block


</td>
</tr>
</table>


for me its a nightmare. anyone can help me?

Last edited by thomasjojo; 06-10-04 at 04:18 PM. Reason: smile mixed up text
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 04:03 AM
can't edit multiple rows at the same time conundrum PHP 2 04-01-04 12:50 AM
need help writing script to let user edit thier html or php files pinochio53 PHP 14 12-15-03 07:26 AM
PHP theme selection script TMD PHP 2 09-22-03 03:43 AM
Make a theme Marko PHP 2 07-22-03 12:36 AM


All times are GMT -5. The time now is 05:01 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.