getCol("select distinct category from categories"); $developers =& $conn->getCol("select distinct name from dev"); $plugins =& $conn->getCol("select distinct name from plugins"); print("
"); if ($sorting == "") {$sorting = "updated";} if (!in_array($sorting,array("added","popular","updated","thisweek"))) {print("bad sort"); $sorting = "";} if ($dev != "" && !in_array($dev,$developers)) {print("bad dev"); $dev = "";} if ($category != "" && !in_array($category,$categories)) {print("bad category $cateogry"); $category = "";} if ($plugin != "" && !in_array($plugin,$plugins)) {print("bad plugin $plugin"); $plugin = "";} if (!is_int($page)) {print("bad page $page"); $page = "1";} print("
\n"); if (!strcmp($sorting,"popular") || !strcmp($sorting,"thisweek")) $stmt .= " join clicks on plugins.id = clicks.plugin "; $stmt .= " where status = 1 and "; if (strcmp($dev,"")) $stmt .= " `dev`.`name` = '$dev' AND "; elseif (strcmp($category,"") && strcmp($category,"all")) $stmt .= " `plugins`.`id` in (select plugin from `categories` where `category` = '$category' ) AND "; if (!strcmp($sorting,"thisweek")) $stmt .= " `clicks`.`timestamp` > date_add(now(), interval -1 week) "; else $stmt .= " 1"; if (!strcmp($sorting,"popular") || !strcmp($sorting,"thisweek")) $stmt .= " group by plugins.id "; if (!strcmp($sorting,"updated")) $stmt .= " order by `updated` desc"; elseif (!strcmp($sorting,"popular") || !strcmp($sorting,"thisweek")) $stmt .= " order by sum(click) desc, plugins.id desc "; else $stmt .= " order by `plugins`.`id` desc "; $plugs =& $conn->getAssoc($stmt); $count = count($plugs); if (0){ print("

$stmt

"); #print("
");
	#print_r($plugs);
	#print("
"); } function showCategoryForm() { global $conn, $category, $sorting, $thispage; $stmt = "SELECT COUNT(1) , `category` FROM `categories` GROUP BY `category` ORDER BY count(1) desc, `category` asc"; $cats =& $conn->getAll($stmt); print("

Plugin Categories

"); } function showSelectForm($selected) { global $conn,$thispage; $plugs =& $conn->getAll("select `plugins`.`name`,`fullname` from plugins order by id asc"); print ("
Choose a Plugin:
"); if (!$selected == "") {print ("← Back to Plugin List\n");} } function showSmall($plugin) { print("
\"$plugin[2]\"\n"); print("

$plugin[1] - $plugin[2]

\n

$plugin[3]

by: $plugin[7]updated: "); print(date("M jS, Y",strtotime($plugin[6]))); if($plugin[6] > "2010-06-08 00:00:00") { print("Bibble 5.1 Ready"); } print("click for details
\n"); print("
\n
\n"); } function showComplete($plugin) { global $conn,$plugs,$thispage; $res =& $conn->query("INSERT INTO `clicks` (`plugin`, `timestamp`) VALUES (?, CURRENT_TIMESTAMP)",$plugin[8]); $stmt = "select `id`,`name`,`bio`,`URL`,`image` from dev where `id` = " .$plugin[9]; $devs =& $conn->getRow($stmt); if (0){ print("
");
		print $stmt;
		print_r($devs);
		print("
"); } print("

Uniquely Powerful Plug-ins

Bibble 5 includes the industry's most advanced, best integrated plug-in interface, providing photographers with unique, totally non-destructive access to third party image editing tools.

\n"); print("
"); showSelectForm($plugin[0]); print ("
"); print("

About $devs[1]

$devs[2]

"); if (strcmp($devs[3],"")) {print("

$devs[1]'s Homepage \"external

");} if (strcmp($devs[4],"")) {print("
");} print("
\n"); $stmt = "select `name`,`name`,`fullname`,`headline` from plugins where `developer` = $devs[0]"; $others =& $conn->getAssoc($stmt); if (count($others) > 1 ) { print("

Other Plugins by $devs[1]:

"); } print("
\n\n"); print("
"); print("

$plugin[1] - $plugin[2]

\n"); print("

$plugin[4]

"); if (strpos($plugin[5],"http") !== FALSE ) { print("

Learn more and download $plugin[1] \"external

\n"); } else { print("

$plugin[5]

"); } if(strcmp($plugin[10],"")) {print("

Buy now from $plugin[7] \"external

\n");} #single image, no hover, no lightbox $pcats =& $conn->getAll("select `category` from `categories` where `plugin` = $plugin[8] ORDER BY category ASC" ); print("
by: $plugin[7]updated: "); print(date("M jS, Y",strtotime($plugin[6]))); if($plugin[6] > "2010-06-08 00:00:00") { print("Bibble 5.1 Ready"); } print(""); foreach ($pcats as $pcat) { print("$pcat[0]
"); } print("
\n"); echo str_replace("%image%", strtolower(str_replace(" ","",$plugin[0])), "\"$plugin[1]\"
"); if ($plugin[9] != 0) {showDisclaimer();} print("
\n"); } function showDisclaimer() { print("
Notice: The plugins shown on this page are not created by Bibble Labs, Inc and are not tested or warranted by Bibble Labs. These plugins are created, sold, and supported by the developers of the individual plugins.
"); } if ( $count == 1) $plugin = key($plugs); if (in_array($plugin,array_keys($plugs))) { ########## Single Plugin page ################ showComplete($plugs[$plugin]); } else { ########## Many Plugin page ################ showCategoryForm(); print <<

Uniquely Powerful Plug-ins

Bibble 5 includes the industry's most advanced, best integrated plug-in interface, providing photographers with unique, totally non-destructive access to third party image editing tools.

Plug-ins in Bibble 5 are no different than the built-in adjustment tools - all tools and plug-ins work seamlessly with Bibble 5's undo/redo and editing History tools, may be applied or changed in any order, and don't ever require creating intermediate image files.

Interested in creating Bibble 5 Plug-ins?

Need help installing Plugins?

END; if ($dev != "") {$query .= "&developer=$dev";} if ($category != "") {$query .= "&category=".urlencode($category);} print("
Sort by:"); print("Date AddedDate UpdatedPopular (overall)Popular (this week)\n"); if ($count > 5) { if ($sorting != "") {$query .= "&sort=$sorting";} $pager = "
Page:"; for ($i = 1; $i <= ceil($count / 5); $i++) { $pager .= "Viewing $dev's plugins. View All"); print("
\n"); foreach (array_slice($plugs, ($page-1) * 5, 5,true) as $plugin) { showSmall($plugin); } print("
"); print($pager); print("
"); showDisclaimer(); } ?>