No Support > Feature requests

Nice URL's for coppermine

<< < (2/3) > >>

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


header.php

--- Code: ---<?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; 

?>

--- End code ---


.htaccess

--- Code: ---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
--- End code ---

t3kn0byt3:
Forgot this...

footer.php

--- Code: ---<?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;

?>
--- End code ---

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"

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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version