vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Posting into vB from a non-vB Page (https://vborg.vbsupport.ru/showthread.php?t=180701)

Cryo 05-27-2008 05:48 PM

Posting into vB from a non-vB Page
 
Hello,

I have an script on my site which creates a new thread on the vB forums. Ever since I upgraded it is no longer working, the page will give me an error with the following -

Fatal error: Database object is not an object in [path]/includes/class_dm.php on line 172

So I'm assuming things have changed. How do I make this possible now in 3.7.1?

Lynne 05-27-2008 06:49 PM

Why don't you post the part of the code around line 172.

grenma 05-27-2008 10:39 PM

I'm assuming you have the same codebase as us, but it is the trigger_error in this function:

/**
* Constructor - checks that the registry object has been passed correctly.
*
* @param vB_Registry Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
* @param integer One of the ERRTYPE_x constants
*/
function vB_DataManager(&$registry, $errtype = ERRTYPE_STANDARD)
{
if (!is_subclass_of($this, 'vB_DataManager'))
{
trigger_error("Direct Instantiation of vB_DataManager class prohibited.", E_USER_ERROR);
}

if (is_object($registry))
{
$this->registry =& $registry;

if (is_object($registry->db))
{
$this->dbobject =& $registry->db;
}
else
{
trigger_error('Database object is not an object', E_USER_ERROR);
}
}
else
{
trigger_error('Registry object is not an object', E_USER_ERROR);
}

$this->set_error_handler($errtype);

if (is_array($this->bitfields))
{
foreach ($this->bitfields AS $key => $val)
{
if (isset($this->registry->$val))
{
$this->bitfields["$key"] =& $this->registry->$val;
}
else
{
trigger_error("Please check the <em>\$bitfields</em> array in the <strong>" . get_class($this) . "</strong> class definition - <em>\$vbulletin->$val</em> is not a valid bitfield.<br />", E_USER_ERROR);
}
}
}
}

Lynne 05-27-2008 11:42 PM

Quote:

Originally Posted by grenma (Post 1533491)
I'm assuming you have the same codebase as us, but it is the trigger_error in this function:

I never make the assumption that somebody has not modified their code. Making that assumption has caused too many problems for me before.

Cryo 05-28-2008 02:31 PM

The vB files are unmodified. The script I'm using invokes a vB class --

Code:

$threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
From there I build the thread's information (poster, subject, forum) and then process it. It worked fine in previous versions, so I'd imagine the method of posting has changed a little since.

Lynne 05-28-2008 03:02 PM

Hey Cryo,

I did some searching around about your problem and found others with the same problem but no solution yet. You might want to make a post in the Programming forum and post the part of your code that creates the new user and then post your error. That might get you the attention you need. Unfortunately, I can't offer a solution.

Cryo 05-28-2008 05:54 PM

Thanks for looking into it, Lynne. I searched around a bit too and couldn't find anything either. :(


All times are GMT. The time now is 06:23 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
  • Page Generation 0.01009 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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