Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: The short url for user mod: http://you.com/username for cpg1.1x use in 1.3.2  (Read 9383 times)

0 Members and 1 Guest are viewing this topic.

itang

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 63

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
« Last Edit: February 13, 2006, 10:11:08 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

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
Logged

itang

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 63

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

Nibbler

  • Guest

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

itang

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 63

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

dEnA

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20

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
Logged

Nibbler

  • Guest

There is a mod posted on the mods board that will do this for 1.4
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.