forum.coppermine-gallery.net
No Support => Feature requests => Topic started by: gtroll on September 30, 2003, 08:11:42 am
-
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] (http://forum.coppermine-gallery.net/viewtopic.php?p=797#797)
-
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] (http://forum.coppermine-gallery.net/viewtopic.php?p=797#797)
-
2003-09-18 07:33
you mean something like
http://coppermine.sf.net/displayimage/3
??
[posting moved manually from sf.net project forums] (http://forum.coppermine-gallery.net/viewtopic.php?p=797#797)
-
2003-09-20 10:59
Yes I got a few rewrites working for my site but hoped someone might have done it already
[posting moved manually from sf.net project forums] (http://forum.coppermine-gallery.net/viewtopic.php?p=797#797)
-
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
-
This may help. This was taken from googlifier.
This is the code for the phpNuke port.
header.php
<?php
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
ob_start();
function replace_for_mod_rewrite(&$s) {
$urlin = array(
"'(?<!/)gate.html\?name=(coppermine\")'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=-([0-9]*)&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([0-9]*)&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=&pos=-([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=([0-9]*)&pos=-([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=displayimage&album=([a-zA-Z]*)&cat=([0-9]*)&pos=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=-([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=-([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([a-zA-Z]*)&cat=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([0-9]*)&page=([0-9]*)&sort=([a-z]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([0-9]*)&page=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=thumbnails&album=([0-9a-zA-Z]*)'",
"'(?<!/)gate.html\?name=coppermine&file=profile&uid=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&cat=([0-9]*)'",
"'(?<!/)gate.html\?name=coppermine&file=index'",
);
$urlout = array(
"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"
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
require_once("mainfile.php");
$header = 1;
function head() {
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();
include("themes/$ThemeSel/theme.php");
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("includes/meta.php");
include("includes/javascript.php");
if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
}
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
include("includes/my_header.php");
echo "\n\n\n</head>\n\n";
themeheader();
}
online();
head();
include("includes/counter.php");
global $home;
if ($home == 1) {
message_box();
blocks(Center);
}
?>
.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
-
Forgot this...
footer.php
<?php
if (eregi("footer.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$footer = 1;
function footmsg() {
global $foot1, $foot2, $foot3, $copyright, $total_time, $start_time;
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$end_time = $mtime;
$total_time = ($end_time - $start_time);
$total_time = ""._PAGEGENERATION." ".substr($total_time,0,5)." "._SECONDS."";
echo "<font class=\"footmsg\">\n";
if ($foot1 != "") {
echo "$foot1<br>\n";
}
if ($foot2 != "") {
echo "$foot2<br>\n";
}
if ($foot3 != "") {
echo "$foot3<br>\n";
}
// 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";
}
function foot() {
global $prefix, $user_prefix, $dbi, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $module, $name;
if ($home == 1) {
blocks(Down);
}
if ($module == 1 AND file_exists("modules/$name/copyright.php")) {
$cpname = ereg_replace("_", " ", $name);
echo "<div align=\"right\"><a href=\"javascript:openwindow()\">$cpname ©</a></div>";
}
themefooter();
echo "</body>\n"
."</html>";
}
foot();
$contents = ob_get_contents(); // store buffer in $contents
ob_end_clean(); // delete output buffer and stop buffering
echo replace_for_mod_rewrite($contents); //display modified buffer to screen
global $dbg_starttime;
?>
-
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"
-
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.
-
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
-
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) (http://forum.coppermine-gallery.net/index.php?topic=69)" in the cpg1.1 category.
[edit GauGau]made your link clickable[/edit]