vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Create Posts (https://vborg.vbsupport.ru/showthread.php?t=102418)

amcd 05-24-2008 07:44 AM

Quote:

Originally Posted by silly rabbit (Post 1529040)
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.

silly rabbit 05-25-2008 01:19 AM

Quote:

Originally Posted by amcd (Post 1529786)
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!

LoRdGd 06-10-2008 12:26 AM

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

Essencee 07-13-2008 12:26 PM

Quote:

Originally Posted by ragtek (Post 1365393)
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?

ragtek 07-13-2008 12:32 PM

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

hth

Essencee 07-13-2008 01:16 PM

Quote:

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

hth

Thank you my dear :)

dlitec 07-16-2008 01:25 PM

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

LoRdGd 07-16-2008 01:49 PM

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 :)

dlitec 07-16-2008 02:32 PM

thx lord.. but my code was correct

it was a problem between xtcommerce and this script.. no i'm handling it on another way ;)

dlitec 07-22-2008 01:02 PM

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?


All times are GMT. The time now is 05:39 AM.

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.03170 seconds
  • Memory Usage 1,764KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete