Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles

Reply
 
Thread Tools
Create Posts
fly
Join Date: Oct 2003
Posts: 1,215

 

Show Printable Version Email this Page Subscription
fly fly is offline 12-06-2005, 10:00 PM

PHP Code:
require_once('./global.php');
require_once(
'./includes/class_dm.php');
require_once(
'./includes/class_dm_threadpost.php');

$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);

$postthreadid '4473';
$postusername 'admin';
// Use $postusername if posting as a guest, use $postuserid if posting as a user
//$postuserid = '1';
$postpagetext 'Hi mom!';

$threadinfo fetch_threadinfo($postthreadid);
$foruminfo fetch_foruminfo($threadinfo['forumid']);

$postdm->set_info('forum'$foruminfo);
$postdm->set_info('thread'$threadinfo);  
$postdm->set('threadid'$postthreadid);
$postdm->set('username'$postusername);
// Use $postusername if posting as a guest, use $postuserid if posting as a user
//$postdm->set('userid', $postuserid);
$postdm->set('pagetext'$postpagetext);
$postdm->set('allowsmilie'1);
$postdm->set('visible'1);
$postdm->set('dateline'TIMENOW);
$postdm->save();
unset(
$postdm); 
Reply With Quote
  #82  
Old 10-08-2009, 09:48 AM
ewelin ewelin is offline
 
Join Date: Dec 2007
Location: Cambridge, MA
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have not, I'm assuming I pass it the thread id correct?

--------------- Added [DATE]1255013971[/DATE] at [TIME]1255013971[/TIME] ---------------

Quote:
Originally Posted by amcd View Post
Did you try build_thread_counters?
That did the trick!!! Thanks!!!
Reply With Quote
  #83  
Old 12-01-2009, 12:32 PM
CarcaBot CarcaBot is offline
 
Join Date: Feb 2008
Location: Romania
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Someone tried to do this in version 4 ?

Because i can't build thread information and forum information .

It post the thread but i can see only title without content. How can i build thread information?
Reply With Quote
  #84  
Old 12-01-2009, 02:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CarcaBot View Post
Someone tried to do this in version 4 ?

Because i can't build thread information and forum information .

It post the thread but i can see only title without content. How can i build thread information?
I just ran it just fine as a quick cron job on my site using the code here - https://vborg.vbsupport.ru/showpost....3&postcount=39
Reply With Quote
  #85  
Old 12-01-2009, 02:28 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit:

It's working for me.
Strange that it first didn't work
Reply With Quote
  #86  
Old 12-01-2009, 02:41 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ragtek View Post
He's right.
In vB4 it's not working this way.
The post is created, but with my code i can't see it in the recent posts widget and also i can't see it in the thread^^
I don't have the cms installed on the site I just tested it on, so I don't know about the recent posts widget thing, but I can definitely see the thread/post on my site and it has the content from the code in it.
Attached Images
File Type: png Picture 2.png (17.5 KB, 0 views)
Reply With Quote
  #87  
Old 12-01-2009, 02:59 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's a codesnippat how it's working for me
http://ragtek.org/blog/vbulletin/vbu...sch-erstellen/
Reply With Quote
  #88  
Old 12-01-2009, 06:22 PM
CarcaBot CarcaBot is offline
 
Join Date: Feb 2008
Location: Romania
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Lynne, i tried all posibilities and no way to work like old coe.
@ragtek i will try this soon, but let me know how to get ID of new thread , if work your code.

thanks.
Reply With Quote
  #89  
Old 12-01-2009, 06:46 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Strange.
Now it's also working with the damanager
Reply With Quote
  #90  
Old 12-01-2009, 06:58 PM
CarcaBot CarcaBot is offline
 
Join Date: Feb 2008
Location: Romania
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

interesting..
i tried with this code:
Code:
<?
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_threadpost.php'); 
require_once('./includes/functions_databuild.php');

$forumid = "44";

$threadinfo = array();
    $foruminfo = fetch_foruminfo($forumid);
    $threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
    $threaddm->set('forumid', $forumid);
    $threaddm->set('userid', "1");
    $threaddm->set('pagetext', 'textul meu');
    $threaddm->set('title', 'titlul meu');
    $threaddm->set('allowsmilie', '1');
    $threaddm->set('visible', '1');
    $threaddm->set_info('forum', $foruminfo);
    $threadid = $threaddm->save();
	build_forum_counters($forumid);
	



?>
It make a thread on that forumid but i can't see the content.
The content is also showed in alt tag of link but in thread nothing.

--------------- Added [DATE]1259749240[/DATE] at [TIME]1259749240[/TIME] ---------------

awesome ) now is working...
I don't understand why not yesterday
Reply With Quote
  #91  
Old 07-13-2010, 01:28 PM
ilbianconiglio ilbianconiglio is offline
 
Join Date: Mar 2006
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not using the script into the forum root. I'm using it outside in my site.

Someone can tell me which are the files and defines required to run this script?
Reply With Quote
Reply

Thread Tools

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 06:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04930 seconds
  • Memory Usage 2,321KB
  • Queries Executed 26 (?)
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)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete