PDA

View Full Version : Post Mod Question


patt1293
01-30-2010, 05:08 PM
I have a mod that scans a new thread for something and if it doesn't have that then it will kick back an error

well this is what I used $post['message'] but that is global for new threads and post replies.

Is there something like that but only for new threads like $post['newthread]?

Thanks to whoever help

Lynne
01-30-2010, 06:01 PM
The message field for any post is $post['message']. It isn't called something different based on which post it is.

patt1293
01-30-2010, 08:32 PM
So then is there any other way of doing what I want to do?

like in a new thread I want the word "Bla", but in a reply I don't care if "Bla" is in there.

Thanks For your help

Lynne
01-30-2010, 10:24 PM
I really don't know exactly what you want to do, so I don't know. You can manipulate the first post of a thread when it is being rendered if you want to use a plugin to do so (probably hook location postbit_display_complete). I think you can even manipulate it when they hit the submit button (take a look at the file class_dm_threadpost.php to find the right hook location).

patt1293
01-30-2010, 10:42 PM
Ok, this is what I am attempting to do,

Edited: Took out my code

I want for a First post in every thread to have either Link A or Link B. That's what I'm trying to acomplish

Lynne
01-30-2010, 10:51 PM
Then you probably need to look into the class_dm_threadpost.php file that I mentioned. That is where the post/thread is created and I think errors are checked in one of the classes there. So, read that page and see what hook location is best for your use (and you may need to change the variable name). You can also probably just add the error to the $errors array too.

patt1293
01-30-2010, 11:46 PM
Ok, I got the hook I want but now it always gives me the error and I think it's because of this, $post['message']. The message isn't actually "posting" because it spits back an error before it can "post". I just need something for the stripos to compare against.

Again thanks, I'm not an expert at this stuff but I am learning :D

Lynne
01-31-2010, 01:20 AM
Depending on the hook location you picked, that may not be the exact variable name you use. You need to look at the code around the hook you are trying to use to see what variable names are being used.

patt1293
01-31-2010, 03:01 AM
OMG!! I got it working, Thanks so much for pointing me in the right direction.