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

PHP postfeed函数代码示例

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

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



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

示例1: feed

 public function feed()
 {
     if ($this->forum('allowfeed') && !$this->param['isanonymous']) {
         if (empty($this->feed)) {
             $this->feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
             $message = !$this->param['price'] && !$this->param['readperm'] ? $this->param['message'] : '';
             $message = messagesafeclear($message);
             $this->feed['icon'] = 'thread';
             $this->feed['title_template'] = 'feed_thread_title';
             $this->feed['body_template'] = 'feed_thread_message';
             $this->feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$this->tid}\">{$this->param['subject']}</a>", 'message' => messagecutstr($message, 150));
             if (getglobal('forum_attachexist')) {
                 //					$firstaid = DB::result_first("SELECT aid FROM ".DB::table(getattachtablebytid($tid))." WHERE pid='$pid' AND dateline>'0' AND isimage='1' ORDER BY dateline LIMIT 1");
                 $imgattach = C::t('forum_attachment_n')->fetch_max_image('tid:' . $this->tid, 'pid', $this->pid);
                 $firstaid = $imgattach['aid'];
                 unset($imgattach);
                 if ($firstaid) {
                     $this->feed['images'] = array(getforumimg($firstaid));
                     $this->feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$this->tid}&pid={$this->pid}");
                 }
             }
         }
         $this->feed['title_data']['hash_data'] = 'tid' . $this->tid;
         $this->feed['id'] = $this->tid;
         $this->feed['idtype'] = 'tid';
         if ($this->feed['icon']) {
             postfeed($this->feed);
         }
     }
 }
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:30,代码来源:model_forum_thread.php


示例2: modelpost


//.........这里部分代码省略.........
    //内容
    $setsqlarr = $uploadfilearr = $ids = array();
    $setsqlarr = getsetsqlarr($resultmessage);
    $uploadfilearr = $feedcolum = uploadfile($resultmessage, $_POST['mid'], $itemid, 0);
    $setsqlarr['message'] = trim($_POST['message']);
    $setsqlarr['postip'] = $_SGLOBAL['onlineip'];
    if (!empty($uploadfilearr)) {
        foreach ($uploadfilearr as $tmpkey => $tmpvalue) {
            if (empty($tmpvalue['error'])) {
                $setsqlarr[$tmpkey] = $tmpvalue['filepath'];
            }
            if (!empty($tmpvalue['aid'])) {
                $ids[] = $tmpvalue['aid'];
            }
        }
    }
    //添加内容
    if (!empty($modelsinfoarr['allowfilter'])) {
        $setsqlarr = scensor($setsqlarr, 1);
    }
    if (!checkperm('allowdirectpost') || checkperm('managemodpost') || checkperm('allowdirectpost') && $op == 'update') {
        //不需要审核时入message表
        if ($op == 'add') {
            $setsqlarr['itemid'] = $itemid;
            //添加内容
            inserttable($modelsinfoarr['modelname'] . 'message', $setsqlarr);
            getreward('postinfo');
            if (allowfeed() && !empty($_POST['addfeed']) && !empty($_SGLOBAL['supe_uid'])) {
                $feed['icon'] = 'comment';
                $feed['title_template'] = 'feed_model_title';
                $murl = geturl('action/model/name/' . $modelsinfoarr['modelname'] . '/itemid/' . $itemid);
                $aurl = A_URL;
                if (empty($_SCONFIG['siteurl'])) {
                    $siteurl = getsiteurl();
                    $murl = $siteurl . $murl;
                    $aurl = $siteurl . $aurl;
                } else {
                    $siteurl = S_URL_ALL;
                }
                $feed['title_data'] = array('modelname' => '<a href="' . $siteurl . '/m.php?name=' . $modelsinfoarr['modelname'] . '">' . $modelsinfoarr['modelalias'] . '</a>');
                $feed['body_template'] = 'feed_model_message';
                $feed['body_data'] = array('subject' => '<a href="' . $murl . '">' . $_POST['subject'] . '</a>', 'message' => cutstr(strip_tags(preg_replace("/\\[.+?\\]/is", '', $_POST['message'])), 150));
                if (!empty($feedsubjectimg)) {
                    $feed['images'][] = array('url' => $aurl . '/' . $feedsubjectimg['subjectimage']['filepath'], 'link' => $murl);
                } else {
                    foreach ($feedcolum as $feedimgvalue) {
                        if ($feedimgvalue['filepath']) {
                            $feed['images'][] = array('url' => $aurl . '/' . $feedimgvalue['filepath'], 'link' => $murl);
                            break;
                        }
                    }
                    if (empty($feed['images'])) {
                        $picurl = getmessagepic(stripslashes($_POST['message']));
                        if ($picurl && strpos($picurl, '://') === false) {
                            $picurl = $siteurl . '/' . $picurl;
                        }
                        if (!empty($picurl)) {
                            $feed['images'][] = array('url' => $picurl, 'link' => $murl);
                        }
                    }
                }
                postfeed($feed);
            }
        } else {
            //更新内容
            updatetable($modelsinfoarr['modelname'] . 'message', $setsqlarr, array('nid' => $_POST['nid'], 'itemid' => $itemid));
        }
        updatetable('attachments', array('isavailable' => '1', 'type' => 'model'), array('hash' => $hash));
        if (checkperm('allowdirectpost') && $op == 'update') {
            deletemodelitems($modelsinfoarr['modelname'], array($itemid), $_POST['mid'], 1, 1);
        }
        if (checkperm('allowdirectpost') && $op == 'update') {
            $jpurl = $cp ? empty($setsqlarr['uid']) ? S_URL . "/admincp.php?action=modelmanages&op=add&mid={$modelsinfoarr['mid']}" : S_URL . '/' . $theurl . '&mid=' . $modelsinfoarr['mid'] : S_URL . "/cp.php?ac=models&op=list&do={$do}&nameid={$modelsinfoarr['modelname']}";
            showmessage('writing_success_online_please_wait_for_audit', $jpurl);
        } else {
            $jpurl = $cp ? S_URL . '/' . $theurl . '&mid=' . $modelsinfoarr['mid'] : S_URL . "/cp.php?ac=models&op=list&do={$do}&nameid={$modelsinfoarr['modelname']}";
            showmessage('online_contributions_success', $jpurl);
        }
    } else {
        $setsqlarr = array_merge($setitemsqlarr, $setsqlarr);
        $setsqlarr['addfeed'] = $_POST['addfeed'];
        $setsqlarr = array('subject' => $setitemsqlarr['subject'], 'mid' => $modelsinfoarr['mid'], 'uid' => $setsqlarr['uid'], 'message' => saddslashes(serialize($setsqlarr)), 'dateline' => $_SGLOBAL['timestamp'], 'folder' => 1);
        if (!empty($_POST['itemid'])) {
            $itemid = intval($_POST['itemid']);
            updatetable('modelfolders', $setsqlarr, array('itemid' => $itemid));
        } else {
            $itemid = inserttable('modelfolders', $setsqlarr, 1);
        }
        if (!empty($subjectimageid)) {
            $ids[] = $subjectimageid;
        }
        if (!empty($ids)) {
            $ids = simplode($ids);
            $hash = 'm' . str_pad($_POST['mid'], 6, 0, STR_PAD_LEFT) . 'f' . str_pad($itemid, 8, 0, STR_PAD_LEFT);
            $_SGLOBAL['db']->query('UPDATE ' . tname('attachments') . ' SET isavailable=\'1\', type=\'model\', hash=\'' . $hash . '\' WHERE aid IN (' . $ids . ')');
        }
        $jpurl = $cp ? empty($setsqlarr['uid']) ? S_URL . "/admincp.php?action=modelmanages&op=add&mid={$modelsinfoarr['mid']}" : S_URL . "/admincp.php?action=modelfolders&mid={$modelsinfoarr['mid']}" : S_URL . "/cp.php?ac=models&op=list&do={$do}&nameid={$modelsinfoarr['modelname']}";
        showmessage('writing_success_online_please_wait_for_audit', $jpurl);
    }
}
开发者ID:superman1982,项目名称:ng-cms,代码行数:101,代码来源:model.func.php


示例3: array

            $data = array('tid' => $_G['tid'], 'username' => $_G['username'], 'uid' => $_G['uid'], 'message' => $message, 'verified' => $verified, 'dateline' => $_G['timestamp'], 'payment' => $payment, 'ufielddata' => $ufielddata);
            C::t('forum_activityapply')->insert($data);
        }
        $applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']);
        C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber));
        if ($thread['authorid'] != $_G['uid']) {
            notification_add($thread['authorid'], 'activity', 'activity_notice', array('tid' => $_G['tid'], 'subject' => $thread['subject']));
            $space = array();
            space_merge($space, 'field_home');
            if (!empty($space['privacy']['feed']['newreply'])) {
                $feed['icon'] = 'activity';
                $feed['title_template'] = 'feed_reply_activity_title';
                $feed['title_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$_G['tid']}\">{$thread['subject']}</a>", 'hash_data' => "tid{$_G[tid]}");
                $feed['id'] = $_G['tid'];
                $feed['idtype'] = 'tid';
                postfeed($feed);
            }
        }
        showmessage('activity_completion', "forum.php?mod=viewthread&tid={$_G['tid']}" . ($_GET['from'] ? '&from=' . $_GET['from'] : ''), array(), array('showdialog' => 1, 'showmsg' => true, 'locationtime' => true, 'alert' => 'right'));
    } elseif (submitcheck('activitycancel')) {
        C::t('forum_activityapply')->delete_for_user($_G['uid'], $_G['tid']);
        $applynumber = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']);
        C::t('forum_activity')->update($_G['tid'], array('applynumber' => $applynumber));
        $message = cutstr(dhtmlspecialchars($_GET['message']), 200);
        if ($thread['authorid'] != $_G['uid']) {
            notification_add($thread['authorid'], 'activity', 'activity_cancel', array('tid' => $_G['tid'], 'subject' => $thread['subject'], 'reason' => $message));
        }
        showmessage('activity_cancel_success', "forum.php?mod=viewthread&tid={$_G['tid']}&do=viewapplylist" . ($_GET['from'] ? '&from=' . $_GET['from'] : ''), array(), array('showdialog' => 1, 'closetime' => true));
    }
} elseif ($_GET['action'] == 'getactivityapplylist') {
    $pp = $_G['setting']['activitypp'];
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:31,代码来源:forum_misc.php


示例4: modelpost


//.........这里部分代码省略.........
                        @unlink(A_DIR . '/' . $defaultmessage[$value['fieldname']]);
                    }
                }
            }
        }
    }
    //内容
    $setsqlarr = $uploadfilearr = $ids = array();
    $setsqlarr = getsetsqlarr($resultmessage);
    $uploadfilearr = $feedcolum = uploadfile($resultmessage, $_POST['mid'], $itemid, 0);
    $setsqlarr['message'] = trim($_POST['message']);
    $setsqlarr['postip'] = $_SGLOBAL['onlineip'];
    if (!empty($uploadfilearr)) {
        foreach ($uploadfilearr as $tmpkey => $tmpvalue) {
            if (empty($tmpvalue['error'])) {
                $setsqlarr[$tmpkey] = $tmpvalue['filepath'];
            }
            if (!empty($tmpvalue['aid'])) {
                $ids[] = $tmpvalue['aid'];
            }
        }
    }
    //添加内容
    if (!empty($modelsinfoarr['allowfilter'])) {
        $setsqlarr = scensor($setsqlarr, 1);
    }
    if (!checkperm('allowdirectpost') || checkperm('managemodpost') || checkperm('allowdirectpost') && $op == 'update') {
        //不需要审核时入message表
        if ($op == 'add') {
            $setsqlarr['itemid'] = $itemid;
            //添加内容
            inserttable($modelsinfoarr['modelname'] . 'message', $setsqlarr);
            if (allowfeed() && !empty($_POST['addfeed']) && !empty($_SGLOBAL['supe_uid'])) {
                $feed['icon'] = 'comment';
                $feed['title_template'] = 'feed_model_title';
                $murl = geturl('action/model/name/' . $modelsinfoarr['modelname'] . '/itemid/' . $itemid);
                $aurl = A_URL;
                if (empty($_SCONFIG['siteurl'])) {
                    $siteurl = getsiteurl();
                    $murl = $siteurl . $murl;
                    $aurl = $siteurl . $aurl;
                } else {
                    $siteurl = S_URL_ALL;
                }
                $feed['title_data'] = array('modelname' => '<a href="' . $siteurl . '/m.php?name=' . $modelsinfoarr['modelname'] . '">' . $modelsinfoarr['modelalias'] . '</a>');
                $feed['body_template'] = 'feed_model_message';
                $feed['body_data'] = array('subject' => '<a href="' . $murl . '">' . $_POST['subject'] . '</a>', 'message' => cutstr(strip_tags(preg_replace("/\\[.+?\\]/is", '', $_POST['message'])), 150));
                if (!empty($feedsubjectimg)) {
                    $feed['images'][] = array('url' => $aurl . '/' . $feedsubjectimg['subjectimage']['filepath'], 'link' => $murl);
                } else {
                    foreach ($feedcolum as $feedimgvalue) {
                        if ($feedimgvalue['filepath']) {
                            $feed['images'][] = array('url' => $aurl . '/' . $feedimgvalue['filepath'], 'link' => $murl);
                            break;
                        }
                    }
                    if (empty($feed['images'])) {
                        $picurl = getmessagepic(stripslashes($_POST['message']));
                        if ($picurl && strpos($picurl, '://') === false) {
                            $picurl = $siteurl . '/' . $picurl;
                        }
                        if (!empty($picurl)) {
                            $feed['images'][] = array('url' => $picurl, 'link' => $murl);
                        }
                    }
                }
                postfeed($feed);
            }
        } else {
            //更新内容
            updatetable($modelsinfoarr['modelname'] . 'message', $setsqlarr, array('nid' => $_POST['nid'], 'itemid' => $itemid));
        }
        updatetable('attachments', array('isavailable' => '1', 'type' => 'model'), array('hash' => $hash));
        if (checkperm('allowdirectpost') && $op == 'update') {
            deletemodelitems($modelsinfoarr['modelname'], array($itemid), $_POST['mid'], 1, 1);
        }
        if (checkperm('allowdirectpost') && $op == 'update') {
            $jpurl = $cp ? empty($setsqlarr['uid']) ? S_URL . "/admincp.php?action=modelmanages&op=add&mid={$modelsinfoarr['mid']}" : S_URL . '/' . $theurl . '&mid=' . $modelsinfoarr['mid'] : S_URL . "/cp.php?ac=models&op=list&do={$do}&nameid={$modelsinfoarr['modelname']}";
            showmessage('writing_success_online_please_wait_for_audit', $jpurl);
        } else {
            $jpurl = $cp ? S_URL . '/' . $theurl . '&mid=' . $modelsinfoarr['mid'] : S_URL . "/cp.php?ac=models&op=list&do={$do}&nameid={$modelsinfoarr['modelname']}";
            showmessage('online_contributions_success', $jpurl);
        }
    } else {
        $setsqlarr = array_merge($setitemsqlarr, $setsqlarr);
        $setsqlarr['addfeed'] = $_POST['addfeed'];
        $setsqlarr = array('subject' => $setitemsqlarr['subject'], 'mid' => $modelsinfoarr['mid'], 'uid' => $setsqlarr['uid'], 'message' => saddslashes(serialize($setsqlarr)), 'dateline' => $_SGLOBAL['timestamp'], 'folder' => 1);
        $itemid = inserttable('modelfolders', $setsqlarr, 1);
        if (!empty($subjectimageid)) {
            $ids[] = $subjectimageid;
        }
        if (!empty($ids)) {
            $ids = simplode($ids);
            $hash = 'm' . str_pad($_POST['mid'], 6, 0, STR_PAD_LEFT) . 'f' . str_pad($itemid, 8, 0, STR_PAD_LEFT);
            $_SGLOBAL['db']->query('UPDATE ' . tname('attachments') . ' SET isavailable=\'1\', type=\'model\', hash=\'' . $hash . '\' WHERE aid IN (' . $ids . ')');
        }
        $jpurl = $cp ? empty($setsqlarr['uid']) ? S_URL . "/admincp.php?action=modelmanages&op=add&mid={$modelsinfoarr['mid']}" : S_URL . "/admincp.php?action=modelfolders&mid={$modelsinfoarr['mid']}" : S_URL . "/cp.php?ac=models&op=list&do={$do}&nameid={$modelsinfoarr['modelname']}";
        showmessage('writing_success_online_please_wait_for_audit', $jpurl);
    }
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:101,代码来源:model.func.php


示例5: _applyActivityTopic

 private function _applyActivityTopic($res, $tid, $uid, $data)
 {
     // from forum_misc.php
     require_once libfile('function/post');
     $activity = DzForumActivity::getActivityByTid($tid);
     if ($activity['expiration'] && $activity['expiration'] < TIMESTAMP) {
         return $this->_makeErrorInfo($res, 'activity_stop');
     }
     $applyinfo = DzForumActivityApply::getApplyByTidUid($tid, $uid);
     if ($applyinfo && $applyinfo['verified'] < DzForumActivityApply::STATUS_VERIFIED_IMPROVE) {
         return $this->_makeErrorInfo($res, 'activity_repeat_apply');
     }
     global $_G;
     $_GET = $data;
     $thread = ForumUtils::getTopicInfo($tid);
     $payvalue = intval($_GET['payvalue']);
     $payment = $_GET['payment'] ? $payvalue : -1;
     $message = cutstr(dhtmlspecialchars($_GET['message']), 200);
     $verified = $thread['authorid'] == $uid ? 1 : 0;
     $ufielddata = '';
     if ($activity['ufield']) {
         $ufielddata = array();
         $version = MobcentDiscuz::getMobcentDiscuzVersion();
         $activity['ufield'] = $version != MobcentDiscuz::VERSION_X20 ? dunserialize($activity['ufield']) : unserialize($activity['ufield']);
         if (!empty($activity['ufield']['userfield'])) {
             if ($version == MobcentDiscuz::VERSION_X20) {
                 if (!class_exists('discuz_censor')) {
                     include libfile('class/censor');
                 }
             }
             $censor = discuz_censor::instance();
             loadcache('profilesetting');
             foreach ($data as $key => $value) {
                 if (empty($_G['cache']['profilesetting'][$key])) {
                     continue;
                 }
                 if (is_array($value)) {
                     $value = implode(',', $value);
                 }
                 $value = cutstr(dhtmlspecialchars(trim($value)), 100, '.');
                 // if ($_G['cache']['profilesetting'][$key]['formtype'] == 'file' && !preg_match("/^https?:\/\/(.*)?\.(jpg|png|gif|jpeg|bmp)$/i", $value)) {
                 //     showmessage('activity_imgurl_error');
                 // }
                 if (empty($value) && $key != 'residedist' && $key != 'residecommunity') {
                     return $this->_makeErrorInfo($res, 'activity_exile_field');
                 }
                 $ufielddata['userfield'][$key] = $value;
             }
         }
         if (!empty($activity['ufield']['extfield'])) {
             foreach ($activity['ufield']['extfield'] as $fieldid) {
                 $value = cutstr(dhtmlspecialchars(trim($_GET['' . $fieldid])), 50, '.');
                 $ufielddata['extfield'][$fieldid] = $value;
             }
         }
         $ufielddata = !empty($ufielddata) ? serialize($ufielddata) : '';
     }
     if ($_G['setting']['activitycredit'] && $activity['credit'] && empty($applyinfo['verified'])) {
         checklowerlimit(array('extcredits' . $_G['setting']['activitycredit'] => '-' . $activity['credit']));
         updatemembercount($uid, array($_G['setting']['activitycredit'] => '-' . $activity['credit']), true, 'ACC', $tid);
     }
     $data = array('tid' => $tid, 'username' => $_G['username'], 'uid' => $uid, 'message' => $message, 'verified' => $verified, 'dateline' => $_G['timestamp'], 'payment' => $payment, 'ufielddata' => $ufielddata);
     if ($applyinfo && $applyinfo['verified'] == DzForumActivityApply::STATUS_VERIFIED_IMPROVE) {
         DzForumActivityApply::updateApplyById($data, $applyinfo['applyid']);
     } else {
         DzForumActivityApply::insertApply($data);
     }
     DzForumActivity::updateApplyNumberByTid($tid);
     if ($thread['authorid'] != $uid) {
         notification_add($thread['authorid'], 'activity', 'activity_notice', array('tid' => $tid, 'subject' => $thread['subject']));
         $space = array();
         space_merge($space, 'field_home');
         if (!empty($space['privacy']['feed']['newreply'])) {
             $feed['icon'] = 'activity';
             $feed['title_template'] = 'feed_reply_activity_title';
             $feed['title_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$thread['subject']}</a>", 'hash_data' => "tid{$tid}");
             $feed['id'] = $tid;
             $feed['idtype'] = 'tid';
             postfeed($feed);
         }
     }
     $res = $this->_makeErrorInfo($res, 'activity_completion');
     $res['rs'] = 1;
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:85,代码来源:TopicActivityAction.php


示例6: replyfeed

 public function replyfeed()
 {
     if (!$this->feed) {
         if ($this->forum['allowfeed'] && !$this->param['isanonymous']) {
             if ($this->thread['authorid'] != $this->member['uid']) {
                 $post_url = "forum.php?mod=redirect&goto=findpost&pid=" . $this->pid . "&ptid=" . $this->thread['tid'];
                 $this->feed['icon'] = 'post';
                 $this->feed['title_template'] = !empty($this->thread['author']) ? 'feed_reply_title' : 'feed_reply_title_anonymous';
                 $this->feed['title_data'] = array('subject' => "<a href=\"{$post_url}\">" . $this->thread['subject'] . "</a>", 'author' => "<a href=\"home.php?mod=space&uid=" . $this->thread['authorid'] . "\">" . $this->thread['author'] . "</a>");
                 $forum_attachexist = getglobal('forum_attachexist');
                 if (!empty($forum_attachexist)) {
                     $imgattach = C::t('forum_attachment_n')->fetch_max_image('tid:' . $this->thread['tid'], 'pid', $this->pid);
                     $firstaid = $imgattach['aid'];
                     unset($imgattach);
                     if ($firstaid) {
                         $this->feed['images'] = array(getforumimg($firstaid));
                         $this->feed['image_links'] = array($post_url);
                     }
                 }
             }
         }
     }
     $this->feed['title_data']['hash_data'] = "tid" . $this->thread['tid'];
     $this->feed['id'] = $this->pid;
     $this->feed['idtype'] = 'pid';
     if ($this->feed['icon']) {
         postfeed($this->feed);
     }
 }
开发者ID:MCHacker,项目名称:docker-discuz,代码行数:29,代码来源:model_forum_post.php


示例7: _setToVote

 private function _setToVote($res, $tid, $options)
 {
     global $_G;
     $_G['tid'] = $tid;
     require_once libfile('function/post');
     $options = rawurldecode($options);
     $_GET['pollanswers'] = $options;
     if (!$_G['group']['allowvote']) {
         return $this->makeErrorInfo($res, 'group_nopermission', array('{grouptitle}' => $_G['group']['grouptitle']));
     } elseif (!empty($thread['closed'])) {
         return $this->makeErrorInfo($res, 'thread_poll_closed');
     } elseif (empty($_GET['pollanswers'])) {
         return $this->makeErrorInfo($res, 'thread_poll_invalid');
     }
     $pollarray = C::t('forum_poll')->fetch($_G['tid']);
     $overt = $pollarray['overt'];
     if (!$pollarray) {
         return $this->makeErrorInfo($res, 'poll_not_found');
     } elseif ($pollarray['expiration'] && $pollarray['expiration'] < TIMESTAMP) {
         return $this->makeErrorInfo($res, 'poll_overdue');
     } elseif ($pollarray['maxchoices'] && $pollarray['maxchoices'] < count($_GET['pollanswers'])) {
         return $this->makeErrorInfo($res, 'poll_choose_most', array('{maxchoices}' => $pollarray['maxchoices']));
     }
     $voterids = $_G['uid'] ? $_G['uid'] : $_G['clientip'];
     $polloptionid = array();
     $pollarray = '';
     $query = C::t('forum_polloption')->fetch_all_by_tid($_G['tid']);
     foreach ($query as $pollarray) {
         if (strexists("\t" . $pollarray['voterids'] . "\t", "\t" . $voterids . "\t")) {
             return $this->makeErrorInfo($res, 'thread_poll_voted');
         }
         $polloptionid[] = $pollarray['polloptionid'];
     }
     $polloptionids = '';
     foreach ($_GET['pollanswers'] as $key => $id) {
         if (!in_array($id, $polloptionid)) {
             return $this->makeErrorInfo($res, 'parameters_error');
         }
         unset($polloptionid[$key]);
         $polloptionids[] = $id;
     }
     // $_GET['pollanswers'] = str_replace(',', '    ', $options);
     $_GET['pollanswers'] = explode(',', $options);
     // DB::query("UPDATE ".DB::table('forum_poll')." SET voters=voters+1 where tid=".$_G['tid']);
     // DB::query("UPDATE ".DB::table('forum_polloption')." SET votes=votes+1,voterids=CONCAT(voterids,'".$_G['uid']."') where polloptionid in (".$_GET['pollanswers'].")");
     foreach ($_GET['pollanswers'] as $key => $value) {
         // DzUserVote::updateUserVoteByTid($_G['tid']);
         // DzUserVote::updateUserVotePolloption($_G['uid'], $value);
         C::t('forum_polloption')->update_vote($value, $voterids . "\t", 1);
         C::t('forum_thread')->update($_G['tid'], array('lastpost' => $_G['timestamp']), true);
         C::t('forum_poll')->update_vote($_G['tid']);
         C::t('forum_pollvoter')->insert(array('tid' => $_G['tid'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'options' => $value, 'dateline' => $_G['timestamp']));
         updatecreditbyaction('joinpoll');
         $space = array();
         space_merge($space, 'field_home');
         if ($overt && !empty($space['privacy']['feed']['newreply'])) {
             $feed['icon'] = 'poll';
             $feed['title_template'] = 'feed_thread_votepoll_title';
             $feed['title_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$_G['tid']}\">{$thread['subject']}</a>", 'author' => "<a href=\"home.php?mod=space&uid={$thread['authorid']}\">{$thread['author']}</a>", 'hash_data' => "tid{$_G[tid]}");
             $feed['id'] = $_G['tid'];
             $feed['idtype'] = 'tid';
             postfeed($feed);
         }
     }
     // $userVoteInfo = DzUserVote::getUserVoteTotalNum($tid);
     $polloption_query = DB::query("SELECT polloption as name,polloptionid as pollItemId,votes as totalNum FROM " . DB::table('forum_polloption') . " where tid=" . $tid);
     while ($polloption_rst = DB::fetch($polloption_query)) {
         $polloption_arr[] = $polloption_rst;
     }
     for ($di = 0; $di < count($polloption_arr); $di++) {
         $polloption_arr[$di][pollItemId] = (int) $polloption_arr[$di][pollItemId];
         $polloption_arr[$di][totalNum] = (int) $polloption_arr[$di][totalNum];
     }
     $res['vote_rs'] = $polloption_arr;
     $params['noError'] = 1;
     $res = $this->makeErrorInfo($res, 'thread_poll_succeed', $params);
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:78,代码来源:VoteAction.php


示例8: getPublishPollObj


//.........这里部分代码省略.........
             if ($_G['forum']['picstyle']) {
                 if (!setthreadcover($pid, 0, $threadimageaid)) {
                     preg_match_all("/(\\[img\\]|\\[img=\\d{1,4}[x|\\,]\\d{1,4}\\])\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/is", $message, $imglist, PREG_SET_ORDER);
                     $values['coverimg'] = "<p id=\"showsetcover\">" . lang('message', 'post_newthread_set_cover') . "<span id=\"setcoverwait\"></span></p><script>if(\$('forward_a')){\$('forward_a').style.display='none';setTimeout(\"\$('forward_a').style.display=''\", 5000);};ajaxget('forum.php?mod=ajax&action=setthreadcover&tid={$tid}&pid={$pid}&fid={$_G['fid']}&imgurl={$imglist[0][2]}&newthread=1', 'showsetcover', 'setcoverwait')</script>";
                     $param['clean_msgforward'] = 1;
                     $param['timeout'] = $param['refreshtime'] = 15;
                 }
             }
             if (!$isInsertForumImage && $threadimageaid && empty($imagearr)) {
                 if (!$threadimage) {
                     $threadimage = C::t('forum_attachment_n')->fetch('tid:' . $tid, $threadimageaid);
                 }
                 $threadimage = daddslashes($threadimage);
                 C::t('forum_threadimage')->insert(array('tid' => $tid, 'attachment' => $threadimage['attachment'], 'remote' => $threadimage['remote']));
                 $isInsertForumImage = true;
             }
         }
     }
     $feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
     if (1) {
         $message = !$price && !$readperm ? $message : '';
         if ($special == 0) {
             $feed['icon'] = 'thread';
             $feed['title_template'] = 'feed_thread_title';
             $feed['body_template'] = 'feed_thread_message';
             $feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'message' => messagecutstr($message, 150));
             if (!empty($_G['forum_attachexist'])) {
                 $imgattach = C::t('forum_attachment_n')->fetch_max_image('tid:' . $tid, 'pid', $pid);
                 $firstaid = $imgattach['aid'];
                 unset($imgattach);
                 if ($firstaid) {
                     $feed['images'] = array(getforumimg($firstaid));
                     $feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$tid}&pid={$pid}");
                 }
             }
         } elseif ($special > 0) {
             if ($special == 1) {
                 $pvs = explode("\t", messagecutstr($polloptionpreview, 150));
                 $s = '';
                 $i = 1;
                 foreach ($pvs as $pv) {
                     $s .= $i . '. ' . $pv . '<br />';
                 }
                 $s .= '&nbsp;&nbsp;&nbsp;...';
                 $feed['icon'] = 'poll';
                 $feed['title_template'] = 'feed_thread_poll_title';
                 $feed['body_template'] = 'feed_thread_poll_message';
                 $feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'message' => $s);
             } elseif ($special == 3) {
                 $feed['icon'] = 'reward';
                 $feed['title_template'] = 'feed_thread_reward_title';
                 $feed['body_template'] = 'feed_thread_reward_message';
                 $feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'rewardprice' => $rewardprice, 'extcredits' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]['title']);
             } elseif ($special == 4) {
                 $feed['icon'] = 'activity';
                 $feed['title_template'] = 'feed_thread_activity_title';
                 $feed['body_template'] = 'feed_thread_activity_message';
                 $feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'starttimefrom' => $_GET['starttimefrom'][$activitytime], 'activityplace' => $activity['place'], 'message' => messagecutstr($message, 150));
                 if ($_GET['activityaid']) {
                     $feed['images'] = array(getforumimg($_GET['activityaid']));
                     $feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$tid}&pid={$pid}");
                 }
             } elseif ($special == 5) {
                 $feed['icon'] = 'debate';
                 $feed['title_template'] = 'feed_thread_debate_title';
                 $feed['body_template'] = 'feed_thread_debate_message';
                 $feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'message' => messagecutstr($message, 150), 'affirmpoint' => messagecutstr($affirmpoint, 150), 'negapoint' => messagecutstr($negapoint, 150));
             }
         }
         $feed['title_data']['hash_data'] = "tid{$tid}";
         $feed['id'] = $tid;
         $feed['idtype'] = 'tid';
         if ($feed['icon']) {
             postfeed($feed);
         }
     }
     if ($digest) {
         updatepostcredits('+', $_G['uid'], 'digest', $_G['fid']);
     }
     updatepostcredits('+', $_G['uid'], 'post', $_G['fid']);
     if ($isgroup) {
         C::t('forum_groupuser')->update_counter_for_user($_G['uid'], $_G['fid'], 1);
     }
     if (!$pid) {
         $obj->rs = SUCCESS;
         echo echo_json($obj);
         exit;
     }
     $subject = str_replace("\t", ' ', $subject);
     $lastpost = "{$tid}\t" . $subject . "\t{$publishdate}\t{$author}";
     C::t('forum_forum')->update($_G['fid'], array('lastpost' => $lastpost));
     C::t('forum_forum')->update_forum_counter($_G['fid'], 1, 1, 1);
     DB::query("DELETE FROM %t WHERE uid=%d", array('forum_attachment_unused', $_G['uid']));
     if (isset($rPostion) && !empty($rPostion)) {
         surround_user::insert_all_thread_location($longitude, $latitude, $location, $pid);
     }
     $data_post["rs"] = 1;
     $data_post["content"] = $modnewposts['modnewposts'] > 0 ? Common::get_unicode_charset('\\u65b0\\u4e3b\\u9898\\u9700\\u8981\\u5ba1\\u6838\\uff0c\\u60a8\\u7684\\u5e16\\u5b50\\u901a\\u8fc7\\u5ba1\\u6838\\u540e\\u624d\\u80fd\\u663e\\u793a') : '';
     return $data_post;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:PublishPollImpl_x25.php


示例9: massSend

	public function massSend($mob,$content,$time)
	{
	
		$http = 'http://119.145.9.12/services/emsServices?wsdl';
		$data = array
		(
				'enterpriseID'=>"15440",
				'loginName'=>"admin",
				'password'=>strtolower(md5("kouyan1559")),
				'smsId'=>"",
				'subPort'=>"",
				'Phone'=>"",
				'mobiles'=>$mob,
				'content'=>iconv("gbk", "utf-8//IGNORE", $content),
				'sendTime'=>$time
		);
		$re	= postfeed($http,$data);						//POST
	
		return $re;
	}
开发者ID:hutao1004,项目名称:yintt,代码行数:20,代码来源:SmsWSInvoke.class.php


示例10: article_move_forums


//.........这里部分代码省略.........
    if ($pid && getstatus($thread['status'], 1)) {
        savepostposition($tid, $pid);
    }
    $threadimageaid = 0;
    $threadimage = array();
    //print_r($message);exit();
    if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata']) && $sortaids) {
        foreach ($sortaids as $sortaid) {
            convertunusedattach($sortaid, $tid, $pid);
        }
    }
    if (($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_GET['attachnew'] || $sortid || !empty($_GET['activityaid']))) {
        updateattach($displayorder == -4 || $modnewthreads, $tid, $pid, $_GET['attachnew']);
        if (!$threadimageaid) {
            $threadimage = DB::fetch_first("SELECT aid, attachment, remote FROM " . DB::table(getattachtablebytid($tid)) . " WHERE tid='{$tid}' AND isimage IN ('1', '-1') ORDER BY width DESC LIMIT 1");
            $threadimageaid = $threadimage['aid'];
        }
        if ($_G['forum']['picstyle']) {
            setthreadcover($pid, 0, $threadimageaid);
        }
    }
    /*删除附件*/
    if ($old_arr['forum_id']) {
        $query = DB::query("SELECT attachment, thumb, remote, aid FROM " . DB::table(getattachtablebytid($old_arr['forum_id'])) . " WHERE tid='{$old_arr['forum_id']}'");
        while ($v = DB::fetch($query)) {
            $attach[] = $v;
        }
        dunlink($attach);
        DB::query("DELETE FROM " . DB::table('forum_attachment') . " WHERE tid='{$old_arr['forum_id']}'");
        DB::query("DELETE FROM " . DB::table(getattachtablebytid($old_arr['forum_id'])) . " WHERE tid='{$old_arr['forum_id']}'");
        DB::delete('forum_threadimage', "tid='{$old_arr['forum_id']}'");
        //图片表
    }
    $param = array('fid' => $arr['fid'], 'tid' => $tid, 'pid' => $pid);
    $statarr = array(0 => 'thread', 1 => 'poll', 2 => 'trade', 3 => 'reward', 4 => 'activity', 5 => 'debate', 127 => 'thread');
    include_once libfile('function/stat');
    updatestat($isgroup ? 'groupthread' : $statarr[$special]);
    dsetcookie('clearUserdata', 'forum');
    if ($specialextra) {
        $classname = 'threadplugin_' . $specialextra;
        if (class_exists($classname) && method_exists($threadpluginclass = new $classname(), 'newthread_submit_end')) {
            $threadpluginclass->newthread_submit_end($_G['fid'], $tid);
        }
    }
    $feed = array('icon' => '', 'title_template' => '', 'title_data' => array(), 'body_template' => '', 'body_data' => array(), 'title_data' => array(), 'images' => array());
    if (!empty($_GET['addfeed']) && $_G['forum']['allowfeed'] && !$isanonymous) {
        $message = !$price ? $message : '';
        if ($special == 0) {
            $feed['icon'] = 'thread';
            $feed['title_template'] = 'feed_thread_title';
            $feed['body_template'] = 'feed_thread_message';
            $feed['body_data'] = array('subject' => "<a href=\"forum.php?mod=viewthread&tid={$tid}\">{$subject}</a>", 'message' => messagecutstr($message, 150));
            if (!empty($_G['forum_attachexist'])) {
                $firstaid = DB::result_first("SELECT aid FROM " . DB::table(getattachtablebytid($tid)) . " WHERE pid='{$pid}' AND dateline>'0' AND isimage='1' ORDER BY dateline LIMIT 1");
                if ($firstaid) {
                    $feed['images'] = array(getforumimg($firstaid));
                    $feed['image_links'] = array("forum.php?mod=viewthread&do=tradeinfo&tid={$tid}&pid={$pid}");
                }
            }
        }
    }
    $feed['title_data']['hash_data'] = "tid{$tid}";
    $feed['id'] = $tid;
    $feed['idtype'] = 'tid';
    if ($feed['icon']) {
        postfeed($feed);
    }
    if ($displayorder != -4) {
        if ($digest) {
            updatepostcredits('+', $_G['uid'], 'digest', $_G['fid']);
        }
        updatepostcredits('+', $_G['uid'], 'post', $_G['fid']);
        if ($isgroup) {
            DB::query("UPDATE " . DB::table('forum_groupuser') . " SET threads=threads+1, lastupdate='" . $arr['public_time'] . "' WHERE uid='{$_G['uid']}' AND fid='{$_G['fid']}'");
        }
        $subject = str_replace("\t", ' ', $subject);
        $f_lastpost = "{$tid}\t{$subject}\t" . $arr['public_time'] . "\t{$author}";
        if ($_G['forum']['type'] == 'sub') {
            DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$f_lastpost}' WHERE fid='" . $_G['forum'][fup] . "'", 'UNBUFFERED');
        }
    }
    $subject = str_replace("\t", ' ', $subject);
    $replys = $replys ? $replys : 1;
    //今日发帖
    $todayposts = date("Yjn", $arr['public_time']) == date("Yjn", $v) ? 1 : 0;
    foreach ((array) $time_arr as $k => $v) {
        if (date("Yjn", $_G['timestamp']) == date("Yjn", $v)) {
            $todayposts++;
        }
    }
    DB::query("UPDATE " . DB::table('forum_forum') . " SET lastpost='{$f_lastpost}', threads=threads+1, posts=posts+{$replys}, todayposts=todayposts+{$todayposts} WHERE fid='{$arr['fid']}'", 'UNBUFFERED');
    //更新今日发帖这些数据
    if ($_G['forum']['status'] == 3) {
        require_once libfile('function/group');
        updateactivity($_G['fid'], 0);
        require_once libfile('function/grouplog');
        updategroupcreditlog($_G['fid'], $_G['uid']);
    }
    return $re;
}
开发者ID:edmundwong,项目名称:V604,代码行数:101,代码来源:function.article.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP posting_gen_attachment_entry函数代码示例发布时间:2022-05-15
下一篇:
PHP posted_on函数代码示例发布时间: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