forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: itang on October 31, 2004, 06:42:25 pm

Title: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
Post by: itang on October 31, 2004, 06:42:25 pm
i follow this mod from this topic:

http://forum.coppermine-gallery.net/index.php?topic=69.20

the author said it is usable.

But when i use it for cpg 1.3.2, it give an error like this:

Code: [Select]
Parse error: parse error, unexpected T_IF in /home/cpg/album.php on line 3
The original mod is like this:

Quote
HTACCESS hasn't changed much, but the most important thing is that now it points to index.php not album.php as it previously did.

Quote
RewriteEngine On
RewriteRule ^([a-z0-9&_=]+)$ index.php?username=$1


Second, ALBUM.PHP has change A LOT!:

Quote
<?php
require('include/init.inc.php')
if (isset($HTTP_GET_VARS['username'])) {
        $username = $HTTP_GET_VARS['username'];
        $results = mysql_query("SELECT user_id FROM cpg11d_users WHERE user_name = '$username'");
        list($row) = mysql_fetch_row($results);
        if (!$row) {
                $row = -10000;
        }
        $idnum=$row+10000;
        $catid = $idnum;
        $cat = $catid;
$HTTP_GET_VARS['cat'] = $cat;
}
?>


Lastly, I'm afraid I had to chang a tiny bit of INDEX.PHP:
I removed from the top:

Quote
require('include/init.inc.php');

and added

Quote
require('album.php');

Is it possible to make it work for cpg 1.3.2?

Thanks
Title: Re: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
Post by: Joachim Müller on November 01, 2004, 02:41:23 pm
when looking for help on a particular mod, you should reply to that mod's thread instead of starting your own mod. Mods are user contributions that come "as-is".
If you get a parse error this usually means you haven't applied the mod correctly, as it's the most basic "syntax error" message from PHP.

Joachim
Title: Re: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
Post by: itang on November 01, 2004, 02:52:46 pm
But it seems that you can't get it wrong to create the album.php file. I copied the content and pasted it in the notepad and savied it as an ANSI .php file. However, the pharse error still comes up.

Is it related to the $HTTP_GET_VARS function?

Just want to get help for this "old" mod for the new 1.3.2 version, sorry to post it here.

I think there may be someone who also want to have this mod applied to their 1.3.2.  ;)
Title: Re: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
Post by: Nibbler on November 01, 2004, 03:28:32 pm
There should be a semicolon at the end of require('include/init.inc.php')
Title: Re: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
Post by: itang on November 04, 2004, 03:26:52 am
Thanks admin for moving this topic into a right place.

Thanks Nibbler for helping the prase error.

However, there is a new error come out. The index page became blank and it showed:

Code: [Select]
Fatal error: Cannot redeclare cpggetuserdata() (previously declared in /home/ppi/cpg/include/init.inc.php:45) in /home/ppi/cpg/include/init.inc.php on line 45
There is no cpggetuserdata function in the album.php. Can anyone help? I am sorry that I have not much experience in php programming.

Just want to make the mod_write and the short url work, I think there are many people out there want this feature! :)
Title: Re: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
Post by: dEnA on February 12, 2006, 08:14:56 pm
anyone got this working yet?
Ps. sorry for replying. dont know if this was better than starting a new, because of this is so old  :o
EDIT: F*CK should have read a little bit more. I have 1.43 not 1.32
Title: Re: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
Post by: Nibbler on February 12, 2006, 08:55:20 pm
There is a mod posted on the mods board that will do this for 1.4