Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2006, 03:08 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default ***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?
Reply With Quote
  #2  
Old 03-31-2006, 04:46 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 04-01-2006, 12:35 AM
JusteCards JusteCards is offline
 
Join Date: Mar 2006
Location: Ashton-Under-Lyne
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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);
}
Reply With Quote
  #4  
Old 04-01-2006, 10:10 AM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, I'm still getting a blank page...
Reply With Quote
  #5  
Old 04-01-2006, 04:09 PM
JusteCards JusteCards is offline
 
Join Date: Mar 2006
Location: Ashton-Under-Lyne
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't really help with that without seeing the rest of the code.
Reply With Quote
  #6  
Old 04-01-2006, 06:53 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 04-02-2006, 08:09 PM
antialiasis's Avatar
antialiasis antialiasis is offline
 
Join Date: Jan 2006
Location: Iceland
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*prods thread* Anybody?
Reply With Quote
  #8  
Old 06-09-2006, 05:02 PM
Airkat Airkat is offline
 
Join Date: Jun 2006
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 
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 05:14 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.04156 seconds
  • Memory Usage 2,238KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete