vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   ***Defining valid fields - NEED HELP*** (https://vborg.vbsupport.ru/showthread.php?t=111723)

antialiasis 03-30-2006 03:08 PM

***Defining valid fields - NEED HELP***
 
Okay, since nobody was interested in porting Darth Cow's default BBCode hack when I asked, I started messing around on my own to make a similar hack, and strangely enough I managed to figure almost everything out, including adding a column for a "Use default BBCode for this post" option in the database. However, now I got an error:

Quote:

Fatal error: Field usedefaultbbcode is not defined in $validfields in class vB_DataManager_Post in \includes\class_dm.php on line 485
I opened class_dm.php and searched for "vB_DataManager_Post", but the phrase is not found. Because my PHP knowledge is rather limited, I don't really get the instructions above "vB_DataManager", either. Any help, please?

antialiasis 03-31-2006 04:46 PM

I seriously need help on this... I tried using this after reading the instructions above vB_DataManager a few times over:

Code:

        $validfields["usedefaultbbcode"] = array('VF_TYPE' => 'TYPE_BOOL', 'VF_REQ' => 'REQ_NO', 'VF_CODE' => 'VF_METHOD');
But then I get a blank page. :/ I have no clue what I'm doing; can anybody give a hint?

JusteCards 04-01-2006 12:35 AM

Try adding a plugin with the following at the userdata_start hook:
Code:

// check to make sure VB_AREA is defined
if (defined('VB_AREA'))
{
        // add these to the validfields

$this->validfields['usedefaultbbcode'] = array(TYPE_BOOL, REQ_NO);
}


antialiasis 04-01-2006 10:10 AM

Hmm, I'm still getting a blank page...

JusteCards 04-01-2006 04:09 PM

Can't really help with that without seeing the rest of the code.

antialiasis 04-01-2006 06:53 PM

Well, basically, I more or less went through newreply.php and includes/functions_newpost.php and everywhere it did something with the "Show your signature in this post?" input, I did the exact same thing with usedefaultbbcode.

antialiasis 04-02-2006 08:09 PM

*prods thread* Anybody?

Airkat 06-09-2006 05:02 PM

had a similar issue and found this thread, but then I figured it out, if you haven't here it is.

I originally added my new field right under the declaration of the validfields like so:

PHP Code:

    var $validfields = array();
    
$this->validfields['MYVAR'] = array(TYPE_INTREQ_NO); 


But then, duh, I realized, this is a class. You can't do random operations outside of functions and stuff, so if you move that to a function it works. I moved mine into

PHP Code:

function vB_DataManager(&$registry$errtype ERRTYPE_STANDARD

So it looks something like so:

PHP Code:

    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);
        }

        
$this->validfields['MYVAR'] = array(TYPE_INTREQ_NO);
///...rest of function 



All times are GMT. The time now is 11:51 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.00994 seconds
  • Memory Usage 1,735KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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