vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Please help! Adding Custom Field to CMS article (https://vborg.vbsupport.ru/showthread.php?t=256601)

FunnyMan 01-06-2011 02:12 AM

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 :)

FunnyMan 01-07-2011 12:43 PM

can someone help me on this? thank you :)

Lynne 01-07-2011 04:28 PM

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?

FunnyMan 01-07-2011 05:50 PM

Quote:

Originally Posted by Lynne (Post 2145515)
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. :)

Lynne 01-07-2011 06:39 PM

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.

FunnyMan 01-09-2011 02:03 PM

Lynne, thank you...did figured it out....

HouseAddict 01-20-2011 08:26 PM

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!

Yellow Slider 01-20-2011 08:47 PM

Quote:

Originally Posted by HouseAddict (Post 2152119)
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.

HouseAddict 01-21-2011 10:20 PM

Quote:

Originally Posted by Lynne (Post 2145581)
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 (Post 2146445)
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!

FunnyMan 01-22-2011 12:29 PM

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!


All times are GMT. The time now is 11:52 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.01823 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete