iGuest 3 Report post Posted January 13, 2005 Create a file with your content and no layout, rename the $inccontent varliable to point to this page. In this file ensure that the edit file is included at 'filename'.php?page=secure&a=sitelayout Create setup.php to connect to db (edit login) and the table called 'section' (below) Create the edit file: sitelayout.php (below). If you use this, Please link back to my site at http://forums.xisto.com/no_longer_exists/,'>http://forums.xisto.com/no_longer_exists/, as this system took me a lot of time to make Name the following file index.php Navigate to this file. <?PHP/* Check User Session (if you require sessions for your login script - do it here, if not delete these 2 lines */session_start(); // Start Session/*---------------------------*///include global file, establishes connection to databaseinclude 'setup.php';$inccontent = "contentfunction.php";$sectionarea = $_GET['page'];$title = "YOUR TITLE HERE";/*--------------------------*///includes required for content file/*--------------------------*///aliases required for content file$a = $_GET['a'];$b = $_GET['b'];$c = $_GET['c'];$id = $_GET['id'];$cat = $_GET['cat'];$p = $_GET['p'];$num = $_GET['num'];$secure = $_GET['secure'];$logout = $_GET['logout'];$register = $_GET['register'];$lostpw = $_GET['lostpw'];$limit = $_GET['limit'];$user = $_GET['user'];$phpself = $_SERVER['PHP_SELF'];/*-- Assign Shown sections --*/?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://forums.xisto.com/no_longer_exists/ xmlns="http://forums.xisto.com/no_longer_exists/ http-equiv="content-type"content="text/html; charset=ISO-8859-1" /><link rel="icon" href="favicon.ico" /><link rel="shortcut icon" href="favicon.ico" /><title>echo $title.' - '.$sectionarea; ?></title><style type="text/css">/*<![CDATA[*/<?$section = 1;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$top = $yes['top'];}$section = 0;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$bg = $yes['bgcolor'];}?>body { background-color: #<? echo "$bg"; ?>; margin:<? echo "$top"; ?>; padding:0px; /* Need to set body margin and padding to get consistency between browsers. */ padding-top: 0px; padding-bottom: 0px; text-align:center; /* Hack for IE5/Win */ height:100%; }td,body { font-family: Arial, Helvetica, sans-serif; font-size: 12px;}a:link {color: #444488; font-family: arial, helvetica, sans-serif; font-weight: bold; font-size: 13px; text-decoration: underline; background-color : transparent; } a:visited {color: #444477; font-family: arial, helvetica, sans-serif; font-weight: bold; font-size: 13px; text-decoration: underline; background-color : transparent; } a:active {color: #000000; font-family: arial, helvetica, sans-serif; font-weight: bold; font-size: 13px; text-decoration: none; background-color : transparent; } a:hover { font-family:arial, helvetica, sans-serif; font-weight: bold; font-size: 13px;color: #662323; cursor: hand; } div#container {<?$section = 1;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$cwidth = $yes['width'];$height = $yes['height'];$bg = $yes['bgcolor'];$left = $yes['left'];$top = $yes['top'];$bordercolor = $yes['border_color'];$borderstyle = $yes['border_style'];$borderwidth = $yes['border_width'];}?> min-width: 650px; width: <? echo "$cwidth"; ?>; height: <? echo "$height"; ?>; background-color: #<? echo "$bg"; ?>; margin:0px auto; /* Right and left margin widths set to "auto" */ text-align:left; /* Counteract to IE5/Win Hack */ padding:1px; border-color: #<? echo "$bordercolor"; ?>; border-style: <? echo "$borderstyle"; ?>; border-width: <? echo "$borderwidth"; ?>;} div#header {<?$section = 2;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$display_2 = $yes['display'];$text_2 = $yes['content'];$width = $yes['width'];$height = $yes['height'];$bg = $yes['bgcolor'];$left = $yes['left'];$top = $yes['top'];$bordercolor = $yes['border_color'];$borderstyle = $yes['border_style'];$borderwidth = $yes['border_width'];$borderbottom = $yes['border_bottom'];}?> position: relative; min-width: 700px; width:<? echo "$width"; ?>; height:<? echo "$height"; ?>; background-color: #<? echo "$bg"; ?>; left:<? echo "$left"; ?>; top: <? echo "$top"; ?>; border-color: #<? echo "$bordercolor"; ?>; border-style: <? echo "$borderstyle"; ?>; border-width: <? echo "$borderwidth"; ?>; border-bottom-width: <? echo "$borderbottom"; ?>;<!--background:url("") no-repeat; --> }font.nav-top { font: 9pt verdana; color: #FFFFCC;} div#nav-top { position: relative;<?$section = 3;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$display_3 = $yes['display'];$text_3 = $yes['content'];$content_3 = $yes['show_content'];$nav_3 = $yes['show_nav'];$width = $yes['width'];$height = $yes['height'];$bg = $yes['bgcolor'];$left = $yes['left'];$top = $yes['top'];$bordercolor = $yes['border_color'];$borderstyle = $yes['border_style'];$borderwidth = $yes['border_width'];$borderbottom = $yes['border_bottom']; }?> min-width: 650px; width:<? echo "$width"; ?>; height:<? echo "$height"; ?>; background-color: #<? echo "$bg"; ?>; left:<? echo "$left"; ?>; top: <? echo "$top"; ?>; border-color: #<? echo "$bordercolor"; ?>; border-style: <? echo "$borderstyle"; ?>; border-width: <? echo "$borderwidth"; ?>; border-bottom-width: <? echo "$borderbottom"; ?>; } div#footer {<?$section = 7;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$display_7 = $yes['display'];$text_7 = $yes['content'];$width = $yes['width'];$height = $yes['height'];$bg = $yes['bgcolor'];$left = $yes['left'];$top = $yes['top'];$bordercolor = $yes['border_color'];$borderstyle = $yes['border_style'];$borderwidth = $yes['border_width'];$borderbottom = $yes['border_bottom'];}?> position: relative; min-width: 650px; width:<? echo "$width"; ?>; height:<? echo "$height"; ?>; background-color: #<? echo "$bg"; ?>; left:<? echo "$left"; ?>; top: <? echo "$top"; ?>; border-color: #<? echo "$bordercolor"; ?>; border-style: <? echo "$borderstyle"; ?>; border-width: <? echo "$borderwidth"; ?>; border-bottom-width: <? echo "$borderbottom"; ?>; line-height: 15pt; text-align: right; }<?////set distance from navtop for nav / middle / right.$section = 4;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$top = $yes['top'];}?>div#main {position: relative;}.main {position: relative;width: 100%;top: <? echo "$top"; ?>;left:0px;right: 0px; }font.left { font: 9pt verdana; color: #111133;}td.left{<?$section = 4;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$display_4 = $yes['display'];$text_4 = $yes['content'];$content_4 = $yes['show_content'];$nav_4 = $yes['show_nav'];$width = $yes['width'];$height = $yes['height'];$bg = $yes['bgcolor'];$left = $yes['left'];$bordercolor = $yes['border_color'];$borderstyle = $yes['border_style'];$borderwidth = $yes['border_width'];}?> width:<? echo "$width"; ?>; height:<? echo "$height"; ?>; background-color: #<? echo "$bg"; ?>; vertical-align:top;background:url("") repeat-y; border-color: #<? echo "$bordercolor"; ?>; border-style: <? echo "$borderstyle"; ?>; border-width: <? echo "$borderwidth"; ?>;}.left{ width:100%; vertical-align:top; padding-left: <? echo "$left"; ?>;}td.right{<?$section = 6;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$display_6 = $yes['display'];$text_6 = $yes['content'];$content_6 = $yes['show_content'];$nav_6 = $yes['show_nav'];$width = $yes['width'];$height = $yes['height'];$bg = $yes['bgcolor'];$top = $yes['top'];$bordercolor = $yes['border_color'];$borderstyle = $yes['border_style'];$borderwidth = $yes['border_width'];}?> width:<? echo "$width"; ?>; height:<? echo "$height"; ?>; background-color: #<? echo "$bg"; ?>; vertical-align:top; padding: <? echo "$top"; ?>;background:url("") repeat-y; border-color: #<? echo "$bordercolor"; ?>; border-style: <? echo "$borderstyle"; ?>; border-width: <? echo "$borderwidth"; ?>;}.right{ width:100%; vertical-align:top;}td.middle {<?$section = 5;$section = mysql_query("SELECT * FROM section WHERE id='$section'");while($yes=mysql_fetch_array($section)) {$display_5 = $yes['display'];$text_5 = $yes['content'];$content_5 = $yes['show_content'];$nav_5 = $yes['show_nav'];$width = $yes['width'];$height = $yes['height'];$bg = $yes['bgcolor'];$left = $yes['left'];$top = $yes['top'];$bordercolor = $yes['border_color'];$borderstyle = $yes['border_style'];$borderwidth = $yes['border_width'];}?> position: relative; width:<? echo "$width"; ?>; height:<? echo "$height"; ?>; background-color: #<? echo "$bg"; ?>; vertical-align: top; padding: <? echo "$top"; ?>; border-color: #<? echo "$bordercolor"; ?>; border-style: <? echo "$borderstyle"; ?>; border-width: <? echo "$borderwidth"; ?>;}.middle{ width:100%; vertical-align:top; }/*]]>*/</style></head><body> <div id="container"> <? IF ($display_2 == 1) { print ' <div id="header">'."n";?> <!--Title--> <center><?print $text_2;?> </center> <!--Title--><?print ' </div>'."n"; }IF ($display_3 == 1) {print ' <div id="nav-top">'."n";print $text_3;IF ($nav_3 == 1) {print " <!--Navigation-->n";}?> <font class="nav-top"> </font><?print ' </div>'."n";}?> <!--Members Links--><div id="main"> <table class="main"> <!--DWLayoutTable--> <tr> <?IF ($display_4 == 1) { print' <td class="left">'."n";print' <table class="left">'."n";print ' <tr><td>'."n";print $text_4;IF ($nav_4 == 1) {print " <!--Navigation-->n";}?><!-----><?if ($content_4 == 1) {/*---------------------------*///include contentinclude $inccontent;/*--------------------------*/}?><?print ' </td></tr>'."n";print ' </table>'."n";print ' </td>'."n";} IF ($display_5 == 1) { print' <td class="middle">'."n";print' <table class="middle">'."n";print ' <tr><td>'."n";print $text_5;?> <!--middle--><?if ($content_5 == 1) {/*---------------------------*///include contentinclude $inccontent;/*--------------------------*/}?><!--middle--> <?print ' </td></tr>'."n";print ' </table>'."n";print ' </td>'."n";}if ($display_6 == 1) {print ' <td class="right">'."n";print' <table class="right">'."n";print ' <tr><td>'."n";print $text_6;IF ($nav_6 == 1) {print " <!--Navigation-->n";}?><!----><?if ($content_6 == 1) {/*---------------------------*///include contentinclude $inccontent;/*--------------------------*/}print ' </td></tr>'."n";print ' </table>'."n";print ' </td> '."n";}?> </tr> </table></div><?if ($display_7 == 1) {print ' <div id="footer"> '."n";?> <font class="yellow"><?print $text_7;?> </font><?print ' </div>'."n";}?> </div></body></html> Create the following table in phpmyadmin: CREATE TABLE `section` ( `id` tinyint(2) NOT NULL default '0', `section` varchar(10) NOT NULL default '', `display` enum('0','1') NOT NULL default '1', `show_content` enum('0','1') NOT NULL default '0', `show_nav` enum('0','1') NOT NULL default '0', `bgcolor` varchar(7) NOT NULL default 'FFFFFF', `height` varchar(5) NOT NULL default 'auto', `width` varchar(5) NOT NULL default 'auto', `left` varchar(5) NOT NULL default '', `top` varchar(5) default NULL, `border_width` char(3) NOT NULL default '1px', `border_bottom` varchar(5) default NULL, `border_color` varchar(6) NOT NULL default '000000', `border_style` varchar(10) NOT NULL default 'solid', `include` varchar(5) default NULL) TYPE=MyISAM;-- -- Dumping data for table `section`-- INSERT INTO `section` VALUES (1, 'container', '0', '0', '0', 'bdc7ce', 'auto', '80%', '', '20px', '1px', NULL, '000000', 'solid', '');INSERT INTO `section` VALUES (2, 'header', '0', '0', '0', 'FCFCFC', '75px', '100%', '0%', '0px', '0px', '1px', '000000', 'solid', '');INSERT INTO `section` VALUES (3, 'nav top', '1', '0', '1', 'bdc7ce', '25px', '100%', '0%', '0px', '0px', '0px', '000000', 'solid', '');INSERT INTO `section` VALUES (4, 'left', '1', '0', '0', 'FFFFFF', '560px', '82px', '', '2px', '1px', NULL, '000000', 'solid', '');INSERT INTO `section` VALUES (5, 'middle', '1', '1', '0', 'FFFFFF', 'auto', ' auto', '', '6px', '1px', NULL, '000000', 'solid', '');INSERT INTO `section` VALUES (6, 'right', '1', '0', '0', 'FFFFFF', '100px', '82px', '', '2px', '1px', NULL, '000000', 'solid', '');INSERT INTO `section` VALUES (7, 'footer', '1', '0', '0', 'bdc7ce', '20px', '100%', '0%', '2px', '0px', '1px', '000000', 'solid', '');INSERT INTO `section` VALUES (0, 'body', '1', '0', '0', '999999', 'auto', 'auto', '', NULL, '', NULL, '', '', NULL); Create setup.php to connect to db and edit values //set database connection variables$hostname='localhost';$uname='';$password='';$database='';//establish database connection$connect = mysql_connect($hostname,$uname,$password); Create the edit file.. Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 13, 2005 <? /*---------------------------*/ //either include in the filename or include setup.php, ensure established connection to database $submit = $_GET['submit']; $update = $_GET['update']; $confirm = $_GET['confirm']; $display_ = $_POST['display']; if(isset($display_)) { $display_ = 1; } else { $display_ = 0; } $bg_ = $_POST['bg']; $width_ = $_POST['width']; $height_ = $_POST['height']; $left_ = $_POST['left']; $padding_ = $_POST['padding']; $border_width_ = $_POST['border_width']; $border_bottom_ = $_POST['border_bottom']; //// //features// $contentarea_ = $_POST['contentarea']; $navarea_ = $_POST['navarea']; //Spacing/// $spacing1_ = $_POST['spacing1']; $spacing2_ = $_POST['spacing2']; $spacing3_ = $_POST['spacing3']; $spacing4_ = $_POST['spacing4']; $bgbody_ = $_POST['bgbody']; $bg1_ = $_POST['bg1']; $bg2_ = $_POST['bg2']; $bg3_ = $_POST['bg3']; $bg4_ = $_POST['bg4']; $bg5_ = $_POST['bg5']; $bg6_ = $_POST['bg6']; $bg7_ = $_POST['bg7']; $backupfilename_ = $_POST['backupfilename']; $resetname_ = $_POST['resetname']; //// $edit = mysql_query("SELECT * FROM section WHERE section='container'"); while($row=mysql_fetch_array($edit)) { $bg = $row["bgcolor"]; $width = $row['width']; $height = $row['height']; $left = $row['left']; $padding = $row['top']; $border_width = $row['border_width']; $border_bottom = $row['border_bottom']; } $editlayout_1 = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editlayout_1" method="post" action="?page=secure&a=sitelayout&submit=2&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Container Setup</td> <td width="78%"><!----></td> </tr> <tr> <td width="22%">Background</td> <td width="78%"><input name="bg" type="text" id="bg" value="$bg"></td> </tr> <tr> <td width="22%">width</td> <td width="78%"><input name="width" type="text" id="width" value="$width"></td> </tr> <tr> <td width="22%">height</td> <td width="78%"><input name="height" type="text" id="height" value="$height"></td> </tr> <tr> <td width="22%">Align</td> <td width="78%"> <select name="exportformat" size="1"> <option value='1' selected>Center</option> <option value='2'>Left</option> <option value='3' >Right</option> </td> </tr> <tr> <td width="22%">Padding</td> <td width="78%"><input name="padding" type="text" id="padding" value="$padding"></td> </tr> <tr> <td width="22%">Border Width</td> <td width="78%"><input name="border_width" type="text" id="border_width" value="$border_width"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT * FROM section WHERE section='header'"); while($row=mysql_fetch_array($edit)) { $display = $row['display']; if($display == 1) { $value = "value="1" CHECKED"; } else { $value = "value="0" UNCHECKED"; } $bg = $row["bgcolor"]; $width = $row['width']; $height = $row['height']; $padding = $row['top']; $border_width = $row['border_width']; $border_bottom = $row['border_bottom']; } $editlayout_2 = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editlayout_2" method="post" action="?page=secure&a=sitelayout&submit=3&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Header Setup</td> <td width="78%"><!----></td> </tr> <tr> <td>Display Header</td><td><input type="checkbox" name="display" $value></td> </tr> <tr> <td width="22%">Background</td> <td width="78%"><input name="bg" type="text" id="bg" value="$bg"></td> </tr> <tr> <td width="22%">width</td> <td width="78%"><input name="width" type="text" id="width" value="$width"></td> </tr> <tr> <td width="22%">height</td> <td width="78%"><input name="height" type="text" id="height" value="$height"></td> </tr> <tr> <td width="22%">Padding</td> <td width="78%"><input name="padding" type="text" id="padding" value="$padding"></td> </tr> <tr> <td width="22%">Border Width</td> <td width="78%"><input name="border_width" type="text" id="border_width" value="$border_width"></td> </tr> <tr> <td width="22%">Bottom Border Width</td> <td width="78%"><input name="border_bottom" type="text" id="border_bottom" value="$border_bottom"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT * FROM section WHERE section='nav top'"); while($row=mysql_fetch_array($edit)) { $display = $row['display']; if($display == 1) { $value = "value="1" CHECKED"; } else { $value = "value="0" UNCHECKED"; } $bg = $row["bgcolor"]; $width = $row['width']; $height = $row['height']; $padding = $row['top']; $border_width = $row['border_width']; $border_bottom = $row['border_bottom']; } $editlayout_3 = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editlayout_3" method="post" action="?page=secure&a=sitelayout&submit=4&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Top Setup</td> <td width="78%"><!----></td> </tr> <tr> <td>Display Top</td><td><input type="checkbox" name="display" $value></td> <tr> <td width="22%">Background</td> <td width="78%"><input name="bg" type="text" id="bg" value="$bg"></td> </tr> <tr> <td width="22%">width</td> <td width="78%"><input name="width" type="text" id="width" value="$width"></td> </tr> <tr> <td width="22%">height</td> <td width="78%"><input name="height" type="text" id="height" value="$height"></td> </tr> <tr> <td width="22%">Padding</td> <td width="78%"><input name="padding" type="text" id="padding" value="$padding"></td> </tr> <tr> <td width="22%">Border Width</td> <td width="78%"><input name="border_width" type="text" id="border_width" value="$border_width"></td> </tr> <tr> <td width="22%">Bottom Border Width</td> <td width="78%"><input name="border_bottom" type="text" id="border_bottom" value="$border_bottom"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT * FROM section WHERE section='left'"); while($row=mysql_fetch_array($edit)) { $display = $row['display']; if($display == 1) { $value = "value="1" CHECKED"; } else { $value = "value="0" UNCHECKED"; } $bg = $row["bgcolor"]; $width = $row['width']; $height = $row['height']; $left = $row['left']; $padding = $row['top']; $border_width = $row['border_width']; $border_bottom = $row['border_bottom']; } $editlayout_4 = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editlayout_4" method="post" action="?page=secure&a=sitelayout&submit=5&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Left Setup</td> <td width="78%"><!----></td> </tr> <tr> <td>Display Left</td><td><input type="checkbox" name="display" $value></td> <tr> <td width="22%">Background</td> <td width="78%"><input name="bg" type="text" id="bg" value="$bg"></td> </tr> <tr> <td width="22%">width</td> <td width="78%"><input name="width" type="text" id="width" value="$width"></td> </tr> <tr> <td width="22%">height</td> <td width="78%"><input name="height" type="text" id="height" value="$height"></td> </tr> <tr> <td width="22%">Top Padding</td> <td width="78%"><input name="padding" type="text" id="padding" value="$padding"></td> </tr> <tr> <td width="22%">Border Width</td> <td width="78%"><input name="border_width" type="text" id="border_width" value="$border_width"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT * FROM section WHERE section='middle'"); while($row=mysql_fetch_array($edit)) { $display = $row['display']; if($display == 1) { $value = "value="1" CHECKED"; } else { $value = "value="0" UNCHECKED"; } $bg = $row["bgcolor"]; $width = $row['width']; $height = $row['height']; $padding = $row['top']; $border_width = $row['border_width']; $border_bottom = $row['border_bottom']; } $editlayout_5 = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editlayout_5" method="post" action="?page=secure&a=sitelayout&submit=6&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Middle Setup</td> <td width="78%"><!----></td> </tr> <tr> <td>Display Middle</td><td><input type="checkbox" name="display" $value></td> <tr> <td width="22%">Background</td> <td width="78%"><input name="bg" type="text" id="bg" value="$bg"></td> </tr> <tr> <td width="22%">width</td> <td width="78%"><input name="width" type="text" id="width" value="$width"></td> </tr> <tr> <td width="22%">height</td> <td width="78%"><input name="height" type="text" id="height" value="$height"></td> </tr> <tr> <td width="22%">Left padding</td> <td width="78%"><input name="padding" type="text" id="padding" value="$padding"></td> </tr> <tr> <td width="22%">Border Width</td> <td width="78%"><input name="border_width" type="text" id="border_width" value="$border_width"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT * FROM section WHERE section='right'"); while($row=mysql_fetch_array($edit)) { $display = $row['display']; if($display == 1) { $value = "value="1" CHECKED"; } else { $value = "value="0" UNCHECKED"; } $bg = $row["bgcolor"]; $width = $row['width']; $height = $row['height']; $padding = $row['top']; $border_width = $row['border_width']; $border_bottom = $row['border_bottom']; } $editlayout_6 = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editlayout_6" method="post" action="?page=secure&a=sitelayout&submit=7&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Right Setup</td> <td width="78%"><!----></td> </tr> <tr> <td>Display Right</td><td><input type="checkbox" name="display" $value></td> <tr> <td width="22%">Background</td> <td width="78%"><input name="bg" type="text" id="bg" value="$bg"></td> </tr> <tr> <td width="22%">width</td> <td width="78%"><input name="width" type="text" id="width" value="$width"></td> </tr> <tr> <td width="22%">height</td> <td width="78%"><input name="height" type="text" id="height" value="$height"></td> </tr> <tr> <td width="22%">Left Padding</td> <td width="78%"><input name="padding" type="text" id="padding" value="$padding"></td> </tr> <tr> <td width="22%">Border Width</td> <td width="78%"><input name="border_width" type="text" id="border_width" value="$border_width"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT * FROM section WHERE section='footer'"); while($row=mysql_fetch_array($edit)) { $display = $row['display']; if($display == 1) { $value = "value="1" CHECKED"; } else { $value = "value="0" UNCHECKED"; } $bg = $row["bgcolor"]; $width = $row['width']; $height = $row['height']; $padding = $row['top']; $border_width = $row['border_width']; $border_bottom = $row['border_bottom']; } $editlayout_7 = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editlayout_7" method="post" action="?page=secure&a=sitelayout&submit=8&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Footer Setup</td> <td width="78%"><!----></td> </tr> <tr> <td>Display footer</td><td><input type="checkbox" name="display" $value></td> <tr> <td width="22%">Background</td> <td width="78%"><input name="bg" type="text" id="bg" value="$bg"></td> </tr> <tr> <td width="22%">width</td> <td width="78%"><input name="width" type="text" id="width" value="$width"></td> </tr> <tr> <td width="22%">height</td> <td width="78%"><input name="height" type="text" id="height" value="$height"></td> </tr> <tr> <td width="22%">Padding</td> <td width="78%"><input name="padding" type="text" id="padding" value="$padding"></td> </tr> <tr> <td width="22%">Border Width</td> <td width="78%"><input name="border_width" type="text" id="border_width" value="$border_width"></td> </tr> <tr> <td width="22%">Bottom Border Width</td> <td width="78%"><input name="border_bottom" type="text" id="border_bottom" value="$border_bottom"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $editfeature = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="editfeature" method="post" action="?page=secure&a=sitelayout&submit=9&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Feature Setup</td> <td width="78%"><!----></td> </tr> <tr> <td width="22%">Content Area</td> </td> <td> <select name="contentarea" size="1"> <option value='1' selected >Middle Column</option> <option value='2'>Left Column</option> <option value='3' >Right Column</option> </td> <tr> <tr> <td width="22%">Navigation Area</td> </td> <td> <select name="navarea" size="1"> <option value='1' selected >Top Nav bar</option> <option value='2'>Left Nav bar</option> <option value='3' >Right Nav bar</option> </td> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT top FROM section WHERE section='container'"); while($row=mysql_fetch_array($edit)) { $spacing1 = $row['top']; } $edit = mysql_query("SELECT top FROM section WHERE section='nav top'"); while($row=mysql_fetch_array($edit)) { $spacing2 = $row['top']; } $edit = mysql_query("SELECT top FROM section WHERE section='left'"); while($row=mysql_fetch_array($edit)) { $spacing3 = $row['top']; } $edit = mysql_query("SELECT top FROM section WHERE section='footer'"); while($row=mysql_fetch_array($edit)) { $spacing4 = $row['top']; } $editspacing = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="spacing1" method="post" action="?page=secure&a=sitelayout&submit=spacing&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Verticle Spacings</td> <td width="78%"><!----></td> </tr> <tr> <td width="22%">Screen spacing</td> <td width="78%"><input name="spacing1" type="text" id="bg" value="$spacing1"></td> </tr> <tr> <td width="22%">Top bar to header</td> <td width="78%"><input name="spacing2" type="text" id="width" value="$spacing2"></td> </tr> <tr> <td width="22%">Middle to above table</td> <td width="78%"><input name="spacing3" type="text" id="height" value="$spacing3"></td> </tr> <tr> <td width="22%">footer to middle</td> <td width="78%"><input name="spacing4" type="text" id="top" value="$spacing4"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $edit = mysql_query("SELECT bgcolor FROM section WHERE section='body'"); while($row=mysql_fetch_array($edit)) { $bgbody = $row['bgcolor']; } $edit = mysql_query("SELECT bgcolor FROM section WHERE section='container'"); while($row=mysql_fetch_array($edit)) { $bg1 = $row['bgcolor']; } $edit = mysql_query("SELECT bgcolor FROM section WHERE section='header'"); while($row=mysql_fetch_array($edit)) { $bg2 = $row['bgcolor']; } $edit = mysql_query("SELECT bgcolor FROM section WHERE section='nav top'"); while($row=mysql_fetch_array($edit)) { $bg3 = $row['bgcolor']; } $edit = mysql_query("SELECT bgcolor FROM section WHERE section='left'"); while($row=mysql_fetch_array($edit)) { $bg4 = $row['bgcolor']; } $edit = mysql_query("SELECT bgcolor FROM section WHERE section='middle'"); while($row=mysql_fetch_array($edit)) { $bg5 = $row['bgcolor']; } $edit = mysql_query("SELECT bgcolor FROM section WHERE section='right'"); while($row=mysql_fetch_array($edit)) { $bg6 = $row['bgcolor']; } $edit = mysql_query("SELECT bgcolor FROM section WHERE section='footer'"); while($row=mysql_fetch_array($edit)) { $bg7 = $row['bgcolor']; } $editcolour = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="colour" method="post" action="?page=secure&a=sitelayout&submit=colour&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Adjust Colour Scheme</td> <td width="78%"><!----></td> </tr> <tr> <td width="22%">Body</td> <td width="78%"><input name="bgbody" type="text" id="bgbody" value="$bgbody"></td> </tr> <tr> <td width="22%">Container</td> <td width="78%"><input name="bg1" type="text" id="bg1" value="$bg1"></td> </tr> <tr> <td width="22%">Header</td> <td width="78%"><input name="bg2" type="text" id="bg2" value="$bg2"></td> </tr> <tr> <td width="22%">Top Nav</td> <td width="78%"><input name="bg3" type="text" id="bg3" value="$bg3"></td> </tr> <tr> <td width="22%">Left</td> <td width="78%"><input name="bg4" type="text" id="bg4" value="$bg4"></td> </tr> <tr> <td width="22%">Middle</td> <td width="78%"><input name="bg5" type="text" id="bg5" value="$bg5"></td> </tr> <tr> <td width="22%">Right</td> <td width="78%"><input name="bg6" type="text" id="bg6" value="$bg6"></td> </tr> <tr> <td width="22%">Footer</td> <td width="78%"><input name="bg7" type="text" id="bg7" value="$bg7"></td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $backupform = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="backupform" method="post" action="?page=secure&a=sitelayout&submit=backup&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Backup Current Settings</td> <td width="78%"><!----></td> </tr> <tr> <td width="22%">Filename</td> <td width="78%"><input name="backupfilename" type="text" id="backupfilename" value="$backupfilename"></td> </tr> <tr> <td width="22%">Export</td> <td width="78%"> <select name="exportformat" size="1"> <option value='1' selected >To Browser</option> <option value='2'>To HDD DIR</option> <option value='3' >To FTP</option> </td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; $resetform = <<<HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <form name="resetform" method="post" action="?page=secure&a=sitelayout&submit=reset&update=1"> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td width="22%">Reset Settings</td> <td width="78%"><!----></td> </tr> <tr> <td width="22%">Filename</td> <td width="78%"><input name="backupname" type="text" id="bg" value="$resetname"></td> </tr> <tr> <td width="22%">Date</td> <td width="78%"><input name="resetdate" type="text" id="width" value="$resetdate"></td> </tr> <tr> <td width="22%">Import</td> <td width="78%"> <select name="importformat" size="1"> <option value='1' selected >From Browser</option> <option value='2'>From HDD DIR</option> <option value='3' >From FTP</option> </td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table> </form> <br> HTML; ?><br><hr><? ////////// if(isset($submit)) { /// if($submit == 1) { print $editlayout_1; } if($submit == 2) { If(isset($update)) { mysql_query("UPDATE section SET display='{$display_}',bgcolor='{$bg_}',width='{$width_}',height='{$height_}',top='{$padding_}',border_width='{$border_width_}' WHERE section='container'"); print 'Container Successfully Edited<br>'; } print $editlayout_2; } if($submit == 3) { If(isset($update)) { mysql_query("UPDATE section SET display='{$display_}',bgcolor='{$bg_}',width='{$width_}',height='{$height_}',top='{$padding_}',border_width='{$border_width_}',border_bottom='{$border_bottom_}' WHERE section='header'"); print 'Header Successfully Edited<br>'; } print $editlayout_3; } if($submit == 4) { If(isset($update)) { mysql_query("UPDATE section SET display='{$display_}',bgcolor='{$bg_}',width='{$width_}',height='{$height_}',top='{$padding_}',border_width='{$border_width_}',border_bottom='{$border_bottom_}' WHERE section='nav top'"); print 'Nav Top Successfully Edited<br>'; } print $editlayout_4; } if($submit == 5) { If(isset($update)) { mysql_query("UPDATE section SET display='{$display_}',bgcolor='{$bg_}',height='{$height_}',width='{$width_}',top='{$padding_}',border_width='{$border_width_}' WHERE section='left'"); print 'left Successfully Edited<br>'; } print $editlayout_5; } if($submit == 6) { If(isset($update)) { mysql_query("UPDATE section SET display='{$display_}',bgcolor='{$bg_}',width='{$width_}',height='{$height_}',top='{$padding_}',border_width='{$border_width_}' WHERE section='middle'"); print 'Middle Successfully Edited<br>'; } print $editlayout_6; } if($submit == 7) { If(isset($update)) { mysql_query("UPDATE section SET display='{$display_}',bgcolor='{$bg_}',width='{$width_}',height='{$height_}',top='{$padding_}',border_width='{$border_width_}' WHERE section='right'"); print 'Right Successfully Edited<br>'; } print $editlayout_7; } if($submit == 8) { If(isset($update)) { mysql_query("UPDATE section SET display='{$display_}',bgcolor='{$bg_}',width='{$width_}',height='{$height_}',top='{$padding_}',border_width='{$border_width_}',border_bottom='{$border_bottom_}' WHERE section='footer'"); print 'Footer Successfully Edited<br>'; } print $editfeature; } if($submit == 9) { If(isset($update)) { /// if($contentarea_ == 1) { mysql_query("UPDATE section SET show_content='1' WHERE section='middle'"); mysql_query("UPDATE section SET show_content='0' WHERE section='left'"); mysql_query("UPDATE section SET show_content='0' WHERE section='right'"); print 'Content section assigned: Middle <br>'; mysql_query("UPDATE section SET display='1' WHERE section='middle'"); } if($contentarea_ == 2) { mysql_query("UPDATE section SET show_content='0' WHERE section='middle'"); mysql_query("UPDATE section SET show_content='1' WHERE section='left'"); mysql_query("UPDATE section SET show_content='0' WHERE section='right'"); print 'Content section assigned: Left <br>'; mysql_query("UPDATE section SET display='1' WHERE section='left'"); } if($contentarea_ == 3) { mysql_query("UPDATE section SET show_content='0' WHERE section='middle'"); mysql_query("UPDATE section SET show_content='0' WHERE section='left'"); mysql_query("UPDATE section SET show_content='1' WHERE section='right'"); print 'Content section assigned: Right <br>'; mysql_query("UPDATE section SET display='1' WHERE section='right'"); } if($navarea_ == 1) { mysql_query("UPDATE section SET show_nav='1' WHERE section='nav top'"); mysql_query("UPDATE section SET show_nav='0' WHERE section='left'"); mysql_query("UPDATE section SET show_nav='0' WHERE section='right'"); print 'Nav section assigned: Top <br>'; } if($navarea_ == 2) { mysql_query("UPDATE section SET show_nav='0' WHERE section='nav top'"); mysql_query("UPDATE section SET show_nav='1' WHERE section='left'"); mysql_query("UPDATE section SET show_nav='0' WHERE section='right'"); print 'Nav section assigned: Left <br>'; } if($navarea_ == 3) { mysql_query("UPDATE section SET show_nav='0' WHERE section='nav top'"); mysql_query("UPDATE section SET show_nav='0' WHERE section='left'"); mysql_query("UPDATE section SET show_nav='1' WHERE section='right'"); print 'Nav section assigned: Right <br>'; } //// } } if($submit == colour) { If(isset($update)) { mysql_query("UPDATE section SET bgcolor='{$bgbody_}' WHERE section='body'"); mysql_query("UPDATE section SET bgcolor='{$bg1_}' WHERE section='container'"); mysql_query("UPDATE section SET bgcolor='{$bg2_}' WHERE section='header'"); mysql_query("UPDATE section SET bgcolor='{$bg3_}' WHERE section='nav top'"); mysql_query("UPDATE section SET bgcolor='{$bg4_}' WHERE section='left'"); mysql_query("UPDATE section SET bgcolor='{$bg5_}' WHERE section='middle'"); mysql_query("UPDATE section SET bgcolor='{$bg6_}' WHERE section='right'"); mysql_query("UPDATE section SET bgcolor='{$bg7_}' WHERE section='footer'"); print 'Updated Colour Scheme<br>'; } else { print $editcolour; } } if($submit == border) { print "updating borders..."; } if($submit == spacing) { If(isset($update)) { mysql_query("UPDATE section SET top='{$spacing1_}' WHERE section='container'"); mysql_query("UPDATE section SET top='{$spacing2_}' WHERE section='nav top'"); mysql_query("UPDATE section SET top='{$spacing3_}' WHERE section='left'"); mysql_query("UPDATE section SET top='{$spacing4_}' WHERE section='footer'"); print 'Verticle Spacings Successfully Edited<br>'; } else { print $editspacing; } } if($submit == 13) { /// If(isset($update)) { print 'saved data to...<br>'; } } if($submit == upload) { if ($_POST["action"]=="upload"){ $file=$HTTP_POST_FILES["file"]; $tmp_name=$file["tmp_name"]; $new_name=$_SERVER["DOCUMENT_ROOT"].'/upload/'.$file["name"]; move_uploaded_file($tmp_name, $new_name); } ?> <form enctype="multipart/form-data" action="?page=secure&a=sitelayout&submit=upload" method="post"> Choose a file: <input type="file" name="file" /> <input type="hidden" name="MAX_FILE_SIZE" value="1048576" /><br /> <input type="hidden" name="action" value="upload" /> <input type="submit" name="submit" value="Upload!" /> </form> <? } if($submit == reset) { if($confirm == 1) { print $resetform; } else { ?> Really reset? <a href="?page=secure&a=sitelayout&submit=reset&confirm=1">Yes</a> || <a href="?">No</a><br><br> <a href="?page=secure&a=sitelayout&submit=backup">backup first?</a><br> <? } If(isset($update)) { print "Failed backup"; print 'Reset data from $resetname_<br>'; } } if($submit == backup) { print $backupform; If(isset($update)) { //////// define("AUTO_QUOTE",get_magic_quotes_gpc()); # configuration $db_name = "$dbname"; $file = $backupfilename_; # blank to output to the screen $create_tables = true; # add "CREATE TABLE" syntax at the begining of the script $database = "$dbname"; function _dump_table($table_name){ $sql = mysql_query("select * from ". $table_name); $dump = ""; while($row = mysql_fetch_assoc($sql)){ $keys = array_keys($row); $val = array_values($row); $len = count($keys); $dump .= "INSERT INTO ".$table_name." ("; for($i=0;$i < $len;$i++){ $comma = ($i+1 != $len)?",":""; $keys[$i] = (AUTO_QUOTE == 1)?addslashes($keys[$i]):$keys[$i]; $dump .= $keys[$i]. $comma; } $dump .= ") VALUES("; for($i=0;$i < $len;$i++){ $comma = ($i+1 != $len)?"',":"'"; $val[$i] = (AUTO_QUOTE == 1)?addslashes($val[$i]):$val[$i]; $dump .= "'".$val[$i]. $comma; } $dump .= ");n"; } return $dump; } function _create_table($table_name){ $sql = mysql_query("SHOW FIELDS FROM " . $table_name); $dump = "CREATE TABLE " .$table_name ."("; $i = 0; while($row = mysql_fetch_assoc($sql)){ $attrib = array_values($row); $keys = array_keys($row); $len = count($attrib); for($n=0;$n < $len;$n++){ $attrib[$n] = ($attrib[$n] == "PRI")?"PRIMARY KEY":$attrib[$n]; $attrib[$n] = ($attrib[$n] == "YES")?$keys[$n]:$attrib[$n]; $dump .= $attrib[$n] . " "; } $dump .= ($i+1 != $len)?",":""; $i++; } $dump .= ");n"; return $dump; } function _get_tables($db){ $sql = mysql_query("SHOW TABLES FROM ".$db); $i=0; while($row = mysql_fetch_assoc($sql)){ list($tables[$i++]) = array_values($row); } return $tables; } function _comments(){ $c = "nn"; return $c; } #header("Content-type: text/plainrn"); $tables = _get_tables($database); $add_table = ""; if($create_tables == true){ foreach($tables as $tab){ $addtable .= _create_table($tab); } $add_table .= "nn"; } if(!empty($file)){ $fp = fopen($file,"w"); fwrite($fp,$addtable); foreach($tables as $tab){ fwrite($fp,_dump_table($tab)); } fwrite($fp,_comments()); fclose($fp); echo "MySQL database saved into file ".$file; }else{ echo $addtable; foreach($tables as $tab){ echo _dump_table($tab); } echo _comments(); } //// } } ?> <hr> <a href="?page=secure&a=sitelayout">Edit Layout Menu</a><br> <? //// } else { /////////// ?> Sections:<br> <a href="?page=secure&a=sitelayout&submit=1">Edit Container</a> <br> <a href="?page=secure&a=sitelayout&submit=2">Edit Header</a><br> <a href="?page=secure&a=sitelayout&submit=3">Edit Top</a> <br> <a href="?page=secure&a=sitelayout&submit=4">Edit Left</a> <br> <a href="?page=secure&a=sitelayout&submit=5">Edit Middle</a> <br> <a href="?page=secure&a=sitelayout&submit=6">Edit right</a> <br> <a href="?page=secure&a=sitelayout&submit=7">Edit footer</a> <br> <hr> Settings:<br> <a href="?page=secure&a=sitelayout&submit=8">Assign Sections</a> <br> <a href="?page=secure&a=sitelayout&submit=colour">Edit Colours</a> <br> <a href="?page=secure&a=sitelayout&submit=spacing">Edit Spacing</a> <br> <br><br> <a href="?page=secure&a=sitelayout&submit=upload">Upload file</a><br> <a href="?page=secure&a=sit Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 it's work Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 14, 2005 lol, is that 'its a lot of work' or 'it works' Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 15, 2005 lol it didn't work for me tho:( Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 15, 2005 brad, pm me what didnt work about it and ill try and fix it. Share this post Link to post Share on other sites