The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
One possible use is having a user enter in the url of a news story and then a generic user "newsman" or something will automatically create a new thread with that news story for people to comment on. Since I am just dealing with 1 user and no moderation (in my case), then I believe all I have to do is add-to/modify the following tables:
forum user (optional because it's a fake user, but I'll do it anyway) thread post posthash Does that seem right? Does postindex come into play at all? I realize that I'll still have to do the dupecheck before posting. Any comments, suggestions, and ideas are welcome. Thank you. |
#2
|
||||
|
||||
![]()
Hmm.. an automated concept might be more useful.
If I had time, I'd code it. An "articlebot", like Sitepoint.com has for their forums when new articles are added. Although, your method of fetching articles is somewhat broad and unclear, if you plan if you intend to grab the content from a news article by a user-submitted URL. A better idea is to read a news feed XML from an XML parser. Not sure if you're familar with PHP's PEAR, but there is a great package by Stephan Schmidt known as XML_Serializer that easily parses XML data to arrays. Another of course is XML_Parser. Then you just find XML news feeds, e.g. http://www.securityfocus.com/rss/news.xml http://www.computerworld.com/news/xml/50/0,5009,,00.xml http://rss.news.yahoo.com/rss/tech And have the "ArticleBot" display the URL and description inside the post. Something to think about. ![]() This would be a most useful hack though. |
#3
|
|||
|
|||
![]()
Velocd,
Thank you for the information. I was just using news articles as an example, but I have no problem parsing information.. in fact, I already wrote the parser for what I need, now I need to stick it in the forum. Is what I said about manually adding threads/posts correct? Thank you in advance. :up: |
#4
|
||||
|
||||
![]()
You would need to assign a forum for where ever the bot is to post, and also a "bot user", and then have a human user upload the file. What ever you're using to do the parsing (I just remembered XML_RSS) will run through the file and then insert a new row into the `thread` table, associated with `forum` and its "bot user", and also insert a `post` associated with `thread` and its "bot user".
|
#5
|
|||
|
|||
![]()
Velocd,
Thank you for your reply. Now to ask you 2 questions that I'm almost sure about but just want to make sure... 1) It would also be necessary to fill out the posthash table (and check it) to make sure I don't get duplicate submissions, correct? 2) To make the post searchable, all I have to do is call build_post_index from functions_databuild.php with the correct args, correct? |
#6
|
||||
|
||||
![]()
Stalk,
I'm assuming you are stepping through the build_new_post() function that is in newthread.php and newpost.php. If not, it's located in /includes/functions_newpost.php, and should have all the necessary steps to completing a thread. ![]() I'll check back tomorrow if you still need help. |
#7
|
|||
|
|||
![]() Quote:
|
#8
|
||||
|
||||
![]()
Can you post your code when its through? I have to bulk load 8 years of news articles as posts for my interim website...
![]() |
#9
|
|||
|
|||
![]()
It's actually really simple if you are just going to create a new thread and add a post.
You can just call the build_new_post function from includes/functions_newpost.php like this: PHP Code:
PHP Code:
Pick a user to be a bot, get their id, and do: [PHP]$bbuserinfo = fetch_userinfo(2)[/PHP You use that to build the posthash. look in newthread.php for an example of how to call build_new_post. Let me know if you need more info. Hm... I'm not sure what you are trying to do, but I had to modify some of the vb files because the forums I want the bot to post to are moderated and a regular user won't have permissions to post.. build_new_post will grab YOUR permissions (I believe). So yeah.. just let me know if you have any questions/problems. |
#10
|
||||
|
||||
![]() Quote:
![]() PHP Code:
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|