$category = " get / post / result etc ";
$result = dbquery("SELECT * FROM ".DB_TABLE." WHERE parentid='".$category."'");
echo "News";
$category = dbquery("SELECT * FROM ".$db_prefix."nodeObject WHERE category=57");
$result = dbquery("SELECT o.name name, o.image image, o.type type, o.link link, o.id id, o.date, o.category, c.id catid, c.name catname FROM ".$db_prefix."nodeObject o LEFT JOIN ".$db_prefix."nodeCategory c ON c.id=o.category WHERE c.parent='".$category."' ORDER BY date DESC LIMIT 20");
$rows = dbcount("(id)", "".$db_prefix."nodeObject");
if ($rows != 0) {
echo "<div class='news'>";
while ($data = dbarray($result)) {
echo "<div class='row'>";
if ($data['image']) {
$image = "<a href='node.php?cat_id=".$data['catid']."&id=".$data['id']."'><img src='".INFUSIONS."node/uploads/".$data['image']."'></a>";
}elseif ($data['link']) {
$image = "<a href='node.php?cat_id=".$data['catid']."&id=".$data['id']."'><img src='".parse_youtube_url($data['link'],'thumb')."' /></a>";
} else {
$image = "<a href='node.php?cat_id=".$data['catid']."&id=".$data['id']."'><img src='".INFUSIONS."node/images/nophoto.jpg' /></a>";
}
echo $image;
echo "<a class='gridtitle' href='node.php?cat_id=".$data['catid']."&id=".$data['id']."'>".trimlink($data['name'],30)."</a>";
echo "</div>";
}
echo "</div>";
}
Quote
Category: 57
---- Parent: 58
---- Parent: 59
---- Parent: 60
---- Parent: 61
define("NODE", ".$db_prefix."nodeObject);
$result57 = dbquery("SELECT * FROM ".NODE." where category='57');
$result58 = dbquery("SELECT * FROM ".NODE." where category='58');
$result59 = dbquery("SELECT * FROM ".NODE." where category='59');
$result60 = dbquery("SELECT * FROM ".NODE." where category='60');
$result61 = dbquery("SELECT * FROM ".NODE." where category='61');
$data57 = dbarray($result57);
$data58 = dbarray($result58);
$data59 = dbarray($result59);
$data60 = dbarray($result60);
$data61 = dbarray($result61);
id
int(11) unsigned NOT NULL auto_increment,name
varchar(255) NOT NULL default '',parent
int(11) NOT NULL default '0',body
text NOT NULL,image
varchar(255) NOT NULL default '',count
int(11) NOT NULL,locked
int(11) NOT NULL default '0',access
int(1) NOT NULL default '0',id
)id
int(10) unsigned NOT NULL auto_increment,name
varchar(255) NOT NULL default '',category
int(10) NOT NULL default '0',type
enum('news','video','audio' NOT NULL default 'news',link
varchar(255) NOT NULL default '',body
text NOT NULL,image
varchar(255) NOT NULL default '',date
int(10) UNSIGNED NOT NULL DEFAULT '0',author
int(10) UNSIGNED NOT NULL DEFAULT '1',count
int(10) NOT NULL,locked
int(10) NOT NULL default '0',access
int(1) NOT NULL default '0',id
)Quote
afaaro wrote:
I tried this
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
$data1 = dbarray(dbquery("SELECT * FROM ".$db_prefix."nodeCategory WHERE parent='1'"));
$data2 = dbquery("SELECT * FROM ".$db_prefix."nodeCategory WHERE parent='".$data1['parent']."'");
while($row = dbarray($data2)){
echo "<h3>{$row['name']}</h3>";
$result = dbquery("SELECT o.name name, o.image image, o.type type, o.link link, o.id id, o.date, o.category, c.id catid, c.name catname FROM ".$db_prefix."nodeObject o LEFT JOIN ".$db_prefix."nodeCategory c ON c.id=o.category WHERE o.category='".$row['id']."' ORDER BY date DESC LIMIT 30");
echo "<div class='muxaadaro'>";
while($row2 = dbarray($result)){
echo "<div class='grid'>";
if ($row2['image']) {
$image = "<a href='node.php?cat_id=".$row2['catid']."&id=".$row2['id']."'><img src='".INFUSIONS."node/uploads/".$row2['image']."'></a>";
}elseif ($data['link']) {
$image = "<a href='node.php?cat_id=".$row2['catid']."&id=".$row2['id']."'><img src='".parse_youtube_url($row2['link'],'thumb')."' /></a>";
} else {
$image = "<a href='node.php?cat_id=".$row2['catid']."&id=".$data['id']."'><img src='".INFUSIONS."node/images/nophoto.jpg' /></a>";
}
echo $image;
echo "<a class='gridtitle' href='node.php?cat_id=".$row2['catid']."&id=".$row2['id']."'>".trimlink($row2['name'],30)."</a><br>".$row2['catname'];
echo "</div>";
}
echo "</div>";
}
[/syntaxhighlighter]
and this what comes up http://hamarey.com/infusions/node/pag...=muxaadaro
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions