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


PHP UpdatePage函数代码示例

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


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

示例1: HandleGuestStore

function HandleGuestStore($pagename, $auth)
{
    global $wpcom_api_key, $wpcom_home;
    $akismet = new Akismet($wpcom_home, $wpcom_api_key);
    $akismet->setCommentAuthor($_POST['name']);
    $akismet->setCommentAuthorEmail($_POST['email']);
    $akismet->setCommentAuthorURL($_POST['url']);
    $akismet->setCommentContent($_POST['comment']);
    $itemurl = $pagename . date("Ymd") . "-" . uniqid();
    $akismet->setPermalink($itemurl);
    $page['name'] = $itemurl;
    $page['text'] = "----\n";
    $page['text'] .= strlen($_POST['name']) > 0 ? $_POST['name'] : "Unbekannt";
    if (strlen($_POST['email']) > 0) {
        $page['text'] .= " [[✉->mailto:";
        $page['text'] .= $_POST['email'];
        $page['text'] .= "]]";
    }
    if (strlen($_POST['url']) > 0) {
        $page['text'] .= " [[➚->";
        $page['text'] .= substr($_POST['url'], 0, 4) == "http" ? $_POST['url'] : "http://" . $_POST['url'];
        $page['text'] .= "]]";
    }
    $page['text'] .= " schrieb am ";
    $page['text'] .= date("d.m.Y");
    $page['text'] .= ":\n\n";
    $page['text'] .= $_POST['comment'];
    $page['text'] .= $akismet->isCommentSpam() ? "(:spam: true:)" : "(:spam: false:)";
    $page['time'] = $Now;
    $page['host'] = $_SERVER['REMOTE_ADDR'];
    $page['agent'] = @$_SERVER['HTTP_USER_AGENT'];
    UpdatePage($page['name'], $page, $page);
    HandleBrowse($pagename);
}
开发者ID:ansgar,项目名称:pmguest,代码行数:34,代码来源:guest.php

示例2: HandleEdit

function HandleEdit($pagename, $auth = 'edit') {
  global $IsPagePosted, $EditFields, $ChangeSummary, $EditFunctions, 
    $EnablePost, $FmtV, $Now, $EditRedirectFmt, 
    $PageEditForm, $HandleEditFmt, $PageStartFmt, $PageEditFmt, $PageEndFmt;
  SDV($EditRedirectFmt, '$FullName');
  if (@$_POST['cancel']) 
    { Redirect(FmtPageName($EditRedirectFmt, $pagename)); return; }
  Lock(2);
  $page = RetrieveAuthPage($pagename, $auth, true);
  if (!$page) Abort("?cannot edit $pagename"); 
  $new = $page;
  foreach((array)$EditFields as $k) 
    if (isset($_POST[$k])) $new[$k]=str_replace("\r",'',stripmagic($_POST[$k]));
  $new['csum'] = $ChangeSummary;
  if ($ChangeSummary) $new["csum:$Now"] = $ChangeSummary;
  $EnablePost &= preg_grep('/^post/', array_keys(@$_POST));
  $new['=preview'] = $new['text'];
  PCache($pagename, $new);
  UpdatePage($pagename, $page, $new);
  Lock(0);
  if ($IsPagePosted && !@$_POST['postedit']) 
    { Redirect(FmtPageName($EditRedirectFmt, $pagename)); return; }
  $FmtV['$DiffClassMinor'] = 
    (@$_POST['diffclass']=='minor') ?  "checked='checked'" : '';
  $FmtV['$EditText'] = 
    str_replace('$','$',PHSC(@$new['text'],ENT_NOQUOTES));
  $FmtV['$EditBaseTime'] = $Now;
  if (@$PageEditForm) {
    $efpage = FmtPageName($PageEditForm, $pagename);
    $form = RetrieveAuthPage($efpage, 'read', false, READPAGE_CURRENT);
    if (!$form || !@$form['text']) 
      Abort("?unable to retrieve edit form $efpage", 'editform');
    $FmtV['$EditForm'] = MarkupToHTML($pagename, $form['text']);
  }
  SDV($PageEditFmt, "<div id='wikiedit'>
    <h2 class='wikiaction'>$[Editing {\$FullName}]</h2>
    <form method='post' rel='nofollow' action='\$PageUrl?action=edit'>
    <input type='hidden' name='action' value='edit' />
    <input type='hidden' name='n' value='\$FullName' />
    <input type='hidden' name='basetime' value='\$EditBaseTime' />
    \$EditMessageFmt
    <textarea id='text' name='text' rows='25' cols='60'
      onkeydown='if (event.keyCode==27) event.returnValue=false;'
      >\$EditText</textarea><br />
    <input type='submit' name='post' value=' $[Save] ' />");
  SDV($HandleEditFmt, array(&$PageStartFmt, &$PageEditFmt, &$PageEndFmt));
  PrintFmt($pagename, $HandleEditFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:48,代码来源:pmwiki.php

示例3: PmFormSave

function PmFormSave($pagename, $msgtmpl, $opt, $safe_opt)
{
    global $IsPagePosted;
    Lock(2);
    $saveto = MakePageName($pagename, $safe_opt['saveto']);
    $target = @$opt['target'];
    $page = ReadPage($saveto);
    if (preg_match("/.*\\(:pmform +{$target}( .*?)?:\\).*\n?/", @$page['text'], $mark)) {
        $mark_opt = ParseArgs($mark[1]);
        $mark_opt['=mark'] = $mark[0];
        $opt = array_merge($opt, $mark_opt);
        $safe_opt = array_merge($safe_opt, $mark_opt);
    }
    if (!@$mark) {
        $page = RetrieveAuthPage($saveto, 'edit', true);
        if (!$page) {
            return '$[Edit permission required]';
        }
    }
    $new = $page;
    $text = @$new['text'];
    $errors = NULL;
    if (preg_match('/\\S/', $msgtmpl)) {
        $msgtext = FmtTemplateVars($msgtmpl, $opt, $saveto);
        $errors = PmFormUpdateText($saveto, $text, $msgtext, $opt, $safe_opt);
    }
    if (!$errors && @$opt['savevars']) {
        $errors = PmFormUpdateVars($saveto, $text, $opt);
    }
    if (!$errors) {
        $new['text'] = $text;
        UpdatePage($saveto, $page, $new);
        if (!$IsPagePosted) {
            return '$[Unable to save page]';
        }
    }
    return $errors;
}
开发者ID:jefmud,项目名称:pmwiki-kit-bootstrap-compass,代码行数:38,代码来源:pmform.php

示例4: DeleteCompany

     DeleteCompany($DeleteId);
 }
 if (ValidId($DeleteHost)) {
     DeleteHost($EditId, $DeleteHost);
 }
 if ($HostId == "new" && ValidArr($EditArr)) {
     CreateNewHost($EditId, $EditArr);
 }
 if (ValidId($HostId) && !ValidVar($EditPage) && !ValidVar($EditEvent) && ValidArr($EditArr)) {
     UpdateHost($HostId, $EditArr);
 }
 if ($EditPage == "new" && ValidArr($EditArr)) {
     AddSitePage($HostId, $EditArr);
 }
 if (ValidId($EditPage) && ValidArr($EditArr)) {
     UpdatePage($EditPage, $EditArr);
 }
 if (ValidId($DeletePage)) {
     DeletePage($DeletePage);
 }
 if (ValidId($EditEvent) && ValidArr($EditArr2)) {
     UpdateQuery($EditEvent, $EditArr2);
 }
 if (ValidVar($EditEvent) == "new" && ValidId($EventPage) && ValidArr($EditArr2)) {
     CreateQuery($EventPage, $EditArr2);
 }
 if (ValidId($DeleteEvent)) {
     DeleteQuery($DeleteEvent);
 }
 if (ValidId($HostId) && ValidVar($NewHost)) {
     CreateNewSiteHost($HostId, $NewHost);
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.company.php


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