|
|
#1
| |||
| |||
|
I noticed you (T2DMan) have a serious knack for this vBulletin stuff... I'm just a beginner. I am charged with creating a hack that reads every post, scans for a certain keyword and then emails back the URL of the post. The problem is, I can get the Post ID of the post I'm REPLYING to, but not for the post that is created. I need the new post id, and I have no idea how to get it... Can you help with this? I'm working in the threadfpdata_presave and threaddata_presave hooks. |
|
#2
| ||||
| ||||
|
New post id? But you said that you were emailing back the url of the post, not reposting it? You want the threadid of the firstpost? A post has a threadid, and it either has a zero parentid if it is the first post on a thread, or a parentid of the post that is first. Confirm it by looking at the database. If you are creating a new post, you just use the built in post creator rather than manually trying to create it, then get the relevant numbers from the output. |
|
#3
| |||
| |||
|
Basically, I want to create a URL of the actual new post that is created. So when the person clicks the link, it takes them to that page in the thread and automatically jumps to their post. I want to build this type of URL, but I can't seem to find out what the post id *WILL BE* when it posts: http://www.lawnsite.com/showthread.p...05#post3459105 I can get the post itself with $this->fetch_field('pagetext') I can get the ID of the post I'm replying to with $id = empty($_POST['postid'])?$_POST[p]:$_POST[postid]; No idea how to get the actual postid of the post that I'm creating... |
|
#4
| ||||
| ||||
|
Sorry, you will just have to experiment. I suggest that you echo out variables that are available - print_r style. When creating a post, there should be a resulting variable from the routine that creates it, or mysql_insert_id ... If I was to research it, it would take time I don't have... |
|
#5
| |||
| |||
|
I'm new to PHP, mostly work in ASP.Net these days... what do you mean by echoing out the variables? You can just print a list of all the variables that are defined in PHP?? That sounds very useful! How do I do it, exactly? Thanks for taking your time to help me! |
|
#6
| ||||
| ||||
|
Have a look at this post echoing out variables |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search Engine Optimize vBulletin | T2DMan | SEO vBulletin | 260 | 23rd Nov 08 08:16 PM |
| Auto New Thread on vBulletin | T2DMan | SEO vBulletin | 0 | 19th Sep 05 08:19 PM |
| Search Engine Optimize vBulletin 3.5 | T2DMan | SEO vBulletin | 9 | 8th Sep 05 12:46 AM |
| Peter Gordon-Sky City | T2DMan | New Zealand-wide Restaurants information | 0 | 1st Sep 05 09:17 AM |