The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to create new threads with attachments automatically through a script
Hi,
I just want to create new threads with attachments through a script on a daily basis. This should act as an interface to vbulletin forum to post new threads. The script can be in perl or php or anything. Can any body please help me how i should start and go forward in this? Thanks, Raja |
#2
|
||||
|
||||
You can do all those with the appropriate data managers. See documentation for this in the manual: vBulletin Data Managers.
|
#3
|
|||
|
|||
Hi Hanson,
I could able to create a new thread with out an attachment. But i tried a lot to create with an attachment, and i failed to do so. Can you please help me in this regard? From the data managers manual, i understood that, i could use "Threads with a Post" data manager to post a thread with an attachment, but i really dont understand how? +Raja --------------- Added [DATE]1239091478[/DATE] at [TIME]1239091478[/TIME] --------------- Hi Hanson, Which one solves my problem in this? should i use "Threads with a Post" or "posts" or "Attachments" data manager? could you explain, what parameter i need to set for this datamanager? +Raja |
#4
|
||||
|
||||
To create a thread and add an attachment - you need to use both. Parameters that are to be set can be found in the $valid_fields[] array in the class of each data manager.
|
#5
|
|||
|
|||
You mean, i have to do the following:
$attachdata =& datamanager_init('Attachment', $vbulletin, ERRTYPE_ARRAY); foreach ($attachdata->$valid_fields AS $key => $value){ echo " KEY : $key => VALUE : $value"; } to know the keys of the array and existing values. +Raja |
#6
|
|||
|
|||
When i printed the value for
************* $attachdata =& datamanager_init('Attachment', $vbulletin, ERRTYPE_ARRAY); print_r($attachdata->validfields); ***************** i got the information which is not in useable format. For your reference, i am attaching the output for the following statement. $attachdata->validfields Please guide me , how i could use this information to post an attachment. +Raja |
#7
|
||||
|
||||
Open the actual class file and look inside it...
|
#8
|
|||
|
|||
How can we pass contents of the file to 'filedata'?
Can this be allowed? if so, can i read all the data from a file into a variable($data) and pass that variable to $attach->set('filedata',$data) function. +Raja |
#9
|
||||
|
||||
That's exactly what you do.
|
#10
|
|||
|
|||
Okay , i got this, i could able to set the filedata in this way.
By the way, Can i create a thread with an attachment with out creating two data managers, one for 'Thread' and another for 'Attachment' ? If i must use two datamanagers, how would i link attachment to the thread? Can i use postid to link both thread and attachment? or is there any otherway around? if i have to use postid to link thread and attachment, how would i get postid from the newly created thread? +Raja |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|