Changeset 5138
- Timestamp:
- Mar 15, 2010, 12:56:21 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/common.inc.php
r5123 r5138 166 166 } 167 167 168 // The "No Photo Yet" feature: if you have no photo yet in your gallery, the 169 // gallery displays only a big box to show you the way for adding your first 170 // photos 171 if ( 172 !isset($conf['no_photo_yet']) // the message disappears at first photo 173 and !(defined('IN_ADMIN') and IN_ADMIN) // no message inside administration 174 and script_basename() != 'identification' // keep the ability to login 175 ) 176 { 177 $query = ' 178 SELECT 179 COUNT(*) 180 FROM '.IMAGES_TABLE.' 181 ;'; 182 list($nb_photos) = pwg_db_fetch_row(pwg_query($query)); 183 if (0 == $nb_photos) 184 { 185 $template->set_filenames(array('no_photo_yet'=>'no_photo_yet.tpl')); 186 187 $url = $conf['no_photo_yet_url']; 188 if (substr($url, 0, 4) != 'http') 189 { 190 $url = get_root_url().$url; 191 } 192 193 $template->assign(array('next_step_url' => $url)); 194 $template->pparse('no_photo_yet'); 195 exit(); 196 } 197 else 198 { 199 conf_update_param('no_photo_yet', 'false'); 200 } 201 } 202 168 203 if (isset($user['internal_status']['guest_must_be_guest']) 169 204 and -
trunk/include/config_default.inc.php
r5123 r5138 766 766 // where should the API add photos? 767 767 $conf['upload_dir'] = PHPWG_ROOT_PATH.'upload'; 768 769 // where should the user be guided when there is no photo in his gallery yet? 770 $conf['no_photo_yet_url'] = 'admin.php?page=photos_add'; 768 771 ?> -
trunk/include/functions.inc.php
r5123 r5138 1061 1061 } 1062 1062 1063 function conf_update_param($param, $value) 1064 { 1065 $query = ' 1066 DELETE 1067 FROM '.CONFIG_TABLE.' 1068 WHERE param = "'.$param.'" 1069 ;'; 1070 pwg_query($query); 1071 1072 $query = ' 1073 INSERT 1074 INTO '.CONFIG_TABLE.' 1075 SET param = "'.$param.'" 1076 , value = "'.$value.'" 1077 ;'; 1078 pwg_query($query); 1079 } 1080 1063 1081 /** 1064 1082 * Prepends and appends a string at each value of the given array.
Note: See TracChangeset
for help on using the changeset viewer.