short url to user albums - Page 3 short url to user albums - Page 3
 

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.

Allo

Thank you. but sometimes i found more here than in other place.  ;)

foei

how to short  last member album on first page

itang

I have found this mod_rewrite solution for cpg 1.1.x to make the short url for members work like this:

http://yourdomain.com/peter

point to the user album -->  http://yourdomain.com/index.php?cat=10013

However, I am using 1.3.2 and it seems that there are some problems. Would any programming expert help solving this problem?

The related topic is here:

http://forum.coppermine-gallery.net/index.php?topic=11343.0

Thanks for your attention.


FearlessX

hi. i'm new to php. what does the ? in ?username does? Possible to make subdomains work?  ???

Fonz


rubbersoul

Can any1 tell me how to get rid of the voting table and features....I don't want any voting functions. Thanks!

Tranz

Go to group manager and say No to allowing rating.

Tarique Sani

SANIsoft PHP applications for E Biz

TheGamer1701

Hey,

that doesn't completly work for me.
I applied the hack and when I try it, coppermine shows me the 4 lst uploaded pictures (album=lastub???), but not the the users private category as it should.

Any idea how to change this?
There are currently no other hacks than this one and a watermarking hack.
Thx,

André

TheGamer1701

any solution here?
Or a hint?
Anything would be great, otherwise I would have to make a work-around by acessing the coppermine tables directly (which I really don't want to do...)

FaizanQ

Quote from: Kfmook on November 17, 2003, 09:40:02 AM
I cant post in 'Modifications/Add-Ons/Hacks' and i post my hack here

With this hack your registered users can access to her albuma with short url:
http://www.domain.com/gallery/?UserName
where http://www.domain.com/gallery/ - url to your gallery
UserName - registered user name (if UserName not contain '=')

hack:
add this code:

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

before:

/**
* Main code
*/

if (isset($HTTP_GET_VARS['page'])) {
   $PAGE = max((int)$HTTP_GET_VARS['page'], 1);
   $USER['lap'] = $PAGE;
} elseif (isset($USER['lap'])) {
   $PAGE = max((int)$USER['lap'], 1);
} else {
   $PAGE = 1;
}

in index.php

I cant really find those lines in my index.php, any suggestions?

kegobeer

If you can't find

if (isset($HTTP_GET_VARS['page'])) {

in index.php, then you aren't running a standard Coppermine gallery.  If you used Fantastico, then you should download 1.3.3 from our site and preform an upgrade.
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

stardotstar

Quote from: Moodi on July 18, 2004, 12:40:45 AM
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__);
 }

}





I have used this code to link to my member galleries from phpBB and it works fine for all my members except those with spaces in their usernames...
I see that urlencode is used for $qq and the browser correctly encodes the username with %20 but the modification returns the error message...

Why would this be; hyphens and alpha numeric seem to work fine.  Example message - even when I type the URL in:

the username is "mr 3d"

.../cpg133/?mr%203d

yields:

"mr%25203d" YOUR ERROR MESSAGE HERE

so there is this 52 sneaking in between the %2 and 0 and the remainder of the username...

Big daz also gets the same problem:

"Big%2520daz" YOUR ERROR MESSAGE HERE
\x\\\\_

TheGamer1701

Quote from: pkulak on May 04, 2004, 09:12:12 AM
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.


Hey,

I want to do a mod that does:
http://www.domain.com/?username
translate to
http://www.domain.com/coppermine/?username (or anything else that points to the user album view)

I found this post and tried to create a .htacces file:


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


but this does not work and doesn't seem right.

Could anyone help me with this?
Unfortunetly I have absolutely no experiences with ".htaccess" files and "Rewrite"

Thx

Lucas Xavier

Thanx. But you have a mod to don't need the "?" on the url?

alanlai

cool, that's interesting... but most servers storing size are SO limited to share

AWJunkies

there was another thread about the same thing. Just thought I would update and change the tag to work with 1.4.x as well

dEnA

That would be nice. when are you doing that?

pcboy123

i get the error!
when
www.domainname.com/gallery/?user

i get this

Fatal error: Call to undefined function: db_query() in /home/xmex/public_html/monica/gallery/index.php on line 1419


Joachim Müller

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