当前位置: 首页>>代码示例>>PHP>>正文


PHP implodeids函数代码示例

本文整理汇总了PHP中implodeids函数的典型用法代码示例。如果您正苦于以下问题:PHP implodeids函数的具体用法?PHP implodeids怎么用?PHP implodeids使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了implodeids函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     global $G, $lang;
     if ($this->checkFormSubmit()) {
         $delete = $_GET['delete'];
         if ($delete && is_array($delete)) {
             $deleteids = implodeids($delete);
             $photos = $this->t('photo')->where("photoid IN({$deleteids})")->select();
             foreach ($photos as $pp) {
                 @unlink(ROOT_PATH . '/' . $pp['thumb']);
                 @unlink(ROOT_PATH . '/' . $pp['picurl']);
             }
             $this->t('photo')->where("photoid IN({$deleteids})")->delete();
         }
         $this->showSuccess('delete_succeed');
     } else {
         $pagesize = 20;
         $totalnum = $this->t('photo')->count();
         $pagecount = $totalnum < $pagesize ? 1 : ceil($totalnum / $pagesize);
         $photolist = $this->t('photo')->page($G['page'], $pagesize)->order('photoid', 'DESC')->select();
         if ($photolist) {
             $newlist = array();
             foreach ($photolist as $list) {
                 $list['thumb'] = C('ATTACHURL') . $list['thumb'];
                 $list['size'] = formatsize($list['size']);
                 $list['uptime'] = @date('Y-m-d H:i', $list['uptime']);
                 $newlist[$list['photoid']] = $list;
             }
             $photolist = $newlist;
             unset($newlist);
         }
         $pages = $this->showPages($G['page'], $pagecount, $totalnum);
         include template('photo');
     }
 }
开发者ID:xy113,项目名称:XiangBaLaoServer,代码行数:35,代码来源:class.PhotoController.php

示例2: updatecache

function updatecache($cachename = '')
{
    global $db, $bbname, $tablepre, $maxbdays;
    static $cachescript = array('settings' => array('settings'), 'usergroups' => array('usergroups'), 'ipbanned' => array('ipbanned'));
    if ($maxbdays) {
        $cachescript['birthdays'] = array('birthdays');
        $cachescript['index'][] = 'birthdays_index';
    }
    $updatelist = empty($cachename) ? array_values($cachescript) : (is_array($cachename) ? array('0' => $cachename) : array(array('0' => $cachename)));
    $updated = array();
    foreach ($updatelist as $value) {
        foreach ($value as $cname) {
            if (empty($updated) || !in_array($cname, $updated)) {
                $updated[] = $cname;
                getcachearray($cname);
            }
        }
    }
    foreach ($cachescript as $script => $cachenames) {
        if (empty($cachename) || !is_array($cachename) && in_array($cachename, $cachenames) || is_array($cachename) && array_intersect($cachename, $cachenames)) {
            $cachedata = '';
            $query = $db->query("SELECT data FROM {$tablepre}caches WHERE cachename in(" . implodeids($cachenames) . ")");
            while ($data = $db->fetch_array($query)) {
                $cachedata .= $data['data'];
            }
            writetocache($script, $cachenames, $cachedata);
        }
    }
    if (!$cachename || $cachename == 'admingroups') {
        $query = $db->query("SELECT * FROM {$tablepre}admingroups");
        while ($data = $db->fetch_array($query)) {
            writetocache($data['admingid'], '', getcachevars($data), 'admingroup_');
        }
    }
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:35,代码来源:cache.func.php

示例3: listinfos

 function listinfos($where = '', $order = '', $page = 1, $pagesize = 50, $flags = 0)
 {
     if (!isset($ACTOR)) {
         $ACTOR = getcache('actor_' . get_siteid(), 'ask');
     }
     if ($where) {
         $where = " WHERE {$where}";
     }
     if ($order) {
         $order = " ORDER BY {$order}";
     }
     $page = max(intval($page), 1);
     $offset = $pagesize * ($page - 1);
     $limit = " LIMIT {$offset}, {$pagesize}";
     $r = $this->get_one('', ' COUNT(*) AS num');
     $number = $r['number'];
     $this->db->pages;
     $array = array();
     $i = 1;
     $result = $this->db->query("SELECT * FROM {$this->table_name} {$where} {$order} {$limit}");
     $data = $this->fetch_array($result);
     foreach ($data as $r) {
         $userids[] = $userid = $r['userid'];
         $r['orderid'] = $i;
         $_array[] = $array[$userid] = $r;
         $i++;
     }
     if ($userids != '') {
         $userids = implodeids($userids);
         $data = $this->db_m->listinfo("userid IN ({$userids})");
         foreach ($data as $r) {
             $userid = $r['userid'];
             $credit = $r['point'];
             $r['lastdate'] = date('Y-m-d H:i', $r['lastdate']);
             foreach ($ACTOR[$r['actortype']] as $k => $v) {
                 if ($credit >= $v['min'] && $credit <= $v['max']) {
                     $r['grade'] = $v['grade'] . ' ' . $v['actor'];
                 } elseif ($credit > $v['max']) {
                     $r['grade'] = $v['grade'] . ' ' . $v['actor'];
                 }
             }
             if ($flags) {
                 $_info[$userid] = $r;
             } else {
                 $info[] = array_merge($array[$userid], $r);
             }
         }
         if ($flags) {
             foreach ($_array as $r) {
                 $userid = $r['userid'];
                 $info[] = array_merge($_info[$userid], $r);
             }
         }
     }
     $info = array_filter($info);
     $this->number = $this->db_m->page;
     $this->db->free_result($result);
     return $info;
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:59,代码来源:ask_credit_model.class.php

示例4: updatespacecache

function updatespacecache($uid, $module, $list = FALSE)
{
    global $_DCOOKIE, $db, $mod, $tablepre, $timestamp, $tpp, $page, $multipage, $starttime, $endtime, $spacedata, $lastvisit, $videoopen, $tradetypeid;
    if (!file_exists(DISCUZ_ROOT . './forumdata/cache/cache_spacesettings.php')) {
        require_once DISCUZ_ROOT . './include/cache.func.php';
        updatespacesettings();
    }
    require DISCUZ_ROOT . './forumdata/cache/cache_spacesettings.php';
    if ($list) {
        $tpp = $mod != 'mytrades' ? $tpp : 15;
        $page = max(1, intval($page));
        $start_limit = ($page - 1) * $tpp;
        $parms['items'] = "{$start_limit}, {$tpp}";
    } else {
        $parms['items'] = intval($spacedata['limit' . $module]);
    }
    $parms['list'] = $list;
    $parms['conditions'] = $parms['extraquery'] = '';
    $parms['cols'] = '*';
    $user_func = 'module_' . $module;
    $user_func($parms);
    $tids = $datalist = array();
    $query = $db->query("SELECT {$parms['cols']} FROM {$tablepre}{$parms['table']} {$parms['conditions']} LIMIT {$parms['items']}");
    while ($data = $db->fetch_array($query)) {
        if (!empty($data['message'])) {
            $data['message'] = spacecutstr($data['message'], $spacedata['textlength']);
            $videoopen && ($data['message'] = videocode($data['message'], $data['tid'], $data['pid']));
        }
        if ($data['tid'] && $lastvisit < $data['lastpost'] && (empty($_DCOOKIE['oldtopics']) || strpos($_DCOOKIE['oldtopics'], 'D' . $data['tid'] . 'D') === FALSE)) {
            $data['subject'] .= ' <a href="redirect.php?tid=' . $data['tid'] . '&amp;goto=newpost#newpost" target="_blank"><img src="' . IMGDIR . '/firstnew.gif" border="0" alt="" /></a>';
        }
        if ($parms['extraquery']) {
            $tids[] = $data['tid'];
            $datalist[$data['tid']] = $data;
        } else {
            $datalist[] = $data;
        }
    }
    if ($tids) {
        $query = $db->query($parms['extraquery'] . '(' . implodeids($tids) . ')');
        while ($data = $db->fetch_array($query)) {
            $datalist[$data['tid']] = array_merge($datalist[$data['tid']], $data);
        }
    }
    if (!$list) {
        $db->query("REPLACE INTO {$tablepre}spacecaches (uid, variable, value, expiration) VALUES ('{$uid}', '{$module}', '" . addslashes(serialize($datalist)) . "', '" . ($timestamp + $spacedata['cachelife']) . "')");
    } else {
        $num = $db->result_first("SELECT count(*) FROM {$tablepre}{$parms['table']} {$parms['conditions']}");
        $module = empty($parms['pagemodule']) ? $module : $parms['pagemodule'];
        $multipage = spacemulti($num, $tpp, $page, "space.php?uid={$uid}&amp;mod={$module}" . ($starttime ? "&amp;starttime={$starttime}" : '') . ($endtime ? "&amp;endtime={$endtime}" : '') . (isset($tradetypeid) ? "&amp;tradetypeid={$tradetypeid}" : ''));
    }
    return $datalist;
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:53,代码来源:space.func.php

示例5: getUpdatedUsers

	function getUpdatedUsers($num) {
		$logfile = DISCUZ_ROOT.'./forumdata/logs/manyou_user.log';
		$totalNum = 0;
		$result = array();
		if(file_exists($logfile) && @rename($logfile, $logfile.'.bak')) {
			$data = file($logfile.'.bak');
			$totalNum = count($data);
			if($num < $totalNum) {
				$ldata = array_slice($data, $num);
				$data = array_slice($data, 0, $num);
				$newdata = @file($logfile);
				$writedata = is_array($newdata) ? array_merge($ldata, $newdata) : $ldata;
				if($fp = @fopen($logfile, 'w')) {
					@flock($fp, 2);
					foreach($writedata as $row) {
						fwrite($fp, trim($row)."\n");
					}
					fclose($fp);
				}
			}
			@unlink($logfile.'.bak');
			if($data) {
				$dataary = $uIds = array();
				foreach($data as $row) {
					list(,, $uid, $action) = explode("\t", $row);
					$uIds[] = $uid;
					$dataary[] = array($uid, $action);
				}
				$sql = 'SELECT m.*, mf.* FROM %s m LEFT JOIN %s mf ON m.uid = mf.uid WHERE m.uid IN (%s)';
				$sql = sprintf($sql, $GLOBALS['tablepre'].'members', $GLOBALS['tablepre'].'memberfields', implodeids(array_unique($uIds)));
				$query = $GLOBALS['db']->query($sql);
				$users = array();
				while($member = $GLOBALS['db']->fetch_array($query)) {
					$user = $this->_space2user($member);
					$users[$user['uId']] = $user;
				}

				foreach($dataary as $row) {
					$users[$row[0]]['action'] = trim($row[1]);
					$result[] = $users[$row[0]];
				}
			}
		}

		$result = array(
			'totalNum' => count($data),
			'users' => $result
		);
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:50,代码来源:Site.php

示例6: getInfo

	function getInfo($uIds, $fields = array()) {
		$result = array();
		$query = $GLOBALS['db']->query("SELECT mf.*, m.* FROM ".$GLOBALS['tablepre']."members m
			LEFT JOIN ".$GLOBALS['tablepre']."memberfields mf ON mf.uid=m.uid
			WHERE m.uid IN (".implodeids($uIds).")");
		while($space = $GLOBALS['db']->fetch_array($query)) {
			$user = $this->_space2user($space);
			$tmp = array();
			if($fields) {
				foreach($fields as $field) {
					$tmp[$field] = $user[$field];
				}
			} else {
				$tmp = $user;
			}
			$result[] = $tmp;
		}
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:19,代码来源:Users.php

示例7: setFlag

	function setFlag($applications, $flag) {
		$flag = ($flag == 'disabled') ? -1 : ($flag == 'default' ? 1 : 0);
		$appIds = array();
		if ($applications && is_array($applications)) {
			foreach($applications as $application) {
				$this->refreshApplication($application['appId'], $application['appName'], null, null, null, $flag, null);
				$appIds[] = $application['appId'];
			}
		}

		if ($flag == -1) {
			$sql = sprintf('DELETE FROM %s WHERE appid IN (%s)', $GLOBALS['tablepre'].'myfeed', implodeids($appIds));
			$GLOBALS['db']->query($sql);

			$sql = sprintf('DELETE FROM %s WHERE appid IN (%s)', $GLOBALS['tablepre'].'userapp', implodeids($appIds));
			$GLOBALS['db']->query($sql);

			$sql = sprintf('DELETE FROM %s WHERE appid IN (%s)', $GLOBALS['tablepre'].'myinvite', implodeids($appIds));
			$GLOBALS['db']->query($sql);
		}

		$result = true;
		return new APIResponse($result);
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:24,代码来源:Application.php

示例8: index

 public function index()
 {
     global $G, $lang;
     if ($this->checkFormSubmit()) {
         $tags = $_GET['tags'];
         $tagids = implodeids($_GET['tagid']);
         $delete = intval($_GET['delete']);
         $newtag = $_GET['newtag'];
         if (!empty($tags) && is_array($tags)) {
             foreach ($tags as $key => $value) {
                 M('member_tag')->where(array('tagid' => $key))->update(array('tag' => $value));
             }
         }
         if ($delete) {
             if (!empty($tagids)) {
                 M('member_tag')->where("tagid IN({$tagids})")->delete();
             }
         }
         if (!empty($newtag)) {
             foreach ($newtag as $key => $tag) {
                 if ($tag) {
                     $this->t('member_tag')->insert(array('tag' => $tag));
                 }
             }
         }
         $this->showSuccess('update_succeed');
     } else {
         $tags = array();
         $pagesize = 30;
         $totalnum = M('member_tag')->count();
         $pagecount = $totalnum < $pagesize ? 1 : ceil($totalnum / $pagesize);
         $taglist = M('member_tag')->page($G['page'], $pagesize)->select();
         $pages = $this->showPages($G['page'], $pagecount, $totalnum);
         include template('usertag');
     }
 }
开发者ID:xy113,项目名称:XiangBaLaoServer,代码行数:36,代码来源:class.UsertagController.php

示例9: COUNT

if(empty($filter) && empty($sortid)) {
	$threadcount = $forum['threads'];
} else {
	$threadcount = $sdb->result_first("SELECT COUNT(*) FROM {$tablepre}threads WHERE fid='$fid' $filteradd AND displayorder>='0'");
}
$thisgid = $forum['type'] == 'forum' ? $forum['fup'] : $_DCACHE['forums'][$forum['fup']]['fup'];
if($globalstick && $forum['allowglobalstick']) {
	$stickytids = $_DCACHE['globalstick']['global']['tids'].(empty($_DCACHE['globalstick']['categories'][$thisgid]['count']) ? '' : ','.$_DCACHE['globalstick']['categories'][$thisgid]['tids']);
	$forumstickytids = array();
	$_DCACHE['forumstick'][$fid] = is_array($_DCACHE['forumstick'][$fid]) ? $_DCACHE['forumstick'][$fid] : array();
	$forumstickycount = count($_DCACHE['forumstick'][$fid]);
	foreach($_DCACHE['forumstick'][$fid] as $forumstickthread) {
		$forumstickytids[] = $forumstickthread['tid'];
	}
	if(!empty($forumstickytids)) {
		$forumstickytids = implodeids($forumstickytids);
		$stickytids .= ", $forumstickytids";
	}
	
	$stickytids = trim($stickytids, ', ');
	if ($stickytids === ''){
		$stickytids = '0';
	}

	$stickycount = $_DCACHE['globalstick']['global']['count'] + $_DCACHE['globalstick']['categories'][$thisgid]['count'] + $forumstickycount;
} else {
	$forumstickycount = $stickycount = $stickytids = 0;
}

$filterbool = !empty($filter) && in_array($filter, array('digest', 'recommend', 'type', 'activity', 'poll', 'trade', 'reward', 'debate'));
$threadcount += $filterbool ? 0 : $stickycount;
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:forumdisplay.php

示例10: sendnotice

             sendnotice($nauthorid, 'repquote_noticeauthor', 'threads');
         } elseif ($ac == 'r') {
             sendnotice($nauthorid, 'reppost_noticeauthor', 'threads');
         }
     }
 }
 $uidarray = array();
 $query = $db->query("SELECT uid FROM {$tablepre}favoritethreads WHERE tid='{$tid}'");
 while ($favthread = $db->fetch_array($query)) {
     if ($favthread['uid'] !== $discuz_uid && (!$nauthorid || $nauthorid != $favthread['uid'])) {
         $uidarray[] = $favthread['uid'];
     }
 }
 if ($discuz_uid && !empty($uidarray)) {
     sendnotice(implode(',', $uidarray), 'favoritethreads_notice', 'threads', $tid, array('user' => !$isanonymous ? $discuz_userss : '<i>Anonymous</i>', 'maxusers' => 5));
     $db->query("UPDATE {$tablepre}favoritethreads SET newreplies=newreplies+1, dateline='{$timestamp}' WHERE uid IN (" . implodeids($uidarray) . ") AND tid='{$tid}'", 'UNBUFFERED');
 }
 if ($discuz_uid) {
     $stataction = '';
     if ($attentionon) {
         $stataction = 'attentionon';
         $db->query("REPLACE INTO {$tablepre}favoritethreads (tid, uid, dateline) VALUES ('{$tid}', '{$discuz_uid}', '{$timestamp}')", 'UNBUFFERED');
     }
     if ($attentionoff) {
         $stataction = 'attentionoff';
         $db->query("DELETE FROM {$tablepre}favoritethreads WHERE tid='{$tid}' AND uid='{$discuz_uid}'", 'UNBUFFERED');
     }
     if ($stataction) {
         write_statlog('', 'item=attention&action=newreply_' . $stataction, '', '', 'my.php');
     }
 }
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:newreply.inc.php

示例11: array

        $resultarray = array('redirect' => "forumdisplay.php?fid={$fid}", 'reasonpm' => $sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_copy') : array(), 'modtids' => $thread['tid'], 'modlog' => array($thread, $other));
    }
} elseif ($action == 'removereward') {
    $modaction = 'RMR';
    if (!is_array($thread) || $thread['special'] != '3' || $thread['price'] >= 0) {
        showmessage('reward_end');
    }
    $answererid = $db->result_first("SELECT answererid FROM {$tablepre}rewardlog WHERE tid='{$thread['tid']}'");
    $thread[price] = abs($thread[price]);
    $db->query("UPDATE {$tablepre}members SET extcredits{$creditstrans}=extcredits{$creditstrans}+{$thread['price']} WHERE uid='{$thread['authorid']}'", 'UNBUFFERED');
    $db->query("UPDATE {$tablepre}members SET extcredits{$creditstrans}=extcredits{$creditstrans}-{$thread['price']} WHERE uid='{$answererid}'", 'UNBUFFERED');
    $db->query("UPDATE {$tablepre}threads SET special='0', price='0' WHERE tid='{$thread['tid']}'", 'UNBUFFERED');
    $db->query("DELETE FROM {$tablepre}rewardlog WHERE tid='{$thread['tid']}'", 'UNBUFFERED');
    showmessage('admin_succeed', "viewthread.php?tid={$tid}");
} elseif ($action == 'banpost') {
    if (!($banpids = implodeids($topiclist))) {
        showmessage('admin_banpost_invalid');
    } elseif (!$allowbanpost || !$tid) {
        showmessage('admin_nopermission', NULL, 'HALTED');
    }
    $posts = array();
    $query = $db->query("SELECT first, authorid FROM {$tablepre}posts WHERE pid IN ({$banpids}) AND tid='{$tid}'");
    while ($post = $db->fetch_array($query)) {
        if ($post['first'] && $thread['digest'] == '-1') {
            showmessage('special_noaction');
        }
        $posts[] = $post;
    }
    if (!submitcheck('banpostsubmit')) {
        $banid = '';
        foreach ($topiclist as $id) {
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:topicadmin.php

示例12: IN

 if ($threadtypesnew && $typeids) {
     $query = DB::query("SELECT * FROM " . DB::table('forum_threadclass') . " WHERE typeid IN ({$typeids}) ORDER BY displayorder");
     while ($type = DB::fetch($query)) {
         if ($threadtypesnew['options']['enable'][$type['typeid']]) {
             $threadtypesnew['types'][$type['typeid']] = $threadtypesnew['options']['name'][$type['typeid']];
         }
         $threadtypesnew['icons'][$type['typeid']] = trim($threadtypesnew['options']['icon'][$type['typeid']]);
     }
     $threadtypesnew = $threadtypesnew['types'] ? addslashes(serialize(array('required' => (bool) $threadtypesnew['required'], 'listable' => (bool) $threadtypesnew['listable'], 'prefix' => $threadtypesnew['prefix'], 'types' => $threadtypesnew['types'], 'icons' => $threadtypesnew['icons']))) : '';
 }
 $forumfielddata['threadtypes'] = $threadtypesnew;
 $threadsortsnew = $_G['gp_threadsortsnew'];
 if ($threadsortsnew['status']) {
     if (is_array($threadsortsnew['options']) && $threadsortsnew['options']) {
         if (!empty($threadsortsnew['options']['enable'])) {
             $sortids = implodeids(array_keys($threadsortsnew['options']['enable']));
         } else {
             $sortids = '0';
         }
         $query = DB::query("SELECT * FROM " . DB::table('forum_threadtype') . " WHERE typeid IN ({$sortids}) AND special='1' ORDER BY displayorder");
         while ($sort = DB::fetch($query)) {
             if ($threadsortsnew['options']['enable'][$sort['typeid']]) {
                 $threadsortsnew['types'][$sort['typeid']] = $sort['name'];
             }
             $threadsortsnew['expiration'][$sort['typeid']] = $sort['expiration'];
             $threadsortsnew['show'][$sort['typeid']] = $threadsortsnew['options']['show'][$sort['typeid']] ? 1 : 0;
         }
     }
     if ($threadsortsnew['default'] && !$threadsortsnew['defaultshow']) {
         cpmsg('forums_edit_threadsort_nonexistence', '', 'error');
     }
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:admincp_forums.php

示例13: elseif

			foreach($directorynew as $id => $directory) {
				if(!$delete || ($delete && !in_array($id, $delete))) {
					if(!istpldir($directory)) {
						cpmsg('templates_directory_invalid');
					} elseif($id == 1 && $directory != './templates/default') {
						cpmsg('templates_default_directory_invalid');
					}
					$db->query("UPDATE {$tablepre}templates SET name='$namenew[$id]', directory='$directorynew[$id]' WHERE templateid='$id'", 'UNBUFFERED');
				}
			}

			if(is_array($delete)) {
				if(in_array('1', $delete)) {
					cpmsg('templates_delete_invalid');
				}
				$ids = implodeids($delete);
				$db->query("DELETE FROM {$tablepre}templates WHERE templateid IN ($ids) AND templateid<>'1'", 'UNBUFFERED');
				$db->query("UPDATE {$tablepre}styles SET templateid='1' WHERE templateid IN ($ids)", 'UNBUFFERED');
			}

			updatecache('styles');
			cpmsg('templates_update_succeed', 'admincp.php?action=templates');

		}

	} else {

		$template = $db->fetch_first("SELECT * FROM {$tablepre}templates WHERE templateid='$edit'");
		if(!$template) {
			cpmsg('undefined_action');
		} elseif(!istpldir($template['directory'])) {
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:templates.inc.php

示例14: IN

		while($option = $db->fetch_array($query)) {
			$classoptions .= "<option value=\"$option[optionid]\">$option[title]</option>";
		}

		$model = $db->fetch_first("SELECT * FROM {$tablepre}typemodels WHERE id='".intval($modelid)."'");
		if(!$model) {
			cpmsg('undefined_action');
		}

		$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE optionid IN (".implodeids(explode("\t", $model['customoptions'])).")");
		while($modelopt = $db->fetch_array($query)){
			$modeloption .=  "<option value=\"$modelopt[optionid]\">$modelopt[title]</option>";
		}

		if($model['type']) {
			$query = $db->query("SELECT * FROM {$tablepre}typeoptions WHERE optionid IN (".implodeids(explode("\t", $model['options'])).")");
			while($modelopt = $db->fetch_array($query)){
				$sysoption .=  "<option value=\"$modelopt[optionid]\">$modelopt[title]</option>";
			}

			$sysoptselect = '<select name="" size="8" multiple="multiple" style="width: 50%">'.$sysoption.'</select>';
		}

		$optselect = '<select name="" size="8" multiple="multiple" style="width: 50%" id="coptselect">'.$classoptions.'</select>';
		$hoptselect = '<select name="customoptions[]" size="8" multiple="multiple" style="width: 50%" id="moptselect">'.$modeloption.'</select>';

?>
<script type="text/javascript">
function copyoption(s1, s2) {
	var s1 = $(s1);
	var s2 = $(s2);
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:threadtypes.inc.php

示例15: array

		$del = array();
		$query = $db->query("SELECT pid, authorid, status, dateline, tid, anonymous FROM {$tablepre}posts WHERE pid IN($plist) AND invisible='0' AND authorid<>'0'");
		while($post = $db->fetch_array($query)){
			if(!$post || $post['tid'] != $tid || !$post['authorid']) {
				showmessage('undefined_action', NULL, 'HALTED');
			} elseif(!$forum['ismoderator'] && $karmaratelimit && $timestamp - $post['dateline'] > $karmaratelimit * 3600) {
				showmessage('thread_rate_timelimit', NULL, 'HALTED');
			} elseif($post['authorid'] == $discuz_uid || $post['anonymous'] || $post['status'] & 1) {
				$del[] = $post['pid'];
			}
			$p[] = $post;
		}

		$alist = array_diff($awardplist, $del);
		$plist = implodeids($alist);
		$ratetimes = ceil($credit / 5);
		$db->query("UPDATE {$tablepre}posts SET rate=rate+($credit), ratetimes=ratetimes+$ratetimes WHERE pid IN($plist)");
		foreach($alist as $id => $aquery) {
			$db->query("INSERT INTO {$tablepre}ratelog (pid, uid, username, extcredits, dateline, score, reason)
				VALUES ('$aquery', '$discuz_uid', '$discuz_user', '$credittype', '$timestamp', '$credit', '$rate_msg')", 'UNBUFFERED');
		}
	}

	if($sendmsg){
		$thread = $db->fetch_first("SELECT tid, subject FROM {$tablepre}posts WHERE tid='$tid' AND first='1'");
		$awardmsg = "$credit ".$extcredits[$credittype]['title'];
		eval("\$message = addslashes(\"".$scriptlang['dps_postawards']['pm_message']."\");");
		foreach(array_unique($awardulist) as $user){
			sendnotice($user, $message, 'systempm', 0, array(), 0);
		}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:postawards.inc.php


注:本文中的implodeids函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。