You are not logged in.
Pages: 1
Any words of wisdom on creating a public module, such as a public image uploader, or simple comment system? I imagine some form of module driven callout that sanitizes user input. Darth Wordpress may be powerful, but the dark side of the cms will only consume me in hate and http requests of overwhelming magnitude.
Offline
I'd recommend having a look at the non-get functions in the BigTreeModule class and the utility functions in the BigTree class.
For example, in BigTreeModule checkout add() - which does three things. First, it checks for duplicate entries in the table associated with your module. Next it creates a new entry in your table with the given values. Finally, it caches the entry so it's viewable immediately through the admin.
In the BigTree class, functions like createThumbnail may be useful if you're making an image uploader.
Have a good weekend.
Offline
A simple comment system can be achieved by setting up a "comments" module. Build out a form to take the user input, as well as a process file that sanitizes the user input and makes use of the module's add() method. Something like:
$commentsMod = new SiteComments;
$keys = array(
"name",
"email",
"comment"
);
$vals = array(
$name,
$email,
$comment
);
if ($commentsMod->add($keys, $vals)) {
echo 'Yay!';
} else {
echo 'Boo!';
}
This process could also be run from an ajax call to avoid a new page load, sort of an auto-updating comment system.
Offline
Pages: 1