Advanced search  

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]

Pages: 1 2 3 [4]   Go Down

Author Topic: short url to user albums  (Read 108933 times)

0 Members and 1 Guest are viewing this topic.

pcboy123

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: short url to user albums
« Reply #60 on: March 14, 2006, 08:42:38 pm »

then read this thread entirely, you have to apply the version for cpg1.4.x


i read this over and over again and i cant find the right code
for cpg 1.4.4?

so if it aint any trouble can you help me??
Logged

altagame

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: short url to user albums
« Reply #61 on: March 17, 2006, 01:01:37 am »

I have run into trouble with this one as well.

I have inserted the following code for phpBB;

Code: [Select]
$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
  $qq = urlencode($qq);
      $sql = "SELECT user_id " . "FROM " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " " . "WHERE username = '". mysql_escape_string($qq) ."'";

    $result = db_query($sql, $UDB_DB_LINK_ID);

    if (mysql_num_rows($result)>0) {
        $u = mysql_fetch_array($result);
        $HTTP_GET_VARS['cat'] = sprintf("1%04d",$u[0]);
  }
  else {
    cpg_die(ERROR, '"' . $qq . '" YOUR ERROR MESSAGE HERE', __FILE__, __LINE__);
  }

}



//
// Main code

This was the proper code, or so I thought from Moodi on July 18, 2004. Titled; My change for work with PHPBB intregration

After adding this code to the index.php file, I get a blank page returned when going to; ../gallery/?UserName


Any thoughts?

Thanks everyone, I am sure its a great mod, just gotta get it working.

Alta.
Logged

pandahuang

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: short url to user albums
« Reply #62 on: April 20, 2006, 01:37:59 pm »

I had read the subject http://forum.coppermine-gallery.net/index.php?topic=1659.40 entirely..

But when I copy the code to index.php and link to the url

 http://gallary/?userid

it didn't work , the page desplayed blank !!

any idea? thanks ^^

my cpg version is : 1.4.4
Logged

pandahuang

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: short url to user albums
« Reply #63 on: April 20, 2006, 05:01:48 pm »

Reply myself ..  ::)

in this code .. cpg132_users is the user table in my cpg.

Code: [Select]
$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
$qq = eregi_replace ( '%20', ' ', $qq);
$qq=mysql_escape_string($qq);
$sql = "SELECT user_id from `cpg132_users` WHERE `user_name` = \"$qq\"";
$result1 = mysql_query($sql);
if (mysql_num_rows($result1)>0) {
 list($uid) = mysql_fetch_array($result1);
 $cat = sprintf("1%04d",$uid);
}
mysql_free_result($result1);
}


maybe it's ugly But it works in my cpg 1.4.4   ;D
Logged

pcboy123

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: short url to user albums
« Reply #64 on: April 20, 2006, 05:35:53 pm »

Reply myself ..  ::)

in this code .. cpg132_users is the user table in my cpg.

Code: [Select]
$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
$qq = eregi_replace ( '%20', ' ', $qq);
$qq=mysql_escape_string($qq);
$sql = "SELECT user_id from `cpg132_users` WHERE `user_name` = \"$qq\"";
$result1 = mysql_query($sql);
if (mysql_num_rows($result1)>0) {
 list($uid) = mysql_fetch_array($result1);
 $cat = sprintf("1%04d",$uid);
}
mysql_free_result($result1);
}


maybe it's ugly But it works in my cpg 1.4.4   ;D

COOL I been looking for this code..
ill try it out later today and let you know..
Logged

andyleery

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 78
Re: short url to user albums
« Reply #65 on: June 13, 2007, 10:53:19 am »

Hi I tried to install this hack but it doesent work! www.bollybilder.de/gallery/?Andy.
I want to start soon, hope we will fix it together ^^
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: short url to user albums
« Reply #66 on: June 13, 2007, 03:13:11 pm »

Not very surprising, as http://www.bollybilder.de/gallery/ doesn't exist and returns a "404 not found". Your gallery seems to reside in the webroot. http://www.bollybilder.de/?andy does something (although not what you'd expect), so I guess you made a mistake applying this hack. Undo your changes, then redo them.
Logged

andyleery

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 78
Re: short url to user albums
« Reply #67 on: June 13, 2007, 03:23:04 pm »

LOL es wrong root ^^ Its because I's sitting on this project for 30 hours in three days...
I just added this code, how it was written in the startpost:

$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
  $sql = "SELECT user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_name = '". mysql_escape_string($qq) . "'";
  $result1 = db_query($sql);
  if (mysql_num_rows($result1)>0) {
    $u = mysql_fetch_array($result1);
    $HTTP_GET_VARS['cat'] = sprintf("1%04d",$u[0]);
  }
  mysql_free_result($result1);
}

Didnt do anything wrong! But how can I fix this error?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: short url to user albums
« Reply #68 on: June 13, 2007, 06:13:55 pm »

Is $HTTP_SERVER_VARS actually populated on your server?
Logged

andyleery

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 78
Re: short url to user albums
« Reply #69 on: June 13, 2007, 06:17:01 pm »

Dont know?! Can you see it here? http://www.bollybilder.de/phpinfo.php
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: short url to user albums
« Reply #70 on: June 13, 2007, 06:24:22 pm »

Dont know?! Can you see it here? http://www.bollybilder.de/phpinfo.php
Of course not - I can't access that page - it's admin-only for security reasons. Why don't you take a look at it? Alternatively, edit the code you refered to above, find
Code: [Select]
$qq=$HTTP_SERVER_VARS["QUERY_STRING"]; and temporarily add into a new line before it
Code: [Select]
print_r($HTTP_SERVER_VARS);
die;
Not sure though if you understand the output and if you can interpret it.
Logged

andyleery

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 78
Re: short url to user albums
« Reply #71 on: June 13, 2007, 06:55:16 pm »

I looked at the PHPINFO but i didnt find anything that helps me. I cant code, just know a little bit of php.
In which section do I have to look in the PHPinfo?

Here is the output:

Quote
Array ( [PATH] => /usr/local/bin:/usr/bin:/bin [DOCUMENT_ROOT] => /kunden/145013_12157/webseiten/bollybilder_de [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [HTTP_ACCEPT_ENCODING] => gzip,deflate [HTTP_ACCEPT_LANGUAGE] => de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 [HTTP_CONNECTION] => keep-alive [HTTP_COOKIE] => __utmz=232593036.1181749878.7.2.utmccn=(referral)|utmcsr=bolly-wood.de|utmcct=/community.htm|utmcmd=referral; __utma=232593036.1832684498.1181732400.1181749878.1181753412.8; cpg143_data=YTo2OntzOjI6IklEIjtzOjMyOiJmNDI5MmI4MGU2MTk1YmQyNWJlYjkzMjkxMzgwNWIxZSI7czoyOiJhbSI7aToxO3M6NDoibGFuZyI7czo2OiJnZXJtYW4iO3M6MzoibGl2IjthOjE6e2k6MDtzOjE6IjQiO31zOjY6InNlYXJjaCI7YTo5OntzOjY6InNlYXJjaCI7czo4OiJBYmhpc2hlayI7czo1OiJhbGJ1bSI7czo2OiJzZWFyY2giO3M6NToidGl0bGUiO3M6Mjoib24iO3M6MTA6Im5ld2VyX3RoYW4iO3M6MDoiIjtzOjc6ImNhcHRpb24iO3M6Mjoib24iO3M6MTA6Im9sZGVyX3RoYW4iO3M6MDoiIjtzOjg6ImtleXdvcmRzIjtzOjI6Im9uIjtzOjQ6InR5cGUiO3M6MzoiQU5EIjtzOjY6InBhcmFtcyI7YTozOntzOjU6InRpdGxlIjtzOjI6Im9uIjtzOjc6ImNhcHRpb24iO3M6Mjoib24iO3M6ODoia2V5d29yZHMiO3M6Mjoib24iO319czozOiJsYXAiO2k6MTt9; cpg143_fav=YTowOnt9; 11568f2cac7d7cbf945a19c2c5278f56=c517319595b0ad996ef963adbccdad47; 9eaaa0a4e39e7a23bd115d7d48462a42=be0b0fecfe2b5b23c6b42d1e2e1cb965; __utmc=232593036; wrfsessionId=9cbce6946b6d0431fcd8cac71e9845e3; __utmb=232593036 [HTTP_HOST] => www.bollybilder.de [HTTP_KEEP_ALIVE] => 300 [HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 [PDFLIBRESOURCE] => /usr/local/fonts/pdflib.upr [REDIRECT_QUERY_STRING] => Andy [REDIRECT_STATUS] => 200 [REDIRECT_URL] => / [REMOTE_ADDR] => 87.160.161.225 [REMOTE_PORT] => 61329 [SCRIPT_FILENAME] => /kunden/145013_12157/webseiten/bollybilder_de/index.php [SCRIPT_URI] => http://www.bollybilder.de/ [SCRIPT_URL] => / [SERVER_ADDR] => 80.67.17.120 [SERVER_ADMIN] => webmaster@www.bollybilder.de [SERVER_NAME] => www.bollybilder.de [SERVER_PORT] => 80 [SERVER_SOFTWARE] => Apache/1.3 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.8d AuthPG/1.3 FrontPage/5.0.2.2635 [SWFFONTPATH] => /usr/lib/libswf/fonts/ [UNIQUE_ID] => RnAg6n8AAAEAACG3WW4 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => Andy [REQUEST_URI] => /?Andy [SCRIPT_NAME] => /index.php [DOCROOT] => /kunden/145013_12157/webseiten/bollybilder_de [DOC_ROOT] => /kunden/145013_12157/webseiten/bollybilder_de [PHPRC] => ./:/etc/php.ini/4/145013/614302:/etc/php.ini/4/145013:/usr/local/lib [PHP_SELF] => /index.php [argv] => Array (
  • => Andy ) [argc] => 1 )
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: short url to user albums
« Reply #72 on: June 14, 2007, 09:47:40 am »

Obviously, HTTP_SERVER_VARS[QUERY_STRING] is not populated. Edit the code suggested above, find
Code: [Select]
$qq=$HTTP_SERVER_VARS["QUERY_STRING"];and replace with
Code: [Select]
$qq=$_GET["QUERY_STRING"];
Logged

andyleery

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 78
Re: short url to user albums
« Reply #73 on: June 14, 2007, 01:18:33 pm »

I did but now it just opens index.php.
Demo - http://www.bollybilder.de/?webmaster / http://www.bollybilder.de/?Andy
Logged

andyleery

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 78
Re: short url to user albums
« Reply #74 on: June 16, 2007, 12:44:07 pm »

No more help for me or does it just dont work on my server? :-(
Logged

andyleery

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 78
Re: short url to user albums
« Reply #75 on: June 25, 2007, 02:19:44 pm »

Last time I hope/ask for help. Please help meeeee  ;D, ist important to have that short url. THX.
Logged

radium35

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: short url to user albums
« Reply #76 on: January 15, 2008, 07:51:02 am »

how can you have the short link be there when you click on someones album?
Logged

invisibl3

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: short url to user albums
« Reply #77 on: February 05, 2008, 04:42:04 am »

hi i tried adding the codes required but it just seems to refresh to the same page. currently using stramm mod pack 1.4.13
Logged
Pages: 1 2 3 [4]   Go Up
 

Page created in 0.03 seconds with 19 queries.