本文整理汇总了PHP中module::parseLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP module::parseLinks方法的具体用法?PHP module::parseLinks怎么用?PHP module::parseLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module
的用法示例。
在下文中一共展示了module::parseLinks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Header
$link = str_replace("\\{$i}", $matches[$i], $link);
}
$link = preg_replace('/\\\\(\\d+?)/is', '', $link);
$found = 1;
}
}
if (preg_match('/^moved:(.+)/is', $link, $matches)) {
Header("HTTP/1.1 301 Moved Permanently");
header("Location:" . $matches[1]);
exit;
}
include_once "./config.php";
include_once "./lib/loader.php";
if ($link != '') {
$mdl = new module();
$param_str = $mdl->parseLinks("<a href=\"{$link}\">");
if (preg_match("/<a href=\".+?\\?pd=(.*?)&(.+)\">/", $param_str, $matches)) {
$pd = $matches[1];
$other = $matches[2];
$tmp = explode('&', $other);
foreach ($tmp as $pair) {
$tmp2 = explode('=', $pair);
$_GET[$tmp2[0]] = $tmp2[1];
${$tmp2[0]} = $tmp2[1];
}
} elseif (preg_match("/<a href=\".+?\\?pd=(.*?)\">/", $param_str, $matches)) {
$pd = $matches[1];
}
} else {
header("HTTP/1.0 404 Not Found");
echo "The page cannot be found. Please use <a href='/'>this link</a> to continue browsing.";
示例2: context
//.........这里部分代码省略.........
$keywords["cm('" . $k] = $k;
$tmp = explode('.', $k);
$keywords["->callMethod('" . $tmp[1]] = $tmp[1];
$keywords["->callMethod(\"" . $tmp[1]] = $tmp[1];
}
}
//print_r($keywords);echo "<br>";
$mdl = new module();
//processing body for keywords
//...
//processing keywords
foreach ($keywords as $k => $v) {
//scripts
$scripts = SQLSelect("SELECT ID, TITLE FROM scripts WHERE (CODE LIKE '%" . DBSafe($k) . "%' OR TITLE LIKE '" . DBSafe($v) . "')");
$total = count($scripts);
for ($i = 0; $i < $total; $i++) {
if (!$found['script' . $scripts[$i]['ID']]) {
$rec = array();
$rec['TYPE'] = 'script';
$rec['TITLE'] = $scripts[$i]['TITLE'];
$rec['LINK'] = '/admin.php?action=scripts&md=scripts&inst=adm&view_mode=edit_scripts&id=' . $scripts[$i]['ID'];
$found['script' . $scripts[$i]['ID']] = $rec;
}
}
//objects
$objects = SQLSelect("SELECT ID, TITLE, CLASS_ID FROM objects WHERE (TITLE LIKE '" . DBSafe($v) . "')");
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
if (!$found['object' . $scripts[$i]['ID']]) {
$rec = array();
$rec['TYPE'] = 'object';
$rec['TITLE'] = $objects[$i]['TITLE'];
$rec['LINK'] = "?(panel:{action=classes}classes:{view_mode=edit_classes,instance=adm,tab=objects,id=" . $objects[$i]['CLASS_ID'] . "})&md=objects&view_mode=edit_objects&id=" . $objects[$i]['ID'];
$result = $mdl->parseLinks("<a href=\"" . $rec['LINK'] . "\">");
if (preg_match('/\\?pd=.+"/', $result, $m)) {
$rec['LINK'] = '/admin.php' . $m[0];
}
$found['object' . $objects[$i]['ID']] = $rec;
}
}
//methods
$methods = SQLSelect("SELECT methods.ID, methods.TITLE, classes.TITLE as CLASS, objects.TITLE as OBJECT, methods.CLASS_ID, methods.OBJECT_ID FROM methods LEFT JOIN classes ON methods.CLASS_ID=classes.ID LEFT JOIN objects ON methods.OBJECT_ID=objects.ID WHERE (methods.CODE LIKE '%" . DBSafe($k) . "%' OR methods.TITLE LIKE '" . DBSafe($v) . "')");
$total = count($methods);
for ($i = 0; $i < $total; $i++) {
if (!$found['method' . $methods[$i]['ID']]) {
$rec = array();
$rec['TYPE'] = 'method';
$rec['TITLE'] = $methods[$i]['TITLE'];
if ($methods[$i]['OBJECT_ID']) {
$rec['LINK'] = "?(panel:{action=classes}classes:{view_mode=edit_classes,instance=adm,tab=objects,id=" . $methods[$i]['CLASS_ID'] . "})&md=objects&view_mode=edit_objects&id=" . $methods[$i]['OBJECT_ID'] . "&tab=methods&overwrite=1&method_id=" . $methods[$i]['ID'];
$rec['TITLE'] = $methods[$i]['OBJECT'] . '.' . $rec['TITLE'];
} else {
$rec['LINK'] = "?(panel:{action=classes}classes:{view_mode=edit_classes,instance=adm,tab=methods,id=" . $methods[$i]['CLASS_ID'] . "})&md=methods&view_mode=edit_methods&id=" . $methods[$i]['ID'];
$rec['TITLE'] = $methods[$i]['CLASS'] . ' (class).' . $rec['TITLE'];
}
$result = $mdl->parseLinks("<a href=\"" . $rec['LINK'] . "\">");
if (preg_match('/\\?pd=.+"/', $result, $m)) {
$rec['LINK'] = '/admin.php' . $m[0];
}
$found['method' . $methods[$i]['ID']] = $rec;
}
}
//properties
$properties = SQLSelect("SELECT properties.ID, properties.TITLE, classes.TITLE as CLASS, objects.TITLE as OBJECT, properties.CLASS_ID, properties.OBJECT_ID FROM properties LEFT JOIN classes ON properties.CLASS_ID=classes.ID LEFT JOIN objects ON properties.OBJECT_ID=objects.ID WHERE (properties.TITLE LIKE '" . DBSafe($v) . "')");
$total = count($properties);
for ($i = 0; $i < $total; $i++) {