/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: links.inc.php,v 1.12 2003/03/10 12:27:12 panda Exp $
+// $Id: links.inc.php,v 1.13 2003/03/10 12:35:19 panda Exp $
//
function plugin_links_action()
}
return plugin_links_initdata();
}
-
+function &plugin_links_get_objects($page)
+{
+ static $obj;
+
+ if (!isset($obj))
+ {
+ $obj = new InlineConverter(array('url','mailto','interwiki','page','auto'));
+ }
+
+ return $obj->get_objects(join('',preg_grep('/^(?!\/\/|\s)./',get_source($page))),$page);
+}
function plugin_links_initdata()
{
global $whatsnew;
$pages[$row['name']] = $row['id'];
}
- $obj = new InlineConverter(array('page','auto'));
foreach ($pages as $page=>$id)
{
- $links = $obj->get_objects(join('',preg_grep('/^(?!\/\/|\s)./',get_source($page))),$page);
+ $links = plugin_links_get_objects($page);
foreach ($links as $_obj)
{
if ($_obj->type != 'pagename')
}
$pages = get_existpages();
$ref = array(); // »²¾È¸µ
- $obj = new InlineConverter(array('page','auto'));
foreach ($pages as $page)
{
if ($page == $whatsnew)
}
$time = get_filetime($page);
$rel = array(); // »²¾ÈÀè
- $links = $obj->get_objects(join('',preg_grep('/^(?!\/\/|\s)./',get_source($page))),$page);
+ $links = plugin_links_get_objects($page);
foreach ($links as $_obj)
{
if (!isset($_obj->type) or $_obj->type != 'pagename')
// cache
$pages = array();
- $obj = new InlineConverter();
- $links = $obj->get_objects(join('',preg_grep('/^(?!\/\/|\s)./',get_source($page))),$page);
+ $links = plugin_links_get_objects($page);
foreach ($links as $_obj)
{
if (!isset($_obj->type) or $_obj->type != 'pagename' or $_obj->name == $page)
}
else // if (!defined('LINK_DB'))
{
- $obj = new InlineConverter();
$time = is_page($page) ? get_filetime($page) : 0;
$rel_old = array();
unlink($rel_file);
}
$rel_new = array(); // »²¾ÈÀè
- $links = $obj->get_objects(join('',preg_grep('/^(?!\/\/|\s)./',get_source($page))),$page);
+ $links = plugin_links_get_objects($page);
foreach ($links as $_obj)
{
if (!isset($_obj->type) or $_obj->type != 'pagename')