Simply copy it into an empty php-file. Save it as index.php and replace the existing index.php in the kissgallery folder on your server.
Code: Select all
<?php
/*
/* #########################################################################################
/* #### index.php file partly recoded to be XHTML valid by Markus, markus-hilpert@gmx.de ###
/* ##################################### November, 2008 ####################################
/* #########################################################################################
CMSimple kissGallery plugin
- 0.3 Fixed:
* Alignment in the css-file fixed
New:
* Options/Config show_album_desc: top/bottom/none where to show the album description
- 0.2 First public release
* Code cleanup
- 0.1 First internal release
kissGallery($func,$sel)
$func 1 - show all photos
2 - show group of photos, $sel contains the group id (album)
*/
function kissGallery($func,$sel) {
GLOBAL $plugin_cf,$plugin_tx, $sn, $su, $pth , $hjs;
if (!defined('KISSLIBV')) require dirname(__FILE__)."/kiss.php";
$fngroup=dirname(__FILE__).'/data/album.txt';
$fnfile=dirname(__FILE__).'/data/photo.txt';
$plugin=basename(dirname(__FILE__),"/");
$filepath=$pth['folder']['plugins'].$plugin."/photos";
if (!isset($hjs)) { $hjs=''; }
$hjs .= "\n".'<link rel="stylesheet" type="text/css" href="'.$pth['folder']['plugins'].$plugin.'/slimbox/slimbox.css" />';
$hjs .= "\n".'<script type="text/javascript" src="'.$pth['folder']['plugins'].$plugin.'/slimbox/mootools_11.js"></script>';
$hjs .= "\n".'<script type="text/javascript" src="'.$pth['folder']['plugins'].$plugin.'/slimbox/slimbox.js"></script>';
if (!isset($func)) $func=1;
if (!isset($sel)) $sel=1;
$groups=kissRFile($fngroup);
$files=kissRFile($fnfile);
if ($func==2) {
$tarr=array();
foreach ($files as $num => $rec) {
if ($rec[2]==$sel) {
$tarr[]=$rec;
}
}
$files=$tarr;
}
$txt='<div class="kissgallery">';
$noofcols=$plugin_cf['kissgallery']['indexpage_no_of_cols'];
if ($func==2) {
foreach ($groups as $gnum => $grec) {
if ($grec[0]==$sel) {
$gname=$grec[2];
$gdesc=$grec[3];
}
}
if (kissIsTrue($plugin_cf['kissgallery']['show_album_name'])) {
$txt.='<div class="kissgallery_name">'.$gname.'</div>';
}
if (strtolower($plugin_cf['kissgallery']['show_album_desc'])=='top') {
$txt.='<div class="kissgallery_desc">'.$gdesc.'</div>';
}
}
if (sizeof($files)>0) {
$txt.='<table class="kissgallery_index"><tr>';
foreach ($files as $num => $rec) {
if ((($num % $noofcols) == 0)&&($num > 0)) $txt.='</tr><tr>';
// record : array($id,$order,$gid,$file_name,$file_datetime,$file_type,$desc);
$id=$rec[0];
$gid=$rec[2];
$file_name=$rec[3];
$file_datetime=date($plugin_cf['kissgallery']['datetime_format'],$rec[4]);
$file_type=$rec[5];
$desc=$rec[6];
$txt.='<td class="c kissgallery_photo">';
$txt.='<a href="'.$filepath.'/'.$id.'.jpg" rel="lightbox[testgr]" title="'.$desc.'"><img src="'.$filepath.'/'.$id.'t.jpg" alt=""/></a>';
$txt.='<div style="display:none">'.$desc.'</div>';
$txt.='</td>';
}
$num=$num+1;
if (($num % $noofcols)>0) {
for ($j=1;$j<=($noofcols-($num % $noofcols));$j++) {
$txt.='<td class="c kissgallery_photo"> </td>';
}
}
$txt.='</tr></table>';
} else {
$txt.=$plugin_tx['kissgallery']['no_files'];
}
if ($func==2) {
if (strtolower($plugin_cf['kissgallery']['show_album_desc'])=='bottom') {
$txt.='<div class="kissgallery_desc">'.$gdesc.'</div>';
}
}
$txt.='</div>';
return $txt;
}
?>
___________________________________
Hi Folks,
I do have another problem with the kissgallery. I have setup my page to be xhtml valid. So far so good. I got basically all errors covered. There is just only one error left.
This error is based on the kissgallery 0.4 I have installed. Initially I had three kissgallery error. Two of them I got covered by doing small modifications to the kissgallery index.php
Here is the description of the remaining error:
And here is the complete code of Line 83:Validation Output: 1 Error
1. Error Line 83, Column 66: end tag for "tr" which is not finished .
…le class="kissgallery_index"><tr></tr><tr><td class="c kissgallery_photo"><a
Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>
Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
Anyone an idea what to do?<div class="kissgallery"><table class="kissgallery_index"><tr></tr><tr><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/1.jpg" rel="lightbox[testgr]" title="Accessoire"><img src="./plugins/kissgallery/photos/1t.jpg" alt=""/></a><div style="display:none">Accessoire</div></td><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/2.jpg" rel="lightbox[testgr]" title=""><img src="./plugins/kissgallery/photos/2t.jpg" alt=""/></a><div style="display:none"></div></td><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/3.jpg" rel="lightbox[testgr]" title=""><img src="./plugins/kissgallery/photos/3t.jpg" alt=""/></a><div style="display:none"></div></td></tr><tr><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/4.jpg" rel="lightbox[testgr]" title=""><img src="./plugins/kissgallery/photos/4t.jpg" alt=""/></a><div style="display:none"></div></td><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/11.jpg" rel="lightbox[testgr]" title=""><img src="./plugins/kissgallery/photos/11t.jpg" alt=""/></a><div style="display:none"></div></td><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/13.jpg" rel="lightbox[testgr]" title=""><img src="./plugins/kissgallery/photos/13t.jpg" alt=""/></a><div style="display:none"></div></td></tr><tr><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/14.jpg" rel="lightbox[testgr]" title=""><img src="./plugins/kissgallery/photos/14t.jpg" alt=""/></a><div style="display:none"></div></td><td class="c kissgallery_photo"><a href="./plugins/kissgallery/photos/16.jpg" rel="lightbox[testgr]" title=""><img src="./plugins/kissgallery/photos/16t.jpg" alt=""/></a><div style="display:none"></div></td><td class="c kissgallery_photo"> </td></tr></table></div> <h4>Untermenü</h4><ul class="submenu"><li class="doc"><a href="/?Ausstellung:Bildergallerie">Bildergallerie</a></li></ul> </div>
Thanks
Cowboy