vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Getting forum domain (https://vborg.vbsupport.ru/showthread.php?t=149650)

steadicamop 06-13-2007 08:04 PM

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

Lynne 06-13-2007 08:49 PM

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.

steadicamop 06-13-2007 09:52 PM

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

LBmtb 06-13-2007 10:20 PM

Try
$mmNice = str_replace('http://www.','',$_SERVER['SERVER_NAME']);

steadicamop 06-13-2007 10:26 PM

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

Jason


All times are GMT. The time now is 07:14 AM.

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.00991 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete