short url to user albums - Page 4 short url to user albums - Page 4
 

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

short url to user albums

Started by Kfmook, November 17, 2003, 09:40:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pcboy123

Quote from: GauGau on March 02, 2006, 08:27:30 AM
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??

altagame

I have run into trouble with this one as well.

I have inserted the following code for phpBB;

$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.

pandahuang

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

pandahuang

Reply myself ..  ::)

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


$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

pcboy123

Quote from: pandahuang on April 20, 2006, 05:01:48 PM
Reply myself ..  ::)

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


$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..

andyleery

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 ^^

Joachim Müller

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.

andyleery

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?

Joachim Müller

Is $HTTP_SERVER_VARS actually populated on your server?

andyleery


Joachim Müller

Quote from: andyleery on June 13, 2007, 06:17:01 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$qq=$HTTP_SERVER_VARS["QUERY_STRING"]; and temporarily add into a new line before itprint_r($HTTP_SERVER_VARS);
die;
Not sure though if you understand the output and if you can interpret it.

andyleery

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:

QuoteArray ( [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 )

Joachim Müller

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

andyleery


andyleery

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

andyleery

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

radium35

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

invisibl3

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