Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2018, 01:08 PM
BasilFawlty BasilFawlty is offline
 
Join Date: Jul 2012
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Extra Field when posting New Thread

This may exist, but I did several searches and didn't see anything. What I would like to do is have an extra field on the "newthread" forum, but only for certain forums I designate. I have a few forums that are "Classifieds" forum and I'd like to have an extra field, probably just below the Title field, called "Ad Link" (or similar). Then, if someone is posting a classified ad and they have the item also on Ebay or Craigslist, for example, they could paste their link into that field (optionally).

Then, when they save their post, "IF" that field is not empty, that link would get parsed and posted at the end of their regular text. The mod would also look at the first X string of characters in the URL they entered and, for example, if the string contains "Ebay" then the link might look like this:

EBay
Reply With Quote
  #2  
Old 03-25-2018, 04:09 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=269667" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=269667</a>
Reply With Quote
  #3  
Old 03-25-2018, 04:19 PM
BasilFawlty BasilFawlty is offline
 
Join Date: Jul 2012
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by snakes1100 View Post
That looks like it! Thank you thank you thank you!
Reply With Quote
  #4  
Old 03-25-2018, 04:22 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

welcome welcome welcome!
Reply With Quote
  #5  
Old 03-27-2018, 12:18 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As promised via PM, I have attached a product that will give you two additional text input fields, below the title field for new threads. You can set in which forums the product is active, and for which usergroups.

The two input fields use pattern recognition to try to ensure valid text is entered. There are settings where you can modify the pattern.

The links are built and displayed beneath the content of the first post in the thread, but they aren't actually part of the post in the database. You can control the color of the links with the StyleVars.

This product adds a table to your database which stores the threadid, and the two links for any thread having links associated with them.

Please let me know if you have any issues, or would like additional features.
Attached Files
File Type: xml product-markfltwolinks.xml (20.9 KB, 7 views)
Reply With Quote
  #6  
Old 03-27-2018, 02:22 AM
BasilFawlty BasilFawlty is offline
 
Join Date: Jul 2012
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Almost there Mark! Tested it on my site (PMd you a video of the test). Works but a couple issues. First, it would be great if the links that get posted would open in a new tab (minor personal preference). When you enter two links (both an Ebay and a Craig's List link) it posts both links perfectly. However, if you only post with an Ebay link in the Ebay field, it still posts a "Craigs List" link, but the link only goes to the home page when you click. If you post only a CL link and put noting in the Ebay field, then neither gets posted.

Hope this helps.
Reply With Quote
Благодарность от:
MarkFL
  #7  
Old 03-27-2018, 02:41 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BasilFawlty View Post
Almost there Mark! Tested it on my site (PMd you a video of the test). Works but a couple issues. First, it would be great if the links that get posted would open in a new tab (minor personal preference). When you enter two links (both an Ebay and a Craig's List link) it posts both links perfectly. However, if you only post with an Ebay link in the Ebay field, it still posts a "Craigs List" link, but the link only goes to the home page when you click. If you post only a CL link and put noting in the Ebay field, then neither gets posted.

Hope this helps.
Your video was superb!

I have addressed the issues you reported, and am now attaching the update...
Attached Files
File Type: xml product-markfltwolinks.xml (20.9 KB, 2 views)
Reply With Quote
  #8  
Old 03-27-2018, 03:11 AM
BasilFawlty BasilFawlty is offline
 
Join Date: Jul 2012
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would say you nailed it! All options - with both links, with either link, or with no links - all cases work as they should. Super duper! Thank you! If I run across any bugs I'll let you know.
Reply With Quote
  #9  
Old 03-27-2018, 03:13 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BasilFawlty View Post
I would say you nailed it! All options - with both links, with either link, or with no links - all cases work as they should. Super duper! Thank you! If I run across any bugs I'll let you know.
Good deal! :up:

Also, if you find you want any added features, just let me know...I'll be glad to see what I can do.
Reply With Quote
  #10  
Old 03-27-2018, 03:38 AM
BasilFawlty BasilFawlty is offline
 
Join Date: Jul 2012
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
Good deal! :up:

Also, if you find you want any added features, just let me know...I'll be glad to see what I can do.
Well, since you asked - if I wanted to play around with font size and link color for the links, would that be something I could just modify myself and if so, where would I do that?
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:12 PM.


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.05044 seconds
  • Memory Usage 2,280KB
  • Queries Executed 14 (?)
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
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete