short url to user albums - Page 2 short url to user albums - Page 2
 

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

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.

newage40

Anyone working on having this feature available?

Like yahoo photos where you have your album private and only the people you send the secret link can view that private album.

Can anyone mod this?

[edit GauGau]
do not try to hijack other's threads, and do not double-post nor cross-post.
You have posted exactly the same question already in feature requests (where it belongs) :evil:
[/edit]

spellspoil

Is there a way to make the url to be:

http://www.domain.com/gallery/party

to go the album thats named party or something...

Ravage

Would be great to have this work with vb intergration.

WreckRman2

I'll share what I did for vb intergration... it's more an addon than a hack.

I created a folder called "user" then add this code to a file called index.php




<?php

$dbuser 
"";
$dbpass "";
$dbname "";
$domain "";

$db mysql_connect&#40;"localhost", $dbuser, $dbpass&#41;;
mysql_select_db&#40;$dbname,$db&#41;;

$username=$HTTP_SERVER_VARS["QUERY_STRING"&#93;;
$username eregi_replace &#40; '%20', ' ', $username&#41;;

$user_result mysql_query&#40;"SELECT * FROM user WHERE username='$username'"&#41;;
while &#40;$user = mysql_fetch_array &#40;$user_result&#41;&#41; &#123;

        
$u $user["userid"&#93;; 
    
$cat sprintf&#40;"1%04d",$u&#41;;

        
header &#40;"Location&#58;http&#58;//www.".$domain."/gallery/index.php?cat=$cat"&#41;;

&#125;

mysql_free_result &#40;$user_result&#41;;

?>




Edit the variables... then you can view a users gallery with the URL:

http://www.yourdomain.com/gallery/user?MEMBERNAME

Substitute MEMBERNAME for your members username.


All this code does is convert the username to the gallery id and redirects the user to that page. Nothing fancy but it's a temp solution until someone comes up wit something better.
David Smith
Indy Web Design - http://www.indywebdesign.com
317-573-2486

We offer web hosting that includes easy installation for Coppermine Photo Gallery, phpBB2, PHP-Nuke, and a lot more...

EliteRides

Quote from: "FishnReef"Error crítico
There was an error while processing a database query

Quote from: "gaugau"you'll have to switch on debug_mode

I get the same thing with YaBBSE.  Here's what my errors say in debug_mode:

QuoteThere was an error while processing a database query.

While executing query "SELECT user_id FROM **ERROR** WHERE user_name = 'damon'" on 0

mySQL error: You have an error in your SQL syntax near '**ERROR** WHERE user_name = 'damon'' at line 1

Debug info
USER:
Array
(
    [ID] => 46025dc00ee3bd09acc1a8272ee0f64e
    [am] => 1
    [liv] => Array
        (
           
  • => 31
  • [1] => 38
                [2] => 43
                [3] => 44
                [4] => 45
            )

    )

     
    GET :
    Array
    (
        [damon] =>
    )

     
    POST :
    Array
    (
    )

pkulak

Quote from: spellspoil on February 28, 2004, 08:57:06 PM
Is there a way to make the url to be:

http://www.domain.com/gallery/party

to go the album thats named party or something...

You can do it with mod_rewrite. Something like this in a .htaccess file:


RewriteEngine On
RewriteBase /gallery/
RewriteRule ^([A-Za-z_0-9\-]+)\/*$ /gallery/index.php?album=$1 [R]


Then you would have to add a bit to index to have it look up the album by it's name and return the number, but it's really not much different then by user. What I would love to do is make it toally mod_rewrite compatible so that /user/album works and the links all work that way to.
"To do any good at all, just believing you are right and you motives are good isn't enough." - Ursula K. Le Guin

cerberus

Quote from: WreckRman2 on February 29, 2004, 04:13:02 AM
I'll share what I did for vb intergration... it's more an addon than a hack.
but it's a temp solution until someone comes up wit something better.
It isn't working with YaBB SE ???
With Best Regards, Cerberus
Edamus, bibamus, gaudeamus.
http://www.pocketpcrussia.com - My Main Site

XBleed

Quote from: WreckRman2 on February 29, 2004, 04:13:02 AM
I'll share what I did for vb intergration... it's more an addon than a hack.

I created a folder called "user" then add this code to a file called index.php




<?php

$dbuser 
"";
$dbpass "";
$dbname "";
$domain "";

$db mysql_connect("localhost"$dbuser$dbpass);
mysql_select_db($dbname,$db);

$username=$HTTP_SERVER_VARS["QUERY_STRING"];
$username eregi_replace '%20'' '$username);

$user_result mysql_query("SELECT * FROM user WHERE username='$username'");
while (
$user mysql_fetch_array ($user_result)) {

        
$u $user["userid"]; 
    
$cat sprintf("1%04d",$u);

        
header ("Location:http://www.".$domain."/gallery/index.php?cat=$cat");

}

mysql_free_result ($user_result);

?>




Edit the variables... then you can view a users gallery with the URL:

http://www.yourdomain.com/gallery/user?MEMBERNAME

Substitute MEMBERNAME for your members username.


All this code does is convert the username to the gallery id and redirects the user to that page. Nothing fancy but it's a temp solution until someone comes up wit something better.

I tried this but there are a bunch of errors in the code..   The "%04d" things.   They're everyhwere!
Does anyone know what they are in actual php code so I can attempt this again?

jarekn

Hello,

Was anyone able to get this to work with vbulletin 3.0?

I'd like to have a link from user's profile to their own gallery.

THANX

dafreak

Well I got Wreckmans deal to work *thanks wreckman!*

i couldnt get it to work via ..gallery/user?Username :(  *going to try to figure out why

in the meantime i just used his code and made user.php and put it in the gallery folder.. so it works as ..gallery/user.php?Username

btw i'm using VB3.01


elBarto

After reading a lot of posts in the past few days, I still have a bit confuse to doing something like this:

http://www.domain.com/coppermine/user/ <- Users' home

http://www.domain.com/coppermine/user/gallery_1 <- User's gallery 1

Would that be possible? ???

Moodi

#31
My change for work with PHPBB intregration

Look the original post
http://forum.coppermine-gallery.net/index.php?topic=1659.msg7910#msg7910
and change the code by



$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__);
 }

}



Paris IS MAGIC !!!!!!!!!!! :D:D

Moodi

#32
My change for work with vbulletin3 intregration

Look the original post
http://forum.coppermine-gallery.net/index.php?topic=1659.msg7910#msg7910
and change the code by



$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
 $qq = urlencode($qq);
   $sql = "SELECT userid as user_id " . "FROM " . $UDB_DB_NAME_PREFIX . VB_TABLE_PREFIX . VB_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__);
 }

}



Paris IS MAGIC !!!!!!!!!!! :D:D

Moodi

#33
My change for work with Invision Power Board v1.1 Integration

Look the original post
http://forum.coppermine-gallery.net/index.php?topic=1659.msg7910#msg7910
and change the code by



$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
 $qq = urlencode($qq);
     $sql = "SELECT id as user_id " . "FROM " . $UDB_DB_NAME_PREFIX . IB_TABLE_PREFIX . IB_USER_TABLE . " " . "WHERE name = '". 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__);
 }

}



Paris IS MAGIC !!!!!!!!!!! :D:D

Moodi

#34
My change for YaBB SE 1.5.4 Integration

Look the original post
http://forum.coppermine-gallery.net/index.php?topic=1659.msg7910#msg7910
and change the code by

$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
 $qq = urlencode($qq);
   $sql = "SELECT ID_MEMBER as user_id " . "FROM " . $UDB_DB_NAME_PREFIX . YS_TABLE_PREFIX . YS_USER_TABLE . " " . "WHERE realName = '". 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__);
 }

}
Paris IS MAGIC !!!!!!!!!!! :D:D

Casper

Hi Moodi,

If you have made mods to the code that will make these bridges work better, then you help is much appreciated, but please explain on each post, to which file you are refering, and show not just the new code, but the old code it is replacing, or if just additional code, where to put it.

Thanks.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Moodi

Yes Casper !! ;)

I modified my post 

it's better like that? :-[
Paris IS MAGIC !!!!!!!!!!! :D:D

hevangel

#37
Hi,

I found a bug (or feature) of this hack.
If I change the theme, I got bounce back to the main page.
So I modified the code by introducing a user_gallery option that overwrite the cat option in URL.

The shortcut URL become
http://www.yourdomain.com/album/user_gallery=user_name

Replace the orginial code with

if (isset($HTTP_GET_VARS['user_gallery'])) {
$user_gallery = $HTTP_GET_VARS['user_gallery'];
$sql = "SELECT user_id " . "FROM {$CONFIG['TABLE_USERS']} " .
"WHERE user_name = '". mysql_escape_string($user_gallery) . "'";
 
$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);
}

Allo

Quote from: SlammedDime on February 18, 2004, 02:02:43 AM
Error checking code -

$qq=$HTTP_SERVER_VARS["QUERY_STRING"];
if (!strstr($qq,'=') and !empty($qq)) {
  $qq = urlencode($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]);
  }
  else {
    cpg_die(ERROR, '"' . $qq . '" is an invalid username.  Please try again.', __FILE__, __LINE__);
  }
  mysql_free_result($result1);
}



I still have problem with this.

The site is: www.artsrater.com

the gallery is in first page but when i'm typing  www.artsrater.com/?allo   (where  "allo" is the username)

I receive this:

There was an error while processing a database query.

While executing query "SELECT user_id FROM nuke_users WHERE user_name = 'allo'" on 0

mySQL error: Unknown column 'user_name' in 'where clause'


Nuke ver is 7 and coppermine 1.2
:-\\ i'm totally out.

kegobeer

QuoteNuke ver is 7 and coppermine 1.2
i'm totally out.

This isn't for the nuke version.  This is for the standalone version.  Nuke support can be found at http://www.nukephotogallery.com.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots