當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Versions::are_different方法代碼示例

本文整理匯總了PHP中Versions::are_different方法的典型用法代碼示例。如果您正苦於以下問題:PHP Versions::are_different方法的具體用法?PHP Versions::are_different怎麽用?PHP Versions::are_different使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Versions的用法示例。


在下文中一共展示了Versions::are_different方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: defined

 * elements of information.
 *
 * Add the option 'edit_as_thread' to activate this script in some article.
 *
 * @author Bernard Paques
 * @reference
 * @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
 */
// loaded from articles/view.php
defined('YACS') or exit('Script must be included');
// process uploaded data
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    // update an existing page
    if (isset($_REQUEST['id'])) {
        // remember the previous version
        if ($item['id'] && Versions::are_different($item, $_REQUEST)) {
            Versions::save($item, 'article:' . $item['id']);
        }
        // stop on error
        if (!Articles::put_attributes($_REQUEST) || is_object($overlay) && !$overlay->remember('update', $_REQUEST, 'article:' . $_REQUEST['id'])) {
            $item = $_REQUEST;
            $with_form = TRUE;
            // else display the updated page
        } else {
            // do whatever is necessary on page update
            Articles::finalize_update($anchor, $_REQUEST, $overlay, isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y', isset($_REQUEST['notify_watchers']) && $_REQUEST['notify_watchers'] == 'Y', isset($_REQUEST['notify_followers']) && $_REQUEST['notify_followers'] == 'Y');
            // cascade changes on access rights
            if ($_REQUEST['active'] != $item['active']) {
                Anchors::cascade('article:' . $item['id'], $_REQUEST['active']);
            }
            // the page has been modified
開發者ID:rair,項目名稱:yacs,代碼行數:31,代碼來源:edit_as_thread.php


注:本文中的Versions::are_different方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。