hallo community
was wird alles benötigt um ein modul zb. die hauptnavigation ausserhalb contenido zu laden?
die geschichte dazu -> würde gerne den ersten level der hauptnavigation in xtcommerce laden.
gibts da ein howto oder sowas?
vielen dank für jede hilfe
oliver
hauptnavigationsmodul ausserhalb contenido laden
ähm nein ein howto oder sowas gibts leider nicht...
was meinst du eigentlich mit laden ?
ein contenido modul innerhalb einer anderen applikation auszuführen ?
was meinst du eigentlich mit laden ?
ein contenido modul innerhalb einer anderen applikation auszuführen ?
*** make your own tools (wishlist :: thx)
Code: Alles auswählen
$level = false; // show all
//$level = 1; // only first level , 2 -> only second level, etc...
// $cfg["tab"]["*"] -> definied in includes/cfg_sql.inc.php prefix is in includes/config.php
// $lang -> language id
// $client -> client id
$sql = "SELECT
A.idcat,
A.level,
C.name
FROM
".$cfg["tab"]["cat_tree"]." AS A,
".$cfg["tab"]["cat"]." AS B,
".$cfg["tab"]["cat_lang"]." AS C
WHERE
A.idcat=B.idcat AND
B.idcat=C.idcat AND
C.idlang='$lang' AND
B.idclient='$client'";
// only show visible otherwise show all levels
//$sql.= " AND C.visible=1";
if ($level) {
$sql.= " AND A.level = '$level'";
}
$sql.= "
ORDER BY
A.idtree";
echo $sql;
*** make your own tools (wishlist :: thx)
falls es mal jemand braucht..
Code: Alles auswählen
<?
// Which Level we should output?
$level = 1;
// Connecting, selecting database
$link = @mysql_connect('localhost', 'mysqluser', 'mysqlpass');
@mysql_select_db('contenidodb');
// Performing SQL query
$sql = "SELECT A.idcat,
A.level,
C.name
FROM
con_cat_tree AS A,
con_cat AS B,
con_cat_lang AS C
WHERE
A.idcat=B.idcat AND
B.idcat=C.idcat AND
B.parentid='1' AND
C.idlang='1' AND
B.idclient='1'";
if ($level) {
$sql.= " AND A.level = '$level'";
}
// Show only visible
$sql.= " AND C.visible=1";
// Sort on idtree
$sql.= " ORDER BY A.idtree";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<ul>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t\t<li id=\"menuitem\"><a href=\"/cms/front_content.php?idcat=".$line['idcat']."\" title=\"".$line['name']."\">".$line['name']."</a></li>\n";
}
echo "</ul>\n";
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>