Not logged in. · Lost password · Register

All posts by jheckmann (15)

topic: Securing shared server/subdomain installation of DokuWiki (Proposed directory structure, files, config settings and permissions)  in the forum: General Help and Support Installation and Configuration
Avatar
jheckmann #1
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
OK, figured out that my secure version should be:

mywiki
 (bin deleted)
 data (change savedir config setting from ./data to ../data)
 conf
 inc
 lib
 html
  doku.php
  prepend.php
html
 index.php (for mydomain.com cms)
php.ini

basedir is /
baseurl is http://mywiki.mydomain.com

prepend.php contains:
<?php
define('DOKU_CONF','/home/com/mydomain/dokuwiki/conf/'); 
define('DOKU_INC','/home/com/mydomain/dokuwiki/');

php.ini was modified with:
auto_prepend_file = "prepend.php" 

permissions on /conf, /data, /inc and /lib were set to 700
permissions on files in /mywiki/html were set to 700 or 600

all this seems to work
however
the symbolic link to /lib is not working
this link is in /mywiki/html and is:  lib -> ../lib
i also tried:  lib -> /home/u4/myname/mywiki/lib
and:  lib -> /home/com/mydomain/mywiki/lib

still struggling...
This post was edited on 2008-07-31, 01:10 by jheckmann.
topic: Securing shared server/subdomain installation of DokuWiki (Proposed directory structure, files, config settings and permissions)  in the forum: General Help and Support Installation and Configuration
Avatar
jheckmann #2
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
Subject: Securing shared server/subdomain installation of DokuWiki
Please help me (and others with a similar situation) secure my Dokuwiki. 

I've studied http://wiki.splitbrain.org/wiki:install:permissions and  http://wiki.splitbrain.org/wiki:security and am having trouble understanding how to apply the information to my situation.  I struggle with Unix and would create needed files in Windows (notepad2) and ftp them to the server and use Windows tools or hosting plan's control panel to change permissions.

My understanding for the general case is as follows.


DokuWiki directory structure as installed is not secure:
www
 mywiki (renamed from dokuwiki)
  bin
  conf
  data
  inc
  lib
  doku.php

secure would be:
dokuwiki (new directory created at same level as www)
 (bin deleted)
 data (change savedir config setting from ./data to what?)  <--Question 1
 conf
 inc
 lib
www
 mywiki
  doku.php
  prepend.php
php.ini


Is the above understanding correct?  <--Question 2

BUT...
My situation is a shared server, with DokuWiki installed in a subdomain of my existing website built with a php cms.

Current directory structure as installed is not secure:
mywiki (renamed from dokuwiki)
 html
  bin
  conf
  data
  inc
  lib
  doku.php
html
 index.php (for mydomain.com cms)
php.ini (existing)

current configuration settings:
baseurl is http://mywiki.mydomain.com
basedir is /


secure would be:
dokuwiki (new directory created at same level as html for existing website)
 (bin deleted)
 data (change savedir config setting from ./data to what?)  <--Question 3
 conf
 inc
 lib
mywiki
 html
  doku.php
  prepend.php
html
 index.php (for mydomain.com cms)
php.ini

baseurl is still http://mywiki.mydomain.com (path to doku.php)
basedir is still /

is this correct?  <--Question 4


per phpinfo, currently (not secure) document_root = /home/com/mydomain/mywiki/html
therefore prepend.php should contain:
<?php
define('DOKU_CONF','/home/com/mydomain/dokuwiki/conf/');  
define('DOKU_INC','/home/com/mydomain/dokuwiki/');

is this correct?   <--Question 5

per phpinfo, auto_prepend_file local value is not set
set via php.ini:
auto_prepend_file = "prepend.php"  


is this correct?   <--Question 6

will prepend.php have any effect on the existing php cms? (my guess is no)   <--Question 7

per http://forum.dokuwiki.org/thread/1566,
fmode and dmode should be set to 600/700
permissions on dokuwiki and subfolders/files also set to 600/700
mywiki and subfolders/files permissions should also be 600/700

is the above correct?   <--Question 8
topic: Images aren't Visible. Any Idea? (some help would much appreciated)  in the forum: General Help and Support Features and Functionality
Avatar
jheckmann #3
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 7591
Andi, you're absolutely correct.

I did a complete reinstall of Dokuwiki, installed notepad2 on my Windows XP Pro per the link you provided, and opened, encoded and saved every file I had created or changed.  All but one of these opened as ANSI - lang.php in /inc/en/ opened as UTF-8 with signature (BOM).

I replaced this re-encoded lang.php in the old install, and the images appeared.

I sincerely hope this helps someone else whose images are not displaying.

Thank you, Andi.

PS  Here is a useful tool, paste a URL into it and it will tell you whether a BOM is present in the page:
http://people.w3.org/rishida/utils/bomtester/index.php
I hope this is helpful.
This post was edited on 2008-07-31, 17:09 by jheckmann.
topic: Images aren't Visible. Any Idea? (some help would much appreciated)  in the forum: General Help and Support Features and Functionality
Avatar
jheckmann #4
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 7512
Looking at the apache access.log in the local development environment, would this seem to indicate that when the page syntax.txt loads, the image dokuwiki-128.png is found successfully and cached (206 first time), found successfully on refresh (200 second time)?  Which would rule out permission problems, images missing... seems to narrow it down to images processed via fetch.php are missing (other images display ok).

127.0.0.1 - - [14/Jul/2008:10:03:49 -0400] "GET /avidflyerwiki/ HTTP/1.1" 302 -
127.0.0.1 - - [14/Jul/2008:10:03:49 -0400] "GET /avidflyerwiki/doku.php HTTP/1.1" 200 17265
127.0.0.1 - - [14/Jul/2008:10:03:51 -0400] "GET /avidflyerwiki/lib/tpl/monobook/common/print.css HTTP/1.1" 200 1047
127.0.0.1 - - [14/Jul/2008:10:03:51 -0400] "GET /avidflyerwiki/lib/exe/indexer.php?id=start&1216044231 HTTP/1.1" 200 45
127.0.0.1 - - [14/Jul/2008:10:03:58 -0400] "GET /avidflyerwiki/doku.php?id=wiki:admin:dokuwiki HTTP/1.1" 200 15402
127.0.0.1 - - [14/Jul/2008:10:03:59 -0400] "GET /avidflyerwiki/lib/exe/indexer.php?id=wiki%3Aadmin%3Adokuwiki&1216044239 HTTP/1.1" 200 45
127.0.0.1 - - [14/Jul/2008:10:04:04 -0400] "GET /avidflyerwiki/doku.php?id=wiki:syntax HTTP/1.1" 200 59021
127.0.0.1 - - [14/Jul/2008:10:04:05 -0400] "GET /avidflyerwiki/lib/exe/fetch.php?w=&h=&cache=cache&media=wiki:dokuwiki-128.png HTTP/1.1" 206 32771
127.0.0.1 - - [14/Jul/2008:10:04:06 -0400] "GET /avidflyerwiki/lib/exe/fetch.php?w=50&h=&cache=cache&media=wiki:dokuwiki-128.png HTTP/1.1" 206 6489
127.0.0.1 - - [14/Jul/2008:10:04:06 -0400] "GET /avidflyerwiki/lib/exe/fetch.php?w=200&h=50&cache=cache&media=wiki:dokuwiki-128.png HTTP/1.1" 206 19094
127.0.0.1 - - [14/Jul/2008:10:04:07 -0400] "GET /avidflyerwiki/lib/exe/indexer.php?id=wiki%3Asyntax&1216044245 HTTP/1.1" 200 45
127.0.0.1 - - [14/Jul/2008:10:04:20 -0400] "GET /avidflyerwiki/doku.php?id=wiki:syntax HTTP/1.1" 200 59021
127.0.0.1 - - [14/Jul/2008:10:04:21 -0400] "GET /avidflyerwiki/lib/exe/css.php?s=all&t=monobook HTTP/1.1" 200 3817
127.0.0.1 - - [14/Jul/2008:10:04:22 -0400] "GET /avidflyerwiki/lib/exe/css.php?t=monobook HTTP/1.1" 200 16099
127.0.0.1 - - [14/Jul/2008:10:04:22 -0400] "GET /avidflyerwiki/lib/exe/css.php?s=print&t=monobook HTTP/1.1" 200 10064
127.0.0.1 - - [14/Jul/2008:10:04:23 -0400] "GET /avidflyerwiki/lib/exe/js.php?edit=0&write=0 HTTP/1.1" 200 63266
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/common/wikibits.js HTTP/1.1" 200 23066
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/user/favicon.ico HTTP/1.1" 200 742
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/monobook/main.css HTTP/1.1" 200 25027
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/common/print.css HTTP/1.1" 200 1047
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/common/commonPrint.css HTTP/1.1" 200 5567
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/doku.css HTTP/1.1" 200 7527
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/lang/en/lang.css HTTP/1.1" 200 -
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/user/Common.css HTTP/1.1" 200 -
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/wikipedia/en/Common.css HTTP/1.1" 200 14342
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/wikipedia/en/Monobook.css HTTP/1.1" 200 7605
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/button-dw.png HTTP/1.1" 200 3459
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/button-rss.png HTTP/1.1" 200 280
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/button-mb.png HTTP/1.1" 200 3560
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/button-xhtml.png HTTP/1.1" 200 321
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/button-css.png HTTP/1.1" 200 299
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/button-php.gif HTTP/1.1" 200 269
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/tpl/monobook/user/Monobook.css HTTP/1.1" 200 -
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_cool.gif HTTP/1.1" 200 172
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_eek.gif HTTP/1.1" 200 170
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_sad.gif HTTP/1.1" 200 171
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_smile.gif HTTP/1.1" 200 174
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_smile2.gif HTTP/1.1" 200 174
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_doubt.gif HTTP/1.1" 200 990
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_doubt2.gif HTTP/1.1" 200 992
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_confused.gif HTTP/1.1" 200 171
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_biggrin.gif HTTP/1.1" 200 172
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_razz.gif HTTP/1.1" 200 176
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_surprised.gif HTTP/1.1" 200 174
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_silenced.gif HTTP/1.1" 200 231
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_neutral.gif HTTP/1.1" 200 171
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_wink.gif HTTP/1.1" 200 170
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_fun.gif HTTP/1.1" 200 590
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_question.gif HTTP/1.1" 200 248
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_exclaim.gif HTTP/1.1" 200 236
127.0.0.1 - - [14/Jul/2008:10:04:26 -0400] "GET /avidflyerwiki/lib/images/smileys/icon_lol.gif HTTP/1.1" 200 336
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/images/smileys/fixme.gif HTTP/1.1" 200 1435
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/images/smileys/delete.gif HTTP/1.1" 200 1421
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/tpl/monobook/monobook/headbg.jpg HTTP/1.1" 200 7881
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/tpl/monobook/monobook/bullet.gif HTTP/1.1" 200 50
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/images/interwiki/doku.gif HTTP/1.1" 200 257
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/images/interwiki/wp.gif HTTP/1.1" 200 680
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/images/interwiki/dokubug.gif HTTP/1.1" 200 166
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/tpl/monobook/user/logo.png HTTP/1.1" 200 7843
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/tpl/monobook/monobook/user.gif HTTP/1.1" 200 932
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/plugins/gallery/images/loading.gif HTTP/1.1" 200 2230
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/plugins/gallery/images/expand.gif HTTP/1.1" 200 209
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/plugins/gallery/images/close.gif HTTP/1.1" 200 99
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/plugins/gallery/images/next.gif HTTP/1.1" 200 93
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/plugins/gallery/images/prev.gif HTTP/1.1" 200 94
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/tpl/monobook/monobook/external.png HTTP/1.1" 200 165
127.0.0.1 - - [14/Jul/2008:10:04:27 -0400] "GET /avidflyerwiki/lib/tpl/monobook/dokuwiki/tocdot2.gif HTTP/1.1" 200 810
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/exe/fetch.php?w=200&h=50&cache=cache&media=wiki:dokuwiki-128.png HTTP/1.1" 200 19094
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/exe/indexer.php?id=wiki%3Asyntax&1216044261 HTTP/1.1" 200 45
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/exe/fetch.php?w=&h=&cache=cache&media=wiki:dokuwiki-128.png HTTP/1.1" 200 32771
127.0.0.1 - - [14/Jul/2008:10:04:24 -0400] "GET /avidflyerwiki/lib/exe/fetch.php?w=200&h=50&cache=cache&media=http%3A%2F%2Fde3.php.net%2Fimages%2Fphp.gif HTTP/1.1" 302 3
127.0.0.1 - - [14/Jul/2008:10:04:25 -0400] "GET /avidflyerwiki/lib/exe/fetch.php?w=50&h=&cache=cache&media=wiki:dokuwiki-128.png HTTP/1.1" 200 6489
topic: Images aren't Visible. Any Idea? (some help would much appreciated)  in the forum: General Help and Support Features and Functionality
Avatar
jheckmann #5
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 7379
Xsendfile options in Configuration Manager are untouched.

Binary download - images look just fine.  Display perfectly in Firefox from an .html page with <img> tags, created in the same directory as doku.php.

I use the DokuWiki syntax page as my test; dokuwiki-128.png is supposed to appear several times on that page.  The images appeared when DokuWiki was first installed; now they no longer appear.  Right click where the image should be, display in new tab, get the detail page for the image but the image is not displayed, just a link.  Interesting - on reload of this detail page, Firefox briefly displays a broken image box in place of the link, then immediately it goes away and is replaced by the link.

While setting up DokuWiki in a local development environment (EasyPHP on XP), this problem happened again.  The syntax page images were displayed at first, now they're not displayed anymore.  Clearing browser cache, /data/cache, forcing the page to reload, nothing helps. 

While researching this problem I came across a Mozilla bug report for the same message (cannot be displayed... contains errors).  Nothing was wrong with the images they used to test.  It was a caching problem with the browser, which was fixed (quite awhile ago).  They followed a very methodical process to narrow down and reproduce the problem.  FWIW:  https://bugzilla.mozilla.org/show_bug.cgi?id=121084.  A brief description:

Sometimes images aren't displayed on their prospective pages, and when I right click on the image and go to "display image" it gives me a message with the following error message.
- The image "[image name]" cannot be displayed because it contains errors. What can I do?
This is a known bug that is being worked on. The image itself is fine, i.e. it contains no errors.
The reason for this behavior appears to be the fact that Mozilla - depending on your Cache settings - requests the image twice. It only appears on websites that do not allow images to be linked to/called directly from outside of their pages. Since Mozilla does not send the referrer (i.e. web address of the page where the file is linked from) the second time it requests the image, the website sends an "access denied" page in HTML form where Mozilla is expecting an image, hence the error messsage (Mozilla tries to display an image when it receives an HTML page, so for the browser, the "image" contains an error).  Solution: Change your cache settings to "Compare the page in the cache to the page on the network When the page is out of date". To do so, select "Edit" -> "Preferences" -> "Advanced" -> "Cache". 

Makes me wonder if DokuWiki is doing something similar?

I've spent days trying to figure this out.  I initially liked DokuWiki.  Now I'm about ready to give it up.  It's just not worth this much of my time, and trying to find an answer or even a path to follow to debug this in the manual or the forums seems more difficult than it should be.
topic: Images aren't Visible. Any Idea? (some help would much appreciated)  in the forum: General Help and Support Features and Functionality
Avatar
jheckmann #6
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 7278
I have this same problem.

The Media Manager uploads images just fine; they can be accessed and viewed outside of the wiki.  I get the same error using the magnifier in Media Manager.

I deleted all files in /data/cache, except _dummy of course, but that didn't help.
topic: [solved] Embed / include Javascript in a page (Using Dynamic Drive's email riddler script to encrypt an email address within a page)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #7
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 7091
Quote by ach on 2008-06-11, 02:28:
Firstly, the page you are referring to (http://wiki.splitbrain.org/wiki:devel:javascript) is NOT intended for small JavaScript snippets like yours.

Thank you... it may be helpful to others if this would be STATED CLEARLY on that page, or somewhere.  It ain't obvious.
Quote by ach on 2008-06-11, 02:28:
Here are the simplest ways (none should take more than five minutes) of including JavaScript snippets ("the dirty way"):
Agreed, these are all "dirty" and introduce maintenance or security problems as you point out.  When I said it was "not possible", I didn't mean that some way couldn't be found to hack it in.  I meant it didn't seem to be a feature, or part of the design of DokuWiki, to allow the insertion of this kind of code.  

Quote by ach on 2008-06-11, 02:28:
Well, I can see several errors at once ... ;-)

Well, OK, you have more training/experience in this particular language than I do.  I'm retired on disability, struggling along with open source/free tools, self-taught.  I appreciate Forums like this one where someone like me can learn from those who are willing to share their knowledge.

JSLint didn't exist when I learned Javascript.  The language evolved when I wasn't looking...<sigh>
topic: [solved] Embed / include Javascript in a page (Using Dynamic Drive's email riddler script to encrypt an email address within a page)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #8
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 6989
Quote by chi on 2008-06-01, 17:15:
Quote by jheckmann:
I already have that set.  This is for a link to contact the administrator.  How do I embed that within a page's content?  What am I missing here?

The thing is that your script does something similar as the mailguard setting, except that it doesn't scramble the email address to be represented as hex values but as ASCII (I can actually "read" the mail address by looking at the "emailriddlerarray"), which makes it rather pointless (this has hardly has anything to do with encryption).

Of course, you are entitled to your opinion.  Remember, some of us who are new to Dokuwiki have been creating websites "the old way".  This script has proved itself; yes, you can "read" the email address, but it completely foils automated readers.  The sites it has been used on receive no spam, which is the point ;-).

As I tried to explain before, I'm trying to create a page that a wiki reader can use to contact the administrator, and at the same time protect the administrator email address from spam.  Is there something about mailguard that would help me do both?  If so, please explain it.
topic: [solved] Embed / include Javascript in a page (Using Dynamic Drive's email riddler script to encrypt an email address within a page)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #9
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 6982
This will be workable for me:

http://wiki.splitbrain.org/plugin:contact

I think I may not be the only person new to DokuWiki who has some HTML and JavaScript experience, who doesn't immediately see that a simple embedded Javascript with a document.write isn't compatible with DokuWiki, and (I think) would have to be replaced with a plugin, not something a beginner would do right away.
topic: [solved] Embed / include Javascript in a page (Using Dynamic Drive's email riddler script to encrypt an email address within a page)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #10
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 6959
I already have that set.  This is for a link to contact the administrator.  How do I embed that within a page's content?  What am I missing here?
topic: [solved] Embed / include Javascript in a page (Using Dynamic Drive's email riddler script to encrypt an email address within a page)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #11
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
Subject: [solved] Embed / include Javascript in a page
Well, this has been a frustrating morning.  Here's my account of the past few hours.  What am I doing wrong?  Please be gentle, I'm new.

How to include a simple Javascript script in a DokuWiki page

To avoid spam, we want to use the email riddler to encrypt a contact email address within a DokuWiki page.

We get the following generated code from the script wizard:

<script type="text/javascript">
/*<![CDATA[*/

/***********************************************
* Encrypt Email script- Please keep notice intact
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/
<!-- Encrypted version of: avidwiki [at] ****************.*** //-->

var emailriddlerarray=[97,118,105,100,119,105,107,105,64,114,111,99,104,101,115,116,101,114,115,121,115,116,101,109,115,46,99,111,109]
var encryptedemail_id32='' //variable to contain encrypted email
for (var i=0; i<emailriddlerarray.length; i++)
 encryptedemail_id32+=String.fromCharCode(emailriddlerarray[i])

document.write('<a href="mailto:'+encryptedemail_id32+'?subject=Request for AvidWiki Support Product">Request it.</a>')

/*]]>*/
</script>

and save it in a Notepad file for later reference.

We read DokuWiki's documentation for including this script:

http://wiki.splitbrain.org/wiki:devel:javascript

Whew!  OK, let's decode this step by step.

First, we know we can't just paste this code into DokuWiki's editor for the page we want it in.  The documentation tells us we have to create a file named script.js in our template directory.  Which directory is that?  Much further in the documentation at JavaScript Dispatcher, we find the answer:

lib/tpl/*/script.js (only from current template)

which for us is:

/lib/tpl/monobook/script.js

Second, we know that the generated code was meant to be pasted into a .htm file as inline code.  It was not formatted as an external script (a .js file).  We need to delete the <script> and CDATA related tags at the beginning and end of the code. 

Third, we are told the Javascript code must pass the JSLint verifier.  We go to this tool, paste in the code, run the verifier, and it fails.  What now?

After an hour of research and fiddling with the code, there seems to be no good reason for the failure. Thinking about the intention behind this recommendation, and the philosophy of JSLint, we decide to go ahead and try the code as-is.

Next, we are told we need to do something with event handlers and DOM (document object model).  What?  This is getting confusing.

OK, here's the idea:  originally, the Javascript code would be placed within an HTML page right where it needed to be, the spot where the contact email address will appear.  Since we have moved the Javascript code to an external script, we need to give our code a name, and use that name to associate the code with the contact email address within the DokuWiki page.

It's a little unclear, but we have several choices for how to accomplish this - event handlers, inline scripts (isn't that where we started?!), and IDs.  Oh, and further in the documentation, include syntax.  What do we use?

Well, let's try inline script.  We look back at the original generated code and compare the tags; they're not quite the same, so we make the changes and embed the script into our DokuWiki page.

It doesn't work in Preview, nor after being Saved.  Now what?

Maybe include syntax?  This requires going back to a .js version, naming it something other than script.js, and adding a special comment in the DokuWiki page where the script should be run.  The script file needs to be placed in the same directory as the page .txt file.

OK, so I create emailriddler.js, place it in /data/pages/wiki/admin/, and edit my DokuWiki page to include the comment:

/* DOKUWIKI:include emailriddler.js */

That didn't work either.

It seems that embedding Javascript into a DokuWiki page using the editor is not possible.
This post was edited on 2008-07-02, 16:16 by jheckmann.
topic: Include JavaScript in dokuwiki template (editing main.php)  in the forum: General Help and Support Templates and Layout
Avatar
jheckmann #12
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 5605
For those who have a similar question and want to save a few minutes of hunting, here's the reference:

http://wiki.splitbrain.org/wiki:devel:javascript
topic: [solved]Syntax for _template.txt files (Need explanation/list for @xx@, ~~xx~~)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #13
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 6824
Thank you.  I was mislead by http://wiki.splitbrain.org/wiki:namespace_templates, which says:
There are a few replacement patterns you can use:

So, is @xx@ some sort of variable substitution, which may be one of those seven or from an installed plugin, and ~~xx~~ represents wiki formatted output from a plugin?
topic: [solved]Syntax for _template.txt files (Need explanation/list for @xx@, ~~xx~~)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #14
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 6821
Thank you, but that link is why I posted.  It contains only a partial list, not a complete list.  And it doesn't explain what @xx@ and ~~xx~~ are. 

I understand some of these patterns may belong to plugins.  How do I find them?  How are they documented?
topic: [solved]Syntax for _template.txt files (Need explanation/list for @xx@, ~~xx~~)  in the forum: General Help and Support Syntax and Usage
Avatar
jheckmann #15
Member since May 2008 · 15 posts
Group memberships: Members
Show profile · Link to this post
Subject: [solved]Syntax for _template.txt files
I've searched for two days for an explanation and list for @xx@ and ~~xx~~ in _template.txt files.

For example, I've found:
@TITLE@
@PAGE@
@TAG@
@NAME@
@TEXT@
@DISCUSSION@
@LINKBACK@
@BACK@
@DATE@
@FILES@
@AVATAR@
@USER@
@PRIORITY@


and

~~DISCUSSION~~
~~TASK~~

Somebody please give me a clue!  Be gentle, I'm new.

Thanks in advance.
This post was edited on 2008-07-14, 02:05 by jheckmann.
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-11-16, 21:17:03 (UTC +01:00)