How can I get the id of the thread ?
Thanks |
Quote:
PHP Code:
|
Thanks ! :)
|
how to use the code like thank please ?
|
thanks for the thread!
how can I add a break line in the content of the just added post? |
I was able to make a script that posts a new thread to a user defined forum but not able to make it post a reply to a current thread. I tried using the example in the first post and it didnt work, can someone please help with a new post to current thread.
|
PHP Code:
|
Quote:
|
build_new_post assumes that you are adding a post for the same user who is logged in. use the data manager.
|
Quote:
. . . if editing an existing post I'd like to have a simple "check box" in the editor that would flag/include the updated post into the "New Posts" search engine for everyone to review, see. Ever seen such a hack before? Easily possible? Great Thread, thx Rabbit |
Quote:
The thread's last updated time can be updated, and that would bump the thread, but it will not solve your purpose. A 10 page thread may have a post on page 4 edited, and users will be wondering why the thread is on top of the forum when the last post is 3 months ago. |
Quote:
If I come up with another amicable solution myself I'll certainly post it here. Hare says ThankYou & Cheers! |
Hello,
Can anybody help me with this one? Quote:
This form is in other dfrent directory, but im totaly newbie in php and i don`t know how to set a directory here. Im using vB 3.7.1 |
Quote:
How can I get the post id after sending? |
you have to save it with $yourid = $threaddm->save();
thant it's stored in $yourid hth |
Quote:
|
hey there
i tryed this too.. but i get back an error.. now first the code: PHP Code:
"Fatal error: Call to a member function query_first_slave() on a non-object in /var/www/de/shop/www/htdocs/community/includes/functions.php on line 1303" anyone has an idea what could be wrong? using 3.7.2 currently |
I`m not good in php, but i have make it some weeks ago.
Look at my thread in vbulletin.com: http://www.vbulletin.com/forum/showthread.php?t=275195 Maybe you will see something interesting :) |
thx lord.. but my code was correct
it was a problem between xtcommerce and this script.. no i'm handling it on another way ;) |
hmm sorry its me again
i wonder if its possible to vote threads with this too?! i tried this: PHP Code:
Field votetotal is not defined in $validfields in class vB_DataManager_Post in [path]/includes/class_dm.php anyone has a clue? edit: extending in class_dm.php with this variable works.. no error anymore, but the voting is not transfered. do i really have to write into the DB directly? or is there a way? |
Quote:
edit: http://members.vbulletin.com/api/vBu...drate.php.html http://members.vbulletin.com/api/vBu...lvote.php.html |
thanks for your advice.. i now solved it with direct db-query's ... i dont like the datamanager :(
i think next time i'll stay straight with php and mysql. |
Hi there,
I am trying to work out how to perform an update as opposed to an insert on the text of the first post of a thread. I currently have the following which works fine for inserts: PHP Code:
I tried this, which generated a 503 error: PHP Code:
|
I have spent many hours now trying to solve the humble little problem stated above with no success.
this is heartbreaking. I tried to set the post id using this: PHP Code:
|
Quote:
|
yeah that's exactly what I am going to do, but it seems wrong when there is an API which supposedly can do all this - but since I do not understand how it works and cannot find a working example or documentation other than the comments in the code itself it doesn;t seem likely that I am going to work it out without a miracle.
|
There is no miracle needed. The vbulletin code is very well organized and commented.
I guess there must be a way of telling the thread data manager to pre-load itself with the thread. Then change whatever you want to and tell it to save. That should do an update. Read the data manager class in the includes directory. Or else read any of the default vb scripts which o an update, such as the edit thread function from thread tools dropdown. |
"well documented" ..? you gotta be joking
but I have figured it out now: In order to force the save command to do an update instead of an insert you need to use set_existing: PHP Code:
|
Quote:
|
Quote:
Quote:
How you could've not checked and/or found that documentation in the first place is seriously beyond me, being the first result on google for vbulletin datamanager and all. It explains everything you could need to know and also has relevant real world examples provided too. So take your ignorant minded "well documented" attack and shove it. |
is there a setting i need to configure in admincp? I'm trying to add a forum thread useing the datamanger_init, and save is returning a new id, but when i try to visit the thread i get a permissions error. it's on 3.7.2
|
Quote:
|
Read my topic on vbulletin.com:
http://www.vbulletin.com/forum/showt...23#post1578823 |
Quote:
this works but how can I also set the prefix? added a prefix line returns an error --------------- Added [DATE]1241372989[/DATE] at [TIME]1241372989[/TIME] --------------- found it. you have to use "prefixid" & you set it to the prefix var. like this $threaddm->set('prefixid', 'report'); I'm using this for our mod forum so alerted posts or pms have prefixes |
how can i attach file when i want to create a thread with data manager?
i think that i must use class_dm_attachment.php but how? can anyone help me? (i am new to vb programming!) |
I was wondering if someone could tell me what is wrong with my script. All I am trying to do is post a new message in an existing thread. When I put this script in a php page and hit it from my browser, I don't get any error, but I also don't get a message posted. I don't even see the "save returned" message in my browser. If I change some things (like the path to class_dm_threadpost), I get an error, so I know it is running something.
As for the echo not working, it seems like as soon as I put those require_once at the top of my file, I can't echo any messages anymore. But I only have those echos in there because the message isn't being posted to my thread. PHP Code:
|
Do you have access to php.ini and/or PHP error log? Check the error log.
If echo does not work, try the PHP error_log() function. You may also find the var_export() function useful. I have almost the same code working with vb 3.6.1. What is your version? |
I am running 3.7.4 PL1.
If I start with an empty php file and just put an echo statement, I see the message when I hit the page. Anything I echo before the line that includes class_dm_threadpost.php I see output, but anything after I don't. For example: PHP Code:
PHP Code:
I am using godaddy, so I don't know how I can access the php error file. I tried using an set_error_handler as described on this page: http://us3.php.net/set-error-handler , to catch any errors, but still I got no output. It is bizarre. It is like including that class_dm_threadpost is killing everything. I have not modified any of my vbulletin files, so it should be whatever came with 3.7.4. var_export() behaves the same way as echo. Before that require_once line it works, after it, I see nothing. --------------- Added [DATE]1251815891[/DATE] at [TIME]1251815891[/TIME] --------------- Doh. I figured it out. I have to include another file as well (class_dm.php). It seems like without it, something in the class_dm_threadpost was unhappy. This works: PHP Code:
|
Quote:
it's updated. Anyone have any ideas on how I can resolve this. |
Did you try build_thread_counters?
|
All times are GMT. The time now is 04:06 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|