Okay, hierfür hab ich mittlerweile eine Lösung geschrieben:
O.g. Template öffnen. An die Stelle scrollen, an der das Bild angezeigt werden soll und folgendes einfügen
PHP-Code:
<?php
// Get Database Object
$db = JFactory::getDBO();
// Initialize a Query
$query = new JDatabaseQuery;
// We want to read out the 'params' field of the DB.
$query->select('params');
// It's positioned in, for example, jos_categories...
$query->from('#__categories');
// Use the category id, declared in $this->item->catid, to get the correct cat.
$query->where('id = ' . $this->item->catid);
// Execute.
$db->setQuery($query);
// Get the results.
$messages = $db->loadObjectList();
// This is our resulting variable, from where we can get the image. Set everything you want to it.
$catimage = "images/blanco.jpg";
foreach($messages as $message)
{
// Get out the params field of the result.
$catparams = $message->params;
// Split it into fields, to get the correct parameter, called image
$catparams = split(',', $catparams);
foreach($catparams as $catparam)
{
// Filter out "image".
if(substr($catparam, 0, 7) == "\"image\"")
{
// Divide it into Key:Value
$image = split(":", $catparam);
// Save the Value...
$image = $image[1];
// Remove all additional characters
$image = str_replace("}", "", $image);
$image = str_replace("\"", "", $image);
$image = str_replace("{", "", $image);
// Voila, clear image-parameter.
$catimage = $image;
}
}
}
?>
Jetzt könnt ihr danach mit <?php echo $catimage ?> den Pfad abrufen.
Viel Spaß und Liebe Grüße,
Marco
Lesezeichen