PDA

View Full Version : Automated Thread Posting System


maximux1
05-12-2004, 04:39 AM
I am currently developing a system to deliver timed news releases using vBulletin and VBAdvanced. I am not really going for integration and had not planned to release as a hack - perhaps more of an add-on, perhaps not.

I currently have a non vb db setup to hold posts in "queue". The table structure is as follows:

| key | title | article | userid | username | day | month | year | hour | minute |

The date fields contain the time the article is to be posted. I am simply converting the date/time to a unix timestamp and comparing it to $now = time(). If it's later than the time stamp then the article gets published.

Here's the code I have so far - this is getting programmed articles out of non vb db to input into vb db as new threads. These new threads in turn should show up on the VBAdvanced homepage, thus allowing programmed articles.

Code removed - had to rewrite.

This is producing unexpected results. For instance, it creates a new thread, but the contents are not in the thread. It appears that it is using the contents of another post in some ways, but I am unsure how at this point.

Id appreciate anyone taking a look at that code snippit above. In particular check out the part I outlined as needing attention. I think I have something missing or wrong there.

Any and all advice is most welcome.

Thanks!

Max

Slapyo
05-12-2004, 04:47 AM
take a look at my RSS News Feed Hack. Look in the rss_update.php file for how i insert my posts. i use a function straight from the message board. you might be able to use some of that code.

https://vborg.vbsupport.ru/showthread.php?t=63798

maximux1
05-12-2004, 04:49 AM
take a look at my RSS News Feed Hack. Look in the rss_update.php file for how i insert my posts. i use a function straight from the message board. you might be able to use some of that code.

https://vborg.vbsupport.ru/showthread.php?t=63798
sweet - thanks for the quick tip. I'll have a look.

maximux1
05-12-2004, 04:23 PM
take a look at my RSS News Feed Hack. Look in the rss_update.php file for how i insert my posts. i use a function straight from the message board. you might be able to use some of that code.

https://vborg.vbsupport.ru/showthread.php?t=63798
since I am doing this outside of the scope of vb, I have a couple questions on your code from the RSS News Feed hack.



// Setup the thread
$post['signature'] = true;
$post['emailupdate'] = 9999;
$post['title'] = $title;
$post['message'] = $article;
$post['poststarttime'] = TIMENOW;
//? $post['rss_date'] = $rss_dateline;
$post['posthash'] = md5($post['poststarttime'] . $bbuserinfo['userid'] . $bbuserinfo['salt']);


In particular, the last line:
$post['posthash'] = md5($post['poststarttime'] . $bbuserinfo['userid'] . $bbuserinfo['salt']);

I dont have access to the $bbuserinfo array (at this point) and I was wondering if there is anyway around this last line?

Also, This line im not sure about either - im not sure I need to include it?
//? $post['rss_date'] = $rss_dateline;

Slapyo
05-12-2004, 06:33 PM
not sure, i don't think there would be a way around it unless you hardcoded the values into your script.

//? $post['rss_date'] = $rss_dateline; - doesn't need to be included because it is for my script specifically. so i can check the date of the news and see if it is old or not. nothing else to do with the operation of the board, just something extra.

maximux1
05-12-2004, 07:54 PM
Thanks bro -
I have figured it out, thanks to your rss hack.

For anyone else following this thread...the code above is no good. Anyone interested in automatically creating threads based on time should definately use the build_new_post() function included in vb. No need to rewrite what vB has done right the first time.

Thanks again, Slapyo - I now have my vbadvanced index updated automatically throughout the day - works like a charm!

Max

Slapyo
05-12-2004, 08:49 PM
sweet. ya, the original rss news feed hack was inserting the posts like you were trying. i looked around and found that function. going with the build_new_post() function it enabled similar threads, searching, post counts ... all the good stuff.

glad you figured it out.