UBB.Dev
Posted By: BassTeQ Perl Help - 08/20/2001 12:58 AM
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
Posted By: NBAustin Re: Perl Help - 08/20/2001 2:12 AM
Use the Who's Online hack.
Posted By: BassTeQ Re: Perl Help - 08/20/2001 2:38 AM
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.
Posted By: qasic Re: Perl Help - 08/20/2001 4:16 AM
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
Posted By: BassTeQ Re: Perl Help - 08/20/2001 5:12 AM
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
Posted By: Lord Dexter Re: Perl Help - 08/20/2001 9:30 AM
I'm a bit confused, What do ya mean by how can I tell? In what way?
Posted By: BassTeQ Re: Perl Help - 08/21/2001 12:52 AM
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
© UBB.Developers