diff options
author | plegall <plg@piwigo.org> | 2010-03-14 23:56:21 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2010-03-14 23:56:21 +0000 |
commit | b95eebbe1809fa74e333df85549c18d77fff7811 (patch) | |
tree | e4e5e2923f4ea6080871927c9aa462ff62e04a8a /include/common.inc.php | |
parent | 59d9c085aa6a86961f53055f7a1936a16f576712 (diff) |
feature 1505: when there is no photo yet in the gallery, displays a big and
obvious message, guiding to the Administration>Images>Add page.
git-svn-id: http://piwigo.org/svn/trunk@5138 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/common.inc.php')
-rw-r--r-- | include/common.inc.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index 9a5ccac90..d4ad9ad5c 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -165,6 +165,41 @@ else $template = new Template(PHPWG_ROOT_PATH.'themes', $user['theme'] ); } +// The "No Photo Yet" feature: if you have no photo yet in your gallery, the +// gallery displays only a big box to show you the way for adding your first +// photos +if ( + !isset($conf['no_photo_yet']) // the message disappears at first photo + and !(defined('IN_ADMIN') and IN_ADMIN) // no message inside administration + and script_basename() != 'identification' // keep the ability to login + ) +{ + $query = ' +SELECT + COUNT(*) + FROM '.IMAGES_TABLE.' +;'; + list($nb_photos) = pwg_db_fetch_row(pwg_query($query)); + if (0 == $nb_photos) + { + $template->set_filenames(array('no_photo_yet'=>'no_photo_yet.tpl')); + + $url = $conf['no_photo_yet_url']; + if (substr($url, 0, 4) != 'http') + { + $url = get_root_url().$url; + } + + $template->assign(array('next_step_url' => $url)); + $template->pparse('no_photo_yet'); + exit(); + } + else + { + conf_update_param('no_photo_yet', 'false'); + } +} + if (isset($user['internal_status']['guest_must_be_guest']) and $user['internal_status']['guest_must_be_guest'] === true) |