Motto changing site [EACH CMS]
Hello, I have a hibbocms edit with change motto on site.
I made it by myself with help from the login thing.
I'm going to give you codes
1. Put this onto your .php file in motto section:
PHP Code:
<form method="post" action="">
<input class="motto" id="motto" type="text" name="motto" value="%motto%"/>
<input type="submit" id="login-submit-button" class="submit" value="Update je motto"/></form>
2. Put this in your <?php and ?> section:
PHP Code:
if (isset($_POST['motto']))
{
$motto = filter($_POST['motto']);
$query = mysql_query("UPDATE users SET motto = '".$_POST['motto']."' WHERE id = '".USER_ID."'");
}
Works, you only have to reload.
I don't care: hate it or love it, but don't flame. It take 20 minutes of my live to code it and make it work.
Re: Motto changing site [EACH CMS]
I guess its OK, if you want to make your own CMS from scratch. ^ ^
(Considering every stable CMS has a similar SQL table)
Re: Motto changing site [EACH CMS]
I want to make a CMS from scratch, but idk where to start from :L
Re: Motto changing site [EACH CMS]
Quote:
Originally Posted by
*****
I want to make a CMS from scratch, but idk where to start from :L
Knowing PHP / HTML would help.
Re: Motto changing site [EACH CMS]
Quote:
Originally Posted by
*****
I want to make a CMS from scratch, but idk where to start from :L
Add my msn webmaster@hotelhebbo.nl and I'd like to help ya out
Re: Motto changing site [EACH CMS]
lol i don't go on MSN much o_o
Re: Motto changing site [EACH CMS]
PHP Code:
if (isset($_POST['motto']))
$query = mysql_query("UPDATE users SET motto = '".filter($_POST['motto'])."' WHERE id = '".USER_ID."'");
Re: Motto changing site [EACH CMS]
Quote:
Originally Posted by
Rav4eG
PHP Code:
if (isset($_POST['motto']))
$query = mysql_query("UPDATE users SET motto = '".filter($_POST['motto'])."' WHERE id = '".USER_ID."'");
That snippet reminds me so much of HoloCMS, honestly..
Re: Motto changing site [EACH CMS]
Quote:
Originally Posted by
AresCJ
That snippet reminds me so much of HoloCMS, honestly..
lol
or at least just use filter you did
PHP Code:
if (isset($_POST['motto']))
{
$motto = filter($_POST['motto']);
$query = mysql_query("UPDATE users SET motto = '".$motto."' WHERE id = '".USER_ID."'");
}
Re: Motto changing site [EACH CMS]
Quote:
Originally Posted by
Exacto
why use SQL Queries, it just makes the CMS more slower, isn't there a way not to use them?
It's only (1) query, so what kind of BIG difference could it make using ONE query for the Motto, I could understand if it was like 10-15 lines of queries being inputted into the Motto, but it's only one so no harm done.
Re: Motto changing site [EACH CMS]
Quote:
Originally Posted by
Exacto
it will when the whole CMS is just made up of SQL Queries :glare:
Well, build me a CMS with NO SQL queries, let's see how this functions..
Re: Motto changing site [EACH CMS]
thank you for this code i have been looking for this for ages!!!!!!!
Re: Motto changing site [EACH CMS]
@2000 Then you must be very old?.. No a joke lolz.
Random question: should I make a CMS from scratch?
Re: Motto changing site [EACH CMS]
Quote:
Originally Posted by
George2000
@2000 Then you must be very old?.. No a joke lolz.
Random question: should I make a CMS from scratch?
w/e you want but you cant quit when started , else people will hate you, xD
Re: Motto changing site [EACH CMS]
Okay, I'll make one. It will have the style of HibboCMS but only the CSS file. Rest I'll code at my own.