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 10-16-2005, 12:19 AM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, i really need help on this! im still desiging it, adn im stumped! please help me!
Reply With Quote
  #12  
Old 10-19-2005, 12:01 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

-Add field to database
See KirbyDE's post above (best done with install code though)
-Add the form element to newthread...
Edit the newthread template and add your field.
-Clean data, place into GPC array:
Hook: newthread_post_start
PHP Code:
$vbulletin->input->clean_array_gpc('p', array(
    
'fieldname' => TYPE_UINT
));
$newpost['fieldname'] = $vbulletin->GPC['fieldname']; 
-Set datamanager value:
Hook: newpost_process
PHP Code:
if ($type == 'thread')
{
    
$dataman->setr('fieldname'$post['fieldname']);

-Validate the field for the datamanger (if you don't you get an error):
Hook: threadfpdata_start
PHP Code:
$this->validfields['fieldname'] = array(TYPE_UINTREQ_NO); 
-Replace every occurance of "fieldname" with your form element name (preferably have it the same as the database field you make), and also replace every occurance of TYPE_UINT with how you want to clean your data.
Reply With Quote
  #13  
Old 10-19-2005, 12:07 AM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, thanks, that really explains some things!

i have one question, its for forum id #26 only! that one, and that one only, how do i rig it up do diaply the information for that forum only!

and, how do i get that border around the text like
Quote:
Originally Posted by me
---Text-------------
|..........................|
|..........................|
|..........................|
---------------------
Reply With Quote
  #14  
Old 10-20-2005, 06:24 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if ($type == 'thread')
{
$dataman->setr('fieldname', $post['fieldname']);
}

will that add this to the post? bgecause, i want it to add the crap to the postbit
Reply With Quote
  #15  
Old 11-01-2005, 06:34 AM
AlexSFBay AlexSFBay is offline
 
Join Date: Jan 2004
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SirAdrian
-Add field to database
See KirbyDE's post above (best done with install code though)
-Add the form element to newthread...
Edit the newthread template and add your field.
-Clean data, place into GPC array:
Hook: newthread_post_start
PHP Code:
$vbulletin->input->clean_array_gpc('p', array(
    
'fieldname' => TYPE_UINT
));
$newpost['fieldname'] = $vbulletin->GPC['fieldname']; 
-Set datamanager value:
Hook: newpost_process
PHP Code:
if ($type == 'thread')
{
    
$dataman->setr('fieldname'$post['fieldname']);

-Validate the field for the datamanger (if you don't you get an error):
Hook: threadfpdata_start
PHP Code:
$this->validfields['fieldname'] = array(TYPE_UINTREQ_NO); 
-Replace every occurance of "fieldname" with your form element name (preferably have it the same as the database field you make), and also replace every occurance of TYPE_UINT with how you want to clean your data.
Hi SirAdrian,

I did find the "newthread" template so I can add the new form field, but for the life of me I couldn't find:
newthread_post_start
newpost_process
threadfpdata_start


I'm currently running vB version 3.0.7. Could that be why? Anyone else successfully get this to work or know of any other helpful links?

Thanks in advance for your help!
Reply With Quote
  #16  
Old 11-12-2005, 09:23 AM
krela krela is offline
 
Join Date: Jun 2004
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hihi!

Okay I got all the above working just fine, and it's great... however there's one problem with this... I can't edit any of the new fields once they're posted. Even if I add them to the editpost template it doesn't populate or update the fields.

I know I need to add the fields into one of the editpost hooks , but which hooks would I use and what would I update them with?

I guess I need a hook or two to add in the new fields to the edit post code, and a a hook to get the data to populate the edit form with the current data?

Any help would be massively appreciated!

Cheers,

Ben.
Reply With Quote
  #17  
Old 11-12-2005, 02:39 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, i could help you, i dont really like using the posting method, if u ahve a im program (or irc) id love to chat with ya
Reply With Quote
  #18  
Old 11-12-2005, 03:03 PM
krela krela is offline
 
Join Date: Jun 2004
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check your private messages!
Reply With Quote
  #19  
Old 02-23-2007, 04:28 PM
delaen1 delaen1 is offline
 
Join Date: Nov 2006
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've got this all working and I can use it just fine from the SHOWTHREAD template (with $threadinfo[myvar], but could anyone tell me how I'd go about using it in the threadbit template?

It doesn't seem to be available there.

Thanks.
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:42 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04880 seconds
  • Memory Usage 2,259KB
  • 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
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete