Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> ShortLinks/TegoNuke
Author Message
bdmdesign
Worker
Worker



Joined: May 11, 2009
Posts: 154
Location: Winsen/Luhe; Germany

PostPosted: Mon Nov 09, 2009 4:30 pm Reply with quote

Ok i have made a GT File like this:
Code:


$urlin = array(
'"(?<!/)modules.php\?name=catalog&amp;file=product_reviews_info&amp;products_id=([0-9+]*)&amp;reviews_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=product_reviews_write&amp;products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=product_reviews&amp;products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=reviews"',
'"(?<!/)modules.php\?name=catalog&amp;file=tell_a_friend&amp;products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=products_new&amp;page=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=products_new"',
'"(?<!/)modules.php\?name=catalog&amp;file=product_info&amp;products_id=([0-9+]*)&amp;action=add_product"',
'"(?<!/)modules.php\?name=catalog&amp;file=product_info&amp;products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=specials"',
'"(?<!/)modules.php\?name=catalog&amp;file=impressum"',
'"(?<!/)modules.php\?name=catalog&amp;file=faq"',
'"(?<!/)modules.php\?name=catalog&amp;file=conditions"',
'"(?<!/)modules.php\?name=catalog&amp;file=privacy"',
'"(?<!/)modules.php\?name=catalog&amp;file=shipping"',
'"(?<!/)modules.php\?name=catalog&amp;file=checkout_success"',
'"(?<!/)modules.php\?name=catalog&amp;file=checkout_confirmation"',
'"(?<!/)modules.php\?name=catalog&amp;file=checkout_payment"',
'"(?<!/)modules.php\?name=catalog&amp;file=checkout_shipping"',
'"(?<!/)modules.php\?name=catalog&amp;file=shopping_cart&amp;sort=([0-9+a-zA-Z]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=shopping_cart"',
'"(?<!/)modules.php\?name=catalog&amp;file=address_book_process&amp;edit=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=address_book_process"',
'"(?<!/)modules.php\?name=catalog&amp;file=address_book"',
'"(?<!/)modules.php\?name=catalog&amp;file=account_notifications"',
'"(?<!/)modules.php\?name=catalog&amp;file=account_newsletters"',
'"(?<!/)modules.php\?name=catalog&amp;file=account_edit"',
'"(?<!/)modules.php\?name=catalog&amp;file=account_history_info&amp;order_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=account_history_info&amp;([0-9+]*)=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=account_history"',
'"(?<!/)modules.php\?name=catalog&amp;file=account"',
'"(?<!/)modules.php\?name=catalog&amp;file=index&amp;manufacturers_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=index&amp;cPath=([0-9+]*)_([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=index&amp;cPath=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&amp;file=index"',
'"(?<!/)modules.php\?name=catalog"'
);

$urlout = array(
'catalog-file-product_reviews_info-products_id-\\1-reviews_id-\\2.html',
'catalog-file-product_reviews_write-products_id-\\1.html',
'catalog-file-product_reviews-products_id-\\1.html',
'catalog-file-reviews.html',
'catalog-file-tell_a_friend-\\1.html',
'catalog-file-products_new-page-\\1.html',
'catalog-file-products_new.html',
'catalog-file-product_info-\\1-add_product.html',
'catalog-file-product_info-\\1.html',
'catalog-file-specials.html',
'catalog-file-impressum.html',
'catalog-file-faq.html',
'catalog-file-conditions.html',
'catalog-file-privacy.html',
'catalog-file-shipping.html',
'catalog-file-checkout_success.html',
'catalog-file-checkout_confirmation.html',
'catalog-file-checkout_payment.html',
'catalog-file-checkout_shipping.html',
'catalog-file-shopping_cart-sort-\\1.html',
'catalog-file-shopping_cart.html',
'catalog-file-address_book_process-edit-\\1.html',
'catalog-file-address_book_process.html',
'catalog-file-address_book.html',
'catalog-file-account_notifications.html',
'catalog-file-account_newsletters.html',
'catalog-file-account_edit.html',
'catalog-file-account_history_info-order_id-\\1.html',
'catalog-file-account_history_info-\\1-\\2.html',
'catalog-file-account_history.html',
'catalog-file-account.html',
'catalog-file-manufacturers_id-\\1.html',
'catalog-cPath-\\1_\\2.html',
'catalog-cPath-\\1.html',
'catalog.html',
'catalog.html'


In .htacces:

Code:


RewriteRule ^catalog-file-product_reviews_info-products_id-([0-9+]*)-reviews_id-([0-9+]*).html modules.php?name=catalog&amp;file=product_reviews_info&amp;products_id=$1&amp;reviews_id=$2 [L]
RewriteRule ^catalog-file-product_reviews_write-products_id-([0-9+]*).html modules.php?name=catalog&amp;file=product_reviews_write&amp;products_id=$1 [L]
RewriteRule ^catalog-file-product_reviews-products_id-([0-9+]*).html modules.php?name=catalog&amp;file=product_reviews&amp;products_id=$1 [L]
RewriteRule ^catalog-file-reviews.html modules.php?name=catalog&amp;file=reviews [L]
RewriteRule ^catalog-file-tell_a_friend-([0-9+]*).html modules.php?name=catalog&amp;file=tell_a_friend&amp;products_id=$1 [L]
RewriteRule ^catalog-file-products_new-page-([0-9+]*).html modules.php?name=catalog&amp;file=products_new&amp;page=$1 [L]
RewriteRule ^catalog-file-products_new.html modules.php?name=catalog&amp;file=products_new [L]
RewriteRule ^catalog-file-product_info-([0-9+]*)-add_product.html modules.php?name=catalog&amp;file=product_info&amp;products_id=$1&amp;action=add_product [L]
RewriteRule ^catalog-file-product_info-([0-9+]*).html modules.php?name=catalog&amp;file=product_info&amp;products_id=$1 [L]
RewriteRule ^catalog-file-specials.html modules.php?name=catalog&amp;file=specials [L]
RewriteRule ^catalog-file-impressum.html modules.php?name=catalog&amp;file=impressum [L]
RewriteRule ^catalog-file-faq.html modules.php?name=catalog&amp;file=faq [L]
RewriteRule ^catalog-file-conditions.html modules.php?name=catalog&amp;file=conditions [L]
RewriteRule ^catalog-file-privacy.html modules.php?name=catalog&amp;file=privacy [L]
RewriteRule ^catalog-file-shipping.html modules.php?name=catalog&amp;file=shipping [L]
RewriteRule ^catalog-file-checkout_success.html modules.php?name=catalog&amp;file=checkout_success [L]
RewriteRule ^catalog-file-checkout_confirmation.html modules.php?name=catalog&amp;file=checkout_confirmation [L]
RewriteRule ^catalog-file-checkout_payment.html modules.php?name=catalog&amp;file=checkout_payment [L]
RewriteRule ^catalog-file-checkout_shipping.html modules.php?name=catalog&amp;file=checkout_shipping [L]
RewriteRule ^catalog-file-shopping_cart-sort-([0-9+a-zA-Z]*).html modules.php?name=catalog&amp;file=shopping_cart&amp;sort=$1 [L]
RewriteRule ^catalog-file-shopping_cart.html modules.php?name=catalog&amp;file=shopping_cart [L]
RewriteRule ^catalog-file-address_book_process-edit-([0-9+]*).html modules.php?name=catalog&amp;file=address_book_process&amp;edit=$1 [L]
RewriteRule ^catalog-file-address_book_process.html modules.php?name=catalog&amp;file=address_book_process [L]
RewriteRule ^catalog-file-address_book.html modules.php?name=catalog&amp;file=address_book [L]
RewriteRule ^catalog-file-account_notifications.html modules.php?name=catalog&amp;file=account_notifications [L]
RewriteRule ^catalog-file-account_newsletters.html modules.php?name=catalog&amp;file=account_newsletters [L]
RewriteRule ^catalog-file-account_edit.html modules.php?name=catalog&amp;file=account_edit [L]
RewriteRule ^catalog-file-account_history_info-order_id-([0-9+]*).html modules.php?name=catalog&amp;file=account_history_info&amp;order_id=$1 [L]
RewriteRule ^catalog-file-account_history_info-([0-9+]*)-([0-9+]*).html modules.php?name=catalog&amp;file=account_history_info&amp;$1=$2 [L]
RewriteRule ^catalog-file-account_history.html modules.php?name=catalog&amp;file=account_history [L]
RewriteRule ^catalog-file-account.html modules.php?name=catalog&amp;file=account [L]
RewriteRule ^catalog-file-manufacturers_id-([0-9+]*).html modules.php?name=catalog&amp;file=index&amp;manufacturers_id=$1 [L]
RewriteRule ^catalog-cPath-([0-9+]*)_([0-9+]*).html modules.php?name=catalog&amp;file=index&amp;cPath=$1_$2 [L]
RewriteRule ^catalog-cPath-([0-9+]*).html modules.php?name=catalog&amp;file=index&amp;cPath=$1 [L]
RewriteRule ^catalog.html modules.php?name=catalog&amp;file=index [L]
RewriteRule ^catalog.html modules.php?name=catalog [L]


now i go over the menue Block in the Catalog, the "modules?name=catalog" was rewriten to catalog.html, but not the rest.

What is wrong ?

Best Regards

Peter

_________________
CMS-Version: pragmaMx 1.12.3.1.33.4.14 :: PHP-Version: 5.3.14 :: MySQL-Version: 5.5.23-log :: Server-Version: Apache/2.2.21 (Linux/SUSE)
Projekt: osc4pragmaMx- 2.3.2 in development

Last edited by bdmdesign on Tue Nov 10, 2009 10:49 am; edited 1 time in total 
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Mon Nov 09, 2009 4:51 pm Reply with quote

you need a GTB file that corresponds to the block.

for the quick and easy open your GT-YourModuleName.php and save as:
GTB-block-BlockFileNameHere.php

you can remove any rewrites in the GTB file that aren't used within the block.... if you like Smile
 
View user's profile Send private message Visit poster's website
meotoo
Hangin' Around



Joined: Aug 04, 2009
Posts: 36

PostPosted: Mon Nov 09, 2009 5:11 pm Reply with quote

Hi,

1) You need to escape . and = characters in your urlin array.

2) You have to replace &amp; by & in your .htaccess rules.

hope that helps.
 
View user's profile Send private message Visit poster's website
bdmdesign







PostPosted: Mon Nov 09, 2009 5:29 pm Reply with quote

spasticdonkey wrote:
you need a GTB file that corresponds to the block.

for the quick and easy open your GT-YourModuleName.php and save as:
GTB-block-BlockFileNameHere.php

you can remove any rewrites in the GTB file that aren't used within the block.... if you like Smile


Ok, but the blockfiles are coming later.
Its at this time only a problem with the catalog modules.

Look here please

Ok i try the &amp, replaceing.

Edit: @meotoo:

In all other GT-Modules Files its the same code:

'"(?<!/)modules.php\?name=Forums&amp;file=viewtopic&amp;t=([0-9]*)&amp;start=([0-9]*)"',

I have copy the GT-Downloads.php and change it to the catalog syntax (see my first post). The File called GT-catalog.php

Edit End

Best Regards

Peter
 
meotoo







PostPosted: Mon Nov 09, 2009 5:48 pm Reply with quote

Quote:
In all other GT-Modules Files its the same code


It does not mean it isn't wrong Wink


run the following under php and you'll notice it for yourself:

echo preg_quote('modules.php?foo=bar');
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Nov 09, 2009 6:25 pm Reply with quote

meotoo wrote:
Hi,

1) You need to escape . and = characters in your urlin array.

2) You have to replace &amp; by & in your .htaccess rules.

hope that helps.


That is incorrect.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
Palbin







PostPosted: Mon Nov 09, 2009 6:35 pm Reply with quote

I am not a regex expert but I think most of your "[0-9+]*" should be "[0-9]*".
 
bdmdesign







PostPosted: Mon Nov 09, 2009 6:36 pm Reply with quote

Must i added some thing in the modules index ?
Or in the .htacces in the catalog?

Its my first time to write SEO Urls.

Give it a universal Rules for Short URL ?

Sorry for all my ask.

Best Regards


Peter
 
Palbin







PostPosted: Mon Nov 09, 2009 6:44 pm Reply with quote

Sorry bdmdesign, but I am having a hard time understanding exactly what you are saying.

If you want a "universal" tap to work across the site you need to add it to the GTZ-PageTap.php.

If that is not what you needed sorry again.
 
bdmdesign







PostPosted: Mon Nov 09, 2009 6:45 pm Reply with quote

Palbin wrote:
I am not a regex expert but I think most of your "[0-9+]*" should be "[0-9]*".


Hmmm, but Rules without [0-9+]* dosnt works.
Its works only one Rule

Sad

Best Regards


Peter
 
bdmdesign







PostPosted: Mon Nov 09, 2009 6:53 pm Reply with quote

Palbin wrote:
Sorry bdmdesign, but I am having a hard time understanding exactly what you are saying.

If you want a "universal" tap to work across the site you need to add it to the GTZ-PageTap.php.

If that is not what you needed sorry again.


No, its ok. I mean a Universal Rule for all new Modules.
I will try it. But its must works with the GT-My_Modules.php, too.

And sorry for my hard English, its only school english.
I can speak better German than english Sad

Best Regards

Peter
 
meotoo







PostPosted: Mon Nov 09, 2009 7:30 pm Reply with quote

Palbin wrote:
meotoo wrote:
Hi,

1) You need to escape . and = characters in your urlin array.

2) You have to replace &amp; by & in your .htaccess rules.

hope that helps.


That is incorrect.


pardon? Wink

which point? or do you mean both!?

I have to admit point (1) is strictly talking, it should (obviously) work without escaping them, but i'm following strict PHP rules Wink

Seriously, if the dot isn't escaped, it will convert in the same way modules.php than modulesZphp - since as you should know a dot means "any character" in regexp.

Regarding point (2), i have no doubt... it is buggy to write urls in your browser's location bar in the form: yoursite.com/blabla.php?foo=bar&amp;home=house

because your scripts will see it as

_GET['foo'] = 'bar';
_GET['amp;home'] = 'house';

or that i noticed, at least...
 
bdmdesign







PostPosted: Mon Nov 09, 2009 7:48 pm Reply with quote

meotoo wrote:
Palbin wrote:
meotoo wrote:
Hi,

1) You need to escape . and = characters in your urlin array.

2) You have to replace &amp; by & in your .htaccess rules.

hope that helps.


That is incorrect.


pardon? Wink

which point? or do you mean both!?

I have to admit point (1) is strictly talking, it should (obviously) work without escaping them, but i'm following strict PHP rules Wink

Seriously, if the dot isn't escaped, it will convert in the same way modules.php than modulesZphp - since as you should know a dot means "any character" in regexp.

Regarding point (2), i have no doubt... it is buggy to write urls in your browser's location bar in the form: yoursite.com/blabla.php?foo=bar&amp;home=house

because your scripts will see it as

_GET['foo'] = 'bar';
_GET['amp;home'] = 'house';

or that i noticed, at least...


The second part is ok, that was my mistake. All other rules in the htacces are with "&" and not with"&amp;"

But it dosnt works

Best Regards

Peter
 
bdmdesign







PostPosted: Mon Nov 09, 2009 7:53 pm Reply with quote

But now i go sleep.


Best Regards

Peter
 
montego
Site Admin



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

PostPosted: Tue Nov 10, 2009 6:52 am Reply with quote

bdmdesign, there has been a bunch of discussion here that I am concerned we are not tracking any longer to the real problem. For one, ([0-9+]*) is absolutely not correct unless your ID's being tapped also include the "+" sign in them which I highly doubt. This should be ([0-9]*) throughout GT and .htaccess.

In your original posting, you mentioned no issues with the module taps at all, it was with some kind of block. Is this a block that is configured via the ACP --> Blocks administration tool or something embedded within the module?

It would really help everyone help you if we could actually see the issue you are referring to.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
bdmdesign







PostPosted: Tue Nov 10, 2009 8:45 am Reply with quote

montego wrote:
bdmdesign, there has been a bunch of discussion here that I am concerned we are not tracking any longer to the real problem. For one, ([0-9+]*) is absolutely not correct unless your ID's being tapped also include the "+" sign in them which I highly doubt. This should be ([0-9]*) throughout GT and .htaccess.

In your original posting, you mentioned no issues with the module taps at all, it was with some kind of block. Is this a block that is configured via the ACP --> Blocks administration tool or something embedded within the module?

It would really help everyone help you if we could actually see the issue you are referring to.


Ok, i have made the file GT-catalog.php for the modules catalog (osc2nuke, osc-Cart4nuke, etc ....)

The Blockfiles i dont have createt, because i will test the modules first without the block's rewrite.

I have change the ([0-9+]*) to ([0-9]*), ((?<!/) to (?!/) only in the GT file) and "&amp;" to "&" in the GT-catalog and htacces.

Now i get this URL's:

"catalog.html?file=products_new"

I have try this, too: [ Only registered users can see links on this board! Get registered or login! ]

Its the same. Shocked Rolling Eyes Laughing

Best Regards

Peter

Thanx @ll for Help Brothers Wink
 
meotoo







PostPosted: Tue Nov 10, 2009 9:02 am Reply with quote

nice you followed the tips i told you by PM Razz

Quote:
I have try this, too: [ Only registered users can see links on this board! Get registered or login! ]

Its the same. Shocked Rolling Eyes Laughing


This fixed function IS ONLY/MAINLY to perform the links's ampersands conversion on a safe way - read, only over links and NOT over the whole HTML code Razz
 
bdmdesign







PostPosted: Tue Nov 10, 2009 9:05 am Reply with quote

Thanx @ll for Help again Brothers.

I have configure the right things out now. Its works now.

The "&amp;" to "&" in the GT File dont was a good idea Wink

Edit:
Not 100% correct, if i go on Home in the Navi/Menue Block, the URLs are Nuke URLs. If i click now on "osc-Cart4nuke 0.0.1" in the Menue Block, the URLs are rewriten. Shocked Rolling Eyes

Edit End

Best Regards

Peter
 
bdmdesign







PostPosted: Tue Nov 10, 2009 9:37 am Reply with quote

Ok now its works 100% Correct.

Best Regards

Peter
 
bdmdesign







PostPosted: Tue Nov 10, 2009 10:48 am Reply with quote

You can Download now the Short Links for your osc Nuke Modules on [ Only registered users can see links on this board! Get registered or login! ] .

Have Fun.

Best Regards

Peter
 
montego







PostPosted: Wed Nov 11, 2009 11:57 am Reply with quote

bdmdesign, your web server is not configured properly to download a .7z file. You might either want to fix the mime/application handlers or try .zip.
 
bdmdesign







PostPosted: Wed Nov 11, 2009 12:09 pm Reply with quote

Ok, i have try it to get a File: Opera and Konqueror works right and Firefox not ?!?

Can you test it with IE, too please?

Best regards

Peter
 
montego







PostPosted: Wed Nov 11, 2009 12:37 pm Reply with quote

Just tested using IE8 and it does download. So, yes, it might be FF3.0.x which is what i have on this PC.
 
bdmdesign







PostPosted: Wed Nov 11, 2009 1:03 pm Reply with quote

montego wrote:
Just tested using IE8 and it does download. So, yes, it might be FF3.0.x which is what i have on this PC.


Yes dito, its a FF 3.0.x bug.


Best Regards

Peter
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> ShortLinks/TegoNuke

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 ©