vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   DataManager Thread_FirstPost help. (https://vborg.vbsupport.ru/showthread.php?t=228218)

Blindspot 11-17-2009 06:18 PM

DataManager Thread_FirstPost help.
 
I have the following code which worked perfectly in 3.8.x...

PHP Code:

$threaddm =& datamanager_init('Thread_FirstPost'$vbulletinERRTYPE_ARRAY'threadpost');
$threaddm->set_info('forum'$foruminfo);
$threaddm->registry->options['floodchecktime'] = 0;  
$threaddm->set('forumid'$forumid);
$threaddm->set('username'$username);
$threaddm->set('title'$title);
$threaddm->set('prefixid'strtolower($section));
$threaddm->set('pagetext''$placeholder');
$threaddm->set('allowsmilie'0);
$threaddm->set('lastposter'$username);
$threaddm->set('visible'1);
$threaddm->set('dateline'time());
$threaddm->pre_save();
...
$threaddm->save(); 

in 4.0.x it creates a thread as expected, database info looks fine... however...

When I view forumdisplay the prefixid's don't show. Am I missing something?

If I advance edit the thread and assign the prefixid again it does show.

Lynne 11-17-2009 06:23 PM

prefixid is set by $section. Have you done any testing regarding that variable yet - making sure it is set and such?

Blindspot 11-17-2009 06:30 PM

I know that its inserting correctly as I can see in the database that its correct, its just not displaying the prefix in forumdisplay.

I am wondering if there is some datastore or cache i need to rebuild after creating a thread this way?

Lynne 11-17-2009 06:37 PM

So it is showing the correct last post, but just not the prefix? What is in the page source? And it shows prefixes for other threads on the forumdisplay page?

Blindspot 11-17-2009 08:49 PM

I will have to look through the standard newpost code and see if I am missing something.

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

my bad, the code above works fine, seems i was sleepy when i created my prefix's and made a few of them in capitals :/


All times are GMT. The time now is 01:09 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00963 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete