Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Maintenance System.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Detox" data-source="post: 460836" data-attributes="member: 596"><p>Hello!</p><p></p><p>I need some professionals help on this and Im puzzled.</p><p></p><p>So I'm trying to re-create HoloCMS housekeeping Theme with BrainCMS and I know Brain is poorly coded but this is just for educational purpose. Once I get the assistance I'm looking for from this community. I am planing on releasing all my work to community as there is lot of new beginners.</p><p></p><p>Anyways with that being said let's begin.</p><p></p><p>So what matter what code I use, its not updating into the database and I'm puzzled. It's all here to look at.</p><p></p><p>Modified Code:</p><p></p><p>All of this is currently in my class.admin.php</p><p></p><p>[CODE=php]function checkMaintenance()</p><p> {</p><p> global $dbh;</p><p> if (isset($_POST['checkMaintenance']))</p><p> {</p><p> </p><p> $siteMode = $_POST['site_closed'];</p><p></p><p> }</p><p> $checkMaintenance = $dbh->prepare("UPDATE cms_site SET siteMode=:site_closed");</p><p> $checkMaintenance->bindParam();</p><p> $checkMaintenance->execute();</p><p></p><p> if ($checkMaintenance) {</p><p> Admin::succeed("Maintenance Mode Enabled");</p><p> }</p><p> </p><p> }[/CODE]</p><p></p><p>[CODE=php]public static function siteMode()</p><p> {</p><p> global $dbh;</p><p> if (isset($_POST['siteMode']))</p><p> {</p><p> if (!empty($_POST['siteMode']))</p><p> {</p><p> if (!empty($_POST['siteMode']))</p><p> {</p><p> $closedSite = $dbh->prepare("UPDATE cms_site(site_closed)</p><p> VALUES</p><p> (</p><p> :site_closed</p><p> )");</p><p> $closedSite->bindParam(':site_closed', $_POST['site_closed']);</p><p> $closedSite->execute();</p><p> Admin::succeed("Site Closed?");</p><p> }</p><p> else</p><p> {</p><p> Admin::error("Fuc*ing Messed Up");</p><p> return;</p><p> }</p><p> }</p><p> </p><p> }</p><p> }[/CODE]</p><p></p><p>[CODE=php]public static function UpdateSite()</p><p> {</p><p> global $dbh;</p><p> if (isset($_POST['update']))</p><p> {</p><p> $updateSite = $dbh->prepare("UPDATE cms_site SET</p><p> site_closed=:site_closed,</p><p> WHERE site_closed = :site_closed");</p><p> $updateSite->bindParam(':site_closed', $_POST['site_closed']);</p><p> $updateSite->execute();</p><p> Admin::succeed("I highly doubt this updated the database");</p><p> }</p><p> }[/CODE]</p><p></p><p>Here is my sitesettings.php</p><p></p><p>[CODE=php]<?php</p><p> include_once "includes/head.php";</p><p> include_once "includes/header.php";</p><p> //include_once "includes/navi.php";</p><p>?></p><p><table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'></p><p><tr> <td width='22%' valign='top' id='leftblock'></p><p><div></p><p><!-- LEFT CONTEXT SENSITIVE MENU --></p><p><?php include_once('includes/sitenavi.php'); ?></p><p><!-- / LEFT CONTEXT SENSITIVE MENU --></p><p></div></p><p></td></p><p><td width='78%' valign='top' id='rightblock'></p><p><div><!-- RIGHT CONTENT BLOCK --></p><p></p><p></p><p><form action="" method='POST' name='theAdminForm' id='theAdminForm'></p><p><div class='tableborder'></p><p><div class='tableheaderalt'>Turn your site on/off</div></p><p><?php admin::updateSite(); ?></p><p><table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'></p><p><tr></p><p><td class='tablerow1' width='40%' valign='middle'><b>Close Site</b><div class='graytext'>If enabled, your site will be closed and show a maintenance page to regular users. Administrators can still login through Housekeeping.</div></td></p><p><td class='tablerow2' width='60%' valign='middle'></p><p> <select name="update" class='dropdown'></p><p> <option name="siteMode" value='open'>Site Open</option></p><p> <option name="siteMode" value='closed'>Site Closed</option> </p><p> </select></p><p></td></p><p></tr></p><p></p><p><tr></p><p><tr><td align='center' class='tablesubheader' colspan='2' ><input type='submit' value='Apply' class='realbutton' accesskey='s'></td></tr></p><p></form></table></div><br /> </div><!-- / RIGHT CONTENT BLOCK --></p><p> </td></tr></p><p></table></p><p></div><!-- / OUTERDIV --></p><p><div align='center'><br /></p><p><?php</p><p>$mtime = explode(' ', microtime());</p><p>$totaltime = $mtime[0] + $mtime[1] - $starttime;</p><p>printf('Time: %.3f', $totaltime);</p><p>?></p><p></div></p><p></p><p></p><p> <?php</p><p> include_once "includes/footer.php";</p><p> include_once "includes/script.php";</p><p> ?> [/CODE]</p><p></p><p>And yes to change the respect name class and in this following section of the code.</p><p></p><p>[CODE=php] <select name="update" class='dropdown'></p><p></p><p> <option name="siteMode" value='open'>Site Open</option></p><p></p><p> <option name="siteMode" value='closed'>Site Closed</option> </p><p></p><p> </select>[/CODE]</p><p></p><p>Here is the MySQL structure Im using.</p><p></p><p>[ATTACH=full]10810[/ATTACH]</p><p></p><p>UPDATE:</p><p></p><p>I almost forgot. I do change the respect code for the function as well. </p><p></p><p>[CODE=php]<?php admin::updateSite(); ?>[/CODE]</p></blockquote><p></p>
[QUOTE="Detox, post: 460836, member: 596"] Hello! I need some professionals help on this and Im puzzled. So I'm trying to re-create HoloCMS housekeeping Theme with BrainCMS and I know Brain is poorly coded but this is just for educational purpose. Once I get the assistance I'm looking for from this community. I am planing on releasing all my work to community as there is lot of new beginners. Anyways with that being said let's begin. So what matter what code I use, its not updating into the database and I'm puzzled. It's all here to look at. Modified Code: All of this is currently in my class.admin.php [CODE=php]function checkMaintenance() { global $dbh; if (isset($_POST['checkMaintenance'])) { $siteMode = $_POST['site_closed']; } $checkMaintenance = $dbh->prepare("UPDATE cms_site SET siteMode=:site_closed"); $checkMaintenance->bindParam(); $checkMaintenance->execute(); if ($checkMaintenance) { Admin::succeed("Maintenance Mode Enabled"); } }[/CODE] [CODE=php]public static function siteMode() { global $dbh; if (isset($_POST['siteMode'])) { if (!empty($_POST['siteMode'])) { if (!empty($_POST['siteMode'])) { $closedSite = $dbh->prepare("UPDATE cms_site(site_closed) VALUES ( :site_closed )"); $closedSite->bindParam(':site_closed', $_POST['site_closed']); $closedSite->execute(); Admin::succeed("Site Closed?"); } else { Admin::error("Fuc*ing Messed Up"); return; } } } }[/CODE] [CODE=php]public static function UpdateSite() { global $dbh; if (isset($_POST['update'])) { $updateSite = $dbh->prepare("UPDATE cms_site SET site_closed=:site_closed, WHERE site_closed = :site_closed"); $updateSite->bindParam(':site_closed', $_POST['site_closed']); $updateSite->execute(); Admin::succeed("I highly doubt this updated the database"); } }[/CODE] Here is my sitesettings.php [CODE=php]<?php include_once "includes/head.php"; include_once "includes/header.php"; //include_once "includes/navi.php"; ?> <table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'> <tr> <td width='22%' valign='top' id='leftblock'> <div> <!-- LEFT CONTEXT SENSITIVE MENU --> <?php include_once('includes/sitenavi.php'); ?> <!-- / LEFT CONTEXT SENSITIVE MENU --> </div> </td> <td width='78%' valign='top' id='rightblock'> <div><!-- RIGHT CONTENT BLOCK --> <form action="" method='POST' name='theAdminForm' id='theAdminForm'> <div class='tableborder'> <div class='tableheaderalt'>Turn your site on/off</div> <?php admin::updateSite(); ?> <table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'> <tr> <td class='tablerow1' width='40%' valign='middle'><b>Close Site</b><div class='graytext'>If enabled, your site will be closed and show a maintenance page to regular users. Administrators can still login through Housekeeping.</div></td> <td class='tablerow2' width='60%' valign='middle'> <select name="update" class='dropdown'> <option name="siteMode" value='open'>Site Open</option> <option name="siteMode" value='closed'>Site Closed</option> </select> </td> </tr> <tr> <tr><td align='center' class='tablesubheader' colspan='2' ><input type='submit' value='Apply' class='realbutton' accesskey='s'></td></tr> </form></table></div><br /> </div><!-- / RIGHT CONTENT BLOCK --> </td></tr> </table> </div><!-- / OUTERDIV --> <div align='center'><br /> <?php $mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; printf('Time: %.3f', $totaltime); ?> </div> <?php include_once "includes/footer.php"; include_once "includes/script.php"; ?> [/CODE] And yes to change the respect name class and in this following section of the code. [CODE=php] <select name="update" class='dropdown'> <option name="siteMode" value='open'>Site Open</option> <option name="siteMode" value='closed'>Site Closed</option> </select>[/CODE] Here is the MySQL structure Im using. [ATTACH=full]10810[/ATTACH] UPDATE: I almost forgot. I do change the respect code for the function as well. [CODE=php]<?php admin::updateSite(); ?>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Maintenance System.
Top