Example #1
0
 /**
  * 通用多类型转换
  * @param $mixed
  * @param $isint
  * @param $istrim
  * @return mixture
  */
 function escapeChar($mixed, $isint = false, $istrim = false)
 {
     if (is_array($mixed)) {
         foreach ($mixed as $key => $value) {
             $mixed[$key] = S::escapeChar($value, $isint, $istrim);
         }
     } elseif ($isint) {
         $mixed = (int) $mixed;
     } elseif (!is_numeric($mixed) && ($istrim ? $mixed = trim($mixed) : $mixed) && $mixed) {
         $mixed = S::escapeStr($mixed);
     }
     return $mixed;
 }
Example #2
0
     }
     $creategroup && ($creategroup = "<ul class=\"list_A list_120 cc\">{$creategroup}</ul>");
     require_once PrintApp('admin');
 } else {
     S::gp(array('creditset', 'creditlog', 'weibophoto', 'weibopost', 'weibourl', 'weibotip', 'weibo_hottopicdays', 'weibo_hotcommentdays', 'weibo_hotfansdays', 'weibo_hottransmitdays'), 'GP');
     S::gp(array('groups'), 'GP', 2);
     $updatecache = false;
     $config['weibophoto'] = $weibophoto ? 1 : 0;
     $config['weibopost'] = $weibopost ? 1 : 0;
     $config['weibourl'] = $weibourl ? 1 : 0;
     $config['weibo_hottopicdays'] = $weibo_hottopicdays ? int($weibo_hottopicdays) : 7;
     $config['weibo_hotcommentdays'] = $weibo_hotcommentdays ? intval($weibo_hotcommentdays) : 1;
     $config['weibo_hottransmitdays'] = $weibo_hottransmitdays ? intval($weibo_hottransmitdays) : 1;
     $config['weibo_hotfansdays'] = $weibo_hotfansdays ? intval($weibo_hotfansdays) : 1;
     $config['weibo_creditset'] = '';
     $config['weibotip'] = S::escapeStr($weibotip);
     $config['weibo_groups'] = is_array($groups) ? ',' . implode(',', $groups) . ',' : '';
     if (is_array($creditset) && !empty($creditset)) {
         foreach ($creditset as $key => $value) {
             foreach ($value as $k => $v) {
                 $creditset[$key][$k] = round($v, $k == 'rvrc' ? 1 : 0);
             }
         }
         $config['weibo_creditset'] = addslashes(serialize($creditset));
     }
     is_array($creditlog) && !empty($creditlog) && ($config['weibo_creditlog'] = addslashes(serialize($creditlog)));
     foreach ($config as $key => $value) {
         if (${'o_' . $key} != $value) {
             $db->pw_update('SELECT hk_name FROM pw_hack WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $value, 'vtype' => 'string')) . ' WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => "o_{$key}", 'vtype' => 'string', 'hk_value' => $value)));
             $updatecache = true;
         }