<commit_before><?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: global/photos.php
| Author: <NAME> (Hien)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
	die("Access Denied");
}
//add_to_head("<link href='".INFUSIONS."gallery/css/photos.css' rel='stylesheet' />\n");
if (!function_exists("render_gallery")) {
	function render_gallery($info) {
		global $locale;
		echo render_breadcrumbs();
		opentable($locale['400']);
		echo $info['page_nav'];
		if (isset($info['item'])) {

			function render_photoAlbum(array $info = array()) {
				// add admin edit.
				global $locale, $gallery_settings;
				echo "<div class='panel panel-default'>\n";
				echo "<div class='panel-heading'>\n";
				echo "<a title='".$locale['430']."' href='".$info['album_link']['link']."'>\n<strong>".trimlink($info['album_link']['name'], 10)."</strong>\n</a>\n";
				echo "</div>\n";
				echo "<div class='overflow-hide' style='background: #ccc; height: ".($gallery_settings['thumb_h']-15)."px'>\n";
				echo $info['image'];
				echo "</div>\n";
				echo "<div class='panel-body'>\n";
				echo "<span class='album_count'>".$info['photo_rows']." ".($info['photo_rows'] > 1 ? $locale['462'] : $locale['461'])."</span>";
				echo "</div>\n";
				echo "<div class='panel-footer'>\n";
				echo "<abbr title='".$locale['464'].showdate("shortdate", $info['album_datestamp'])."'><i class='entypo calendar text-lighter'></i></abbr> ".timer($info['album_datestamp'])."";
				echo "</div></div>\n";
			}

			echo "<div class='row'>\n";
			foreach ($info['item'] as $data) {
				echo "<div class='col-xs-12 col-sm-3'>\n";
				render_photoAlbum($data);
				echo "</div>\n";
			}
		} else {
			echo "<div class='well m-t-20 m-b-20 text-center'>".$locale['406']."</div>\n";
		}
		echo $info['page_nav'];
		closetable();
	}
}

/* Photo Category Page */
if (!function_exists('render_photo_album')) {
	function render_photo_album($info) {
		global $locale;
		echo render_breadcrumbs();
		opentable($locale['430']);
		echo "<!--pre_album_info-->";
		echo "<div class='clearfix well'>\n";
		echo "<h4 class='album_title m-t-0'>".$info['album_title']."</h4>\n";
		if (isset($info['album_stats'])) {
			echo "<span class='album_stats'>\n".$info['album_stats']."</span>\n";
		}
		if ($info['album_description']) {
			echo "<div class='m-t-20'>\n";
			echo "<!--photogallery_album_desc-->\n";
			echo "<span class='album_description'>\n".nl2br(parseubb($info['album_description']))."</span><br/>\n";
			echo "</div>\n";
		}
		echo "</div>\n";
		echo "</div>\n";
		echo "<hr/>\n";
		if (isset($info['page_nav'])) echo "<div class='text-right'>".$info['page_nav']."</div>\n";
		echo "<!--sub_album_info-->";
		$counter = 0;

		function render_photo_items(array $info = array()) {
			global $locale, $gallery_settings;
			echo "<div class='panel panel-default'>\n";
			echo "<div class='overflow-hide' style='background: #ccc; height: ".($gallery_settings['thumb_h']-15)."px'>\n";
			echo $info['image'];
			echo "</div>\n";
			echo "<div class='panel-body'>\n";
			echo "<a class='word-break' href='".$info['photo_link']['link']."'><strong>".trim_text($info['photo_link']['name'], 10)."</strong></a>\n<br/>";
			echo "</div>\n";
			echo "<div class='panel-footer'>\n";
			echo "<span><i class='fa fa-eye fa-fw'></i>".$info['photo_views']."</span></br>\n";
			if (isset($info['photo_comments'])) echo "<span><i class='fa fa-comment-o fa-fw'></i><a href='".$info['photo_comments']['link']."'>".$info['photo_comments']['word']."</a>\n</span></br>\n";
			if (isset($info['photo_ratings'])) echo "<span><i class='fa fa-star-o fa-fw'></i><a href='".$info['photo_ratings']['link']."'>".$info['photo_ratings']['word']."</a>\n</span></br>\n";
			echo "</div>\n";
			echo "<div class='panel-footer'>\n";
			echo "<small><strong>".$locale['434']."</strong></small>\n<br/>\n";
			echo "<div class='pull-left'>\n".display_avatar($info, "15px", "", "", "")."</div>";
			echo "<div class='overflow-hide'>\n".profile_link($info['user_id'], $info['user_name'], $info['user_status'])."</div>\n";
			echo "</div>\n";
			echo "<div class='panel-footer'>\n";
			echo "<abbr title='".$locale['464'].showdate("shortdate", $info['photo_datestamp'])."'>
			<i class='entypo calendar text-lighter'></i></abbr> ".timer($info['photo_datestamp'])."";
			echo "</div></div>\n";
		}

		if (isset($info['item'])) {
			echo "<div class='row' style='position:relative;'>\n";
			global $gallery_settings;
			foreach ($info['item'] as $data) {
				echo "<div style='margin:0 auto; width: ".($gallery_settings['thumb_w']+15)."px; float:left; padding-left:10px; padding-right:10px;'>\n";
				render_photo_items($data);
				echo "</div>\n";
				$counter++;
			}
			echo "</div>\n";
		} else {<commit_msg>Gallery Patch -  fixes #163<commit_after><?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: global/photos.php
| Author: <NAME> (Hien)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
	die("Access Denied");
}
//add_to_head("<link href='".INFUSIONS."gallery/css/photos.css' rel='stylesheet' />\n");
if (!function_exists("render_gallery")) {
	function render_gallery($info) {
		global $locale;
		echo render_breadcrumbs();
		opentable($locale['400']);
		echo $info['page_nav'];
		if (isset($info['item'])) {

			function render_photoAlbum(array $info = array()) {
				// add admin edit.
				global $locale, $gallery_settings;
				echo "<div class='panel panel-default'>\n";
				echo "<div class='panel-heading'>\n";
				echo "<a title='".$locale['430']."' href='".$info['album_link']['link']."'>\n<strong>".trimlink($info['album_link']['name'], 10)."</strong>\n</a>\n";
				echo "</div>\n";
				echo "<div class='overflow-hide' style='background: #ccc; height: ".($gallery_settings['thumb_h']-15)."px'>\n";
				echo $info['image'];
				echo "</div>\n";
				echo "<div class='panel-body'>\n";
				echo "<span class='album_count'>".$info['photo_rows']." ".($info['photo_rows'] > 1 ? $locale['462'] : $locale['461'])."</span>";
				echo "</div>\n";
				echo "<div class='panel-footer'>\n";
				echo "<abbr title='".$locale['464'].showdate("shortdate", $info['album_datestamp'])."'><i class='entypo calendar text-lighter'></i></abbr> ".timer($info['album_datestamp'])."";
				echo "</div></div>\n";
			}

			echo "<div class='row'>\n";
			foreach ($info['item'] as $data) {
				echo "<div class='col-xs-12 col-sm-3'>\n";
				render_photoAlbum($data);
				echo "</div>\n";
			}
		} else {
			echo "<div class='well m-t-20 m-b-20 text-center'>".$locale['406']."</div>\n";
		}
		echo $info['page_nav'];
		closetable();
	}
}

/* Photo Category Page */
if (!function_exists('render_photo_album')) {
	function render_photo_album($info) {
		global $locale;
		echo render_breadcrumbs();
		opentable($locale['430']);
		echo "<!--pre_album_info-->";
		echo "<div class='clearfix well'>\n";
		echo "<h4 class='album_title m-t-0'>".$info['album_title']."</h4>\n";
		if (isset($info['album_stats'])) {
			echo "<span class='album_stats'>\n".$info['album_stats']."</span>\n";
		}
		if ($info['album_description']) {
			echo "<div class='m-t-20'>\n";
			echo "<!--photogallery_album_desc-->\n";
			echo "<span class='album_description'>\n".nl2br(parseubb($info['album_description']))."</span><br/>\n";
			echo "</div>\n";
		}
		echo "</div>\n";
		echo "</div>\n";
		echo "<hr/>\n";
		if (isset($info['page_nav'])) echo "<div class='text-right'>".$info['page_nav']."</div>\n";
		echo "<!--sub_album_info-->";
		$counter = 0;

		function render_photo_items(array $info = array()) {
			global $locale, $gallery_settings;
			echo "<div class='panel panel-default'>\n";
			echo "<div class='overflow-hide' style='background: #ccc; height: ".($gallery_settings['thumb_h']-15)."px'>\n";
			echo $info['image'];
			echo "</div>\n";
			echo "<div class='panel-body'>\n";
			echo "<a class='word-break' href='".$info['photo_link']['link']."'><strong>".trimlink($info['photo_link']['name'], 20)."</strong></a>\n<br/>";
			echo "</div>\n";
			echo "<div class='panel-footer'>\n";
			echo "<span><i class='fa fa-eye fa-fw'></i>".$info['photo_views']."</span></br>\n";
			if (isset($info['photo_comments'])) echo "<span><i class='fa fa-comment-o fa-fw'></i><a href='".$info['photo_comments']['link']."'>".$info['photo_comments']['word']."</a>\n</span></br>\n";
			if (isset($info['photo_ratings'])) echo "<span><i class='fa fa-star-o fa-fw'></i><a href='".$info['photo_ratings']['link']."'>".$info['photo_ratings']['word']."</a>\n</span></br>\n";
			echo "</div>\n";
			echo "<div class='panel-footer'>\n";
			echo "<small><strong>".$locale['434']."</strong></small>\n<br/>\n";
			echo "<div class='pull-left'>\n".display_avatar($info, "15px", "", "", "")."</div>";
			echo "<div class='overflow-hide'>\n".profile_link($info['user_id'], $info['user_name'], $info['user_status'])."</div>\n";
			echo "</div>\n";
			echo "<div class='panel-footer'>\n";
			echo "<abbr title='".$locale['464'].showdate("shortdate", $info['photo_datestamp'])."'>
			<i class='entypo calendar text-lighter'></i></abbr> ".timer($info['photo_datestamp'])."";
			echo "</div></div>\n";
		}

		if (isset($info['item'])) {
			echo "<div class='row' style='position:relative;'>\n";
			global $gallery_settings;
			foreach ($info['item'] as $data) {
				echo "<div style='margin:0 auto; width: ".($gallery_settings['thumb_w']+15)."px; float:left; padding-left:10px; padding-right:10px;'>\n";
				render_photo_items($data);
				echo "</div>\n";
				$counter++;
			}
			echo "</div>\n";
		} else {
{'fraction_non_alphanumeric': 0.2882380288238029, 'fraction_numerical': 0.011250581125058112, 'mean_word_length': 3.6989951944080386, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 0, '>': 201, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4924891', 'n_tokens_mistral': 4111, 'n_tokens_neox': 3633, 'n_words': 691}