Пример #1
0
 private function _prepareControlPanelData()
 {
     $sefConfig =& shRouter::shGetConfig();
     $this->assign('sefConfig', $sefConfig);
     // update information
     $versionsInfo = Sh404sefHelperUpdates::getUpdatesInfos();
     $this->assign('updates', $versionsInfo);
     // url databases stats
     $database =& JFactory::getDBO();
     $sql = 'SELECT count(*) FROM #__redirection WHERE ';
     $database->setQuery($sql . "`dateadd` > '0000-00-00' and `newurl` = '' ");
     // 404
     $Count404 = $database->loadResult();
     $database->setQuery($sql . "`dateadd` > '0000-00-00' and `newurl` != '' ");
     // custom
     $customCount = $database->loadResult();
     $database->setQuery($sql . "`dateadd` = '0000-00-00'");
     // regular
     $sefCount = $database->loadResult();
     // calculate security stats
     $default = empty($sefConfig->shSecLastUpdated) ? '- -' : '0';
     $this->assign('sefCount', $sefCount);
     $this->assign('Count404', $Count404);
     $this->assign('customCount', $customCount);
 }
Пример #2
0
 * @version     $Id: mod_sh404sef_cpicon.php 2112 2011-10-24 17:49:42Z silianacom-svn $
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_sh404sef')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// define path to sh404SEF front and backend dirs
require_once JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_sh404sef' . DS . 'defines.php';
if (defined('sh404SEF_AUTOLOADER_LOADED')) {
    $lang =& JFactory::getLanguage();
    $app =& JFactory::getApplication();
    $document =& JFactory::getDocument();
    // is an update available?
    $versionsInfo = Sh404sefHelperUpdates::getUpdatesInfos();
    $updateText = $versionsInfo->shouldUpdate ? '<br /><font color="red">' . JText::_('COM_SH404SEF_UPDATE_REQUIRED') . '</font>' : '<br /><font color="green">' . JText::_('COM_SH404SEF_UPDATE_NOT_REQUIRED') . '</font>';
} else {
    $updateText = '';
}
?>

<div id="cpanel" >

<div class="icon-wrapper">
  <div class="icon">
    <a href="index.php?option=com_sh404sef"><img src="components/com_sh404sef/assets/images/icon-48-analytics.png" title="sh404sef & Analytics" alt="sh404sef & Analytics" /><span>sh404sef &amp; Analytics<?php 
echo $updateText;
?>
</span>
    </a>
Пример #3
0
 private function _prepareControlPanelData()
 {
     $sefConfig = Sh404sefFactory::getConfig();
     $this->assign('sefConfig', $sefConfig);
     // update information
     $versionsInfo = Sh404sefHelperUpdates::getUpdatesInfos();
     $this->assign('updates', $versionsInfo);
     // url databases stats
     $database = ShlDbHelper::getDb();
     try {
         $sql = 'SELECT count(*) FROM #__sh404sef_urls WHERE ';
         $database->setQuery($sql . "`dateadd` > '0000-00-00' and `newurl` = '' ");
         // 404
         $count404 = $database->shlLoadResult();
         $database->setQuery($sql . "`dateadd` > '0000-00-00' and `newurl` != '' ");
         // custom
         $customCount = $database->shlLoadResult();
         $database->setQuery($sql . "`dateadd` = '0000-00-00'");
         // regular
         $sefCount = $database->shlLoadResult();
         // calculate security stats
         $default = empty($sefConfig->shSecLastUpdated) ? '- -' : '0';
     } catch (Exception $e) {
         ShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage());
         $sefCount = 0;
         $count404 = 0;
         $customCount = 0;
     }
     $this->assign('sefCount', $sefCount);
     $this->assign('Count404', $count404);
     $this->assign('customCount', $customCount);
 }
Пример #4
0
 private function _doUpdates($tpl)
 {
     // get configuration object
     $sefConfig =& Sh404sefFactory::getConfig();
     // push it into to the view
     $this->assignRef('sefConfig', $sefConfig);
     // do we force reading updates from server ?
     $forced = JRequest::getInt('forced', 0);
     $versionsInfo = Sh404sefHelperUpdates::getUpdatesInfos(!empty($forced));
     // push security stats into view
     $this->assign('updates', $versionsInfo);
     // push any message
     $error = $this->getError();
     if (empty($error)) {
         $noMsg = JRequest::getInt('noMsg', 0);
         if (empty($noMsg)) {
             $this->assign('message', JText::_('COM_SH404SEF_ELEMENT_SAVED'));
         }
     }
     parent::display($tpl);
 }