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

Reply
 
Thread Tools Display Modes
  #11  
Old 11-19-2009, 03:41 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks alot !!

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

in newreply.php (i think this is the file i need to edit)

they have the part :

PHP Code:
$globaltemplates = array(
    
'newreply',
    
'newpost_attachment',
    
'newreply_reviewbit',
    
'newreply_reviewbit_ignore',
    
'newreply_reviewbit_ignore_global',
    
'newpost_attachmentbit',
    
'im_aim',
    
'im_icq',
    
'im_msn',
    
'im_yahoo',
    
'im_skype',
    
'postbit',
    
'postbit_wrapper',
    
'postbit_attachment',
    
'postbit_attachmentimage',
    
'postbit_attachmentthumbnail',
    
'postbit_attachmentmoderated',
    
'postbit_ip',
    
'postbit_onlinestatus',
    
'postbit_reputation',
    
'bbcode_code',
    
'bbcode_html',
    
'bbcode_php',
    
'bbcode_quote',
    
'humanverify',
); 
is this the $validfields u meant ?

--------------- Added [DATE]1258719365[/DATE] at [TIME]1258719365[/TIME] ---------------
Reply With Quote
  #12  
Old 11-20-2009, 01:29 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, those are templates. You should try an actual search through the templates for $validfields and you would find it. The thread one is in class_dm_threadpost.php in the datamanager. The next hook after the fields are defined is threaddata_start, as I said before, and so you can plugin to there and add to the array.
Reply With Quote
  #13  
Old 11-20-2009, 03:25 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok ive looked in the file u mentioned ("class_dm_threadpost.php") and ive there three classes that have this $validfields array .

i have added in the following textbox in the template "newreply" :

Code:
			<td><input type="text" class="bginput" name="bookname" value="$bookname" size="20" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" /></td>
			<td>&nbsp;&nbsp;</td>
			<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>

			<td><input type="text" class="bginput" name="pagenumber" value="$pagenumber" size="20" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" /></td>
			<td>&nbsp;&nbsp;</td>
			<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
			<td><input type="text" class="bginput" name="exnumber" value="$exnumber" size="20" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" /></td>
			<td>&nbsp;&nbsp;</td>
			<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
so in each class on the file class_dm_threadpost.php i need to add to the $validfields array things like :

PHP Code:
'bookname'          => array(TYPE_STR,  REQ_NO),
'pagenumber'          => array(TYPE_STR,  REQ_NO),
'exnumber'          => array(TYPE_STR,  REQ_NO
by the same order,

and then what? where they will be available? sry im so annoying about this.. but belive me im reading alot about these datamanager and still havent understood how the all proccess goes .

ill be glad if u could more specific.

in addition, where shall i look for more "$validfields", in what templates? not through the admin cp right ? cause there i found nothing .

and so, i didnt understand what shall i do with the : threaddata_start .

the code i found about this hook is :

Code:
	function vB_DataManager_Thread(&$registry, $errtype = ERRTYPE_STANDARD)
	{
		parent::vB_DataManager_ThreadPost($registry, $errtype);

		($hook = vBulletinHook::fetch_hook('threaddata_start')) ? eval($hook) : false;
	}
in the same file u mentioned.

regards,
Reply With Quote
  #14  
Old 11-20-2009, 03:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you add them to the validfields array, you may then use the datamanager to 'set' them prior to saving them. So, in threaddata_start, you add them:
PHP Code:
$this->validfields['whatever'] = array(TYPE_UINTREQ_NO); 
And then in your plugin, you set them:
PHP Code:
$threadman->set('whatever'$vbulletin->GPC['whatever']); 
You would do that prior to them being saved:
PHP Code:
$threadman->save(); 
Did you do as I suggested and look at other modifications to see how they do this?
Reply With Quote
  #15  
Old 11-20-2009, 04:34 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes i did that and also looked in "product-thread_thumbnails_v2" which adds another parameter to the thread(picture) and searched for "validfields" but found nothing.

in the file class_dm_threadpost.php there is three functions which using the validfields array, i need to add fields just to the class vB_DataManager_Post or to all of them ?

"in threaddata_start, you add them" where is the threaddata_start ?

in the function i posted above ?

and i have no plugin, what does it mean in my plugin ? in what file ? newreply.php ?

isnt some guides for this ? i read alot at the articles but still cant figure out...
Reply With Quote
  #16  
Old 11-20-2009, 04:51 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You might want to read this section in the manual - Plugin System
Reply With Quote
  #17  
Old 11-20-2009, 05:05 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok im reading this, can u please answer my questions ?

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

ok so i understood i need to do add a plugin and there to choose the threaddata_start hook and there to write the code u said before, and which product i need to choose ?
Reply With Quote
  #18  
Old 11-20-2009, 05:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to create your own product as that is what you are doing.
Reply With Quote
  #19  
Old 11-20-2009, 05:51 PM
emath emath is offline
 
Join Date: Sep 2008
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok so let me get it straight :

i go to default style choosing the newreply template, there ive added three textbox next to the title by the code :

Code:
			<td><input type="text" class="bginput" name="bookname" value="$bookname" size="20" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" /></td>
			<td>&nbsp;&nbsp;</td>
			<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>

			<td><input type="text" class="bginput" name="pagenumber" value="$pagenumber" size="20" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" /></td>
			<td>&nbsp;&nbsp;</td>
			<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
			<td><input type="text" class="bginput" name="exnumber" value="$exnumber" size="20" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" /></td>
			<td>&nbsp;&nbsp;</td>
			<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
then i go to the file "class_dm_threadpost.php" and in the class vB_DataManager_Post ive the $validfields array i added there :

PHP Code:
'bookname'          => array(TYPE_STR,  REQ_NO),
'pagenumber'          => array(TYPE_STR,  REQ_NO),
'exnumber'          => array(TYPE_STR,  REQ_NO
now i go and creating a product in admin cp.

then creating a plugin, on the plugin choosing the product i just made and in the hook i choose "threaddata_start" .

in the Plugin PHP Code i write :

PHP Code:
 $this->validfields['whatever'] = array(TYPE_UINTREQ_NO); 
and
PHP Code:
 $threadman->set('whatever'$vbulletin->GPC['whatever']); 
and then i save it with :
PHP Code:
 $threadman->save(); 
but where my table ive created for this goes in all this story ?

and please refer to every step here im rly trying.. and sure that not all is right .

regards,
Reply With Quote
  #20  
Old 11-20-2009, 05:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You do not need to edit the file class_dm_threadpost.php to add those validfields if you created the plugin at threaddata_start to add the three fields (by replacing "whatever" with the name of the field, of course).

And you would not save the field using that same plugin. You need to pick a more appropriate hook location which is why I suggested looking at other modifications to see which hook locations they were using.
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 11:08 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.05873 seconds
  • Memory Usage 2,285KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_code
  • (9)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete