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


PHP Diff::fetch_diff方法代码示例

本文整理汇总了PHP中Diff::fetch_diff方法的典型用法代码示例。如果您正苦于以下问题:PHP Diff::fetch_diff方法的具体用法?PHP Diff::fetch_diff怎么用?PHP Diff::fetch_diff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Diff的用法示例。


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

示例1: fclose

            fclose($fp);
        }
        $resetbutton = $onclickevent = $checkresult = '';
        if ($template['templateid'] != 1) {
            $defaulttpl = DISCUZ_ROOT . "./templates/default/{$fn}";
            if (file_exists($defaulttpl) && md5_file($defaulttpl) != md5_file($filename)) {
                $resetbutton = ' <input  style="vertical-align: middle" type="button" class="btn" value="' . $lang['templates_edit_reset'] . '" accesskey="r" onclick="location.href=\'' . $BASESCRIPT . '?action=templates&operation=edit&templateid=' . $template['templateid'] . '&fn=' . $fn . '&keyword=' . $keywordenc . '&reset=yes\'"> ' . (strtolower(fileext($fn)) == 'htm' ? '<input  style="vertical-align: middle" type="button" class="btn" value="' . $lang['templates_edit_diff'] . '" onclick="location.href=\'' . $BASESCRIPT . '?action=templates&operation=edit&templateid=' . $template['templateid'] . '&fn=' . $fn . '&keyword=' . $keywordenc . '&checktpl=yes\'"> ' : '');
            }
            $dellist = $addlist = array();
            if ($checktpl && strtolower(fileext($fn)) == 'htm') {
                $fp = @fopen($defaulttpl, 'rb');
                $defaultcontent = @fread($fp, filesize($defaulttpl));
                fclose($fp);
                require_once DISCUZ_ROOT . './include/diff.class.php';
                $a = new Diff($content, $defaultcontent);
                $entries = $a->fetch_diff();
                $result = '<br /><table class="tb tb2 nobdb" width="100%" border="0" cellpadding="0" cellspacing="0"><tr class="partition"><td>' . $lang['templates_edit_diff_current'] . '</td><td>&nbsp;</td><td>' . $lang['templates_edit_diff_default'] . '</td></tr>';
                foreach ($entries as $diff_entry) {
                    $result .= '<tr><th width="49.5%" valign="top" class="diff-' . $diff_entry->left_class() . '">' . $diff_entry->diff_text($diff_entry->left) . '</th><th width="1%">&nbsp;</th>' . '<th width="49.5%" valign="top" class="diff-' . $diff_entry->right_class() . '">' . $diff_entry->diff_text($diff_entry->right) . "</th></tr>";
                }
                $result .= '</table><br /><table class="tb tb2 nobdb" width="100%" border="0" cellpadding="4" cellspacing="0">' . '<tr><th class="diff-deleted" style="text-align: center">' . $lang['templates_edit_diff_deleted'] . '</th><th class="diff-notext">&nbsp;</th></tr>' . '<tr><th class="diff-changed" style="text-align: center" colspan="2">' . $lang['templates_edit_diff_changed'] . '&nbsp;</th></tr>' . '<tr><th class="diff-notext">&nbsp;</th><th class="diff-added" style="text-align: center">' . $lang['templates_edit_diff_added'] . '</th></tr></table>';
                $checkresult = $result;
            }
        } else {
            $onclickevent = 'onclick="return confirm(\'' . $lang['templates_edit_default_overwriteconfirm'] . '\')"';
        }
        $content = dhtmlspecialchars($content);
        $filemtime = date("{$dateformat} {$timeformat}", filemtime($filename));
        ?>
<script language="JavaScript">
var n = 0;
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:templates.inc.php


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