Advertisement:

Author Topic: Age Warning-Need a little help  (Read 964 times)

k33n

  • Newbie
  • *
  • Posts: 36
Age Warning-Need a little help
« on: February 11, 2015, 02:31:19 pm »
Hello everyone,

Can you please point  me how to tell robots that this plugin is not for them?I found this code to identify them,
Code: [Select]
    if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/bot|crawl|slurp|spider/i', $_SERVER['HTTP_USER_AGENT'])) {
but i dont know how to disable verification if condition is met.

Here is the code from plugin
Code: [Select]
<?php
/*
Plugin Name: Age warning
Plugin URI: http://www.osclass.org/
Description: Display a warning message about adult content
Version: 1.0.2
Author: OSClass
Author URI: http://www.osclass.org/
Short Name: agewarning
Plugin update URI: age-warning
*/


    
function agewarning_install() {
    }

    function 
agewarning_uninstall() {
    }

    function 
agewarning_splash() {
        
error_log('agewarning_splash');
        if (
Session::newInstance()->_get("agewarning_accepted") != '1' &&
        
Cookie::newInstance()->get_value('agewarning_accepted') != '1'&&
        !
osc_is_web_user_logged_in() &&
        
Params::getParam('action')!='renderplugin') {

            
error_log(Params::getParam('file'));

            if(
Params::getParam('file')==osc_plugin_folder(__FILE__) . 'confirm.php') {
                
$url Session::newInstance()->_get('agew_backto');
                
Session::newInstance()->_set("agewarning_accepted""1");
                
Cookie::newInstance()->push("agewarning_accepted""1");
                
Cookie::newInstance()->set();
                
Session::newInstance()->_drop('agew_backto');
                
header("Location: ".$url);
                exit;
            }

    
            if(
Params::getParam('file')!=osc_plugin_folder(__FILE__) . 'warning.php' && Params::getParam('file')!=osc_plugin_folder(__FILE__) . 'confirm.php') {
                
Session::newInstance()->_set('agew_backto'$_SERVER['REQUEST_URI']);
                
header("Location: ".osc_render_file_url(osc_plugin_folder(__FILE__) . 'warning.php'));
                exit;
            }
        }
    }


    
/**
     * ADD HOOKS
     */
    
osc_register_plugin(osc_plugin_path(__FILE__), 'agewarning_install');
    
osc_add_hook(osc_plugin_path(__FILE__)."_uninstall"'agewarning_uninstall');

    
osc_add_hook('before_html''agewarning_splash');

?>


Thank you!


Guib

  • Jr. Member
  • **
  • Posts: 92
Re: Age Warning-Need a little help
« Reply #1 on: July 28, 2015, 12:03:00 pm »
Hi.

I have the same question.

I install the plugin Age Warning, but robots don't crowl the website.
Anybody know how to say of bots to crowling the website…
With a server verification or with an ad of meta robots.

When the visitor clic on enter, It's ok, meta robots are good, but when he is on the warning page, meta robots disable…

Thanks.

AdMeGreek

  • Full Member
  • ***
  • Posts: 101
Re: Age Warning-Need a little help
« Reply #2 on: December 04, 2015, 07:34:30 am »
any news for this problem? it's safe to use this plugin for meta robots and google crowl?

Guib

  • Jr. Member
  • **
  • Posts: 92
Re: Age Warning-Need a little help
« Reply #3 on: December 05, 2015, 09:45:21 am »
Hi AdMeGeek.

I don't use this plugin, I use another js for the disclamer in my website car this plugin block robots… :
http://www.ohmondieu.fr

Put the js on your root folder (with sitemap and robot txt files) and ad a line in your head.php
JS : http://www.outils.xxx/script-disclaimer-dhtml.html

The line on the head.php :
<script type='text/javascript' language='javascript' src="../../../../disclaimer.js"></script>

Good Luck ;)


SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Age Warning-Need a little help
« Reply #4 on: December 05, 2015, 03:48:58 pm »
Hi,

have a look here.

Regards,
Eric