Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

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
  #52  
Old 05-24-2008, 07:44 AM
amcd amcd is offline
 
Join Date: Oct 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by silly rabbit View Post
Cute! flypaper, a somewhat related question to the topic at hand, creating posts . . .

. . . 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
Not a good idea. To accomplish this, the time of the post would have to be edited, and that would move the post to the end of the thread.

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.
Reply With Quote
  #53  
Old 05-25-2008, 01:19 AM
silly rabbit silly rabbit is offline
 
Join Date: Oct 2005
Location: Atlanta/NYC
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by amcd View Post
Not a good idea. To accomplish this, the time of the post would have to be edited, and that would move the post to the end of the thread.
Thanks amcd! Yer right, moving the post by adjusting the time is not what I would have had in mind but at least now I have a better understanding of the problem at hand . . .

If I come up with another amicable solution myself I'll certainly post it here.

Hare says ThankYou & Cheers!
Reply With Quote
  #54  
Old 06-10-2008, 12:26 AM
LoRdGd LoRdGd is offline
 
Join Date: Mar 2008
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,
Can anybody help me with this one?

Quote:
$postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);

$timenow = TIMENOW ;
$threadinfo = fetch_threadinfo($threadid);
$foruminfo = fetch_foruminfo($forumid);
$threadid = '19987';
$userid = '1500';
$symid='90000';

$postdm->set_info('forum', $foruminfo);
$postdm->set_info('thread', $threadinfo);
$postdm->set('threadid', $threadid);
$postdm->set('title', $symid);
$postdm->set('userid', $userid);
$postdm->set('pagetext', $wiadomosc);
$postdm->set('allowsmilie', 1);
$postdm->set('visible', 1);
$postdm->set('dateline', $timenow);
$postdm->save();
unset($postdm);
Im trying to posing messages from FORM in my joomla based site... but nothing happens on the board
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
Reply With Quote
  #55  
Old 07-13-2008, 12:26 PM
Essencee Essencee is offline
 
Join Date: May 2008
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ragtek View Post
with this code:
PHP Code:
$threaddm =& datamanager_init('Thread_FirstPost'$vbulletinERRTYPE_ARRAY'threadpost');

$forumid $vbulletin->GPC['fid']; // can also be a number ;) $forumdid= 12;

$foruminfo fetch_foruminfo($forumid);
$threaddm->set_info('forum'$foruminfo);

$threaddm->set('forumid'$foruminfo['forumid']);
$threaddm->set('userid'1234);
$threaddm->set('title''Testtitle');
$threaddm->set('pagetext''a little test');
$threaddm->set('allowsmilie'1);
$threaddm->set('visible'1);
$threaddm->set('dateline'TIMENOW);
$threaddm->save(); 
Thank you!
How can I get the post id after sending?
Reply With Quote
  #56  
Old 07-13-2008, 12:32 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you have to save it with $yourid = $threaddm->save();
thant it's stored in $yourid

hth
Reply With Quote
  #57  
Old 07-13-2008, 01:16 PM
Essencee Essencee is offline
 
Join Date: May 2008
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ragtek View Post
you have to save it with $yourid = $threaddm->save();
thant it's stored in $yourid

hth
Thank you my dear
Reply With Quote
  #58  
Old 07-16-2008, 01:25 PM
dlitec dlitec is offline
 
Join Date: Jul 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey there
i tryed this too.. but i get back an error.. now first the code:
PHP Code:
$forumid 50;
$userid 1077;
$title '$PRODUCTS_MODEL - $PRODUCTS_NAME';
$pagetext 'Tatatatatestpost....';
        
$threaddm =& datamanager_init('Thread_FirstPost'$vbulletinERRTYPE_ARRAY'threadpost');

$foruminfo fetch_foruminfo($forumid);
$threaddm->set_info('forum'$foruminfo);

$threaddm->set('forumid'$forumid);
$threaddm->set('userid'$userid);
$threaddm->set('user''Onlineshop Kommentar');
$threaddm->set('title'$title);
$threaddm->set('pagetext'$pagetext);
$threaddm->set('allowsmilie'1);
$threaddm->set('visible'1);
$threaddm->set('dateline'TIMENOW);
$threaddm->save(); 
looks good to me.. but i'll recieve this:
"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
Reply With Quote
  #59  
Old 07-16-2008, 01:49 PM
LoRdGd LoRdGd is offline
 
Join Date: Mar 2008
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #60  
Old 07-16-2008, 02:32 PM
dlitec dlitec is offline
 
Join Date: Jul 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thx lord.. but my code was correct

it was a problem between xtcommerce and this script.. no i'm handling it on another way
Reply With Quote
  #61  
Old 07-22-2008, 01:02 PM
dlitec dlitec is offline
 
Join Date: Jul 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm sorry its me again

i wonder if its possible to vote threads with this too?!

i tried this:
PHP Code:
$postdm->set('votetotal'$voted); 
but recieved the standard error:
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?
Reply With Quote
Reply


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:46 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.05450 seconds
  • Memory Usage 2,350KB
  • 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
  • (4)bbcode_php
  • (5)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
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete