* @based_on http://wiki.splitbrain.org/wiki:tips:weblog_bookmarklet by riny [at] bk [dot] ru
*/
/**
* - TODO this should use the dokuwiki template header.
*/
function printHeader() {
global $conf;
?>
Dokuwiki Website Tagger
use this
if (!strstr($data['selection'], ' '))
$n=$data['selection'];
# check if title is a not empty
if (empty($n))
$n=$data['title'];
# if still empty.. mmh - use URL or use 'noname'
if (empty($n)) $n='noname';
#-> replace ': ' and ASCIIfy
$n=strtr($n, ': ','__');
# [^\x20-\x7E] or [^A-Za-z_0-9]
$n=preg_replace('@[^A-Za-z_0-9]@', '', $n);
$n=preg_replace('@__*@', '_', $n);
# trim to 64 chars.
$data['name']=substr($n,0,64);
}
# TODO: replace Placeholders alike ../../../inc/common.php pageTemplate() ?!
return str_replace("@D@",$data['timestamp'],
str_replace("@S@",$data['selection'],
str_replace("@U@",$data['url'],
str_replace("@N@",$data['name'],
str_replace("@F@",$data['foo'],
str_replace("@T@",$data['title'], $idx))))));
}
/**
*
*/
function printForm ($data, $options, $alltags = NULL) {
global $ID;
global $REV;
global $DATE;
global $PRE;
global $SUF;
global $INFO;
global $SUM;
global $lang;
global $conf;
global $TEXT;
global $RANGE;
$SUM = htmlentities($data['title'], ENT_COMPAT, 'UTF-8');
echo '
'.NL;
}
/**
* - unused javascript redirect/POST -
*
* - could be made into a non-interactive bookmarklet -
*/
function printPost($targeturl, $path, $wikiid, $timestamp, $title, $wikitext) {
?>