Exemplo n.º 1
0
 function usesubmit()
 {
     global $_G;
     $id = intval($_G['gp_id']);
     $idtype = $_G['gp_idtype'];
     $blog = magic_check_idtype($id, $idtype);
     $newdateline = dstrtotime($_POST['newdateline']);
     if (!$_POST['newdateline'] || $newdateline < dstrtotime('1970-1-1') || $newdateline > $blog['dateline']) {
         showmessage('magicuse_bad_dateline');
     }
     $tablename = gettablebyidtype($idtype);
     DB::query("UPDATE " . DB::table($tablename) . " SET dateline='{$newdateline}' WHERE {$idtype}='{$id}' AND uid='{$_G['uid']}'");
     DB::query("UPDATE " . DB::table('home_feed') . " SET dateline='{$newdateline}' WHERE id='{$id}' AND idtype='{$idtype}' AND uid='{$_G['uid']}'");
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id);
     showmessage('magics_use_success', '', array('magicname' => $_G['setting']['magics']['downdateline']), array('showdialog' => 1));
 }
Exemplo n.º 2
0
     showformfooter();
 } else {
     $feednew = getgpc('feednew');
     $feedid = intval($feednew['feedid']);
     if (empty($feednew['feeduid']) || empty($feedid)) {
         $setarr = array('title_template' => trim($feednew['title_template']), 'body_template' => trim($feednew['body_template']));
         if (empty($setarr['title_template']) && empty($setarr['body_template'])) {
             cpmsg('sitefeed_error', '', 'error');
         }
     } else {
         $setarr = array();
     }
     $feednew['dateline'] = trim($feednew['dateline']);
     if ($feednew['dateline']) {
         require_once libfile('function/home');
         $newtimestamp = dstrtotime($feednew['dateline']);
         if ($newtimestamp > $_G['timestamp']) {
             $_G['timestamp'] = $newtimestamp;
         }
     }
     if (empty($feedid)) {
         $_G['uid'] = 0;
         require_once libfile('function/feed');
         $feedid = feed_add('sitefeed', trim($feednew['title_template']), array(), trim($feednew['body_template']), array(), trim($feednew['body_general']), array(trim($feednew['image_1']), trim($feednew['image_2']), trim($feednew['image_3']), trim($feednew['image_4'])), array(trim($feednew['image_1_link']), trim($feednew['image_2_link']), trim($feednew['image_3_link']), trim($feednew['image_4_link'])), '', '', '', 1);
     } else {
         if (empty($feednew['feeduid'])) {
             $setarr['body_general'] = trim($feednew['body_general']);
         }
         $setarr['image_1'] = trim($feednew['image_1']);
         $setarr['image_1_link'] = trim($feednew['image_1_link']);
         $setarr['image_2'] = trim($feednew['image_2']);
Exemplo n.º 3
0
            $fuid_actives = array($fuid => ' selected');
        } else {
            $wheresql = "a.uid IN ({$space['feedfriend']})";
            $theurl = "home.php?mod=space&uid={$space['uid']}&do={$do}&view=we";
        }
        $query = DB::query("SELECT * FROM " . DB::table('home_friend') . " WHERE uid='{$space['uid']}' ORDER BY num DESC LIMIT 0,100");
        while ($value = DB::fetch($query)) {
            $userlist[] = $value;
        }
    } else {
        $need_count = false;
    }
}
$actives = array($_GET['view'] => ' class="a"');
if ($need_count) {
    $today = dstrtotime(dgmdate($_G['timestamp'], 'Y-m-d'));
    $order = '';
    if ($_G['gp_view'] != 'all') {
        $wheresql .= " AND a.starttimefrom >'{$today}'";
    } elseif (empty($_G['gp_order'])) {
        $order = 'DESC';
    }
    if ($searchkey = stripsearchkey($_GET['searchkey'])) {
        $threadsql .= " AND t.subject LIKE '%{$searchkey}%'";
    }
    $count = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('forum_activity') . " a {$apply_sql} WHERE {$wheresql}"), 0);
    if ($count) {
        if ($_GET['view'] == 'all' && $_GET['order'] == 'hot') {
            $apply_sql = '';
        }
        $threadsql = empty($threadsql) ? '' : $threadsql . ' AND ';
Exemplo n.º 4
0
\t\t</div>
\t</form>
SEARCHFORM;
    $mpurl = ADMINSCRIPT . '?action=members&operation=verify';
    $intkeys = array('uid');
    $strkeys = array('fieldid');
    $randkeys = array();
    $likekeys = array('username');
    $results = getwheres($intkeys, $strkeys, $randkeys, $likekeys);
    $wherearr = $results['wherearr'];
    if ($_GET['dateline1']) {
        $wherearr[] = "dateline >= '" . dstrtotime($_GET['dateline1']) . "'";
        $mpurl .= '&starttime=' . $_GET['dateline1'];
    }
    if ($_GET['dateline2']) {
        $wherearr[] = "dateline <= '" . dstrtotime($_GET['dateline2']) . "'";
        $mpurl .= '&endtime=' . $_GET['dateline2'];
    }
    $wheresql = empty($wherearr) ? '1' : implode(' AND ', $wherearr);
    $orders = getorders(array('dateline'), 'dateline');
    $ordersql = $orders['sql'];
    if ($orders['urls']) {
        $mpurl .= '&' . implode('&', $orders['urls']);
    }
    $orderby = array($_GET['orderby'] => ' selected');
    $ordersc = array($_GET['ordersc'] => ' selected');
    $perpage = empty($_GET['perpage']) ? 0 : intval($_GET['perpage']);
    if (!in_array($perpage, array(10, 20, 50, 100))) {
        $perpage = 10;
    }
    $perpages = array($perpage => ' selected');
Exemplo n.º 5
0
     $item['pic'] = 'portal/' . $result['pic'];
     $item['picflag'] = $result['remote'] ? '2' : '1';
     $item['makethumb'] = 0;
 } elseif ($_POST['pic']) {
     $item['pic'] = $_POST['pic'];
     $item['picflag'] = intval($_POST['picflag']);
     $item['makethumb'] = 0;
 }
 $item['showstyle'] = $_POST['showstyle'] ? dstripslashes($_POST['showstyle']) : array();
 $item['showstyle'] = daddslashes(serialize($item['showstyle']));
 foreach ($theclass['fields'] as $key => $value) {
     if (!isset($item[$key]) && isset($_POST[$key])) {
         if ($value['datatype'] == 'int') {
             $_POST[$key] = intval($_POST[$key]);
         } elseif ($value['datatype'] == 'date') {
             $_POST[$key] = dstrtotime($_POST[$key]);
         } else {
             $_POST[$key] = dstripslashes($_POST[$key]);
         }
         $item['fields'][$key] = $_POST[$key];
     }
 }
 $item['fields'] = addslashes(serialize($item['fields']));
 $archive = array();
 if ($item['startdate'] > $_G['timestamp']) {
     DB::insert('common_block_item', $item, false, true);
 } elseif (!$item['enddate'] || $item['enddate'] > $_G['timestamp']) {
     $archive = DB::fetch_first('SELECT * FROM ' . DB::table('common_block_item') . " WHERE bid='{$block['bid']}' AND displayorder='{$item['displayorder']}'");
     DB::insert('common_block_item', $item, false, true);
 } else {
     $archive = DB::fetch_first('SELECT * FROM ' . DB::table('common_block_item') . " WHERE bid='{$block['bid']}' AND displayorder='{$item['displayorder']}'");