Time2Dine.co.nz is Online Restaurant Booking
 
 New Zealand Restaurants Forum
Restaurant Forum | Contact Time2Dine | Book Online & Save | About Time2Dine

Go Back   New Zealand Restaurants & Food Forum > Search Engine Optimisation > SEO vBulletin
Register

Reply
 
LinkBack Thread Tools
  #1  
Old 11th Mar 10, 05:22 AM
Junior Reviewer
 
Join Date: Mar 2010
Posts: 3
BlueChipEarth is on a distinguished road
Default Linking back to new vbulletin post

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.
Reply With Quote
  #2  
Old 11th Mar 10, 07:14 AM
T2DMan's Avatar
Administrator
 
Join Date: Apr 2004
Location: Auckland, New Zealand
Posts: 7,839
T2DMan is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 11th Mar 10, 07:26 AM
Junior Reviewer
 
Join Date: Mar 2010
Posts: 3
BlueChipEarth is on a distinguished road
Default

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...
Reply With Quote
  #4  
Old 11th Mar 10, 11:02 AM
T2DMan's Avatar
Administrator
 
Join Date: Apr 2004
Location: Auckland, New Zealand
Posts: 7,839
T2DMan is on a distinguished road
Default

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...
Reply With Quote
  #5  
Old 11th Mar 10, 11:05 AM
Junior Reviewer
 
Join Date: Mar 2010
Posts: 3
BlueChipEarth is on a distinguished road
Default

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!
Reply With Quote
  #6  
Old 11th Mar 10, 12:29 PM
T2DMan's Avatar
Administrator
 
Join Date: Apr 2004
Location: Auckland, New Zealand
Posts: 7,839
T2DMan is on a distinguished road
Default

Have a look at this post
echoing out variables
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
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



Powered by: vBulletin Copyright ©2000 -2012, Jelsoft Enterprises Limited.
Search Engine Friendly URLs by vBSEO 3.2.0
© 2010 Time2Dine