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 2 [3] 4   Go Down

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

0 Members and 1 Guest are viewing this topic.

Allo

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: HACK: short url to user albums
« Reply #40 on: August 18, 2004, 06:53:07 am »

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

foei

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: short url to user albums
« Reply #41 on: September 07, 2004, 07:06:41 am »

how to short  last member album on first page
Logged

itang

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 63
Re: short url to user albums
« Reply #42 on: November 04, 2004, 03:35:41 am »

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.

Logged

FearlessX

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: short url to user albums
« Reply #43 on: December 14, 2004, 03:51:58 pm »

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

Fonz

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: short url to user albums
« Reply #44 on: January 26, 2005, 01:01:56 am »

nice i can use that !!!
Logged

rubbersoul

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 92
Re: short url to user albums
« Reply #45 on: February 27, 2005, 04:38:59 am »

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

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: short url to user albums
« Reply #46 on: February 27, 2005, 04:55:40 am »

Go to group manager and say No to allowing rating.
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Re: short url to user albums
« Reply #47 on: February 27, 2005, 05:45:02 am »

One question per thread please
Logged
SANIsoft PHP applications for E Biz

TheGamer1701

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
    • PartyNation.tv - Always the newest Party Facs from North Germany
Re: short url to user albums
« Reply #48 on: July 05, 2005, 08:57:49 pm »

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é
Logged

TheGamer1701

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
    • PartyNation.tv - Always the newest Party Facs from North Germany
Re: short url to user albums
« Reply #49 on: July 08, 2005, 03:36:31 pm »

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

FaizanQ

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: short url to user albums
« Reply #50 on: July 14, 2005, 02:11:36 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:
Code: [Select]
$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:
Code: [Select]
/**
 * 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?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: short url to user albums
« Reply #51 on: July 14, 2005, 02:46:23 am »

If you can't find

Code: [Select]
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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 17
  • give it a name
    • arcHELI
Re: HACK: short url to user albums
« Reply #52 on: September 29, 2005, 06:20:59 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

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

}




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
Logged
\x\\\\_

TheGamer1701

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
    • PartyNation.tv - Always the newest Party Facs from North Germany
Re: HACK: short url to user albums
« Reply #53 on: October 13, 2005, 10:29:26 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:

Code: [Select]
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:

Code: [Select]
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
Logged

Lucas Xavier

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: short url to user albums
« Reply #54 on: November 04, 2005, 07:59:52 pm »

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

alanlai

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 53
    • Goddess
Re: short url to user albums
« Reply #55 on: November 08, 2005, 11:07:27 am »

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

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: short url to user albums
« Reply #56 on: January 29, 2006, 01:44:38 am »

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
Logged

dEnA

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: short url to user albums
« Reply #57 on: February 13, 2006, 04:05:38 pm »

That would be nice. when are you doing that?
Logged

pcboy123

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: short url to user albums
« Reply #58 on: March 01, 2006, 05:54:05 am »

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

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 #59 on: March 02, 2006, 08:27:30 am »

then read this thread entirely, you have to apply the version for cpg1.4.x
Logged
Pages: 1 2 [3] 4   Go Up
 

Page created in 0.033 seconds with 19 queries.