PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

PostPosted: Sun Jan 03, 2010 10:13 am Reply with quote Back to top

Hello! Thanks for your time in looking at this post.
I have a custom News section, with a custom Printer friendly articles. What I would like is to create some sort of pre check code, that will find out if the visitor is accessing the printer version article FROM the original article, or "referred" from the original article link, and if not, do something else.

I don't want people sending visitors to my printer version articles. Any ideas? Thanks!
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

PostPosted: Thu Jan 14, 2010 6:34 am Reply with quote Back to top

Not sure how we missed this one selectric. Sorry about that. Take a look at this code in includes/nukesentinel.php as it should give you the ideas that you need:

Code:

function get_referer() {
  global $nuke_config;
  if(get_env("HTTP_REFERER")) {
    if(stristr(get_env("HTTP_REFERER"), $nuke_config['nukeurl'])) {
      return "on site";
    } elseif(stristr(get_env("HTTP_REFERER"), "http://localhost") || stristr(get_env("HTTP_REFERER"), "http://127.0.") || stristr(get_env("HTTP_REFERER"), "http://192.168.") || stristr(get_env("HTTP_REFERER"), "http://10.") || stristr(get_env("HTTP_REFERER"), "file://")) {
      return "local link";
    }
    return get_env("HTTP_REFERER");
  }
  return "none";
}
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum