- Timestamp:
- Jun 7, 2011, 9:44:37 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Comments_on_Albums/include/coa_admin_intro.php
r10984 r11267 2 2 /* adds info about comments count on main admin page, uses javascript */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 global $template; 4 6 5 7 // comments count … … 10 12 list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); 11 13 12 $template->assign('DB_COMMENTS_ALBUMS', l10n_dec('%d comment', '%d comments', $nb_comments)); 14 $template->assign( 15 'DB_COMMENTS_ALBUMS', 16 l10n_dec('%d comment', '%d comments', $nb_comments) 17 ); 13 18 14 19 // unvalidated comments … … 20 25 list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); 21 26 22 if ($nb_comments > 0) { 23 $template->assign('unvalidated_albums', array( 24 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments&section=albums', 25 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) 26 )); 27 if ($nb_comments > 0) 28 { 29 $template->assign( 30 'unvalidated_albums', 31 array( 32 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments&section=albums', 33 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) 34 ) 35 ); 27 36 } 28 37 29 // template 30 $template->set_filename('comments_on_albums', dirname(__FILE__) .'/../template/coa_admin_intro.tpl'); 31 $template->concat('ADMIN_CONTENT', $template->parse('comments_on_albums', true)); 38 $template->set_prefilter('intro', 'coa_admin_intro_prefilter'); 39 40 function coa_admin_intro_prefilter($content, &$smarty) 41 { 42 $search = '(<a href="{$unvalidated.URL}">{$unvalidated.INFO}</a>)'; 43 44 $replace = $search.' 45 {/if} 46 [{\'Photos\'|@translate}] 47 </li> 48 <li> 49 {$DB_COMMENTS_ALBUMS} 50 {if isset($unvalidated_albums)} 51 (<a href="{$unvalidated_albums.URL}">{$unvalidated_albums.INFO}</a>) 52 {/if} 53 [{\'Albums\'|@translate}] 54 {if true}'; 55 56 return str_replace($search, $replace, $content); 57 } 32 58 33 59 ?>
Note: See TracChangeset
for help on using the changeset viewer.