jo, men da jeg ønsker at kunne definere hvilken tekst der står for sidenavn og kategorinavn og samtidig laver koden til et modul i et cms vil jeg meget gerne kunne hente 'sidenavn' og 'kategorinavn' fra en XML fil
Jeg henter fra XML filen vha.
$sidenavn = $params->get( 'sidenavn' );
$kategorinavn = $params->get( 'kategorinavn' );
Og disse data vil jeg gerne have ind i mit array da det er her det afgøres hvad "navnet" skal være...
Hvis det hjælper med koden i sin helhed er den her:
<?php
/**
* @copyright (C) 2006 eyemedia.dk
* @license
http://www.gnu.org/copyleft/gpl.html GNU/GPL
* This module is Free
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
require_once( $mainframe->getPath( 'front_html', 'com_content') );
global $$mosConfig_shownoauth;
$access = !$mosConfig_shownoauth;
$moduleclass_sfx = $params->get( 'moduleclass_sfx' );
$antaltd = $params->get( 'antaltd' );
$sidenavn = $params->get( 'sidenavn' );
$kategorinavn = $params->get( 'kategorinavn' );
$option = $_GET['option'];
$task = $_GET['task'];
if ($option=="com_content" && $task=="view") {
$catid = intval( mosGetParam( $_REQUEST, 'Itemid', null ) );
$queries = array(
'sidenavn' => 'SELECT cat.id AS catid, cat.title, con.id AS contentid FROM jos_categories cat LEFT JOIN jos_content con ON (cat.title = con.title) GROUP BY cat.title ORDER BY cat.title',
'kategorinavn' => "SELECT id AS contentid, catid, title FROM jos_content WHERE catid = $catid ORDER BY title ASC"
);
echo "<table class=\"$moduleclass_sfx\">";
foreach($queries as $headline => $stmt) {
echo "<tr><td colspan=\"3\"><b>$headline</b></td></tr><tr>";
$query = mysql_query($stmt);
$i = 1;
while ($row = mysql_fetch_array($query)) {
if ($row['contentid']=="") {
echo "<td>{$row['title']}</td>";
if(($i%$antaltd) == 0) {
echo "</tr><tr>";
}
}
else {
echo "<td><a href=\"index.php?option=com_content&task=view&id={$row['contentid']}&Itemid={$row['catid']}\" class=\"$moduleclass_sfx\">{$row['title']}</a></td>";
if(($i%$antaltd) == 0) {
echo "</tr><tr>";
}}
$i++;
}
echo "</tr>";
}
echo "</table>";
}
?>