Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
manunkind
Client



Joined: Apr 26, 2004
Posts: 368
Location: Albuquerque, NM

PostPosted: Thu Jun 15, 2006 6:24 am Reply with quote

Hello,

I was just reading hitwalker's thread here:
http://www.ravenphpscripts.com/postt10001.html

And I figured I would ask if anybody has any working Googlifier code for this module? It seems very similar but I can't get it working from the above posted sample.

For those of you that don't know/remember Googlifier, it has only 3 parts, in 2 files. For example:

In .htaccess:
Code:
RewriteEngine On 


RewriteRule ^index.html /index.php

RewriteRule ^gate.html /modules.php

#Articles
RewriteRule ^article([1-9][0-9]*).* /gate.html?name=News&file=article&sid=$1
RewriteRule ^article([1-9][0-9]*).html /gate.html?name=News&file=article&sid=$1&mode=$2&order=$3&thold=$4
RewriteRule ^topic([1-9][0-9]*)-([0-9]*).* /gate.html?name=News&new_topic=$1&pagenum=$2
RewriteRule ^topic([1-9][0-9]*).* /gate.html?name=News&new_topic=$1
RewriteRule ^cat([1-9][0-9]*)-([0-9]*).* /gate.html?name=News&file=categories&op=newindex&catid=$1&pagenum=$2
RewriteRule ^cat([1-9][0-9]*).* /gate.html?name=News&file=categories&op=newindex&catid=$1
RewriteRule ^cat([1-9][0-9]*)-([0-9]*).* gate.html?name=News&file=article&op=newindex&catid=$1&pagenum=$2
RewriteRule ^cat([1-9][0-9]*).* /gate.html?name=News&file=article&op=newindex&catid=$1
RewriteRule ^printout([1-9][0-9]*).* /gate.html?name=News&file=print&sid=$1
RewriteRule ^newspage([1-9][0-9]*).* /gate.html?name=News&pagenum=$1
RewriteRule ^comment([0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)([0-9]*)([/:|\s\-\'{}().&_0-9+=]*).html /gate.html?name=News&file=comments&op=showreply&tid=$1&sid=$2&pid=$3&mode=$4&order=$5&thold=$6
RewriteRule ^articles.* /gate.html?name=News&file=index


In header.php
Code:
$urlin = 

array(
"'(?<!/)index.php'",
"'(?<!/)modules.php'",
"'(?<!/)gate.html\?name=News&amp;file=comments&amp;op=showreply&amp;tid=([0-9]*)&amp;sid=([0-9]*)&amp;pid=([0-9]*)&amp;mode=([a-zA-Z0-9+]*)&amp;order=([0-9]*)&amp;thold=([/:|\s\-\'{}().&_0-9+=]*)'",
"'(?<!/)gate.html\?name=News&amp;file=categories&amp;op=newindex&amp;catid=([0-9]*)&amp;pagenum=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;file=categories&amp;op=newindex&amp;catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;file=categories&amp;op=newindex&amp;catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;file=article&amp;op=newindex&amp;catid=([0-9]*)&amp;pagenum=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;file=article&amp;op=newindex&amp;catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;op=newindex&amp;catid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;file=article&amp;sid=([0-9]*)&amp;mode=([a-zA-Z0-9+]*)&amp;order=([0-9]*)&amp;thold=([/:|\s\-\'{}().&_0-9+=]*)'",
"'(?<!/)gate.html\?name=News&amp;file=article&amp;sid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&file=article&sid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;new_topic=([0-9]*)&amp;pagenum=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;new_topic=([0-9]*)'",
"'(?<!/)gate.html\?name=News&new_topic=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;file=print&amp;sid=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;pagenum=([0-9]*)'",
"'(?<!/)gate.html\?name=News&amp;file=index'",
"'(?<!/)gate.html\?name=News&file=index'"
);

$urlout = array(
"index.html",
"gate.html",
"comment\\1-\\2-\\3-\\4\\5\\6.html",
"cat\\1-\\2.html",
"cat\\1.html",
"cat\\1.html",
"cat\\1-\\2.html",
"cat\\1.html",
"cat\\1.html",
"article\\1.html",
"article\\1.html",
"article\\1.html",
"topic\\1-\\2.html",
"topic\\1.html",
"topic\\1.html",
"printout\\1.html",
"newspage\\1.html",
"articles",
"articles"
);

$s = preg_replace($urlin, $urlout, $s);
return $s;
}


The above would be the whole Articles section.

If I remember right, GT has additional files that need edited like session.php, mainfile.php, etc. I guess that's why hitwalker's code won't work.

Any working code out there for the PHP_Manual module?

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
montego
Site Admin



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

PostPosted: Thu Jun 15, 2006 6:32 am Reply with quote

Quote:

If I remember right, GT has additional files that need edited like session.php, mainfile.php, etc. I guess that's why hitwalker's code won't work.

Any working code out there for the PHP_Manual module?


Has nothing to do with why hitwalkers code did not work. It was strictly an issue of not having all the right rules in place. It was missing key "punctuation", basically the period ".". He had not placed the right rewrite rule back in .htaccess.

Can you post the lines for urlin/out and .htaccess just for your Googlefier version of the PHP_Manual "tap"? It really works exactly as GTNG does in terms of how the replacements and rewrite work so we should be able to get this to work.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
manunkind







PostPosted: Thu Jun 15, 2006 6:45 am Reply with quote

I have no code for it at all currently. That's what I was asking for.

I tried posting his code that he posted at the end and it just didn't work. I got a 500 server error. I tried a few things like removing the "[L]" at the end (because the rest of my code doesn't have that), and changing "modules.php" to "gate.html" (because that's how Googlifier was designed to work). And I just couldn't get it working.

So I have no current code at all to show you.
 
montego







PostPosted: Thu Jun 15, 2006 7:16 am Reply with quote

Ok, fair enough. By the way, the [L] should be added to the end of each of your rewrite rules as it helps to save processing time/resources. What it means is as soon as a "hit" is found it does not have to go any further (for that ONE link).

Ok, so it looks like the urlin line might be this:

"'(?<!/)gate.html\?name=PHP_Manual&amp;page=([[:alnum:]-\.]*)\.html'",

The urlout:

"php_manual-\\1.html",

The .htaccess:

RewriteRule ^php_manual-([[:alnum:]_-]*).html /gate.html?name= PHP_Manual&page=$1\.html [L]

Now, this is only the first rewrite rule of potentially 3 - 4. I am only giving you possible sample to work from. This is NOT tested and you may have to tweak it slightly to get it to work for you.
 
manunkind







PostPosted: Thu Jun 15, 2006 8:30 pm Reply with quote

Ok, I'll play with it. Thanks! Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©