vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Extra Field when posting New Thread (https://vborg.vbsupport.ru/showthread.php?t=326236)

BasilFawlty 03-25-2018 01:08 PM

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

snakes1100 03-25-2018 04:09 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=269667" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=269667</a>

BasilFawlty 03-25-2018 04:19 PM

Quote:

Originally Posted by snakes1100 (Post 2593732)

That looks like it! Thank you thank you thank you!

snakes1100 03-25-2018 04:22 PM

welcome welcome welcome!

MarkFL 03-27-2018 12:18 AM

1 Attachment(s)
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. :)

BasilFawlty 03-27-2018 02:22 AM

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.

MarkFL 03-27-2018 02:41 AM

1 Attachment(s)
Quote:

Originally Posted by BasilFawlty (Post 2593770)
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! :D

I have addressed the issues you reported, and am now attaching the update...

BasilFawlty 03-27-2018 03:11 AM

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.

MarkFL 03-27-2018 03:13 AM

Quote:

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

BasilFawlty 03-27-2018 03:38 AM

Quote:

Originally Posted by MarkFL (Post 2593773)
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?


All times are GMT. The time now is 12:51 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.01147 seconds
  • Memory Usage 1,736KB
  • 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