как можно переписать цикл так, что бы в результате при выполнении сценария выводилось не сразу три ссылки а по отдельности можно было вывести ссылки.
$MenuCellClass = "";
// Menu "on" or "off" status
foreach ($UI_LANGS['menu'] as $Key => $Value)
{
// Is this the current page?
if (strtolower($PageHeader) == strtolower($UI_LANGS['menu'][$Key]))
{
// Set to On
$MenuCellClass[$UI_LANGS['menu'][$Key]] = "clmLeftMenuCell_selected";
}
else
{
// Set to Off
$MenuCellClass[$UI_LANGS['menu'][$Key]] = "clmLeftMenuCell";
}
}
// Get Dynamic Content
// Init varsc
$DynamicMenuItems = '';
// Query dynamic content pages from database
$sql = "SELECT id, menu, title FROM `".PREFIX."content` WHERE `lang` = '".$lg."' AND `visible` = '1' ORDER BY `sort` ASC";
$result = mysql_query($sql, $db)
or die("<font color=\"#FF0000\">Query Error</FONT>");
$inc = 0;
if($row = mysql_fetch_array($result))
{
$inc++;
$DynamicID = $row['id'];
$DynamicMenu = $row["menu"];
$DynamicTitle = $row["title"];
if($DynamicMenu == 'home') { $replace_ct = 'home'; $DynamicMenu = $DynamicTitle; }
if($DynamicMenu == 'contact') { $replace_ct = 'contact'; $DynamicMenu = $DynamicTitle; }
// Is the page selected?
if ($DynamicTitle == $PageHeader || $DynamicMenu == $PageHeader)
$DynamicItemState = "clmLeftMenuCell_selected";
else
$DynamicItemState = "clmLeftMenuCell";
if($DynamicMenu != 'conditions')
{
// Create menu item HTML
$DynamicMenuItems .= '<tr><td class="ml"><a href="'.($replace_ct == true ? $replace_ct : 'content').'.php?id='.$DynamicID.'" target="_self" class="ml">'.$DynamicMenu.'</a></td></tr>';
}
else
{
$conditionlink = 'content.php?id='.$DynamicID;
}
$replace_ct = '';
}
mysql_free_result($result);
// Print the dynamic menu items
//echo "<tr><td class=\"ml\"> 123456</td></tr>";
echo $DynamicMenuItems;