To display a random image from my coppermine gallery inside my blog, I found Brad Guilford’s plugin CoppermineSC 0.4.3.
The installation was easy and everything seemed to be working.
But then I noticed that some thumbnails were broken. Although the link to the image was working.
I managed to track the error down to “special” characters in the filepath, like the german Umlaute (öäüß), which I used for the album and category names.
The fix was simple:
I replaced the original code in line 717
$uri = $config[0].$separatorslash.$config[1].$image->filepath;
with
$tmpfilepaths = explode("/", $image->filepath);
$cleanfilepaths = array();
foreach($tmpfilepaths as $val) {
$cleanfilepaths[] = rawurlencode($val);
}
$newfilepath = implode ("/", $cleanfilepaths);
$uri = $config[0].$separatorslash.$config[1].$newfilepath;
As you can see, it is a simple fix. Take the filepath, split it up. Encode each part and join the parts back together.
This patch is just working for the thumbnail display! There are more places like this inside the plugin-code.
But as I am lazy and only need a working thumbnail display, I didn’t do more changes to the code ![]()












Hi. Kannst Du mir bitte verraten wie du die RANDOM-Galerie in der Sidebar integriert hast ? Ich kann zwar problemlos mehrere Bilder in den Posts einbinden, leider versteht “sidebar.php” nicht den befehl. Danke
Hi Shortie.
Die Einbindung sieht bei mir in etwa so aus:
< ?php if (function_exists('cpgsc_sidebar')) {
cpgsc_sidebar('[cpg_galrand:1]');
}
?>
Den Block packe ich dann noch in ein Div und formatiere die Ausgabe per Stylesheet.
Kannst du, bzw magst du (ist besser
mir verraten wie du die diggit/yiggit Buttons da unten ran bekommen hast?
Hi Stefan,
einfach die single.php deines Themes anpassen.