ファイルの編集箇所はPukiWikiでの別窓リンク方法と似ているのだが、編集箇所の一部が違うのでメモ
使い方はPukiWikiでの場合と同じでURLの先頭に”+”を付加する
# cd [XOOPS_TRUST_PATH]/modules/xpwiki/class # cp make_link.php make_link.php- # chown root.root make_link.php- # chmod 400 make_link.php- # vi make_link.php
以後の書き換える場所は、xpwikiのバージョンによって変化
ver 4.x
ver 5.x
-( # (3) url - (?:(?:https?|ftp|news):\/\/|mailto:)[\w\/\@\$()!?&%#:;.,~'=*+-]+ -)_/_/_/_/_/
+( # (3) url + (?:(?:\+?https?|\+?ftp|\+?news):\/\/|mailto:)[\w\/\@\$()!?&%#:;.,~'=*+-]+ +)
- $img = ($this->is_image)? ' type="img"' : ''; - return '<a href="'.$this->name.'"'.$title.$rel.$class.$img.$target.'>'.$this->alias.'</a>';_/_/_/_/_/
+ $img = ($this->is_image)? ' type="img"' : ''; + if (ereg("^(\+)(.*)", $this->name, $regs)) { + return '<a href="' . $regs[2] . '" target="_blank" ' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>'; + }else{ + return '<a href="' . $this->name . '"' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>'; + }
-( # (3) scheme - (?:(?:https?|ftp|news):\/\/|mailto:) -)_/_/_/_/_/
+( # (3) scheme + (?:(?:\+?https?|\+?ftp|\+?news):\/\/|mailto:) +)
- return '<a href="'.$this->name.'"'.$title.$rel.$class.$img.$target.'>'.$this->alias.'</a>'.$host;_/_/_/_/_/
+ if (ereg("^(\+)(.*)", $this->name, $regs)) { + return '<a href="' . $regs[2] . '" target="_blank" ' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>' . $host; + }else{ + return '<a href="' . $this->name . '"' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>' . $host; + }
-( # (3) url - (?:(?:https?|ftp|news|site):\/\/|mailto:)[\w\/\@\$()!?&%#:;.,~'=*+-]+ -)_/_/_/_/_/
+( # (3) url + (?:(?:\+?https?|\+?ftp|\+?news|\+?site):\/\/|mailto:)[\w\/\@\$()!?&%#:;.,~'=*+-]+ +)
- $img = ($this->is_image)? ' type="img"' : ''; - return '<a href="'.$this->name.'"'.$title.$rel.$class.$img.$target.'>'.$this->alias.'</a>';_/_/_/_/_/
+ $img = ($this->is_image)? ' type="img"' : ''; + if (ereg("^(\+)(.*)", $this->name, $regs)) { + return '<a href="' . $regs[2] . '" target="_blank" ' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>'; + }else{ + return '<a href="' . $this->name . '"' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>'; + }
-( # (3) scheme - (?:(?:https?|ftp|news|site):\/\/|mailto:) -)_/_/_/_/_/
+( # (3) scheme + (?:(?:\+?https?|\+?ftp|\+?news|\+?site):\/\/|mailto:) +)
- return '<a href="'.$this->name.'"'.$title.$rel.$class.$img.$target.'>'.$this->alias.'</a>'.$host;_/_/_/_/_/
+ if (ereg("^(\+)(.*)", $this->name, $regs)) { + return '<a href="' . $regs[2] . '" target="_blank" ' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>' . $host; + }else{ + return '<a href="' . $this->name . '"' . $title.$rel.$class.$img.$target . '>' . $this->alias . '</a>' . $host; + }