| <?
class gallery {
	var $a_data;
	var $n_border;
	var $n_debug;
	var $s_message;
	//
	//	gallery
	//
	function gallery ( $n_debug = 0, $s_message = "Array is empty" ) {
		$this->n_debug = $n_debug;
		$this->s_message = $s_message;
	}
	//
	//	show
	//
	//		displays table with the data array
	//
	function show ( $a_data, $n_border = 0, $n_max = 5, $s_bg_color = "FFFFFF" ) {
		$this->a_data = $a_data;
		$this->n_border = $n_border;
		if ( sizeof ( $this->a_data ) > 0 ) {
			echo "<table border=$n_border bgcolor=$s_bg_color>\n";
			echo "<tr>\n";
			$i = 1;
			foreach ( $this->a_data as $content ) {
				echo "<td>", $content, "</td>\n";
				if ( ( $i % $n_max ) == 0 ) {
					echo "</tr><tr>\n";
				}
				$i++;
			}
			echo "</tr>";
			echo "</table>";
		}
		else if ( $this->n_debug <> 0 ) {
			echo "<br>", $this->s_message;
		}
	}
}
 |