PHPNuke News Module

Discuss practical ways rearrange URLs using mod_rewrite.

Postby xiketuan » Wed Feb 25, 2009 5:34 pm

you can tutorial sample mode little code for modules News phpnuke? thanks

i can use shortlink.

Code: Select all
RewriteRule ^cat-([0-9]*).html modules.php?name=News&op=viewcat&catid=$1 [L]


Code: Select all
$urlin = array(
'"(?<!/)modules.php\?name=News&amp;op=viewcat&amp;catid=([0-9]*)&amp;ttitle2=([/:\-\'{}()\,\._&a-zA-Z0-9+= ]*)"',
'"(?<!/)modules.php\?name=News&amp;op=viewcat&amp;catid=([0-9]*)"',
)

Code: Select all
$urlout = array(
'cat\\1-page\\2.html',
'cat-\\1-\\2.html',
'cat-\\1.html',)


modules News file index.php

a href=\"modules.php?name=$module_name&op=viewcat&catid=$cat_id&$ttitle2
view site : http://localhost/tlnn/cat-2.html&Xa-hoi---Giao-duc

help me : http://localhost/tlnn/cat-2-Xa-hoi---Giao-duc.html
xiketuan
 
Posts: 10
Joined: Wed Feb 25, 2009 4:56 pm

Postby richardk » Thu Feb 26, 2009 7:04 am

What's wrong with what you already have?
What error are you getting?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby xiketuan » Thu Feb 26, 2009 4:54 pm

Modules News :
$cat_name = "<a href=\"modules.php?name=$module_name&op=viewcat&catid=$cat_id&$ttitle2\" class=\"titmuc\">$cat_title</a>";


How can this like this:
http://localhost/tlnn/cat-2-Xa-hoi---Giao-duc.html
xiketuan
 
Posts: 10
Joined: Wed Feb 25, 2009 4:56 pm

Postby richardk » Sun Mar 01, 2009 7:31 am

Try
Code: Select all
$cat_name = "<a href=\"cat-$cat_id-$ttitle2.html\" class=\"titmuc\">$cat_title</a>";

with
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^cat-([0-9]+)-([^/]+)\.html$ ./modules.php?name=News&op=viewcat&catid=$1&ttitle2=$2 [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby xiketuan » Sun Mar 01, 2009 6:21 pm

Thank you for helping your satisfaction.

you are currently using the Shortlink. you do it only in the revised

file = shortlink.php with mainmodule News.

but used this modules: the url: cat-catid-title, can modify how to show to: cat / catid / title is better, would just hack instructions.
xiketuan
 
Posts: 10
Joined: Wed Feb 25, 2009 4:56 pm

Postby richardk » Mon Mar 02, 2009 4:56 am

I do not understand.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby xiketuan » Mon Mar 02, 2009 4:49 pm

instead to rewrite: http://mysite.com/cat-2-Xa-hoi---Giao-duc.html wide that cat-2: the subject 2, the Xa-hoi --- Communication -Germany is the name of the topic, can change in Shortlinks to rewrite this:

http://mysite.com/cat-2/Xa-hoi-Giao-duc.html
help me
xiketuan
 
Posts: 10
Joined: Wed Feb 25, 2009 4:56 pm

Postby richardk » Tue Mar 03, 2009 3:12 am

For /cat-2-Xa-hoi---Giao-duc.html
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^cat-([0-9]+)-([^/]+)\.html$ ./modules.php?name=News&op=viewcat&catid=$1 [L]


For /cat-2/Xa-hoi-Giao-duc.html
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^cat-([0-9]+)/([^/]+)\.html$ ./modules.php?name=News&op=viewcat&catid=$1 [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby xiketuan » Wed Mar 25, 2009 1:43 am

i use shortlink :
Code: Select all
<?php
/************************************************************************
* Script:     Tanhlinh.com ShortLinks

************************************************************************/

$urlin = array(
'"(?<!/)modules.php\?name=News&amp;op=viewcat&amp;catid=([0-9]*)&amp;cattitleseo=([a-zA-Z0-9-_]*)&amp;page=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;op=viewcat&amp;catid=([0-9]*)&amp;page=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;op=viewcat&amp;catid=([0-9]*)&amp;cattitleseo=([a-zA-Z0-9-_]*)"',
'"(?<!/)modules.php\?name=News&amp;op=viewcat&amp;catid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;op=tabdetail&amp;catid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;file=print&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;file=friend&amp;op=FriendSend&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;file=friend"',
'"(?<!/)modules.php\?name=News&amp;file=save&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;page=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;op=viewst&amp;sid=([0-9]*)&amp;titleseo=([a-zA-Z0-9-_]*)"',
'"(?<!/)modules.php\?name=News&amp;op=viewst&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;op=viewtop&topicid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;op=addcomment&amp;sid=([0-9]*)&amp;titleseo=([a-zA-Z0-9-_]*)"',
'"(?<!/)modules.php\?name=News&amp;op=addcomment&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;file=comm&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;op=showcomm&amp;sid=([0-9]*)&amp;titleseo=([a-zA-Z0-9-_]*)"',
'"(?<!/)modules.php\?name=News&amp;op=showcomm&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=News&amp;file=addnews"',
'"(?<!/)modules.php\?name=News&op=archive&day=$1&month=$2&year=$3"',
'"(?<!/)modules.php\?name=News"',
'"(?<!/)modules.php\?name=Private_Messages&amp;mode=post&amp;u=([0-9]*)"',
'"(?<!/)modules.php\?name=Search&amp;type=comments&amp;sid=([0-9]*)"',
'"(?<!/)modules.php\?name=Your_Account&amp;op=userinfo&amp;username=([a-zA-Z0-9_-]*)"',
'"(?<!/)modules.php\?name=Your_Account&amp;op=([a-z_]*)"',
);

$urlout = array(
'tlnn-chude\\1-\\2-trang\\3.html',
'tlnn-chude\\1-trang\\2.html',
'tlnn-chude-\\1/\\2.html',
'tlnn-chude-\\1.html',
'tlnn-tab-\\1.html',
'tlnn-in-\\1.html',
'tlnn-goi-\\1.html',
'tlnn-goi.html',
'tlnn-luu-\\1.html',
'tlnn-trang-\\1.html',
'tlnn-\\1-\\2.html',
'tlnn-\\1.html',
'tlnn-sukien-\\1.html',
'tlnn-goithaoluan-\\1-\\2.html',
'tlnn-goithaoluan-\\1.html',
'tlnn-thaoluan-\\1.html',
'tlnn-xemthaoluan-\\1-\\2.html',
'tlnn-xemthaoluan-\\1.html',
'goi-bai-viet.html',
'tlnn-ngay\\1-thang\\2-nam\\3.html"',
'tintuc.html',
'messages-post-\\1.html',
'search-comments-\\1.html',
'userinfo-\\1.html',
'account-\\1.html',
);

?>


help me.
xiketuan
 
Posts: 10
Joined: Wed Feb 25, 2009 4:56 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 29 guests

cron