Ignore:
Timestamp:
03/15/10 00:56:21 (10 years ago)
Author:
plg
Message:

feature 1505: when there is no photo yet in the gallery, displays a big and
obvious message, guiding to the Administration>Images>Add page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r5123 r5138  
    166166} 
    167167 
     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 
     171if ( 
     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 = ' 
     178SELECT 
     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 
    168203if (isset($user['internal_status']['guest_must_be_guest']) 
    169204    and 
Note: See TracChangeset for help on using the changeset viewer.