Hello everyone out there. First thing: please forgive my bad english, it's not my mother tongue. If something is confusing I'll try to explain.
I hope that this is the right place, I didn't know where to put it.
I made a quick and dirty hack (very dirty) for this sitemap mod I found ->
http://forum.coppermine-gallery.net/index.php?topic=4419.0My problem was that my gallery contains about 4000 Files and images, and everytime a user opend the sitemap the database had to cycle through this 4000 Entrys.
So I made a quick and dirty hack to write the content to a txt file, with the oppotunity to activate the writing process manually.
Put the following code into a file called sitemap.php and save it in your coppermine root folder:
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
pageheader(Fotoindex);
$get_vars['sitemap']=$_GET['sitemap'];
if ($get_vars['sitemap']=="build")
{
// Select all photos
$result = mysql_query("SELECT a.pid, a.aid, a.title, a.caption, a.keywords, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid order by a.aid, a.pid desc");
if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap']);
$p_aid = -1 ;
// Result to table
starttable("100%", Fotoindex, 3);
echo "<br>-------------Cache Writer start-------------<br>";
$cache = "albums/cache.txt";
$fh = fopen($cache, 'w');
while ($row = mysql_fetch_array($result))
{
if ($row[aid] != $p_aid) {
$write="<tr><td class=\"tableh2\" colspan = \"3\">$row[atitle]</td></tr>";
fwrite($fh, $write);
}
// weer geef de data
$write2="<tr><td><a href=\"displayimage.php?pos=-$row[pid]\" title=\"$row[title]\">$row[title]</a></td><td>$row[caption]</td><td>$row[keywords]</td></tr>";
fwrite($fh, $write2);
$p_aid = $row[aid] ;
} ; // while
fclose($fh);
echo "<br>-------------Cache Writer finished-------------<br>";
endtable();
}
else
{
starttable("100%", Fotoindex, 3);
echo "Hello engines";
include "albums/cache.txt";
endtable();
}
pagefooter();
?>
Afterwards active the writing process for the first time as described below.
You can active the writing process by putting the following into your browser adress field: path-to-coppermine/sitemap.php?sitemap=build
Afterwards place a link from somewhere on your site to the sitemap.php (without the ?sitemap.php=build ending) and activate the writing process from time to time. (Perhaps @ night when your server load is low).
PS: Thanks to the coppermine team for the superb software. I'm using it for two years now (just updated to 1.4.10), and I love it