[Linpha-cvs] SF.net SVN: linpha: [4490] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-04-08 19:39:18
|
Revision: 4490 Author: fangehrn Date: 2006-04-08 12:38:58 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4490&view=rev Log Message: ----------- * implemented home site configuration * implemented sort orders Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/index.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/modules/module.albums.php trunk/linpha2/lib/modules/module.browse.php trunk/linpha2/reset_database.php trunk/linpha2/templates/default/css/home.css trunk/linpha2/templates/default/home.html.php Added Paths: ----------- trunk/linpha2/admin/settings.php trunk/linpha2/admin/settings_layout.php Removed Paths: ------------- trunk/linpha2/admin/home.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/ChangeLog 2006-04-08 19:38:58 UTC (rev 4490) @@ -6,6 +6,8 @@ - metadata comments - metadata edit - admin section + * implemented home site configuration + * implemented sort orders 2006-04-07 flo * implemented admin section for user, groups and group memberships Deleted: trunk/linpha2/admin/home.php =================================================================== --- trunk/linpha2/admin/home.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/admin/home.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -1,4 +0,0 @@ -<?php -if(!defined('LINPHA_DIR')) { exit(1); } - -?> \ No newline at end of file Modified: trunk/linpha2/admin/index.php =================================================================== --- trunk/linpha2/admin/index.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/admin/index.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -20,7 +20,7 @@ if( ! isset( $_GET['cat'] ) ) { - $cat1 = 'home'; + $cat1 = 'settings'; } else { @@ -55,7 +55,7 @@ <?php $array_menu = Array( 'linpha_home' => Array('name' => 'Linpha Home', 'link' => 'linpha_home'), - 'home' => Array('name' => 'Home', 'link' => 'home'), + 'settings' => Array('name' => 'Settings', 'link' => 'settings'), 'permissions' => Array('name' => 'Permissions', 'link' => 'permissions'), 'import' => Array('name' => 'Import', 'link' => 'import'), 'imagefields' => Array('name' => 'Image fields', 'link' => 'imagefields'), @@ -65,8 +65,8 @@ switch($cat1) { -case 'home': - include_once('./home.php'); +case 'settings': + include_once('./settings.php'); break; case 'permissions': include_once('./permissions.php'); @@ -124,4 +124,74 @@ ?> </ul> <?php -} \ No newline at end of file +} + +function printAdminConfig($type,$text,$id,$options=array()) +{ + switch($type) + { + case 'radio': + if($GLOBALS['linpha']->sql->config->value[$id]) + { + $str_enabled = ' checked="checked"'; + $str_disabled = ''; + } + else + { + $str_enabled = ''; + $str_disabled = ' checked="checked"'; + } + echo $text; + ?> + <input type="radio" id="<?php echo $id; ?>01" name="<?php echo $id; ?>" value="1"<?php echo $str_enabled; ?> /> + <label for="<?php echo $id; ?>01"><?php echo i18n("Enable"); ?></label> + <input type="radio" id="<?php echo $id; ?>02" name="<?php echo $id; ?>" value="0"<?php echo $str_disabled; ?>/> + <label for="<?php echo $id; ?>02"><?php echo i18n("Disable"); ?></label> + <br /> + <?php + break; + case 'text': + echo $text; + ?> + <input type="text" name="<?php echo $id; ?>" value="<?php echo $GLOBALS['linpha']->sql->config->value[$id]; ?>" maxlength="255"/> + <br /> + <?php + + break; + case 'select': + echo $text; + ?> + <select name="<?php echo $id; ?>" size="1"> + <?php + foreach($options AS $key=>$value) + { + if($key == $GLOBALS['linpha']->sql->config->value[$id]) + { + $selected = ' selected="selected"'; + } + else + { + $selected = ''; + } + echo '<option value="'.$key.'"'.$selected.'>'.$value.'</option>'; + } + ?> + </select> + <?php + break; + } +} + +function saveConfig($array) +{ + foreach($array AS $value) + { + if(isset($GLOBALS['linpha']->sql->config->value[$value]) && + isset($_POST[$value])) + { + $GLOBALS['linpha']->sql->config->updateConfig($value,$_POST[$value]); + } + } + $GLOBALS['linpha']->sql->config->reloadConfig(); +} +?> \ No newline at end of file Added: trunk/linpha2/admin/settings.php =================================================================== --- trunk/linpha2/admin/settings.php (rev 0) +++ trunk/linpha2/admin/settings.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -0,0 +1,24 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + +if(!isset($cat2)) +{ + $cat2 = 'layout'; +} + +$array_menu = Array( + 'layout' => Array('name' => 'Layout', 'link' => 'settings_layout'), + 'others' => Array('name' => 'Others', 'link' => 'settings_others') +); + +print_admin_menu($array_menu,$cat2); + +switch($cat2) +{ + case 'layout': + include_once(LINPHA_DIR.'/admin/settings_layout.php'); + break; + case 'others': + break; +} +?> \ No newline at end of file Added: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php (rev 0) +++ trunk/linpha2/admin/settings_layout.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -0,0 +1,86 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + +if(!isset($cat3)) +{ + $cat3 = 'home'; +} + +$array_menu = Array( + 'home' => Array('name' => 'Home Site', 'link' => 'settings_layout_home'), + 'others' => Array('name' => 'Others', 'link' => 'settings_layout_others') +); + +print_admin_menu($array_menu,$cat3); +?> + +<form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=settings_layout_'.$cat3; ?>"> +<?php + +switch($cat3) +{ +case 'home': + $welcometxt = i18n("Add Your Own Welcome Text Here"); + $data = $GLOBALS['linpha']->db->GetRow("SELECT comment FROM ".PREFIX."meta_comments WHERE md5sum='welcometext'"); + if(isset($data['comment'])) + { + $welcometxt = $data['comment']; + $update = true; + } + + /** + * save settings + */ + if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') + { + saveConfig(Array('sys_style_home_usedefaultwelcometext', + 'sys_style_home_nrrandomimages', + 'sys_style_home_showalbums', + 'sys_style_home_firstsortorder', + 'sys_style_home_showbrowsebydate')); + if(isset($_POST['welcometext']) && $_POST['welcometext'] != $welcometxt) + { + /** + * insert or update + */ + if(isset($update)) + { + $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."meta_comments SET " . + "comment = '".LinSql::linAddslashes($_POST['welcometext'])."'" . + "WHERE md5sum='welcometext'"); + $welcometxt = $_POST['welcometext']; + } + else + { + $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."meta_comments (md5sum, comment) " . + "VALUES ('welcometext', '".LinSql::linAddslashes($_POST['welcometext'])."')"); + $welcometxt = $_POST['welcometext']; + } + } + } + + + echo '<b>'.i18n("Welcome Text").'</b><br />'; + printAdminConfig('radio',i18n("Use Default Welcome Text"),'sys_style_home_usedefaultwelcometext'); + + ?> + <textarea name="welcometext" rows="10" cols="50"><?php echo htmlspecialchars($welcometxt,ENT_QUOTES); ?></textarea> + <br /><br /><br /> + <?php + printAdminConfig('text',i18n("Nr Of Random Images (0 to disable)"),'sys_style_home_nrrandomimages'); + printAdminConfig('radio',i18n("Show Browse By Date"),'sys_style_home_showbrowsebydate'); + printAdminConfig('radio',i18n("Show Albums On Home Site"),'sys_style_home_showalbums'); + printAdminConfig('select',i18n("Sort Order Of First Level Albums"),'sys_style_home_firstsortorder',getSortOrders()); + + break; +case 'others': + + + + break; +} +?> +<br /><br /><hr /> +<input type="hidden" name="cmd" value="saveconfig" /> +<input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" /> +</form> \ No newline at end of file Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/install/sql/sql.data.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -40,7 +40,12 @@ 'sys_path_cache_dir' => $_SESSION['cache_dir'], 'sys_path_tmp_dir' => $_SESSION['tmp_dir'], 'sys_style_img_quality' => '75', - 'sys_style_nrrandomimages' => '4', + 'sys_style_home_showbrowsebydate' => '1', + 'sys_style_home_nrrandomimages' => '4', + 'sys_style_home_showalbums' => '1', + 'sys_style_home_usedefaultwelcometext' => '1', + 'sys_style_home_firstsortorder' => 'nameasc', + 'sys_style_sortorder' => 'nameasc', 'sys_style_template' => 'default', 'sys_style_tn_size' => '150', 'sys_user_autologin' => '1' Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -129,8 +129,42 @@ } } +/** + * returns an array with the sort orders + */ +function getSortOrders() +{ + return Array( + 'nameasc' => i18n("Name Asc"), + 'namedesc' => i18n("Name Desc"), + 'dateasc' => i18n("Date Asc"), + 'datedesc' => i18n("Date Desc") + ); +} /** + * return the correct sql order string + */ +function getSqlSortOrder($order) +{ + switch($order) + { + case 'nameasc': + return "name ASC"; + break; + case 'namedesc': + return "name DESC"; + break; + case 'dateasc': + return "time_add ASC"; + break; + case 'datedesc': + return "time_add DESC"; + break; + } +} + +/** * explode string to array and remove first and last entry of array because they are empty * * should be moved to "others" Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -34,7 +34,6 @@ $array_tn_sizes = Array(50,75,100,150,200,250,300,400,500); $def_tn_size = 150; $array_nr_images = Array('auto',10,25,50,100,200,'all'); -$array_sort_orders = Array('nameasc', 'namedesc', 'dateasc', 'datedesc'); $no_js_nr_rows = 3; $no_js_nr_cols = 4; @@ -62,6 +61,8 @@ */ function setCurrentView($modulename) { + $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_sortorder']); + if(isset($_GET['id']) && $_GET['id'] != 0) { /** @@ -121,6 +122,7 @@ if($modulename=='albums') { $this->mode = 'home'; + $this->orderby = getSqlSortOrder($GLOBALS['linpha']->sql->config->value['sys_style_home_firstsortorder']); } else // $modulename=='browse', others will come.. { @@ -278,7 +280,8 @@ /** * more than one time used stuff */ - foreach($GLOBALS['array_sort_orders'] AS $value) + $array = getSortOrders(); + foreach($array AS $value) { $array_sort_orders_links[] = Array('name' => i18n($value), 'value' => $GLOBALS['linpha']->template->URL_full.'&order_by='.$value); } @@ -378,14 +381,17 @@ */ function adminCommands() { - switch($_GET['admin_cmd']) + if($GLOBALS['linpha']->sql->isAdmin()) { - case 'recreate': - LinImage::createThumbnail($this->id_current,$this->img_type,$force=true); - break; - case 'rotate_left': - case 'rotate_right': - break; + switch($_GET['admin_cmd']) + { + case 'recreate': + LinImage::createThumbnail($this->id_current,$this->img_type,$force=true); + break; + case 'rotate_left': + case 'rotate_right': + break; + } } } @@ -663,6 +669,28 @@ { $GLOBALS['linpha']->template->setModuleName('home'); + /** + * set welcome text + */ + if($GLOBALS['linpha']->sql->config->value['sys_style_home_usedefaultwelcometext']) + { + $GLOBALS['linpha']->template->output['welcome'] = '<h1>'.i18n("Welcome").'</h1>'. + i18n("Hi, this is the home of \"The PHP Photo Archive\" " . + "<a href=\"http://linpha.sf.net\">aka LinPHA</a>.").'<br />'; + } + else + { + $data = $GLOBALS['linpha']->db->GetRow("SELECT comment FROM ".PREFIX."meta_comments WHERE md5sum='welcometext'"); + if(isset($data['comment'])) + { + $GLOBALS['linpha']->template->output['welcome'] = $data['comment']; + } + else + { + $GLOBALS['linpha']->template->output['welcome'] = ''; + } + } + $this->setRandomImages(); $this->setBrowseByDate(); @@ -683,27 +711,30 @@ */ function setBrowseByDate() { - $GLOBALS['linpha']->template->output['browse_by_date'] = ''; - - $data = $GLOBALS['linpha']->db->GetRow("SELECT min(datetimeoriginal), max(datetimeoriginal) " . - "FROM ".PREFIX."meta_exif"); - if(isset($data[0]) && isset($data[1]) && !empty($data[0]) && !empty($data[1]) ) + if($GLOBALS['linpha']->sql->config->value['sys_style_home_showbrowsebydate']) { - /** - * get min and max year - */ - $min_year = substr($data[0],0,4); - $max_year = substr($data[1],0,4); - - /** - * get years between - */ - for($i = $min_year; $i <= $max_year; $i++) + $GLOBALS['linpha']->template->output['browse_by_date'] = ''; + + $data = $GLOBALS['linpha']->db->GetRow("SELECT min(datetimeoriginal), max(datetimeoriginal) " . + "FROM ".PREFIX."meta_exif"); + if(isset($data[0]) && isset($data[1]) && !empty($data[0]) && !empty($data[1]) ) { - $data = $GLOBALS['linpha']->db->GetRow("SELECT count(datetimeoriginal) FROM ".PREFIX."meta_exif WHERE datetimeoriginal LIKE '".$i."%'"); - if($data[0]>0) + /** + * get min and max year + */ + $min_year = substr($data[0],0,4); + $max_year = substr($data[1],0,4); + + /** + * get years between + */ + for($i = $min_year; $i <= $max_year; $i++) { - $GLOBALS['linpha']->template->output['browse_by_date'] .= '<a href="'.LINPHA_DIR.'/?cat=browse&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; + $data = $GLOBALS['linpha']->db->GetRow("SELECT count(datetimeoriginal) FROM ".PREFIX."meta_exif WHERE datetimeoriginal LIKE '".$i."%'"); + if($data[0]>0) + { + $GLOBALS['linpha']->template->output['browse_by_date'] .= '<a href="'.LINPHA_DIR.'/?cat=browse&year='.$i.'">'.$i.'</a> ('.$data[0].'), '; + } } } } @@ -716,40 +747,45 @@ */ function setRandomImages() { - switch(DB_TYPE) - { - case 'mysql': - $str_random = 'rand()'; - break; - case 'postgres': - $str_random = 'random()'; - break; - case 'sqlite': - $str_random = 'random()'; - break; - } - - $nr_random_images = $GLOBALS['linpha']->sql->config->value['sys_style_nrrandomimages']; $GLOBALS['linpha']->template->output['random_images'] = Array(); - $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999 ORDER BY ".$str_random); - for($i = 1; $i <= $nr_random_images ; ) + if($GLOBALS['linpha']->sql->config->value['sys_style_home_nrrandomimages'] != 0) { - $data = $query->FetchRow(); - if(isset($data['id'])) + switch(DB_TYPE) + { + case 'mysql': + $str_random = 'rand()'; + break; + case 'postgres': + $str_random = 'random()'; + break; + case 'sqlite': + $str_random = 'random()'; + break; + } + + $nr_random_images = $GLOBALS['linpha']->sql->config->value['sys_style_home_nrrandomimages']; + $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999 ORDER BY ".$str_random); + + for($i = 1; $i <= $nr_random_images ; ) { - $path = implode('/',LinSql::getFullFilenameFromId($data['id'])); - - if(file_exists(LinFilesys::getFullPath($path)) && LinSql::photoIsAllowed($data['id'])) + $data = $query->FetchRow(); + if(isset($data['id'])) { - $GLOBALS['linpha']->template->output['random_images'][] = Array('id'=>$data['id'],'path'=>$path); - $i++; + $array = LinSql::getFullFilenameFromId( $data['id'] ); + $path = LinSql::getPath('album') .'/'. implode('/',$array); + + if(file_exists(LinFilesys::getFullPath($path)) && LinSql::photoIsAllowed($data['id'])) + { + $GLOBALS['linpha']->template->output['random_images'][] = Array('id'=>$data['id'],'path'=>$path); + $i++; + } } + else + { + break; + } } - else - { - break; - } } } Modified: trunk/linpha2/lib/modules/module.albums.php =================================================================== --- trunk/linpha2/lib/modules/module.albums.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/lib/modules/module.albums.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -78,10 +78,10 @@ * take folders first */ $array_folders = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, md5sum, stats_numbers, time_add FROM ".PREFIX."photos " . - "WHERE img_type = '0' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$order_by); + "WHERE img_type = '0' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$linpha->imgview->orderby); $array_files = $GLOBALS['linpha']->db->GetAssoc("SELECT id, name, img_type, md5sum, stats_numbers, time_add FROM ".PREFIX."photos " . - "WHERE img_type <> '0' AND img_type <> '9999999' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$order_by); + "WHERE img_type <> '0' AND img_type <> '9999999' AND parent_id = '".$linpha->imgview->id_parent."' ORDER by ".$linpha->imgview->orderby); $linpha->imgview->photos = array_merge($array_folders,$array_files); Modified: trunk/linpha2/lib/modules/module.browse.php =================================================================== --- trunk/linpha2/lib/modules/module.browse.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/lib/modules/module.browse.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -222,7 +222,7 @@ $linpha->imgview->photos = $GLOBALS['linpha']->db->GetAssoc("SELECT p.id, p.name, p.img_type, p.md5sum, p.stats_numbers, p.time_add " . "FROM ".PREFIX."photos AS p LEFT OUTER JOIN ".PREFIX."meta_exif AS e ON p.md5sum = e.md5sum " . "WHERE e.datetimeoriginal is NULL AND img_type <> '0' AND img_type <> '9999999' " . - "ORDER by ".$order_by); + "ORDER by ".$linpha->imgview->orderby); } else { @@ -231,7 +231,7 @@ "WHERE p.md5sum = e.md5sum " . "AND img_type <> '0' AND img_type <> '9999999' " . "AND e.datetimeoriginal LIKE '".$search_string."%' " . - "ORDER by ".$order_by); + "ORDER by ".$linpha->imgview->orderby); } Modified: trunk/linpha2/reset_database.php =================================================================== --- trunk/linpha2/reset_database.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/reset_database.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -30,7 +30,7 @@ /** * drop tables */ - echo tr("Drop tables")."... "; + echo "<br /><br />".tr("Drop tables")."... "; while( list($key,$value) = each($linpha_tables) ) { $result = @$linpha->db->Execute("DROP TABLE ".$value); @@ -56,7 +56,7 @@ /** * finally create tables */ - echo tr("Creating Tables")."... "; + echo "<br /><br />".tr("Creating Tables")."... "; $translation_array = array_keys($linpha_tables); // only used in error case while( list($key,$query) = each($sql_tables) ) @@ -99,12 +99,13 @@ unset($error_nr); } + $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."users (username, password) VALUES ('admin','".md5('test')."')"); + $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."user_group (user_id, group_id) VALUES ('1','1')"); - function failed_msg() { Modified: trunk/linpha2/templates/default/css/home.css =================================================================== --- trunk/linpha2/templates/default/css/home.css 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/templates/default/css/home.css 2006-04-08 19:38:58 UTC (rev 4490) @@ -21,9 +21,8 @@ } .div_random { - height: 200px; -} +} .div_random_img { float: left; margin-left: 40px; @@ -32,8 +31,8 @@ .img_random_thumbnail { border: 0; - max-width: 130px; - max-height: 130px; + width: 130px; + height: 130px; } .div_folder { Modified: trunk/linpha2/templates/default/home.html.php =================================================================== --- trunk/linpha2/templates/default/home.html.php 2006-04-08 15:41:24 UTC (rev 4489) +++ trunk/linpha2/templates/default/home.html.php 2006-04-08 19:38:58 UTC (rev 4490) @@ -5,58 +5,63 @@ <div id="main"> -<h1><?php echo i18n("Welcome"); ?></h1> -<br /><br /><br /> +<?php echo $GLOBALS['linpha']->template->output['welcome']; ?> +<br /> -<hr /> - +<!-- Random Images --> <?php if( count($GLOBALS['linpha']->template->output['random_images']) > 0 ) { ?> + <hr /> <h1><?php echo i18n("Random images"); ?></h1> - <div class='div_random'> <?php foreach($GLOBALS['linpha']->template->output['random_images'] AS $key=>$value) { ?> - <div class='div_random_img'> + <div class="div_random_img"> <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' . '<img class="img_random_thumbnail" title="'.htmlentities($value['path']).'" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="randomimage" /></a>'; ?> + <br /><br /> </div> <?php } ?> - </div> - - <hr /> + <div style="clear: both;"></div> <?php } ?> +<!-- Browse by Date --> <?php -if(!empty($GLOBALS['linpha']->template->output['browse_by_date'])) { +if($GLOBALS['linpha']->sql->config->value['sys_style_home_showbrowsebydate'] && + !empty($GLOBALS['linpha']->template->output['browse_by_date'])) { + echo "<hr />"; echo i18n("Browse by Date").': '.$GLOBALS['linpha']->template->output['browse_by_date']; - echo "<br /><hr />"; + echo "<br />"; } ?> -<h1><?php echo i18n("Albums"); ?></h1> - -<?php -foreach($GLOBALS['linpha']->imgview->photos_filtered AS $key=>$value) -{ - ?> - <div class='div_folder'> - <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' - . '<img class="img_folder_thumbnail" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="thumbnail_album" /></a>'; ?> - - <div class='div_folder_text'> - <h2><?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">'.$value['name'].'</a>'; ?></h2> - - <?php echo $value['stats_numbers'].' '.i18n("Photos"); ?> - - <br /> - <?php echo strftime("%x %X",$value['time_add']); ?> - +<!-- Albums --> +<?php if($GLOBALS['linpha']->sql->config->value['sys_style_home_showalbums']) { ?> + <hr /> + <h1><?php echo i18n("Albums"); ?></h1> + + <?php + foreach($GLOBALS['linpha']->imgview->photos_filtered AS $key=>$value) + { + ?> + <div class='div_folder'> + <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' + . '<img class="img_folder_thumbnail" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="thumbnail_album" /></a>'; ?> + + <div class='div_folder_text'> + <h2><?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">'.$value['name'].'</a>'; ?></h2> + + <?php echo $value['stats_numbers'].' '.i18n("Photos"); ?> + + <br /> + <?php echo strftime("%x %X",$value['time_add']); ?> + + </div> </div> - </div> - <?php + <?php + } } ?> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |