maneri
04-19-2011, 11:42 AM
I need users to always set a tag before posting in blog. I have created a new plugin with this functions and hooked it in blog_post_start inside blog_post.php
if(isset($_POST['sbutton']) && empty($_POST['taglist'])){
echo "You must enter a tag in order to post your thread";
die();
}
It works perfectly, I just would like to change echo, I do not want users to get a simple browser page with that simple message "You must enter a tag in order to post your thread".
Rather I would prefer an errors function similar to the one users get when, e.g., they do not put any title in theit blog entry.
What should I put after if(isset($_POST['sbutton']) && empty($_POST['taglist']))
in order to get en error like this ?
http://img52.imageshack.us/img52/3392/requireblogtag.jpg (http://img52.imageshack.us/i/requireblogtag.jpg/)
Thanks !
if(isset($_POST['sbutton']) && empty($_POST['taglist'])){
echo "You must enter a tag in order to post your thread";
die();
}
It works perfectly, I just would like to change echo, I do not want users to get a simple browser page with that simple message "You must enter a tag in order to post your thread".
Rather I would prefer an errors function similar to the one users get when, e.g., they do not put any title in theit blog entry.
What should I put after if(isset($_POST['sbutton']) && empty($_POST['taglist']))
in order to get en error like this ?
http://img52.imageshack.us/img52/3392/requireblogtag.jpg (http://img52.imageshack.us/i/requireblogtag.jpg/)
Thanks !