Nice URL's for coppermine Nice URL's for coppermine
 

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

Nice URL's for coppermine

Started by gtroll, September 30, 2003, 08:11:42 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

gtroll

2003-09-16 23:06

 I have been working on a googletap like nice url's for coppermine and been having a heck of a time with it. Has anyone already done this?
Thanks
Scott

[posting moved manually from sf.net project forums]

hyperion01

2003-09-17 05:26

 gtroll,

I cannot answer your question, but you might also ask it here:

http://sourceforge.net/projects/immaginuke

Best regards,

Hyperion01

[posting moved manually from sf.net project forums]

Tarique Sani

SANIsoft PHP applications for E Biz


boii

while i dont have any prewritten code, i dont think it would be too hard to do album rewrites for nice urls, ie:

instead of:
http://www.domain.com/copper/thumbnails.php?album=6

you get:
http://www.domain.com/copper/album/blackandwhite
or even:
http://www.domain.com/copper/?album=blackandwhite

i can probably whip that up in no time (though right now..i do have no time  :P )

itd be nice to have it for displayimage.php as well (word instead of id number). is that what you're asking about?

cheers.
ken

t3kn0byt3

This may help.  This was taken from googlifier.
This is the code for the phpNuke port.


header.php
<?php 


if &#40;eregi&#40;"header.php",$_SERVER['PHP_SELF'&#93;&#41;&#41; &#123; 
    
Header&#40;"Location&#58; index.php"&#41;; 
    
die&#40;&#41;; 
&#125; 

ob_start&#40;&#41;; 

function replace_for_mod_rewrite&#40;&$s&#41; &#123; 
$urlin = array&#40; 

"'&#40;?<!/&#41;gate.html\?name=&#40;coppermine\"&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=displayimage&album=&#40;[a-zA-Z&#93;*&#41;&cat=-&#40;[0-9&#93;*&#41;&pos=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=displayimage&album=&#40;[0-9&#93;*&#41;&pos=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=displayimage&album=&#40;[a-zA-Z&#93;*&#41;&cat=&pos=-&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=displayimage&album=&#40;[a-zA-Z&#93;*&#41;&cat=&pos=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=displayimage&album=&#40;[a-zA-Z&#93;*&#41;&cat=&#40;[0-9&#93;*&#41;&pos=-&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=displayimage&album=&#40;[a-zA-Z&#93;*&#41;&cat=&#40;[0-9&#93;*&#41;&pos=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=thumbnails&album=&#40;[a-zA-Z&#93;*&#41;&cat=-&#40;[0-9&#93;*&#41;&page=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=thumbnails&album=&#40;[a-zA-Z&#93;*&#41;&cat=-&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=thumbnails&album=&#40;[a-zA-Z&#93;*&#41;&cat=&#40;[0-9&#93;*&#41;&page=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=thumbnails&album=&#40;[a-zA-Z&#93;*&#41;&cat=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=thumbnails&album=&#40;[0-9&#93;*&#41;&page=&#40;[0-9&#93;*&#41;&sort=&#40;[a-z&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=thumbnails&album=&#40;[0-9&#93;*&#41;&page=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=thumbnails&album=&#40;[0-9a-zA-Z&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=profile&uid=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&cat=&#40;[0-9&#93;*&#41;'"
"'&#40;?<!/&#41;gate.html\?name=coppermine&file=index'",
&
#41;;

$urlout = array&#40; 
"photogallery.html\""
"image_\\1-\\2-\\3.html"
"image_\\1-\\2.html"
"image-\\1-\\2.html"
"image_\\1-\\2.html"
"image-\\1-\\2-\\3.html"
"image_\\1\\2-\\3.html"
"gallery-\\1-\\2-\\3.html"
"gallery-\\1-\\2.html"
"gallery_\\1-\\2-\\3.html"
"gallery_\\1-\\2.html"
"gallery_\\1-\\2-\\3.html"
"gallery_\\1-\\2.html"
"gallery_\\1.html"
"gallery_user-\\1.html"
"user_galleries-\\1.html"
"gallery.html"

&#41;; 

$s preg_replace&#40;$urlin, $urlout, $s&#41;; 
return $s
&
#125; 

require_once&#40;"mainfile.php"&#41;; 

$header 1

function 
head&#40;&#41; &#123; 
    
global $slogan$sitename$banners$nukeurl$Version_Num$artpage$topic$hlpfile$user$hr$theme$cookie$bgcolor1$bgcolor2$bgcolor3$bgcolor4$textcolor1$textcolor2$forumpage$adminpage$userpage$pagetitle
    
$ThemeSel get_theme&#40;&#41;; 
    
include&#40;"themes/$ThemeSel/theme.php"&#41;; 
    
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
    echo 
"<html>\n"
    echo 
"<head>\n"
    echo 
"<title>$sitename $pagetitle</title>\n"

    include&
#40;"includes/meta.php"&#41;; 
    
include&#40;"includes/javascript.php"&#41;; 
    
    
if &#40;file_exists&#40;"themes/$ThemeSel/images/favicon.ico"&#41;&#41; &#123; 
   
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n"
    &
#125; 
        
    
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n"
    include&
#40;"includes/my_header.php"&#41;; 
    
echo "\n\n\n</head>\n\n"
    
themeheader&#40;&#41;; 
&#125; 

online&#40;&#41;; 
head&#40;&#41;; 
include&#40;"includes/counter.php"&#41;; 
global $home
if &
#40;$home == 1&#41; &#123; 
    
message_box&#40;&#41;; 
    
blocks&#40;Center&#41;; 
&#125; 

?>



.htaccess
DirectoryIndex index.php index.cgi index.pl index.shtml index.html

<Limit GET PUT POST>
order allow,deny
allow from all
</Limit>

# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)$">
deny from all
</FilesMatch>

#Disable .htaccess viewing from browser
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

<Files ~ "\config.php$">
deny from all
</Files>

# change to yoursite.com
ErrorDocument 404 http://www.lbd1956.com/index.html

RewriteEngine On

RewriteRule ^index.html index.php

RewriteRule ^gate.* modules.php

#Coppermine
RewriteRule ^image_([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=-$2&pos=$3
RewriteRule ^image_([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&pos=$2
RewriteRule ^image-([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=&pos=-$2
RewriteRule ^image_([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=&pos=$2
RewriteRule ^image-([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=$2&pos=-$3
RewriteRule ^image_([a-zA-Z]*)([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=displayimage&album=$1&cat=$2&pos=$3
RewriteRule ^gallery-([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=-$2&page=$3
RewriteRule ^gallery-([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=-$2
RewriteRule ^gallery_([a-zA-Z]*)-([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=$2&page=$3
RewriteRule ^gallery_([a-zA-Z]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&cat=$2
RewriteRule ^gallery_([0-9]*)-([0-9]*)-([a-z]*).html gate.html?name=coppermine&file=thumbnails&album=$1&page=$2&sort=$3
RewriteRule ^gallery_([0-9]*)-([0-9]*).html gate.html?name=coppermine&file=thumbnails&album=$1&page=$2
RewriteRule ^gallery_([0-9a-zA-Z]*).html gate.html?name=coppermine&file=thumbnails&album=$1
RewriteRule ^gallery_user-([0-9]*).html gate.html?name=coppermine&file=profile&uid=$1
RewriteRule ^user_galleries-([0-9]*).html gate.html?name=coppermine&cat=$1
RewriteRule ^gallery.html gate.html?name=coppermine&file=index

t3kn0byt3

Forgot this...

footer.php
<?php



if &#40;eregi&#40;"footer.php",$PHP_SELF&#41;&#41; &#123;
    
Header&#40;"Location&#58; index.php"&#41;;
    
die&#40;&#41;;
&#125;

$footer 1;

function 
footmsg&#40;&#41; &#123;
    
global $foot1$foot2$foot3$copyright$total_time$start_time;
    
$mtime microtime&#40;&#41;;
    
$mtime explode&#40;" ",$mtime&#41;;
    
$mtime $mtime[1&#93; + $mtime[0&#93;;
    
$end_time $mtime;
    
$total_time = &#40;$end_time - $start_time&#41;;
    
$total_time ""._PAGEGENERATION." ".substr&#40;$total_time,0,5&#41;." "._SECONDS."";
    
echo "<font class=\"footmsg\">\n";
    if &
#40;$foot1 != ""&#41; &#123;
        
echo "$foot1<br>\n";
    &
#125;
    
if &#40;$foot2 != ""&#41; &#123;
        
echo "$foot2<br>\n";
    &
#125;
    
if &#40;$foot3 != ""&#41; &#123;
        
echo "$foot3<br>\n";
    &
#125;
    // DO NOT REMOVE THE FOLLOWING COPYRIGHT LINE. YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS.
    
echo "$copyright<br>$total_time<br>\n</font>\n";
&
#125;

function foot&#40;&#41; &#123;
    
global $prefix$user_prefix$dbi$index$user$cookie$storynum$user$cookie$Default_Theme$foot1$foot2$foot3$foot4$home$module$name;
    if &
#40;$home == 1&#41; &#123;
        
blocks&#40;Down&#41;;
    
&#125;
    
if &#40;$module == 1 AND file_exists&#40;"modules/$name/copyright.php"&#41;&#41; &#123;
        
$cpname ereg_replace&#40;"_", " ", $name&#41;;
        
echo "<div align=\"right\"><a href=\"javascript&#58;openwindow&#40;&#41;\">$cpname &copy;</a></div>";
    &
#125;
    
themefooter&#40;&#41;;
    
echo "</body>\n"
        
."</html>";
&
#125;

foot&#40;&#41;;

$contents ob_get_contents&#40;&#41;; // store buffer in $contents
ob_end_clean&#40;&#41;; // delete output buffer and stop buffering
echo replace_for_mod_rewrite&#40;$contents&#41;; //display modified buffer to screen
global $dbg_starttime;

?>

Tarique Sani

If all the rigamarole is just for getting Indexed in Google - don't bother Google indexs Coppermine pages just fine

Try a google search for "coppermine tarique"
SANIsoft PHP applications for E Biz

copperminerules

I call upon everyone's collective knowlege for the following question.  I am EXTREMELY interested in the friendly url system but i run a coppermine version that is not part of a phpnuke portal i.e. the stand-alone version.

can i do the same thing as you outlined here?  im a bit web design slow (not stupid) so i still need simple instrctions etc.

Rodinou

Very interested too (but standalone version)

Indeed, It would be nice ...

www.domain.com/copper_folder/name_of_album/name_of_the_gallery/

It's more simple to do (in my case)

If you want to see the photos go to

www.sortons.net/photos/exo7/soiree_haiwaienne

and not www.sortons.net/photos/thumbnails.php?album=blabla

Oasis

This should be fairly easy to implement. I have already done this successfully for user albums, so http://mydomain.com/cpgfolder/username goes to the users' private gallery, so doing the same thing for albums should be a piece of cake. Take a look at the thread "another question (regarding user album urls)" in the cpg1.1 category.

[edit GauGau]made your link clickable[/edit]
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org