Răsfoiți Sursa

#53 - Check TODOs in the code.

AntonLV 12 ani în urmă
părinte
comite
ad92560622

+ 0 - 24
inc/classes/BxDolCmts.php

@@ -306,30 +306,6 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
         return $GLOBALS['bx_dol_cmts_systems'];
     }
 
-	/**
-     * it is called on cron every day or similar period to clean old comment votes
-     */
-    public static function maintenance() 
-    {
-        $iResult = 0;
-        $oDb = BxDolDb::getInstance();
-
-        $aSystems = self::getSystems();
-        foreach($aSystems as $aSystem) {
-			if(!$aSystem['is_on'])
-				continue;
-
-            $sQuery = $oDb->prepare("DELETE FROM `{$aSystem['table_track']}` WHERE `cmt_rate_ts` < (UNIX_TIMESTAMP() - ?)", BX_CMT_OLD_VOTES);
-            $iDeleted = (int)$oDb->query($sQuery);
-            if($iDeleted > 0)
-            	$oDb->query("OPTIMIZE TABLE `{$aSystem['table_track']}`");
-
-			$iResult += $iDeleted;
-        }
-
-        return $iResult;
-    }
-
     public function init ($iId)
     {
         if (empty($this->iId) && $iId)

+ 0 - 4
inc/classes/BxDolCronPruning.php

@@ -67,10 +67,6 @@ class BxDolCronPruning extends BxDolCron
         bx_import('BxDolVote');
         $iDeletedVotes = BxDolVote::maintenance();
 
-        // clean comments ratings
-        //bx_import('BxDolCmts');
-        //BxDolCmts::maintenance(); // TODO: fix it
-
         echo _t('_sys_pruning_db', $iDeleteMemLevels, $iSessions, $iDeletedViews, $iDeletedVotes, $iDeletedKeys, $iDeletedExpiredTokens, $iDeletedTranscodedImages);
     }
 

+ 1 - 10
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -654,16 +654,7 @@ class BxTimelineModule extends BxDolModule
 		);
     }
 
-    //--- Check permissions methods ---//
-
-    // TODO: this function is incorrect ,$iAction is never defined, also it looks like it is not used anywhere: rewrite it or delete
-    public function checkActionErrorMsg ($iAction)
-    {
-        $iId = $this->_getAuthorId();
-        $check_res = checkAction($iId, $iAction);
-        return $check_res[CHECK_ACTION_RESULT] !== CHECK_ACTION_RESULT_ALLOWED ? $check_res[CHECK_ACTION_MESSAGE] : '';
-    }
-    
+    //--- Check permissions methods ---//    
     public function isAllowedPost($bPerform = false)
     {
 		if(isAdmin())