Beispiel #1
0
 $MG['refresh_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback');
 $itemid or message($L['select_info']);
 $itemids = $itemid;
 $s = $f = 0;
 foreach ($itemids as $itemid) {
     $do->itemid = $itemid;
     $item = $do->get_one();
     $could_refresh = $item && $item['username'] == $_username;
     if ($could_refresh && $MG['refresh_limit'] && $DT_TIME - $item['edittime'] < $MG['refresh_limit']) {
         $could_refresh = false;
     }
     if ($could_refresh && $MOD['credit_refresh'] && $MOD['credit_refresh'] > $_credit) {
         $could_refresh = false;
     }
     if ($could_refresh) {
         $do->refresh($itemid);
         $s++;
         if ($MOD['credit_refresh']) {
             $_credit = $_credit - $MOD['credit_refresh'];
         }
     } else {
         $f++;
     }
 }
 if ($MOD['credit_refresh'] && $s) {
     $credit = $s * $MOD['credit_refresh'];
     credit_add($_username, -$credit);
     credit_record($_username, -$credit, 'system', lang($L['credit_record_refresh'], array($MOD['name'])), lang($L['refresh_total'], array($s)));
 }
 $msg = lang($L['refresh_success'], array($s));
 if ($f) {