1 sandrayln Jan 19, 2010 18:16
3 sam2kb Jan 19, 2010 20:59
The actual code will be
global $DB, $Blog;
$items_with_tags = $DB->get_col('SELECT itag_itm_ID FROM T_items__itemtag');
$items_without_tags = $DB->get_col('SELECT post_ID FROM T_items__item WHERE post_ID NOT IN ( '.implode( ',', $items_with_tags ).' )');
// Create empty List:
$ItemList = & new ItemList2( $Blog, NULL, NULL );
// Filter list:
$ItemList->set_filters( array(
'post_ID_list' => implode( ',', $items_without_tags ),
) );
// Get ready for display (runs the query):
$ItemList->display_init();
if( $ItemList->result_num_rows )
{
while( $Item = & $ItemList->get_item() )
{
echo $Item->title.'<br />';
}
}
4 sandrayln Jan 22, 2010 17:15
Ah-ha. And thank you for the impromptu lesson on how to use the built-in b2evo SQL functions, which was my next bit of work. :)
Once you get item IDs you can use ItemList and set_filters
Use T_ prefix in your queries, it will be automatically replaced with the real tables prefix