Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Mar 03, 2007 11:41 am Reply with quote

This question came up in a recent forum thread and I felt like it deserved a Sticky response (since I have not had time to get my Wiki up and populated).

Any module and/or block, or even any other link for that matter, can have their links shortened with just a few short steps:

1) For just a new block going against an existing tapped module, simply create a new GTB-block-<<block name>>.php script using the existing GTB and GT files for that module. I have found that in 99% of the cases, once a module's links are "tapped", the block(s) use the same links and so there are usually on additional .htaccess statements required, just the new GTB/GT.

2) For a completely new module, use your browser's "copy link" feature and save off each link into a text file for later reference. At least copy those links that you will want to shorten.

3) Copy an existing module's GT-<<module name>>.php script to a new one and give it the name of the new module (the module name to use is the directory name for that module under the modules directory.

4) Modify the $urlin and $urlout arrays for each of the links that you copied off from step 2) above. The Sticky here has some good information on how to work with regex and mod_rewrite.

5) Add to your .htaccess file the needed RewriteRule statements to expand the URLs back to what they need to be for PHP-Nuke to work.

I know there are a lot of details left out, but these involve some basic understandings of PHP and regex and Apache mod_rewrite. It is difficult to teach these skills... you just have to try them on your own and use the numerous other ShortLinks as examples.

Good luck!

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Dawg
Newbie
Newbie



Joined: Mar 15, 2006
Posts: 12

PostPosted: Tue Aug 28, 2007 7:32 am Reply with quote

I have been reading here all morning but I guess I missing something.

I have a custom mod....
modules.php?name=BCHC

So I create a GT-BCHC.php file and place it in the Shortlinks folder with this in it....Simple Mod...Only one link...

Code:

<?php


$urlin = array(
'"(?<!/)modules.php\?name=BCHC"'
);

$urlout = array(

'BALTIMORE_CANYON_TO_HATTERAS_CANYON.html'
);

?>


Then I go into my htaccess file and put....

Code:

#BCHC
RewriteRule ^BALTIMORE_CANYON_TO_HATTERAS_CANYON.html modules.php?name=BCHC [L]


Now here is my question....I do all of this....then go into my main menu and I still get

modules.php?name=BCHC

What am I missing in this?
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 28, 2007 7:50 am Reply with quote

The GT-BCHC.php only taps the module (when you are IN the module) and nothing else. To also tap the menu link, if you are using the standard nuke modules block, you would also add these things into your GTB-block-Modules.php script.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Dawg
Newbie
Newbie



Joined: Mar 15, 2006
Posts: 12

PostPosted: Tue Aug 28, 2007 8:30 am Reply with quote

Ok, I thought it was me...Is it safe to just change the links in the menu?

I am using Sommaire.

Dawg
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 28, 2007 8:33 am Reply with quote

If your link is of type "External" you can make it whatever you like, however, I also have the "Tap" for Sommaire in my downloads if you do not already have it. It is just another GTB file...

*Edited* - as long as it matches what your rewrite is! Sorry, thought I'd better throw that in there...

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Dawg
Newbie
Newbie



Joined: Mar 15, 2006
Posts: 12

PostPosted: Tue Aug 28, 2007 9:19 am Reply with quote

Do I stll have to hard code the links using Extenal?

Dawg
 
View user's profile Send private message
Dawg
Newbie
Newbie



Joined: Mar 15, 2006
Posts: 12

PostPosted: Tue Aug 28, 2007 9:23 am Reply with quote

Never mind I got it....I have to change the SL block code to match...DUH!

Dave
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 28, 2007 8:58 pm Reply with quote

Glad you got it sir!

Regards,
montego

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
snype
Newbie
Newbie



Joined: May 25, 2010
Posts: 1

PostPosted: Wed May 26, 2010 7:00 am Reply with quote

Just like to say thanks for this post it has helped me a lot along with other posts on this forums i am now able to tap all my links and have done so with ease so once again thank you for this and the wonderful mod

Snype

_________________
http://phpnuke-install.com 
View user's profile Send private message
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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunchlinear-bunch