PmWiki Index

Show last 10 recent changes

(:pagelist trail=Site.AllRecentChanges count=10 fmt=#simple:)

A couple table markup examples

PmWiki-Tables

My SideBar special links

%sidehead% Featured Pages
(:if !authid:)
* [[{$PageUrl}?action=login | Login]]

(:feralsimplecalendar:)
(:ifend:)
(:if authid:)
* [[Main/HomePage | Home]]
* [[Main/WikiSandbox]]
* [[{$PageUrl}?action=logout | Logout]]

(:feralsimplecalendar:)

%sidehead% My Sites (external)
* [[Games/HomePage | Games]]
* %newwin% [[http://music.wjsams.com|My Music]]
* %newwin% [[http://public.wjsams.com|Public]]

%sidehead% Special Links
* [[{$PageUrl}&action=edit | Edit]]
* [[{$PageUrl}&action=rename | Rename]]
* [[Site/RecentChanges]]
* [[Site/AllRecentChanges]]
* [[SiteAdmin/NotifyList]]
* [[Site/AuthUser]]
* [[{$PageUrl}&action=refcount|Find Missing Pages]]
* [[Site/GlossyHue-SiteHeader | Header]]
* [[Site/GlossyHue-SiteNav | Nav]]
* [[Site/GlossyHue-SiteFooter | Footer]]
* [[{$Group}/GroupAttributes?action=attr | Group Attributes]]
* [[{$Group}/GroupFooter | Group Footer]]
* [[{$Group}/GroupPrintFooter | Group Print Footer]]
* [[{$PageUrl}?action=attr | Page Attributes]]
* [[Main/CommentsTemplate | Comments Template]]
* [[Site/AuthForm | Auth. Form]]

>>comment<<
%sidehead% [[PmWiki/PmWiki]]
* [[PmWiki/Initial Setup Tasks]]  
* [[PmWiki/Basic Editing]]
* [[PmWiki/Documentation Index]]
* [[PmWiki/FAQ | PmWiki FAQ ]]
* [[PmWiki/PmWikiPhilosophy]]
* [[PmWiki/Release Notes]]
* [[PmWiki/ChangeLog]]

%sidehead% [[http://www.pmwiki.org | pmwiki.org ]]
* [[Cookbook:CookbookBasics | Cookbook (addons) ]]
* [[Cookbook:Skins | Skins (themes) ]]
* [[PITS:PITS | PITS (issue tracking) ]]
* [[PmWiki/Mailing Lists]]
>><<

%right% [-[[Site.SideBar?action=edit | edit SideBar]]-]
(:ifend:)

Putting a login and logout link in your sidebar

Just edit your SideBar and add the following wiki markup,

(:if !authid:)
* [[{$PageUrl}?action=login | Login]]
(:ifend:)
(:if authid:)
* [[{$PageUrl}?action=logout | Logout]]
(:ifend:)

Force SSL

Add the following to your .htaccess file.

# Forces SSL
RewriteCond %{SERVER_PORT} !443
RewriteCond %{SERVER_PORT} 80
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Clean URLs using .htaccess (Sometimes called Pretty URLs)

If you installed pmwiki in your root directory, say /var/www/localhost/htdocs@, add the following to /var/www/localhost/htdocs/.htaccess@@.

Make sure you have AllowOverride All or the setting that allows you to use .htaccess files on a per directory basis.

# Use mod_rewrite to enable "Clean URLs" for a PmWiki installation.
RewriteEngine On
# The rewrite base will be the document root.
RewriteBase /
# Forces SSL
RewriteCond %{SERVER_PORT} !443
RewriteCond %{SERVER_PORT} 80
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# Send requests without parameters to pmwiki.php.
RewriteRule ^$           index.php  [L]
# Send requests to pmwiki.php, appending the query string part.
RewriteRule ^([A-Z0-9\xa0-\xff].*)$ pmwiki.php?n=$1  [QSA,L]

If you have pmwiki installed in a different directory other than your root directory, say /var/www/localhost/htdocs/pmwiki, add the following to /var/www/localhost/htdocs/pmwiki/.htaccess.

### Pmwiki ###
# Use mod_rewrite to enable "Clean URLs" for a PmWiki installation.
RewriteEngine On
# Define the rewrite base.  It's not necessarily PmWiki's directory.
RewriteBase /pmwiki
# Forces SSL
RewriteCond %{SERVER_PORT} !443
RewriteCond %{SERVER_PORT} 80
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# Send requests without parameters to pmwiki.php.
RewriteRule ^$           pmwiki.php  [L]
# Send requests for index.php to pmwiki.php.
RewriteRule ^index\.php$ pmwiki.php  [L]
# Send requests to pmwiki.php, appending the query string part.
RewriteRule ^([A-Z0-9\xa0-\xff].*)$ pmwiki.php?n=$1  [QSA,L]

Now, open up your config.php file and make sure you have $EnablePathInfo set to 1 to enable Clean URLs.

Say your domain is http://www.example.com ».

If you installed pmwiki in your root directory, set the following variables in config.php as so,

$ScriptUrl = 'http://www.example.com';
$PubDirUrl = 'http://www.example.com/pub';

If you installed pmwiki in another directory as stated above, set the following variables in config.php as so,

$ScriptUrl = 'http://www.example.com/pmwiki';
$PubDirUrl = 'http://www.example.com/pmwiki/pub';

I also force SSL by adding the following to my config.php. Don't forget to change $ScriptUrl and $PubDirUrl to https or this won't work.

## Force SSL
if (@$_SERVER['HTTPS'] != 'on' && @$_SERVER['SERVER_PORT'] != '443') {
  header("Location: https://www.example.com");
  exit('<html><body>
    <a href="https://www.example.com">Please use SSL.</a>
    </body></html>');
}

Modifying skin template

In Glossy Hue, there's the Group and then Name right under the header. The Group is always a link, but the page name isn't a link by default.

I just opened up pub/skins/glossyhue/skin.tmpl and changed that portion of the template to read,

<h1><a href='{$ScriptUrl}/{$Group}/{$Name}'>{$Titlespaced}</a></h1>

How to change your edit buttons

Read the text in the red box below before adding gui buttons via a specific skin file.

I'm using the skin, GlossyHue », so I edit the file pub/skins/glossyhue/skin.php.

Just edit the entries beginning with $GUIButtons such as $GUIButtons['indent'].

The format is,

$GUIButtons['code'] = array(540, 'Start of markup', 'End of markup', 
     'Text displayed in the textarea of form', 'Text or image displayed in the buttons line above the textarea');

The 540 is a number representing the order the buttons will be in. The lower the number the further left and the higher the number the further right the buttons will show up.

If you aren't using GlossyHue », you should search for the skin file that is defining your $GUIButtons.

If you're not using a skin, or you don't want to edit gui buttons inside a skin file, just edit your config.php by adding lines like the following,

$GUIButtons['code'] = array(610,'%block code_box% [@\\n','\\n@]','Enter your code here.','$GUIButtonDirUrlFmt/code.png"Code Box"');

The following was to add a button for entering code boxes.

Making a framing around a picture


Tux Rocks
%lframe center rfloat% Attach:tux.png | '''Tux Rocks'''
[[<<]]

Notice the [[<<]] above. It is used to clear a line below the floated object. If not, it will just float off to the right and on top of things.


Managing users and passwords

This is pretty well documented at http://www.pmwiki.org/wiki/PmWiki/AuthUser », but still had some troubles.

Basically, you'll want to set $DefaultPasswords['admin'] = crypt('yourpassword'); in config.php.

This will allow you to login without a username - only using the provided password.

You must activate AuthUser to add users and passwords.

Once that is done, navigate to the page Site/AuthUser to add users. You must start each username or group at the very beginning of lines. The examples show a pound sign (#) in front. Don't do that. Just put them at the very beginning of the line as so,

The contents after username: should be entered first as (:encrypt your_password:). It will be encrypted as below once you save.

username: $1$Jp.iw0pw$UGG3MSroQgEJNiakR3RGM1
@group_name: joe, bob, sue
joe: @admin, @group_name

I added myself to the @lock group so that I don't have to use the admin password.

@lock: my_username

My config.php addons

## Add Allow HTML
#include_once("$FarmD/cookbook/enablehtml.php");
#EnableHtml('a|br|div|em|embed|form|hr|img|input|li|ol|option|p|pre|script|select|strike|strong|sub|sup|style|table|td|textarea|tr|tt|ul|!');

## Notification emails
ini_set('sendmail_from','Me <email@example.com>');
$EnableNotify = 1;
$NotifyList[] = 'notify=email@example.com';
$NotifySquelch = 60*1;

## Use "Clean URLs".
$EnablePathInfo = 1;
$ScriptUrl = "http://www.example.com";

## AuthUser
include_once("$FarmD/scripts/authuser.php");

## Enable direct downloads
$EnableDirectDownload = 1;

## Maximum Upload Size
$UploadMaxSize = 2000000000; # bytes

## obfuscate mailto-links
$LinkFunctions['mailto:'] = 'myLinkIMap';
## $IMapLinkFmt['mailto:'] = "<a class=\"urllink\" href=\"\$LinkUrl\">\$LinkText</a>";
function myLinkIMap($pagename,$imap,$path,$title,$txt,$fmt=NULL)
{
        if($txt{0}=='&') return LinkIMap($pagename,$imap,$path,$title,$txt,$fmt);
        global $FmtV, $IMap, $IMapLinkFmt, $UrlLinkFmt;
        $FmtV['$LinkUrl'] = obfuscate(PUE(str_replace('$1',$path,$IMap[$imap])));
        $FmtV['$LinkText'] = obfuscate($txt);
        $FmtV['$LinkAlt'] = str_replace(array('"',"'"),array('&#34;','&#39;'),$title);
        if(!$fmt) $fmt = (isset($IMapLinkFmt[$imap])) ? $IMapLinkFmt[$imap] : $UrlLinkFmt;
        return str_replace(array_keys($FmtV),array_values($FmtV),$fmt);
}
function obfuscate($s)
{
        $r = '';
        for($i=0;$i<strlen($s);$i++)
        {
                $r = $r . ( ($s{$i}==':') ? ':' : sprintf('&#%03d;', ord($s{$i})) );
        }
        return $r;
}

## Log all pages that are viewed.
$eol = "\n"; ### your end of line character. UNIX=\n, Mac=\r and Win=\r\n
$ws_log_entry = date("Y-m-d H:i:s") . "\t-\t " . $_SERVER['REMOTE_ADDR'] . "\t-\t" . $_SERVER['REQUEST_URI'] . $eol;
file_put_contents("pmwiki.log",$ws_log_entry,FILE_APPEND);

## beautifier
include_once('cookbook/beautifier/beautifier.php');
register_beautifier('cpp');
register_beautifier('csharp');
register_beautifier('javascript');
register_beautifier('lua');
register_beautifier('php3');
register_beautifier('python');
register_beautifier('vbdotnet');
register_beautifier('xml');

## Markup Ruleset Debugging
## Call up the URL http://path/to/wiki/pmwiki.php?action=ruletable
## Must uncomment: $EnableDiag = 1;
if(IsEnabled($EnableDiag,0) && $action == 'ruletable')
{
        include_once('cookbook/ruletable.php');
}

## Colored Boxes
include_once("cookbook/colored_boxes.php");

## Require an Author
$EnablePostAuthorRequired = 1;

## Only uncomment one of the two options $EnableUploadOverwrite or $EnableUploadVersions
## Don't allow uploaded files to overwrite existing files
## or
## Allow versions of files
#$EnableUploadOverwrite = 0;
$EnableUploadVersions = 1;

## Upload directory configuration
#$UploadPrefixFmt = ''; ### Organize uploads by site-wide
$UploadPrefixFmt = '/$Group'; ### Organize uploads by group
#$UploadPrefixFmt = '/$Group/$Name'; ### Organize uploads by page name

## Additional Wiki Styles
$WikiStyleCSS[] = 'border-collapse';

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.