本文整理汇总了PHP中getpostinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getpostinfo函数的具体用法?PHP getpostinfo怎么用?PHP getpostinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getpostinfo函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buy
function buy()
{
global $_G;
if (!empty($_G['gp_id'])) {
$thread = getpostinfo($_G['gp_id'], 'tid', array('fid', 'authorid'));
$this->_check($thread);
}
}
示例2: buy
function buy()
{
global $_G;
if (!empty($_GET['id'])) {
$thread = getpostinfo($_GET['id'], 'tid', array('fid'));
$this->_check($thread['fid']);
}
}
示例3: buy
function buy()
{
global $_G;
if (!empty($_G['gp_id'])) {
list($_G['gp_id'], $_G['tid']) = explode(':', $_G['gp_id']);
$post = getpostinfo($_G['gp_id'], 'pid', array('p.fid', 'p.authorid'));
$this->_check($post);
}
}
示例4: buy
function buy()
{
global $_G;
if (!empty($_GET['id'])) {
$thread = getpostinfo($_GET['id'], 'tid', array('fid'));
$this->_check($thread['fid']);
}
$this->parameters['expiration'] = $this->parameters['expiration'] ? intval($this->parameters['expiration']) : 1;
magicshowtips(lang('magic/jack', 'jack_info', array('expiration' => $this->parameters['expiration'])));
}
示例5: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magic_move.inc.php 16688 2008-11-14 06:41:07Z cnteacher $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($tid) && empty($moveto)) {
showmessage('magics_info_nonexistence');
}
$thread = getpostinfo($tid, 'tid', array('fid', 'tid', 'authorid', 'special'));
checkmagicperm($magicperm['forum'], $thread['fid']);
if ($thread['authorid'] != $discuz_uid) {
showmessage('magics_operation_nopermission');
}
if ($thread['special']) {
$query = $db->query("SELECT allowpostspecial FROM {$tablepre}forums WHERE fid='{$moveto}'");
if (!substr(sprintf('%04b', $forum['allowpostspecial']), -$thread['special'], 1)) {
showmessage('admin_move_nopermission');
}
}
$query = $db->query("SELECT postperm FROM {$tablepre}forumfields WHERE fid='{$moveto}'");
if ($forum = $db->fetch_array($query)) {
if (!$forum['postperm'] && !$allowpost) {
showmessage('group_nopermission');
} elseif ($forum['postperm'] && !forumperm($forum['postperm'])) {
示例6: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magic_up.inc.php 19412 2009-08-29 01:48:51Z monkey $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($tid)) {
showmessage('magics_info_nonexistence');
}
$thread = getpostinfo($tid, 'tid', array('fid'));
checkmagicperm($magicperm['forum'], $thread['fid']);
$db->query("UPDATE {$tablepre}threads SET lastpost='{$timestamp}', moderated='1' WHERE tid='{$tid}'");
usemagic($magicid, $magic['num']);
updatemagiclog($magicid, '2', '1', '0', $tid);
updatemagicthreadlog($tid, $magicid, $magic['identifier']);
if ($thread['authorid'] != $discuz_uid) {
sendnotice($thread['authorid'], 'magic_thread', 'systempm');
}
showmessage('magics_operation_succeed', '', 1);
}
function showmagic()
{
global $tid, $lang;
magicshowtype($lang['option'], 'top');
magicshowsetting($lang['target_tid'], 'tid', $tid, 'text');
示例7: buy
function buy()
{
global $_G;
$id = !empty($_GET['id']) ? dhtmlspecialchars($_GET['id']) : '';
$idtype = !empty($_GET['idtype']) ? dhtmlspecialchars($_GET['idtype']) : '';
if (!empty($id) && $_GET['idtype'] == 'pid') {
list($id, $_G['tid']) = explode(':', $id);
$post = getpostinfo(intval($id), 'pid', array('p.fid', 'p.authorid'));
$this->_check($post);
}
}
示例8: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magic_del.inc.php 19960 2009-09-15 23:18:37Z wangjinbo $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($pid)) {
showmessage('magics_info_nonexistence');
}
$post = getpostinfo($pid, 'pid', array('t.tid', 't.fid', 't.authorid', 'first'));
checkmagicperm($magicperm['forum'], $post['fid']);
if ($post['authorid'] != $discuz_uid) {
showmessage('magics_operation_nopermission');
}
require_once DISCUZ_ROOT . './include/post.func.php';
if ($post['first']) {
foreach (array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'attachments', 'favorites', 'debates', 'debateposts', 'typeoptionvars', 'forumrecommend') as $value) {
$db->query("DELETE FROM {$tablepre}{$value} WHERE tid='{$post['tid']}'", 'UNBUFFERED');
}
$query = $db->query("SELECT uid, attachment, dateline, thumb, remote FROM {$tablepre}attachments WHERE tid='{$post['tid']}'");
while ($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
updateforumcount($post['fid']);
} else {
示例9: exit
$Id: magic_hidden.inc.php 9806 2007-08-15 06:04:37Z cnteacher $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($pid)) {
showmessage('magics_info_nonexistence');
}
$post = getpostinfo($pid, 'pid', array('p.tid', 'p.fid', 'p.author', 'p.authorid', 'first', 'p.dateline', 'anonymous'));
checkmagicperm($magicperm['forum'], $post['fid']);
if ($post['authorid'] != $discuz_uid) {
showmessage('magics_operation_nopermission');
}
$thread = getpostinfo($post['tid'], 'tid', array('tid', 'subject', 'author', 'replies', 'lastposter'));
if ($post['first']) {
$author = '';
$lastposter = $thread['replies'] > 0 ? $thread['lastposter'] : '';
$db->query("UPDATE {$tablepre}posts SET anonymous='1' WHERE tid='{$post['tid']}' AND first='1'");
updatemagicthreadlog($post['tid'], $magicid, $magic['identifier'], '0', '1');
} else {
$author = $thread['author'];
$lastposter = '';
$db->query("UPDATE {$tablepre}posts SET anonymous='1' WHERE pid='{$pid}'");
}
$query = $db->query("SELECT lastpost FROM {$tablepre}forums WHERE fid='{$post['fid']}'");
$forum['lastpost'] = explode("\t", $db->result($query, 0));
if ($post['dateline'] == $forum['lastpost'][2] && ($post['author'] == $forum['lastpost'][3] || $forum['lastpost'][3] == '' && $post['anonymous'])) {
$lastpost = "{$thread['tid']}\t{$thread['subject']}\t{$timestamp}\t{$lastposter}";
$db->query("UPDATE {$tablepre}forums SET lastpost='{$lastpost}' WHERE fid='{$post['fid']}'", 'UNBUFFERED');
示例10: buy
function buy()
{
global $_G;
$idtype = !empty($_GET['idtype']) ? $_GET['idtype'] : '';
if (!empty($_GET['id'])) {
$info = getpostinfo($_GET['id'], $idtype);
if ($idtype == 'tid') {
$this->_check($info['fid']);
}
}
}
示例11: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magic_top.inc.php 19412 2009-08-29 01:48:51Z monkey $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($tid)) {
showmessage('magics_info_nonexistence');
}
$post = getpostinfo($tid, 'tid', array('fid'));
checkmagicperm($magicperm['forum'], $post['fid']);
magicthreadmod($tid);
$db->query("UPDATE {$tablepre}threads SET displayorder='1', moderated='1' WHERE tid='{$tid}'");
$expiration = $timestamp + 86400;
usemagic($magicid, $magic['num']);
updatemagiclog($magicid, '2', '1', '0', $tid);
updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration);
if ($thread['authorid'] != $discuz_uid) {
sendnotice($thread['authorid'], 'magic_thread', 'systempm');
}
showmessage('magics_operation_succeed', '', 1);
}
function showmagic()
{
global $tid, $lang;
示例12: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magic_top.inc.php 19071 2009-08-12 03:22:17Z tiger $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($tid)) {
showmessage('magics_info_nonexistence');
}
$post = getpostinfo($tid, 'tid', array('fid', 'dateline'));
checkmagicperm($magicperm['forum'], $post['fid']);
$firstsofa = $db->result_first("SELECT COUNT(*) FROM {$tablepre}threadsmod WHERE magicid='{$magicid}' AND tid='{$tid}'");
if ($firstsofa >= 1) {
showmessage('magics_SOFA_message', '', 1);
}
$sofamessage = $lang['SOFA_message'];
$dateline = $post['dateline'] + 1;
$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, dateline, message, useip, usesig)\r\n\t\t\tVALUES ('{$post['fid']}', '{$tid}', '0', '{$discuz_user}', '{$discuz_uid}', '{$dateline}', '{$sofamessage}', '{$onlineip}', '1')");
$db->query("UPDATE {$tablepre}threads SET replies=replies+1, moderated='1' WHERE tid='{$tid}'", 'UNBUFFERED');
$db->query("UPDATE {$tablepre}forums SET posts=posts+1, todayposts=todayposts+1 WHERE fid='{$post['fid']}'", 'UNBUFFERED');
usemagic($magicid, $magic['num']);
updatemagiclog($magicid, '2', '1', '0', $tid);
updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration);
if ($thread['authorid'] != $discuz_uid) {
sendpm($thread['authorid'], 'magics_use_subject', 'magic_thread', 0);
示例13: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magic_see.inc.php 19412 2009-08-29 01:48:51Z monkey $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($pid)) {
showmessage('magics_info_nonexistence');
}
$post = getpostinfo($pid, 'pid', array('p.fid', 'useip'));
checkmagicperm($magicperm['forum'], $post['fid']);
usemagic($magicid, $magic['num']);
updatemagiclog($magicid, '2', '1', '0', '0', $pid);
if ($thread['authorid'] != $discuz_uid) {
sendnotice($thread['authorid'], 'magic_user_anonymous', 'systempm');
}
showmessage('magics_SEK_message', '', 1);
}
function showmagic()
{
global $pid, $lang;
magicshowtype($lang['option'], 'top');
magicshowsetting($lang['target_pid'], 'pid', $pid, 'text');
magicshowtype('', 'bottom');
}
示例14: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: magic_color.inc.php 19908 2009-09-14 13:14:41Z liuqiang $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (submitcheck('usesubmit')) {
if (empty($highlight_color)) {
showmessage('magics_info_nonexistence');
}
$thread = getpostinfo($tid, 'tid', array('fid', 'authorid', 'subject'));
checkmagicperm($magicperm['forum'], $thread['fid']);
magicthreadmod($tid);
$db->query("UPDATE {$tablepre}threads SET highlight='{$highlight_color}', moderated='1' WHERE tid='{$tid}'", 'UNBUFFERED');
$expiration = $timestamp + 86400;
usemagic($magicid, $magic['num']);
updatemagiclog($magicid, '2', '1', '0', $tid);
updatemagicthreadlog($tid, $magicid, $magic['identifier'], $expiration);
if ($thread['authorid'] != $discuz_uid) {
sendnotice($thread['authorid'], 'magic_thread', 'systempm');
}
showmessage('magics_operation_succeed', '', 1);
}
function showmagic()
{
global $tid, $lang;