Output problem
Posted: Fri May 23, 2008 9:50 pm
Hello,
I am in the process of writing a Wordpress plugin. I have one function, that produces the output, or rather it should. Here it is:
The problem I am having is that on the page I don't have any output at all and I can't see why that is. When I use echo instead of $out then everything shows up fine. I'd rather use $out though.
This is only my second attempt on writing something in PHP, so please be gentle
Any help would really be appreciated.
Thanks,
Boris
I am in the process of writing a Wordpress plugin. I have one function, that produces the output, or rather it should. Here it is:
Code: Select all
function nggShowImageFlow($galleryID,$irWidth,$irHeight, $link = false) {
global $wpdb;
$ngg_options = get_option ('ngg_options');
$ngg_if_options = get_option('ngg_if_options');
$pictures = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = '$galleryID' AND tt.exclude != 1 ORDER BY tt.$ngg_options[galSort] $ngg_options[galSortDir] ");
$siteurl = get_option ('siteurl');
if (!is_array($pictures)) die;
$out = '<div id="if_imageflow">';
$out .= "\n".'<div id="if_loading">';
$out .= "\n".'<b>'.__('Loading images...', 'nggflow').'</b><br/>';
$out .= "\n".'<img src="'.NGGIMAGEFLOW_URLPATH.'imageflow/loading.gif" width="208" height="13" alt="'.__('Loading', 'nggflow').'" />';
$out .= "\n".'</div>';
$out .= "\n".'<div id="if_images">';
foreach ($pictures as $picture) {
$out .= "\n".'<img src="'.$siteurl.'/reflect.php?img='.$picture->path.'/'.$picture->filename.'&bgc='.$ngg_if_options['ngg_if_background_color'].'" longdesc="'.$siteurl.'/'.$picture->path.'/'.$picture->filename.'" alt="'.apply_filters('the_title', $picture->description).'" />';
}
$out .= "\n".'</div>';
$out .= "\n".'<div id="if_captions"></div>';
$out .= "\n".'<div id="if_scrollbar">';
$out .= "\n".'<div id="if_slider"></div>';
$out .= "\n".'</div>';
$out .= '</div>';
return $out;
}
This is only my second attempt on writing something in PHP, so please be gentle
Any help would really be appreciated.
Thanks,
Boris