Im doing some modifications to postings.cgi
just around the area where this line can be found
$TopicSubject = &CensorCheck("$TopicSubject");
Now what I would like to know it how can I tell when the user is trying to post a new topic, and not be replying or trying to edit a thread?
Ive tried checking if action eq "newtopic" but that hasn't worked, any other ideas?
Thanks
Use the Who's Online hack.
No, there has to be an easier way!
A variable is passed in the string
action=newtopic
action=postreply
etc....
There has to be a way I can just refer to these.
All the ubb variables are placed in the %in hash so to see what action they are doing, you must check if ($in{action} eq 'blah_action') ...
qasic
Thats the string which I tried,
I found it further on down in postings.cgi
would it be ok to check for
if ($in{action} eq 'newtopic')
in the area just above where this line can be found?
$TopicSubject = &CensorCheck("$TopicSubject");
Thanks
I'm a bit confused, What do ya mean by how can I tell? In what way?
Well I need to be able to distinguish between what action is trying to be performed by the user.
For example, if they click on the edit button they will get a URL that looks like this.
http://www.domain.com/ubbcgi/postings.cgi?action=editpost&forum=...... Now if they post a new reply the URL that is parsed is
http://www.domain.com/ubbcgi/postings.cgi?action=reply&forum=... and if they post a new topic it looks like
http://www.domain.com/ubbcgi/postings.cgi?action=newtopic&number=1... Now from these examples you can see that the word ACTION in these string changes depending on what the user is trying to do. Now all I need to know is how to tell when the user has clicked on the NEW TOPIC button