4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Naveen on April 09, 2005, 06:27:06 AM

Title: Paid MOD required - Skin for search engine.
Post by: Naveen on April 09, 2005, 06:27:06 AM
Hi,

I've already posted a thread similar to this one long back but did not get much response. The thread no longer exists.

So, Now I'm ready to pay for this MOD as I really need it.

Following is what I want in the MOD.

The MOD should be able to detect search engine(s) (google) and then automatically assign a different skin for the search engine, this skin would be different than the default skin visible to guests or members.

This is similar to what we have in IPB where we can force search engines to use a pre-defined skin.

I'm already using one of the mod provided by V@no which detects the search engines and logs them as members, all I want is that the logged search engine should be forced to use a different skin which would be very light.

You can contact me via PM or reply here.

Thank you.

Naveen
Title: Re: Paid MOD required - Skin for search engine.
Post by: V@no on April 09, 2005, 06:52:07 AM
would u post the changes in sessions.php to login search bots?
there are only few lines of code need for what u are looking, I just want make it using the changes u already made.
Title: Re: Paid MOD required - Skin for search engine.
Post by: Naveen on April 09, 2005, 07:03:23 PM
Following is the modified part from sessions.php

Code: [Select]
$robots = array("FAST-WebCrawler", "Gulliver", "ia_archiver", "NPBot", "Pompos", "Scooter", "SiteSnagger", "Slurp", "WebmasterWorldForumBot", "zyborg", "Google", "googlebot");
$user_bot = 0;
foreach($robots as $val) {
  if(!$_SERVER['HTTP_USER_AGENT'] || preg_match("/".$val."/i", $_SERVER['HTTP_USER_AGENT'])) {
    $user_bot = 1;
    break;
  }
}
$site_sess = new Session();
if ($user_bot)
{
  $site_sess->login("searchbot", "password");
}

// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();

Thank you,

Naveen
Title: Re: Paid MOD required - Skin for search engine.
Post by: V@no on April 09, 2005, 07:39:01 PM
ok, try this then.
Remove (or comment out) from global.php:
Code: [Select]
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
and
Code: [Select]
//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);

Then in includes/sessions.php below the code u just showed insert this:
Code: [Select]
//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
if ($user_bot)
{
  $config['template_dir'] = "bottemplate";
}
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);
I used template name bottemplate but you can rename it as u wish.
Title: Re: Paid MOD required - Skin for search engine.
Post by: Naveen on April 10, 2005, 12:30:26 PM
Hi,

Removing those two lines from global.php gives me the following error.

Template Error: Couldn't open Template-Pack TEMPLATE_PATH

Above steps have been followed.

Thank you,

Naveen
Title: Re: Paid MOD required - Skin for search engine.
Post by: V@no on April 10, 2005, 07:57:28 PM
I've updated the code
Title: Re: Paid MOD required - Skin for search engine.
Post by: Naveen on April 10, 2005, 09:06:44 PM
I'm sorry, but no luck.

Getting the same error again with the new code, Just that you know I'm on 4images 1.7

Thank you,

Naveen
Title: Re: Paid MOD required - Skin for search engine.
Post by: V@no on April 10, 2005, 09:16:53 PM
ok, lets do different approach.
Remove all the changes I suggested.
Then from includes/sessions.php remove this part:
Code: [Select]
$robots = array("FAST-WebCrawler", "Gulliver", "ia_archiver", "NPBot", "Pompos", "Scooter", "SiteSnagger", "Slurp", "WebmasterWorldForumBot", "zyborg", "Google", "googlebot");
$user_bot = 0;
foreach($robots as $val) {
  if(!$_SERVER['HTTP_USER_AGENT'] || preg_match("/".$val."/i", $_SERVER['HTTP_USER_AGENT'])) {
    $user_bot = 1;
    break;
  }
}

In global.php insert:
Code: [Select]
$robots = array("FAST-WebCrawler", "Gulliver", "ia_archiver", "NPBot", "Pompos", "Scooter", "SiteSnagger", "Slurp", "WebmasterWorldForumBot", "zyborg", "Google", "googlebot");
$user_bot = 0;
foreach($robots as $val) {
  if(!$_SERVER['HTTP_USER_AGENT'] || preg_match("/".$val."/i", $_SERVER['HTTP_USER_AGENT'])) {
    $user_bot = 1;
    break;
  }
}
if ($user_bot)
{
  $config['template_dir'] = "bottemplate";
}

above:
Code: [Select]
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
Title: Re: Paid MOD required - Skin for search engine.
Post by: Naveen on April 11, 2005, 07:15:49 PM
Works Magically :)

Thanx a million   :mrgreen:

Good Day

Naveen
Title: Re: Paid MOD required - Skin for search engine.
Post by: mawenzi on July 05, 2005, 05:32:23 PM

... mod provided by V@no which detects the search engines and logs them as members ...


Sorry, but I can't find this MOD in the forum ...  :? ...
and the MOD isn't in Missing MODs/FIXes/FAQs (http://www.4homepages.de/forum/index.php?topic=6787.0) listed ...
Someone can help me with a link.


mawenzi
Title: Re: Paid MOD required - Skin for search engine.
Post by: Vincent on July 05, 2005, 10:13:16 PM
yes what exactly i is doing this code?  :?
Title: Re: Paid MOD required - Skin for search engine.
Post by: mawenzi on July 05, 2005, 11:32:36 PM
yes what exactly i is doing this code?  :?

Vincent ... read the description on top  ... then you know it ...  :wink:

But I search for the [MOD] detects the search engines and logs them as members [by V@no]
Someone can help me with a link ... or MOD-code.

mawenzi
Title: Re: Paid MOD required - Skin for search engine.
Post by: Vincent on July 06, 2005, 12:01:48 AM
@mawenzi
why a search enging needs to login :?:   :?

vincent
Title: Re: Paid MOD required - Skin for search engine.
Post by: V@no on July 06, 2005, 02:00:18 AM
@mawenzi
why a search enging needs to login :?: :?

vincent
This is handy when u have some categories locked for guests but you want them be listed at a search engine.
Title: Re: Paid MOD required - Skin for search engine.
Post by: V@no on July 06, 2005, 02:07:56 AM
But I search for the [MOD] detects the search engines and logs them as members [by V@no]
Someone can help me with a link ... or MOD-code.
basicaly that "mod" is what Naveen posted in his first code above ;)
Title: Re: Paid MOD required - Skin for search engine.
Post by: mawenzi on July 06, 2005, 03:54:22 PM
basicaly that "mod" is what Naveen posted in his first code above ;)
... but only basicaly ...
now I found what I'm searching for : here (http://www.4homepages.de/forum/index.php?topic=8752.0) !

mawenzi