Hi,
when galerry contain only galleries (no images), flash gallery gener empty flash at end.
I recommend add condition to function theme_flash_gallery($galleries, $tid) after condition
if ($tid && taxonomy_term_count_nodes($tid, 'image')) {
Added code:
$result = db_query(db_rewrite_sql("SELECT count(*) as image_counter FROM {term_node} t INNER JOIN {node} n ON t.nid=n.nid WHERE n.status=1 AND n.type='image' AND t.tid=%d ORDER BY n.sticky DESC, n.created DESC"), $tid);
if (db_fetch_object($result)->image_counter > 0) {
Comments
Comment #1
maxim76 commentedSorry,
there is a copy/paste error with sql query (my fault) :). Correct query is:
"SELECT count(*) as image_counter FROM {term_node} t INNER JOIN {node} n ON t.nid=n.nid WHERE n.status=1 AND n.type='image' AND t.tid=%d"
Comment #2
mr john commentedI'm using PHP 4.4 and was getting an error on the if statement. I need to break up the if into two lines:
$cnt =db_fetch_object($result);
if ( $cnt->image_counter > 0) {
Comment #3
simeAnyone still want this? I won't add logic inside the theme function, but I will add a decent patch so that the theme function doesn't get called.
Marking won't fix for now, due to age of ticket, please reopen if more info.