includes/template.php
changeset 261 5f1cd51bf1be
parent 259 112debff64bd
child 267 105457df35e5
equal deleted inserted replaced
259:112debff64bd 261:5f1cd51bf1be
   257     // Page toolbar
   257     // Page toolbar
   258     // Comments button
   258     // Comments button
   259     if ( $session->get_permissions('read') && getConfig('enable_comments')=='1' && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $paths->cpage['comments_on'] == 1 )
   259     if ( $session->get_permissions('read') && getConfig('enable_comments')=='1' && $paths->namespace != 'Special' && $paths->namespace != 'Admin' && $paths->cpage['comments_on'] == 1 )
   260     {
   260     {
   261       
   261       
   262       $e = $db->sql_query('SELECT approved FROM '.table_prefix.'comments WHERE page_id=\''.$paths->cpage['urlname_nons'].'\' AND namespace=\''.$paths->namespace.'\';');
   262       $e = $db->sql_query('SELECT approved FROM '.table_prefix.'comments WHERE page_id=\''.$paths->page_id.'\' AND namespace=\''.$paths->namespace.'\';');
   263       if ( !$e )
   263       if ( !$e )
   264       {
   264       {
   265         $db->_die();
   265         $db->_die();
   266       }
   266       }
   267       $nc = $db->numrows();
   267       $nc = $db->numrows();
   623     
   623     
   624     $this->tpl_bool['enable_uploads'] = ( getConfig('enable_uploads') == '1' && $session->get_permissions('upload_files') ) ? true : false;
   624     $this->tpl_bool['enable_uploads'] = ( getConfig('enable_uploads') == '1' && $session->get_permissions('upload_files') ) ? true : false;
   625     
   625     
   626     $this->tpl_bool['stupid_mode'] = false;
   626     $this->tpl_bool['stupid_mode'] = false;
   627     
   627     
   628     $this->tpl_bool['in_admin'] = ( ( $paths->cpage['urlname_nons'] == 'Administration' && $paths->namespace == 'Special' ) || $paths->namespace == 'Admin' );
   628     $this->tpl_bool['in_admin'] = ( ( $paths->page_id == 'Administration' && $paths->namespace == 'Special' ) || $paths->namespace == 'Admin' );
   629     
   629     
   630     $p = ( isset($_GET['printable']) ) ? '/printable' : '';
   630     $p = ( isset($_GET['printable']) ) ? '/printable' : '';
   631     
   631     
   632     // Add the e-mail address client code to the header
   632     // Add the e-mail address client code to the header
   633     $this->add_header($email->jscode());
   633     $this->add_header($email->jscode());
   739       'LOGIN_LINK'=>$login_link,
   739       'LOGIN_LINK'=>$login_link,
   740       'LOGOUT_LINK'=>$logout_link,
   740       'LOGOUT_LINK'=>$logout_link,
   741       'ADMIN_LINK'=>$admin_link,
   741       'ADMIN_LINK'=>$admin_link,
   742       'THEME_LINK'=>$theme_link,
   742       'THEME_LINK'=>$theme_link,
   743       'SEARCH_ACTION'=>makeUrlNS('Special', 'Search'),
   743       'SEARCH_ACTION'=>makeUrlNS('Special', 'Search'),
   744       'INPUT_TITLE'=>( urlSeparator == '&' ? '<input type="hidden" name="title" value="' . htmlspecialchars( $paths->nslist[$paths->namespace] . $paths->cpage['urlname_nons'] ) . '" />' : ''),
   744       'INPUT_TITLE'=>( urlSeparator == '&' ? '<input type="hidden" name="title" value="' . htmlspecialchars( $paths->nslist[$paths->namespace] . $paths->page_id ) . '" />' : ''),
   745       'INPUT_AUTH'=>( $session->sid_super ? '<input type="hidden" name="auth"  value="' . $session->sid_super . '" />' : ''),
   745       'INPUT_AUTH'=>( $session->sid_super ? '<input type="hidden" name="auth"  value="' . $session->sid_super . '" />' : ''),
   746       'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme,
   746       'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme,
   747       'THEME_ID'=>$this->theme,
   747       'THEME_ID'=>$this->theme,
   748       'STYLE_ID'=>$this->style,
   748       'STYLE_ID'=>$this->style,
   749       'JS_DYNAMIC_VARS'=>$js_dynamic,
   749       'JS_DYNAMIC_VARS'=>$js_dynamic,
  1701    */
  1701    */
  1702   
  1702   
  1703   function notify_unread_pms()
  1703   function notify_unread_pms()
  1704   {
  1704   {
  1705     global $db, $session, $paths, $template, $plugins; // Common objects
  1705     global $db, $session, $paths, $template, $plugins; // Common objects
  1706     if ( ( $paths->cpage['urlname_nons'] == 'PrivateMessages' || $paths->cpage['urlname_nons'] == 'Preferences' ) && $paths->namespace == 'Special' )
  1706     if ( ( $paths->page_id == 'PrivateMessages' || $paths->page_id == 'Preferences' ) && $paths->namespace == 'Special' )
  1707     {
  1707     {
  1708       return '';
  1708       return '';
  1709     }
  1709     }
  1710     $ob = '<div class="usermessage">'."\n";
  1710     $ob = '<div class="usermessage">'."\n";
  1711     $s = ( $session->unread_pms == 1 ) ? '' : 's';
  1711     $s = ( $session->unread_pms == 1 ) ? '' : 's';