SmileysPlusPlus

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

Add graphical smileys to the wiki markup, similar to WikiSmileys, but now do it with an almost unlimited supply of differing smileys.

Solution

http://anthony.liekens.net/smileys.tar.gz - complete tarball including gif images (File is too large to upload to pmwiki and attach it)
http://www.pmichaud.com/uploads/Cookbook-V1/smileys++.php (The attach functionality does not allow filenames with "+" signs in them)

Installation

To make this script work, put the smileys++.php in "local". Then add the following line to local.php: include("local/smileys++.php");

Configuration

By default, this script looks for the smiley images in a directory called "smileys" in the root directory for pmwiki. If your smiley images are elsewhere, you can set the path to the directory the smileys are in. It should end with the name of the directory with no ending slash. For example, you can set: $SmileysDir = "[(approve links) edit diff]";

Usage

You can now use any of :), :(, :p, :D, ... You can also use {cool}, {confused}, {eek}, {angry}, {rolleyes} like in the original smileys.php cookbook. But you can now also use "{:name:}" for printing the smiley where "name.gif" is in the smileys directory. There are over 680 smileys in the directory. If you use your browser to point to the "index.php" in the smileys directory, it gives you a list of all available smileys for smileys++.

Example

You can take a look at how my web site uses smileys++.php in order to display all of the funky little men at http://anthony.liekens.net

If you're smart enough, you can also fish out how to get access to the index.php showing all my smileys. Please don't post the URL if you find it, or use my collection as your default source for image downloads. I don't have too much bandwidth, and it would force me close down the PHP script, or move my smileys around my directory structures in order for you annoying guys to quit downloading from my server. Please use the images in the tarball locally.

Comments, Bugs

zet: Hi there. I have written an iconmanager that can manage your icons in directory. I chose a quite simple modell of a catalogsystem:
<imagename>.<category>.<subcategory>.<...>.gif
The files are sorted this way and the iconmanager can move/rename the images so you can sort the whole system quite fast. It is even possible to write descriptions for the categories.
The script location: [(approve links) edit diff]

Of course, I would like to implement this in the PmWiki. The directory that the iconmanager manages could be an uploaddirectory of the wiki. The wiki could use the {iconname} syntax like before - the categories won't be used in the wiki.
Example: smile.smiley.happysmiley.gif{smile}

The catalogsystem could also be used in the editpages of the wiki. A html-script could be written that there's a frame or somewhat where the user could browse/search for icons he wants to use.

I would also suggest to rename this script to WikiIcon instead of using smileys anymore.

Oh - The syntax should also make it possible to align the image - for example align=right - for floating. Syntaxproposal: {iconname left/right} or {iconname} for normal use. The reason is that I would like to add also larger icons (32x32) and it would look nicer if the paragraph would be floating around the icon.

''-zet 31. August 2003, GMT+1 1:25 am

Use with PmWiki 2

I don't have time right now to make a new cookbook page, but to get a basic version of this to work with PmWiki 2, basically follow the same instructions, but use this for the smileys++.php file:

   
  <?
  $IconsDir = "/path/to/icons";
  Markup('icon','inline','/\\[:(.*?):\\]/',"<img src='$IconsDir/\$1.gif' border='0' alt='smiley'/>");
  ?>
  

That replaces everything in the file and icons are used like this:

  
  [:nameOfGif:]
  

where nameOfGif is the name of one of the gifs in the icon directory linked to above.

''-MarcusVorwaller Dec 4 2004

Contributors

  • Janice Heinold
  • Anthony Liekens (Extensions starting with Janice's script)

pmwiki-2.3.33 -- Last modified by {{MarcusVorwaller}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons