| 
	
 | 
 Posted by deko on 08/10/06 23:18 
This seems to work: 
 
 
$linkdata = $wpdb->get_results("SELECT link_category, link_url,  
link_description, link_name 
  FROM wp02_links WHERE link_category != 1"); 
 
  $linkcats = $wpdb->get_results("SELECT DISTINCT cat_id, cat_name 
  FROM wp02_linkcategories WHERE cat_id != 1"); 
 
  foreach ($linkcats as $link_cat) 
  { 
   ?><h2>» <?php echo $link_cat->cat_name; ?></h2><?php 
   foreach ($linkdata as $link_datum) 
   { 
    if ($link_datum->link_category == $link_cat->cat_id) 
    { 
     if ($pp) 
     { 
      $link = "<a href='".$link_datum->link_url; 
     } 
     elseif ($rg) 
     { 
      $link = "<a href='http://www.example.com/example/example.php"; 
     } 
     if ($link_datum->link_description == '0') 
     { 
      $linkdesc = ""; 
     } 
     else 
     { 
      $linkdesc = "#cat".$link_datum->link_description; 
     } 
     echo "• ".$link.$linkdesc."'>".$link_datum->link_name."</a><br  
/>"; 
    } 
   } 
  }
 
  
Navigation:
[Reply to this message] 
 |