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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-06-2011, 02:12 AM
FunnyMan FunnyMan is offline
 
Join Date: Dec 2005
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Please help! Adding Custom Field to CMS article

Hi,

I would like to add two custom fields to CMS article. Read about hook feature in different articles. If i get some guidence on how to write a plugin or hook to add new fields would be very helpful.

Please note that i am new to vb coding, so any help would be really great

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

Lynne, you have helped many with your answers. can you please help me with this one?

or any other expert? please guide me in the right direction to make this change.

appreciate your help
Reply With Quote
  #2  
Old 01-07-2011, 12:43 PM
FunnyMan FunnyMan is offline
 
Join Date: Dec 2005
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can someone help me on this? thank you
Reply With Quote
  #3  
Old 01-07-2011, 04:28 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean by new fields - like User Profile Fields to show something from the user? Or like new fields to the article? Have you looked at the mods yet?
Reply With Quote
  #4  
Old 01-07-2011, 05:50 PM
FunnyMan FunnyMan is offline
 
Join Date: Dec 2005
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
What do you mean by new fields - like User Profile Fields to show something from the user? Or like new fields to the article? Have you looked at the mods yet?
Lynne, thank you very much for your attention on this.

I would like to add two new fields to the article:

1) External URL Link - This will be used in the <a href={}> on the article preview title. When the user click on the title header, they would be directly sent to the external url (deal link). I am running the deal site and it is very much needed (currently when the user clicks on the header it will open the article page and i don't want to do that for user friendly purposes)

2) Expired/Active Status - This field will be displayed next to the title in the article preview. If the deal is expired the status needs to changed.

Hope i have given you the detail...let me know if any further information needed...I did looked into the Mods, but couldn't find the one for my need.

Appreciate your help on this.
Reply With Quote
  #5  
Old 01-07-2011, 06:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't tell you specifics since I haven't done this. But, you are going to want to be familiar with the cms_article table (maybe add a couple fields?) and then look at the code for content.php where the method is addcontent. You'll probably have to add your two new fields to an array so you can use the datamanager to add the content of those fields to the database.
Reply With Quote
  #6  
Old 01-09-2011, 02:03 PM
FunnyMan FunnyMan is offline
 
Join Date: Dec 2005
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne, thank you...did figured it out....
Reply With Quote
  #7  
Old 01-20-2011, 08:26 PM
HouseAddict HouseAddict is offline
 
Join Date: Jul 2008
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be cool if someone could make this into a mod of some sort, so we don't have to hack the core files... as I am really looking to add some custom fields to CMS articles like that too!
Reply With Quote
  #8  
Old 01-20-2011, 08:47 PM
Yellow Slider Yellow Slider is offline
 
Join Date: Aug 2006
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HouseAddict View Post
It would be cool if someone could make this into a mod of some sort, so we don't have to hack the core files... as I am really looking to add some custom fields to CMS articles like that too!
afaik, you have to edit a core file in order to add custom fields to the cms.
Reply With Quote
  #9  
Old 01-21-2011, 10:20 PM
HouseAddict HouseAddict is offline
 
Join Date: Jul 2008
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I can't tell you specifics since I haven't done this. But, you are going to want to be familiar with the cms_article table (maybe add a couple fields?) and then look at the code for content.php where the method is addcontent. You'll probably have to add your two new fields to an array so you can use the datamanager to add the content of those fields to the database.
Quote:
Originally Posted by FunnyMan View Post
Lynne, thank you...did figured it out....
FunnyMan, could you post the steps you took to get this handled? I am lost... not sure which file to even look for here and what to add...

Thanks!
Reply With Quote
  #10  
Old 01-22-2011, 12:29 PM
FunnyMan FunnyMan is offline
 
Join Date: Dec 2005
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi,

you could start with "vbcms_content_article_inline" template edit.

add the fields that you may want and then search for the existing field by name into the source files.

you may get 3 or 4 files that you need to edit in order to make this thingwork. also you need to add fields in the database table cms_article.

hope this helps.

good luck!
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:21 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.04281 seconds
  • Memory Usage 2,251KB
  • 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
  • (4)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
  • (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