logo

Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

would the coding be something like
Code:

$book = new Book();  //create a book object
$book->title = "Php is cool";  //assign a title to the book
$book->Save();  //this will insert the following record into the table
$book->title = "Php is very cool"; //modify the title of the book
$book->Save();  //this will update the record
$book = new Book();  //create a book object
$book->title = "Php is cool";  //assign a title to the book
$book->Save();  //this will insert the following record into the table
$book->title = "Php is very cool"; //modify the title of the book
if ($book->Save())
{
    echo "book successfully saved";
}
else
{
    echo "something bad happened, couldn't save";
}
$user= new User();  //create a user object
$user->GetUserList("username", "=", $_POST["username"]); //get a list of user with username supplied
$currentUser = $userList[ 0 ];  //assuming all usernames are unique, this should give you the correct user
if ($user->password == $_POST['password'])
{
    //log user in either by putting user id in the session or serializing the entire user
    $_SESSION['userId'] = $user->userId; // either put userid in session
    $_SESSION['user'] = serialize($user); //  or serialize user in session
}
else
{
    //user is not logged in
    echo "wrong username / password";
}
$user= new User();  //create a user object
$user->Get($_SESSION['userId']); //Get the logged in user
//If you serialized the user in the example above, you can simply unserialize it
$user->unserialize($_SESSION['user']);
$user->firstName = $_POST['firstName'];
$user->lastName = $_POST['lastName'];
$user->Save();  //this will update the user profile by updating the new firstname and lastname supplied


because i have had a look on google for some help and it says something like that
Last Edit: 5th June, 2009, 07:23:04 AM by James
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: making plugins

um no because that is using classes

Please do not PM me requesting support or anything, use the forums, thats what they are here for
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

so what would it have to look like and i am making the save button atm for it Smile because i dont know the next part for the coding
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

also if i have to put it in the new folder how do i get that to link to the sendpm.php so it shows in the send pm section

i have got a image for it but just dont know the coding to put it in with the message box and i have looked on google but carnt seem to find anything

~ Posts merged - Brad
Last Edit: 6th June, 2009, 01:32:12 PM by Brad
Admin
Admin
Offline Offline
avatar
Posts: 54
netattackrp@yahoo.come.g.games@hotmail.com
Re: making plugins

Don't double post.

...WTF?!
Member
Member
Offline Offline
Posts: 392
james.patten@hotmail.co.uk
Re: making plugins

haha i didnt mean to i was gunan quick edit the other one but i forgot and then the deleat wont work so i had to put it like that
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 909
Re: making plugins

I hold the record for double posts, and dont you forget it Smile

which reminds me, "allow double post" should be an "eoCMS tweak" option




James: if you need to know what $user or $settings are, use "search file contents" contents in your file explorer (on you eoCMS installation), and var_dump($user); to get an idea of its construction..


Jump to:


0.08 seconds Queries: 13