• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP implodeids函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: array

		}

		$resultarray = array(
		'redirect'	=> "viewthread.php?tid=$tid&page=$page",
		'reasonpm'	=> ($sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post') : array()),
		'modtids'	=> 0,
		'modlog'	=> $thread
		);

		procreportlog('', $pids);

	}

} elseif($action == 'warn' && $allowwarnpost) {

	if(!($warnpids = implodeids($topiclist))) {
		showmessage('admin_warn_invalid');
	} elseif(!$allowbanpost || !$tid) {
		showmessage('admin_nopermission', NULL, 'HALTED');
	}

	$posts = $authors = array();
	$authorwarnings = $warningauthor = $warnstatus = '';
	$query = $db->query("SELECT p.pid, p.authorid, p.author, p.status, p.dateline, p.message, m.adminid FROM {$tablepre}posts p LEFT JOIN {$tablepre}members m ON p.authorid=m.uid WHERE pid IN ($warnpids) AND p.tid='$tid'");
	while($post = $db->fetch_array($query)) {
		if($post['adminid'] == 0 || $post['adminid'] == -1) {
			$warnstatus = ($post['status'] & 2) || $warnstatus;
			$authors[$post['authorid']] = 1;
			$posts[] = $post;
		}
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:topicadmin.php


示例17: IN

</td></tr>
<?php 
        echo $advs;
        ?>
</table>
<?php 
        echo $multipage;
        ?>
<br /><center><input class="button" type="submit" name="advsubmit" value="<?php 
        echo $lang['submit'];
        ?>
"></center>
</form>
<?php 
    } else {
        if ($advids = implodeids($delete)) {
            $db->query("DELETE FROM {$tablepre}advertisements WHERE advid IN ({$advids})");
        }
        if (is_array($titlenew)) {
            foreach ($titlenew as $advid => $title) {
                $db->query("UPDATE {$tablepre}advertisements SET available='{$availablenew[$advid]}', displayorder='{$displayordernew[$advid]}', title='" . cutstr($titlenew[$advid], 50) . "' WHERE advid='{$advid}'", 'UNBUFFERED');
            }
        }
        updatecache(array('settings', 'advs_archiver', 'advs_register', 'advs_index', 'advs_forumdisplay', 'advs_viewthread'));
        cpmsg('advertisements_update_succeed', 'admincp.php?action=adv');
    }
} elseif ($action == 'advadd' && in_array($type, array('headerbanner', 'footerbanner', 'text', 'thread', 'interthread', 'float', 'couplebanner', 'intercat')) || $action == 'advedit' && $advid) {
    if (!submitcheck('advsubmit')) {
        require_once DISCUZ_ROOT . './include/forum.func.php';
        shownav('menu_misc_advertisements');
        if ($action == 'advedit') {
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:advertisements.inc.php


示例18: deletethreads

function deletethreads($tids = array())
{
    global $db, $tablepre, $losslessdel, $creditspolicy;
    static $cleartable = array('threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'debates', 'videos', 'debateposts', 'attachments', 'favorites', 'mythreads', 'myposts', 'subscriptions', 'typeoptionvars', 'forumrecommend');
    $threadsdel = 0;
    if ($tids = implodeids($tids)) {
        $auidarray = array();
        $query = $db->query("SELECT uid, attachment, dateline, thumb, remote FROM {$tablepre}attachments WHERE tid IN ({$tids})");
        while ($attach = $db->fetch_array($query)) {
            dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
            if ($attach['dateline'] > $losslessdel) {
                $auidarray[$attach['uid']] = !empty($auidarray[$attach['uid']]) ? $auidarray[$attach['uid']] + 1 : 1;
            }
        }
        if ($auidarray) {
            updateattachcredits('-', $auidarray, $creditspolicy['postattach']);
        }
        $videoopen && videodelete($moderate, TRUE);
        foreach ($cleartable as $tb) {
            $db->query("DELETE FROM {$tablepre}{$tb} WHERE tid IN ({$tids})", 'UNBUFFERED');
        }
        $db->query("DELETE FROM {$tablepre}threads WHERE tid IN ({$tids})");
        $threadsdel = $db->affected_rows();
    }
    return $threadsdel;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:26,代码来源:cpanel.share.php


示例19: showmessage

    $tag = $db->fetch_first("SELECT * FROM {$tablepre}tags WHERE tagname='{$name}'");
    if ($tag['closed']) {
        showmessage('tag_closed');
    }
    $count = $db->result_first("SELECT count(*) FROM {$tablepre}threadtags WHERE tagname='{$name}'");
    $query = $db->query("SELECT t.*,tt.tid as tagtid FROM {$tablepre}threadtags tt LEFT JOIN {$tablepre}threads t ON t.tid=tt.tid AND t.displayorder>='0' WHERE tt.tagname='{$name}' ORDER BY lastpost DESC LIMIT {$start_limit}, {$tpp}");
    $cleantid = $threadlist = array();
    while ($tagthread = $db->fetch_array($query)) {
        if ($tagthread['tid']) {
            $threadlist[] = procthread($tagthread);
        } else {
            $cleantid[] = $tagthread['tagtid'];
        }
    }
    if ($cleantid) {
        $db->query("DELETE FROM {$tablepre}threadtags WHERE tagname='{$name}' AND tid IN (" . implodeids($cleantid) . ")", 'UNBUFFERED');
        $cleancount = count($cleantid);
        if ($count > $cleancount) {
            $db->query("UPDATE {$tablepre}tags SET total=total-'{$cleancount}' WHERE tagname='{$name}'", 'UNBUFFERED');
        } else {
            $db->query("DELETE FROM {$tablepre}tags WHERE tagname='{$name}'", 'UNBUFFERED');
        }
    }
    $tagnameenc = rawurlencode($name);
    $navtitle = $name . ' - ';
    $multipage = multi($count, $tpp, $page, "tag.php?name={$tagnameenc}");
    include template('tag_threads');
} else {
    $viewthreadtags = intval($viewthreadtags);
    $query = $db->query("SELECT tagname,total FROM {$tablepre}tags WHERE closed=0 ORDER BY total DESC LIMIT {$viewthreadtags}");
    $hottaglist = array();
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:tag.php


示例20: foreach

        $filters .= '<select onchange="window.location=\'' . $BASESCRIPT . '?action=logs&operation=invite&status=\'+this.options[this.selectedIndex].value"><option value="">' . $lang['action'] . '</option><option value="">' . $lang['all'] . '</option>';
        foreach (array(1, 2, 3, 4) as $s) {
            $filters .= '<option value="' . $s . '" ' . (!empty($status) && $s == $status ? 'selected="selected"' : '') . '>' . lang('logs_invite_status_' . $s) . '</option>';
        }
        $filters .= '</select>';
        $query = $db->query("SELECT i.*, m.username FROM {$tablepre}invites i, {$tablepre}members m\r\n\t\t\t\tWHERE i.uid=m.uid {$addstatus}\r\n\t\t\t\tORDER BY i.dateline LIMIT {$start_limit},{$tpp}");
        while ($invite = $db->fetch_array($query)) {
            $invite['statuslog'] = $lang['logs_invite_status_' . $invite['status']];
            $username = "<a href=\"space.php?uid={$invite['uid']}\">{$invite['username']}</a>";
            $invite['dateline'] = gmdate('Y-n-j H:i', $invite['dateline'] + $timeoffset * 3600);
            $invite['expiration'] = gmdate('Y-n-j H:i', $invite['expiration'] + $timeoffset * 3600);
            $stats = $invite['statuslog'] . ($invite['status'] == 2 ? '&nbsp;[<a href="space.php?uid=' . $invite['reguid'] . '">' . $lang['logs_invite_target'] . '</a>]' : '');
            showtablerow('', array('', 'class="bold"'), array('<input type="checkbox" class="checkbox" name="delete[]" value="' . $invite[invitecode] . '" />', $username, $invite['dateline'], $invite['expiration'], $invite['inviteip'], $invite['invitecode'], $stats));
        }
    } else {
        if ($deletelist = implodeids($delete)) {
            $db->query("DELETE FROM {$tablepre}invites WHERE invitecode IN ({$deletelist})");
        }
        header("Location: {$boardurl}{$BASESCRIPT}?action=logs&operation=invite");
    }
} elseif ($operation == 'magic') {
    require_once DISCUZ_ROOT . './forumdata/cache/cache_magics.php';
    $lpp = empty($lpp) ? 50 : $lpp;
    $page = max(1, intval($page));
    $start_limit = ($page - 1) * $lpp;
    $mpurl = "{$BASESCRIPT}?action=logs&operation=magic&lpp={$lpp}";
    if (in_array($opt, array('1', '2', '3', '4', '5'))) {
        $optadd = "AND ma.action='{$opt}'";
        $mpurl .= '&opt=' . $opt;
    } else {
        $optadd = '';
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:logs.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP implota函数代码示例发布时间:2022-05-15
下一篇:
PHP implodearray函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap