Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2007, 08:04 PM
steadicamop's Avatar
steadicamop steadicamop is offline
 
Join Date: Jul 2004
Location: Lancashire, UK
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Getting forum domain

Hey guys and gals,

I'm trying to make my product dynamic - at the moment you need to type in the domain name of the forum (ie - steadiforum.com) - and I tried using $vboptions[bburl] but that is stored as http://www.steadiforum.com - and I need to find a way of getting the forum url, but stripped down - without the http://www part - how would I go about this?

Cheers

Jason
Reply With Quote
  #2  
Old 06-13-2007, 08:49 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think it is actually stored anywhere as a phrase currently. But, that doesn't mean you can't make your own phrase and store it and then use it somewhere. I'm not sure that that answers your question exactly. Perhaps if you say how you want to use it, we can help you further.
Reply With Quote
  #3  
Old 06-13-2007, 09:52 PM
steadicamop's Avatar
steadicamop steadicamop is offline
 
Join Date: Jul 2004
Location: Lancashire, UK
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have asked a friend of mine, who's pretty clued up with php and he gave me this code:

PHP Code:
$ref str_replace(array('http://','www.'),array('',''),$vboptions['bburl']); 
And as I've read it, str_replace works by searching the first part (array('http://','www.')) then replaces it with the next (array('','')) and looking in the last part for the source ($vboptions['bburl']) - but this isn't working, just giving an error:

Warning: strstr() [function.strstr]: Empty delimiter. in /attachment.php(112) : eval()'d code on line 3

Which is this line:

PHP Code:
if(!strstr($_SERVER['HTTP_REFERER'],$ref)) { 
Now I'm in teritory I don't fully understand - but there is something to do with the strstr function that has caused the error.

Beyond that I'm lost .... can anyone shed any light on this?

Cheers

Jason
Reply With Quote
  #4  
Old 06-13-2007, 10:20 PM
LBmtb LBmtb is offline
 
Join Date: Jan 2006
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try
$mmNice = str_replace('http://www.','',$_SERVER['SERVER_NAME']);
Reply With Quote
  #5  
Old 06-13-2007, 10:26 PM
steadicamop's Avatar
steadicamop steadicamop is offline
 
Join Date: Jul 2004
Location: Lancashire, UK
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant, that's done it - the one thing I will ask about this is that it's going to be used on an anti-leech system so it checks the referring domain before allowing the download - I've tested it and it now works fine, but this is only on my forum, will it work fine with forums in sub directories (www.mysite.com/forum) ?

Would using $_SERVER['SERVER_NAME'] give any issues for people using root servers or home based servers? If a server is running more than one forum, would each one have it's own server name? I'm maybe asking questions which are a little too indepth ..... I'm not too sure myself.

Thanks for your help, you've saved me a big headache

Jason
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:29 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.04233 seconds
  • Memory Usage 2,200KB
  • 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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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