====== How to use your dokuwiki as a Weblog like tool ====== This little script is for adding quickly time-organised text-clips and urls with a [[wp>Bookmarklet]]. The idea is to have a button in your browser that adds a timestamped page to your wiki with the url,title and selected text of the webpage you visit. Since doku.php does not allow GET posting we need something to convert it properly and do some formatting. Now you can use your dokuwiki as a kind of browser-scrapbook/blog. Please write your experiences in the Notes section of this page. ====== How to install ====== - Create a file post2wiki.php and put the content below in it. Put in somewhere on your server. - Change the **SETUP** sections and make sure the $host and $dokuwikipath are set correctly - Make a standard bookmarklet by dragging the following link to your bookmarks (FireFox) or links (IE) toolbar: [[javascript:Q=document.selection?document.selection.createRange().text:document.getSelection(); void(window.open('http://myserver/post2wiki.php?te='+escape(Q)+' '+ escape(location.href)+'&ti='+escape(document.title),'dokuwikiadd','scrollbars=yes,resizable=yes,toolbars=yes,width=200,height=100,left=200,top=200,status=yes'));|DOKU THIS!]] You could get a security warning when doing this... - Take a look at the properties of the **DOKU THIS** link: - Change the http://myserver/post2wiki.php part of the bookmark to point to your post2wiki.php - strip the http://www.dokuwiki.org/ part from the beginning ====== The code ======
"); while(!feof($fp)) { $res .= fgets($fp, 128); } printf("
View/Edit this entry

Close this window"); fclose($fp); return $res; } $data = "id=$wikiid&wikitext=".stripslashes($wikitext)."&summary=$title&do=save"; printf("

Contacting server $host..."); $x = PostToHost($host, $dokuwikipath,$_SERVER['remote_addr'],$data,$targeturl); ?> ====== Notes ====== * I did not test this for UTF-8 * to copy the link, copy from the source of this page, not from the rendered page :) \\ , or just drag the "doku this" link to your link bar --- iDo the "doku this" link is //escaped// by dokuwiki: javascript:Q=document.selection?document.selection.createRange().text:document.getSelection(); void(window.open('http://myserver/post2wiki.php?te='+escape(Q)+'&ur='+ escape(location.href)+'&ti='+escape(document.title),'dokuwikiadd','scrollbars=yes,resizable=yes,toolbars=yes,width=200,height=100,left=200,top=200,status=yes')); --- robin Thanks for this code - I elaborated a bit on it, worked around the GET/POST issue and am on the way to make a dokuwiki-plugin out of it: http://mir.dnsalias.com/wiki/dokubookmark released [[plugin:dokubookmark]] into the wild. --- robin Hello guys, [[plugin:dokubookmark]] plugin was not maintained for few years and seems not compatible with the latest version of Dokuwiki “Igor”. I amended the original post2wiki.php code. The code may not look tidy but it works. I posted the code here [[https://github.com/edwardcodelab/bookmark2wiki]] and hope if anyone can help to make it better. Thank you.:-) --- edwardcodelab