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

PHP process_post_preview函数代码示例

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

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



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

示例1: while

     while ($attachment = $db->fetch_array($attachs)) {
         if (!$attachment['build_thumbnail']) {
             $attachment['hasthumbnail'] = false;
         }
         $postattach["{$attachment['attachmentid']}"] = $attachment;
     }
     // Attachments added since the edit began.
     $attachs = $db->query_read("\n\t\t\tSELECT dateline, thumbnail_dateline, filename, filesize, visible, attachmentid, counter,\n\t\t\t\tIF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize,\n\t\t\t\tattachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow\n\t\t\tFROM " . TABLE_PREFIX . "attachment AS attachment\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype USING (extension)\n\t\t\tWHERE posthash = '" . $db->escape_string($posthash) . "'\n\t\t\t\tAND (userid = " . $vbulletin->userinfo['userid'] . " OR userid = {$postinfo['userid']})\n\t\t\tORDER BY attachmentid\n\t\t");
     while ($attachment = $db->fetch_array($attachs)) {
         if (!$attachment['build_thumbnail']) {
             $attachment['hasthumbnail'] = false;
         }
         $postattach["{$attachment['attachmentid']}"] = $attachment;
     }
     // ### PREVIEW POST ###
     $postpreview = process_post_preview($edit, $postinfo['userid'], $postattach);
     $previewpost = true;
     $_REQUEST['do'] = 'editpost';
 } else {
     if ($vbulletin->GPC['advanced']) {
         // Don't display preview on QuickEdit->Advanced as parseurl is turned off and so the preview won't be correct unless the post originally had checked to not parse links
         // If you turn on parseurl then the opposite happens and you have to go unparse your links if that is what you want. Compromise
         $_REQUEST['do'] = 'editpost';
     } else {
         // ### POST HAS NO ERRORS ###
         $dataman->save();
         $update_edit_log = true;
         // don't show edited by AND reason unchanged - don't update edit log
         if (!($permissions['genericoptions'] & $vbulletin->bf_ugp_genericoptions['showeditedby']) and $edit['reason'] == $postinfo['edit_reason']) {
             $update_edit_log = false;
         }
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:editpost.php


示例2: fetch_error

                $errors[] = fetch_error('pmfloodcheck', $vbulletin->options['pmfloodtime'], $vbulletin->options['pmfloodtime'] - $timepassed);
            }
        }
    }
    // process errors if there are any
    $errors = array_merge($errors, $pmdm->errors);
    if (!empty($errors)) {
        define('PMPREVIEW', 1);
        $preview = construct_errors($errors);
        // this will take the preview's place
        $_REQUEST['do'] = 'newpm';
    } else {
        if ($vbulletin->GPC['preview'] != '') {
            define('PMPREVIEW', 1);
            $foruminfo = array('forumid' => 'privatemessage', 'allowicons' => $vbulletin->options['privallowicons']);
            $preview = process_post_preview($pm);
            $_REQUEST['do'] = 'newpm';
        } else {
            // everything's good!
            $pmdm->save();
            // force pm counters to be rebuilt
            $vbulletin->userinfo['pmunread'] = -1;
            build_pm_counters();
            ($hook = vBulletinHook::fetch_hook('private_insertpm_complete')) ? eval($hook) : false;
            $vbulletin->url = 'private.php' . $vbulletin->session->vars['sessionurl_q'];
            eval(print_standard_redirect('pm_messagesent'));
        }
    }
}
// ############################### start new pm ###############################
// form for creating a new private message
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:private.php


示例3: htmlspecialchars_uni

     $newpost['message'] = htmlspecialchars_uni($newpost['message']);
     $podcasturl = htmlspecialchars_uni($newpost['podcasturl']);
     $podcastsize = $newpost['podcastsize'] ? $newpost['podcastsize'] : '';
     $podcastkeywords = htmlspecialchars_uni($newpost['podcastkeywords']);
     $podcastsubtitle = htmlspecialchars_uni($newpost['podcastsubtitle']);
     $podcastauthor = htmlspecialchars_uni($newpost['podcastauthor']);
     $explicitchecked = $newpost['podcastexplicit'] ? 'checked="checked"' : '';
 } else {
     if ($newpost['preview']) {
         if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions'])) {
             require_once DIR . '/packages/vbattach/attach.php';
             $attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
             $postattach = $attach->fetch_postattach($posthash);
         }
         // ### PREVIEW POST ###
         $postpreview = process_post_preview($newpost, 0, $postattach);
         $_REQUEST['do'] = 'newthread';
         $newpost['message'] = htmlspecialchars_uni($newpost['message']);
         $podcasturl = htmlspecialchars_uni($newpost['podcasturl']);
         $podcastsize = $newpost['podcastsize'] ? $newpost['podcastsize'] : '';
         $podcastkeywords = htmlspecialchars_uni($newpost['podcastkeywords']);
         $podcastsubtitle = htmlspecialchars_uni($newpost['podcastsubtitle']);
         $podcastauthor = htmlspecialchars_uni($newpost['podcastauthor']);
         $explicitchecked = $newpost['podcastexplicit'] ? 'checked="checked"' : '';
     } else {
         // ### NOT PREVIEW - ACTUAL POST ###
         $threadinfo = fetch_threadinfo($newpost['threadid']);
         // need the forumread variable from this
         mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
         ($hook = vBulletinHook::fetch_hook('newthread_post_complete')) ? eval($hook) : false;
         if ($newpost['postpoll']) {
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:newthread.php


示例4: while

     $ids = $vbulletin->db->query_read_slave("\n\t\t\tSELECT postid\n\t\t\tFROM " . TABLE_PREFIX . "post\n\t\t\tWHERE\n\t\t\t\tthreadid = {$postinfo['threadid']}\n\t\t\t\t\tAND\n\t\t\t\tattach > 0\n\t\t");
     while ($id = $vbulletin->db->fetch_array($ids)) {
         $idlist[] = $id['postid'];
     }
     $postattach = $attach->fetch_postattach($posthash, $idlist, $postinfo['userid'], true);
     if ($postattach['bycontent'][0]) {
         if ($postattach['bycontent'][$postinfo['postid']]) {
             $postattach['bycontent'][$postinfo['postid']] = $postattach['bycontent'][$postinfo['postid']] + $postattach['bycontent'][0];
         } else {
             $postattach['bycontent'][$postinfo['postid']] = $postattach['bycontent'][0];
         }
         unset($postattach['bycontent'][0]);
     }
     $edit['postid'] = $postinfo['postid'];
     // ### PREVIEW POST ###
     $postpreview = process_post_preview($edit, $postinfo['userid'], $postattach['bycontent'][$postinfo['postid']], $postattach['byattachment']);
     $previewpost = true;
     $_REQUEST['do'] = 'editpost';
 } else {
     if ($vbulletin->GPC['advanced']) {
         // Don't display preview on QuickEdit->Advanced as parseurl is turned off and so the preview won't be correct unless the post originally had checked to not parse links
         // If you turn on parseurl then the opposite happens and you have to go unparse your links if that is what you want. Compromise
         $_REQUEST['do'] = 'editpost';
     } else {
         // ### POST HAS NO ERRORS ###
         $dataman->save();
         clear_autosave_text('vBForum_Post', $postinfo['postid'], 0, $vbulletin->userinfo['userid']);
         $update_edit_log = true;
         // don't show edited by AND reason unchanged - don't update edit log
         if (!($permissions['genericoptions'] & $vbulletin->bf_ugp_genericoptions['showeditedby']) and $edit['reason'] == $postinfo['edit_reason']) {
             $update_edit_log = false;
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:editpost.php


示例5: do_send_pm


//.........这里部分代码省略.........
    $pm['folderid'] =& $vbulletin->GPC['folderid'];
    // *************************************************************
    // PROCESS THE MESSAGE AND INSERT IT INTO THE DATABASE
    $errors = array();
    // catches errors
    if ($vbulletin->userinfo['pmtotal'] > $permissions['pmquota'] or $vbulletin->userinfo['pmtotal'] == $permissions['pmquota'] and $pm['savecopy']) {
        json_error(strip_tags(fetch_error('yourpmquotaexceeded')), RV_POST_ERROR);
    }
    // create the DM to do error checking and insert the new PM
    $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
    $pmdm->set_info('savecopy', $pm['savecopy']);
    $pmdm->set_info('receipt', $pm['receipt']);
    $pmdm->set_info('cantrackpm', $cantrackpm);
    $pmdm->set_info('forward', $pm['forward']);
    $pmdm->set_info('bccrecipients', $pm['bccrecipients']);
    if ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) {
        $pmdm->overridequota = true;
    }
    $pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
    $pmdm->set('fromusername', $vbulletin->userinfo['username']);
    $pmdm->setr('title', $pm['title']);
    $pmdm->set_recipients($pm['recipients'], $permissions, 'cc');
    $pmdm->set_recipients($pm['bccrecipients'], $permissions, 'bcc');
    $pmdm->setr('message', $pm['message']);
    $pmdm->setr('iconid', $pm['iconid']);
    $pmdm->set('dateline', TIMENOW);
    $pmdm->setr('showsignature', $pm['signature']);
    $pmdm->set('allowsmilie', $pm['disablesmilies'] ? 0 : 1);
    if (!$pm['forward']) {
        $pmdm->set_info('parentpmid', $pm['pmid']);
    }
    $pmdm->set_info('replypmid', $pm['pmid']);
    ($hook = vBulletinHook::fetch_hook('private_insertpm_process')) ? eval($hook) : false;
    $pmdm->pre_save();
    // deal with user using receivepmbuddies sending to non-buddies
    if ($vbulletin->userinfo['receivepmbuddies'] and is_array($pmdm->info['recipients'])) {
        $users_not_on_list = array();
        // get a list of super mod groups
        $smod_groups = array();
        foreach ($vbulletin->usergroupcache as $ugid => $groupinfo) {
            if ($groupinfo['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator']) {
                // super mod group
                $smod_groups[] = $ugid;
            }
        }
        // now filter out all moderators (and super mods) from the list of recipients
        // to check against the buddy list
        $check_recipients = $pmdm->info['recipients'];
        $mods = $db->query_read_slave("\n\t\t\tSELECT user.userid\n\t\t\tFROM " . TABLE_PREFIX . "user AS user\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "moderator AS moderator ON (moderator.userid = user.userid)\n\t\t\tWHERE user.userid IN (" . implode(',', array_keys($check_recipients)) . ")\n\t\t\t\tAND ((moderator.userid IS NOT NULL AND moderator.forumid <> -1)\n\t\t\t\t" . (!empty($smod_groups) ? "OR user.usergroupid IN (" . implode(',', $smod_groups) . ")" : '') . "\n\t\t\t\t)\n\t\t");
        while ($mod = $db->fetch_array($mods)) {
            unset($check_recipients["{$mod['userid']}"]);
        }
        if (!empty($check_recipients)) {
            // filter those on our buddy list out
            $users = $db->query_read_slave("\n\t\t\t\tSELECT userlist.relationid\n\t\t\t\tFROM " . TABLE_PREFIX . "userlist AS userlist\n\t\t\t\tWHERE userid = " . $vbulletin->userinfo['userid'] . "\n\t\t\t\t\tAND userlist.relationid IN(" . implode(array_keys($check_recipients), ',') . ")\n\t\t\t\t\tAND type = 'buddy'\n\t\t\t");
            while ($user = $db->fetch_array($users)) {
                unset($check_recipients["{$user['relationid']}"]);
            }
        }
        // what's left must be those who are neither mods or on our buddy list
        foreach ($check_recipients as $userid => $user) {
            $users_not_on_list["{$userid}"] = $user['username'];
        }
        if (!empty($users_not_on_list) and (!$vbulletin->GPC['sendanyway'] or !empty($errors))) {
            $users = '';
            foreach ($users_not_on_list as $userid => $username) {
                $users .= "<li><a href=\"member.php?" . $vbulletin->session->vars['sessionurl'] . "u={$userid}\" target=\"profile\">{$username}</a></li>";
            }
            $pmdm->error('pm_non_contacts_cant_reply', $users);
        }
    }
    // check for message flooding
    if ($vbulletin->options['pmfloodtime'] > 0 and !$vbulletin->GPC['preview']) {
        if (!($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) and !can_moderate()) {
            $floodcheck = $db->query_first("\n\t\t\t\tSELECT pmtextid, title, dateline\n\t\t\t\tFROM " . TABLE_PREFIX . "pmtext AS pmtext\n\t\t\t\tWHERE fromuserid = " . $vbulletin->userinfo['userid'] . "\n\t\t\t\tORDER BY dateline DESC\n\t\t\t");
            if (($timepassed = TIMENOW - $floodcheck['dateline']) < $vbulletin->options['pmfloodtime']) {
                json_error(strip_tags(fetch_error('pmfloodcheck', $vbulletin->options['pmfloodtime'], $vbulletin->options['pmfloodtime'] - $timepassed)), RV_POST_ERROR);
            }
        }
    }
    // process errors if there are any
    $errors = array_merge($errors, $pmdm->errors);
    if (!empty($errors)) {
        json_error(strip_tags($errors[0]), RV_POST_ERROR);
    } else {
        if ($vbulletin->GPC['preview'] != '') {
            define('PMPREVIEW', 1);
            $foruminfo = array('forumid' => 'privatemessage', 'allowicons' => $vbulletin->options['privallowicons']);
            $preview = process_post_preview($pm);
            $_REQUEST['do'] = 'newpm';
        } else {
            // everything's good!
            $pmdm->save();
            // force pm counters to be rebuilt
            $vbulletin->userinfo['pmunread'] = -1;
            build_pm_counters();
        }
    }
    return array('success' => 1);
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:pms.php


示例6: do_post_edit


//.........这里部分代码省略.........
    }
    // set options
    $dataman->setr('showsignature', $edit['signature']);
    $dataman->setr('allowsmilie', $edit['enablesmilies']);
    // set data
    /*$dataman->setr('userid', $vbulletin->userinfo['userid']);
    	if ($vbulletin->userinfo['userid'] == 0)
    	{
    		$dataman->setr('username', $post['username']);
    	}*/
    $dataman->setr('title', $edit['title']);
    $dataman->setr('pagetext', $edit['message']);
    if ($postinfo['userid'] != $vbulletin->userinfo['userid']) {
        $dataman->setr('iconid', $edit['iconid'], true, false);
    } else {
        $dataman->setr('iconid', $edit['iconid']);
    }
    $postusername = $vbulletin->userinfo['username'];
    $dataman->pre_save();
    if ($dataman->errors) {
        $errors = $dataman->errors;
    }
    if ($dataman->info['podcastsize']) {
        $edit['podcastsize'] = $dataman->info['podcastsize'];
    }
    if (sizeof($errors) > 0) {
        fr_standard_error($errors[0]);
    } else {
        if ($edit['preview']) {
            require_once DIR . '/packages/vbattach/attach.php';
            $attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
            $postattach = $attach->fetch_postattach($posthash, $postinfo['postid']);
            // ### PREVIEW POST ###
            $postpreview = process_post_preview($edit, $postinfo['userid'], $postattach);
            $previewpost = true;
            $_REQUEST['do'] = 'editpost';
        } else {
            if ($vbulletin->GPC['advanced']) {
                // Don't display preview on QuickEdit->Advanced as parseurl is turned off and so the preview won't be correct unless the post originally had checked to not parse links
                // If you turn on parseurl then the opposite happens and you have to go unparse your links if that is what you want. Compromise
                $_REQUEST['do'] = 'editpost';
            } else {
                // ### POST HAS NO ERRORS ###
                $dataman->save();
                $update_edit_log = true;
                // don't show edited by AND reason unchanged - don't update edit log
                if (!($permissions['genericoptions'] & $vbulletin->bf_ugp_genericoptions['showeditedby']) and $edit['reason'] == $postinfo['edit_reason']) {
                    $update_edit_log = false;
                }
                if ($update_edit_log) {
                    // ug perm: show edited by
                    if ($postinfo['dateline'] < TIMENOW - $vbulletin->options['noeditedbytime'] * 60 or !empty($edit['reason'])) {
                        // save the postedithistory
                        if ($vbulletin->options['postedithistory']) {
                            // insert original post on first edit
                            if (!$db->query_first("SELECT postedithistoryid FROM " . TABLE_PREFIX . "postedithistory WHERE original = 1 AND postid = " . $postinfo['postid'])) {
                                $db->query_write("\n\t\t\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "postedithistory\n\t\t\t\t\t\t\t\t(postid, userid, username, title, iconid, dateline, reason, original, pagetext)\n\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t({$postinfo['postid']},\n\t\t\t\t\t\t\t\t" . $postinfo['userid'] . ",\n\t\t\t\t\t\t\t\t'" . $db->escape_string($postinfo['username']) . "',\n\t\t\t\t\t\t\t\t'" . $db->escape_string($postinfo['title']) . "',\n\t\t\t\t\t\t\t\t{$postinfo['iconid']},\n\t\t\t\t\t\t\t\t" . $postinfo['dateline'] . ",\n\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t'" . $db->escape_string($postinfo['pagetext']) . "')\n\t\t\t\t\t\t");
                            }
                            // insert the new version
                            $db->query_write("\n\t\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "postedithistory\n\t\t\t\t\t\t\t(postid, userid, username, title, iconid, dateline, reason, pagetext)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t({$postinfo['postid']},\n\t\t\t\t\t\t\t" . $vbulletin->userinfo['userid'] . ",\n\t\t\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t\t\t'" . $db->escape_string($edit['title']) . "',\n\t\t\t\t\t\t\t{$edit['iconid']},\n\t\t\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t\t\t'" . $db->escape_string($edit['reason']) . "',\n\t\t\t\t\t\t\t'" . $db->escape_string($edit['message']) . "')\n\t\t\t\t\t");
                        }
                        /*insert query*/
                        $db->query_write("\n\t\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "editlog\n\t\t\t\t\t\t(postid, userid, username, dateline, reason, hashistory)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t({$postinfo['postid']},\n\t\t\t\t\t\t" . $vbulletin->userinfo['userid'] . ",\n\t\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t\t'" . $db->escape_string($edit['reason']) . "',\n\t\t\t\t\t\t" . ($vbulletin->options['postedithistory'] ? 1 : 0) . ")\n\t\t\t\t");
                    }
                }
                $date = vbdate($vbulletin->options['dateformat'], TIMENOW);
开发者ID:0hyeah,项目名称:yurivn,代码行数:67,代码来源:post.php


示例7: explode

         $quote_postids = explode(',', $vbulletin->GPC['vbulletin_multiquote']);
     } else {
         $quote_postids = array();
     }
     if ($quote_postids) {
         fetch_quotable_posts($quote_postids, $threadinfo['threadid'], $unquoted_post_count, $quoted_post_ids);
         // handle MQ VBIV-388
         $multiquote_empty = 'only';
     }
     if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions'])) {
         require_once DIR . '/packages/vbattach/attach.php';
         $attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
         $postattach = $attach->fetch_postattach($posthash, 0, $postinfo['userid'], true, $attachid);
     }
     // ### PREVIEW POST ###
     $postpreview = process_post_preview($newpost, 0, $postattach['bycontent'][0], $postattach['byattachment']);
     $_REQUEST['do'] = 'newreply';
     $newpost['message'] = htmlspecialchars_uni($newpost['message']);
 } else {
     // ### NOT PREVIEW - ACTUAL POST ###
     if ($vbulletin->options['threadmarking'] and $vbulletin->userinfo['userid']) {
         $threadview = max($threadinfo['threadread'], $threadinfo['forumread'], TIMENOW - $vbulletin->options['markinglimit'] * 86400);
     } else {
         $threadview = intval(fetch_bbarray_cookie('thread_lastview', $thread['threadid']));
         if (!$threadview) {
             $threadview = $vbulletin->userinfo['lastvisit'];
         }
     }
     $newpostid = $newpost['postid'];
     if ($cms_comment_thread) {
         // Expire any CMS comments cache entries.
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:newreply.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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