Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 05-12-2004, 04:39 AM
maximux1's Avatar
maximux1 maximux1 is offline
 
Join Date: Mar 2002
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Automated Thread Posting System

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:

Code:
| 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.

PHP Code:
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
Reply With Quote
  #2  
Old 05-12-2004, 04:47 AM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 05-12-2004, 04:49 AM
maximux1's Avatar
maximux1 maximux1 is offline
 
Join Date: Mar 2002
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Slapyo
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.
Reply With Quote
  #4  
Old 05-12-2004, 04:23 PM
maximux1's Avatar
maximux1 maximux1 is offline
 
Join Date: Mar 2002
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Slapyo
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.

PHP Code:

            
// 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;
Reply With Quote
  #5  
Old 05-12-2004, 06:33 PM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 05-12-2004, 07:54 PM
maximux1's Avatar
maximux1 maximux1 is offline
 
Join Date: Mar 2002
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 05-12-2004, 08:49 PM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 03:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04530 seconds
  • Memory Usage 2,229KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete