Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-03-2009, 03:49 PM
doa24uk doa24uk is offline
 
Join Date: Feb 2008
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default New Mod - idea mostly there - jsut need it coded ... you can take the credit

Hi guys,

This will require a mod of the database.

The standard thread table will get a 2 new fields 'fullURL' & 'urlID'.
Create a new table called URL w/ 2 fields - urlID and URL1

urlID will be the unique ID for the URL.

eg.


urlID URL1
1 http://yahoo.com
2 http://google.com
3 http://msn.com
4 http://myblog.blogspot.com
5 http://facebook.com


etc. etc.


I want a new text box on my newthread.php page. The user will input an URL to a page.

eg. http://none.com/mytestpage.html

Two things now need to happen.

1. The system checks whether this full URL exists in the thread table in DB - fullURL
2. The system cuts just the domain from this & inserts it into a new table - URL


I already have the code that is required to do no. 2


Now here's the logic for creating the topic based on the above information.....
  • From thread table check whether the full URL exists
  • if it does then send back to newthread.php page with an error (sorry this page has already been shared, please try a different one)
  • If not, then do the following -->
  • Select * from URL where URL1 is equal to $shortenedURL (created by the PHP script from point no. 2)
  • If it exists then URL1 has been shared before & doesn't need re-inputted. Create topic, remembering to insert urlID into the thread table.
  • Otherwise it doesn't exist so insert URL1 into URL. Create topic, remembering to insert urlID into the thread table.


My question is, does anyone wanna fully code this & take credit for it.

I know the custom thread fields mod exists but that requires an admin inputting all the available options into the DB - which is impossible for what I want to use it for ... so are topic prefixes.

If you code this you are more than welcome to take full credit for it.


DoA

ps. The end result of this mod is so that people can filter by original site ... so they can see all topics posted that originated from Facebook for example ... this would of course require a drop down list that could be coded into this system.....
Reply With Quote
  #2  
Old 05-15-2009, 07:33 PM
troybtj troybtj is offline
 
Join Date: Apr 2007
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wouldn't a regular expression to get only the root URL of the sites from a list work better?

Fractalizer has a filter mod that will do this, with the correct regular expression:

Code:
\b((?#protocol)https?|ftp)://((?#domain)[-A-Z0-9.]+)((?#file)/[-A-Z0-9+&@#/%=~_|!:,.;]*)?((?#parameters)\?[A-Z0-9+&@#/%=~_|!:,.;]*)?
Replace with only protocol://domain e.g. \1, \2
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 08:26 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.08555 seconds
  • Memory Usage 2,168KB
  • 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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete