本文整理汇总了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> </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%"> </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"> </th></tr>' . '<tr><th class="diff-changed" style="text-align: center" colspan="2">' . $lang['templates_edit_diff_changed'] . ' </th></tr>' . '<tr><th class="diff-notext"> </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;