Hello,
Is here any MOD with what I can rewrite urls
Something like that.
h**p://smartor.is-root.com/viewtopi...=asc&highlight=
Thanks
FAP SUPPORT - Rewrite Jpg Url-s In Album
Subject: Re: Rewrite Jpg Url-s In Album
I copied this to my forums root and it ain't work.
Could you please explain better?
What changes I need to do to show the pictures in other forums?
Thanks.
Could you please explain better?
What changes I need to do to show the pictures in other forums?
Thanks.
Subject: Re: Rewrite Jpg Url-s In Album
Works for me as below.......
My phpbb_root is web_root/forum and I placed the htaccess file in my web_root
Accessed the pic by MyDoman.com/pic_ID.jpg
If your web_root is also your phpbb_root try this.....
Note that you must have Hotlink Prevention disabled (ACP) to use this short url in any domain other that yours (or have that domain in the allowed list)
My phpbb_root is web_root/forum and I placed the htaccess file in my web_root
Accessed the pic by MyDoman.com/pic_ID.jpg
RewriteEngine On
RewriteBase /
RewriteRule ^pic_([0-9]*).jpg forum/album_pic.php?pic_id=> RewriteRule ^pic_([0-9]*).jpg forum/album_pic.php?pic_id=$1 [L,NC]< [L,NC]
RewriteBase /
RewriteRule ^pic_([0-9]*).jpg forum/album_pic.php?pic_id=> RewriteRule ^pic_([0-9]*).jpg forum/album_pic.php?pic_id=$1 [L,NC]< [L,NC]
If your web_root is also your phpbb_root try this.....
RewriteEngine On
RewriteBase /
RewriteRule ^pic_([0-9]*).jpg album_pic.php?pic_id=> RewriteRule ^pic_([0-9]*).jpg album_pic.php?pic_id=$1 [L,NC]< [L,NC]
RewriteBase /
RewriteRule ^pic_([0-9]*).jpg album_pic.php?pic_id=> RewriteRule ^pic_([0-9]*).jpg album_pic.php?pic_id=$1 [L,NC]< [L,NC]
Note that you must have Hotlink Prevention disabled (ACP) to use this short url in any domain other that yours (or have that domain in the allowed list)
Subject: Re: Rewrite Jpg Url-s In Album
Is it possible to rewrite user album urls ?
Like :
www.domain.com/forum/album.php?user_id=123
To
www.domain.com/forum/ablum/username/
I guess we need to fetch the username from the url in album.php and then get the user_id corresponding to this username and then process further. I am not very good at PHP but still I would try, but in the meantime if there are experts who would like to do it I would really appreciate.
Like :
www.domain.com/forum/album.php?user_id=123
To
www.domain.com/forum/ablum/username/
I guess we need to fetch the username from the url in album.php and then get the user_id corresponding to this username and then process further. I am not very good at PHP but still I would try, but in the meantime if there are experts who would like to do it I would really appreciate.
Subject: Re: Rewrite Jpg Url-s In Album
OK I have done it but with some problems.
Its now successfully redirecting
www.domain.com/forum/album.php?username=someuser
to
www.domain.com/album/someuser/
But the problem is that its not picking the correct urls of images and other links since all the paths are relative. I need some help here.
Here is what I did : ********** PLEASE DO NOT TRY THIS YET **********
Open .HTACCESS file
OPEN album.php
FIND
AFTER ADD
OPEN overall_header.tpl
Change the relative path of stylesheet to absolute
Its now successfully redirecting
www.domain.com/forum/album.php?username=someuser
to
www.domain.com/album/someuser/
But the problem is that its not picking the correct urls of images and other links since all the paths are relative. I need some help here.
Here is what I did : ********** PLEASE DO NOT TRY THIS YET **********
Open .HTACCESS file
### Rewrite RULE FOR USER ALBUMS
RewriteRule ^album/([^/]+)/?$ /forum/album.php?username=> RewriteRule ^album/([^/]+)/?$ /forum/album.php?username=$1 [QSA,L] < [QSA,L]
RewriteRule ^album/([^/]+)/?$ /forum/album.php?username=> RewriteRule ^album/([^/]+)/?$ /forum/album.php?username=$1 [QSA,L] < [QSA,L]
OPEN album.php
FIND
elseif (isset ($_GET['user_id']))
{
$album_user_id = intval($_GET['user_id']);
}
{
$album_user_id = intval($_GET['user_id']);
}
AFTER ADD
// Display album by username by Manish
elseif (isset ($_POST['username']))
{
$album_user_name = $_POST['username'];
$sql_1 = "SELECT * FROM ". USERS_TABLE . " WHERE username = '" . $album_user_name. "'
AND user_id <> " . ANONYMOUS;
if( !($result_1 = $db->sql_query($sql_1)) )
{
message_die(GENERAL_ERROR, 'Username '.$album_user_name.' does not exist', '', __LINE__, __FILE__, $sql_1);
}
elseif (isset ($_GET['username']))
{
$album_user_name = $_GET['username'];
$sql_1 = "SELECT * FROM ". USERS_TABLE . " WHERE username = '" . $album_user_name. "'
AND user_id <> " . ANONYMOUS;
if( !($result_1 = $db->sql_query($sql_1)) )
{
message_die(GENERAL_ERROR, 'Username '.$album_user_name.' does not exist', '', __LINE__, __FILE__, $sql_1);
}
$result_1 = $db->sql_query($sql_1);
$fetch_1 = $db->sql_fetchrow($result_1);
$album_user_id = $fetch_1['user_id'];
}
// display album by username by Manish ends
elseif (isset ($_POST['username']))
{
$album_user_name = $_POST['username'];
$sql_1 = "SELECT * FROM ". USERS_TABLE . " WHERE username = '" . $album_user_name. "'
AND user_id <> " . ANONYMOUS;
if( !($result_1 = $db->sql_query($sql_1)) )
{
message_die(GENERAL_ERROR, 'Username '.$album_user_name.' does not exist', '', __LINE__, __FILE__, $sql_1);
}
elseif (isset ($_GET['username']))
{
$album_user_name = $_GET['username'];
$sql_1 = "SELECT * FROM ". USERS_TABLE . " WHERE username = '" . $album_user_name. "'
AND user_id <> " . ANONYMOUS;
if( !($result_1 = $db->sql_query($sql_1)) )
{
message_die(GENERAL_ERROR, 'Username '.$album_user_name.' does not exist', '', __LINE__, __FILE__, $sql_1);
}
$result_1 = $db->sql_query($sql_1);
$fetch_1 = $db->sql_fetchrow($result_1);
$album_user_id = $fetch_1['user_id'];
}
// display album by username by Manish ends
OPEN overall_header.tpl
Change the relative path of stylesheet to absolute
Subject: Re: Rewrite Jpg Url-s In Album
Ok I added the following and I think I am close
OPEN overall_header.tpl
FIND
<meta http-equiv="Content-Style-Type" content="text/css">
AFTER ADD
<base href="http://www.domain.com/forum/" />
OPEN overall_header.tpl
FIND
<meta http-equiv="Content-Style-Type" content="text/css">
AFTER ADD
<base href="http://www.domain.com/forum/" />
Page 1 of 1
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.3922s (PHP: 5% SQL: 95%)
SQL queries: 29 - Debug Off - GZIP Enabled