The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2 The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2

Started by itang, October 31, 2004, 06:42:25 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

itang

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:

Parse error: parse error, unexpected T_IF in /home/cpg/album.php on line 3

The original mod is like this:

QuoteHTACCESS 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

Joachim Müller

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

itang

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.  ;)

Nibbler

There should be a semicolon at the end of require('include/init.inc.php')

itang

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:

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! :)

dEnA

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

Nibbler