miniforum

NP_MiniForum

With this plugin you can easily add simple forum (guestbook) to your weblog. It can also to use as a shoutbox.

General Plugin info
Current Version: 0.6.11
Download: see here or 0.6.12(unofficial)
Demo: http://edmondhui.homeip.net/blog/shoutbox.php
Forum thread: http://forum.nucleuscms.org/viewtopic.php?t=8810
Requiremets: Nucleus CMS version 3.0 or newer, php version 4.1.1 or newer (probably it can work on older version, but not tested)
Author: Josef ‘Pepiino’ Adamcik (http://zapisnik.pepiino.cz - in czech, josef.adamcik@gmail.com ), admun (Edmond Hui)

Features

  • CAPTCHA support (new) - more
  • full skinable output with multiple templates
  • an admin area for creating / editing / erasing discussions, posts and templates
  • auto-refresh using AJAX - more (Thanks Admun)
  • multilanguage support (english and czech supported now, but you can simply add your language)
  • spamcheck using NP_BlackList and/or NP_Captcha
  • gravatar support - more (Thanks z3rg)
  • remember me function
  • Support for graphic smileys - more
  • the plugin should be compatible with BLOG:CMS.

Installing

  1. Unzip the file and upload the contents to your plugin directory
  2. If you want to use different language than English, go to the miniforum directory. There are lang.php.xx files, where xx are language shortcuts (e.g.: en, cs …). Choose your preffered language and rename the file to lang.php. If you do this after the installation, the plugin options will not be translated.
  3. Install the plugin.

Upgrading

  1. Unzip the file and upload the contents to your plugin directory (rewrite old files)
  2. If you want to use different language than English, go to the miniforum directory. There are lang.php.xx files, where xx are language shortcuts (e.g.: en, cs …). Choose your preffered language and rename the file to lang.php. If you do this after the upgrade, the plugin options will not be translated.
  3. Point your browser to http://example.com/nucleus/plugins/miniforum/upgrade.php. Then choose your previous version of the plugin. This script will do everything necessary. You have to be logged in as administrator!
  4. delete the file nucleus/plugins/miniforum/upgrade.php

How to use the plugin

In an admininstration area of the plugin you can manage forums, posts and templates. Installation creates one default forum (named ‘default’). If you want to show the forum on your page, use skinvars as described in a next section.

Options

Enable quickmenu? Set it to no, if you don’t want to show the miniforum link in your admin menu.
Number of posts to show: how many posts will be shown on one page
Convert linebreaks to <br/> tags linebreaks will be replaced with <br/> tag
Max length of word. Longer words will be splited with ‘-’. It prevents users from breaking your page’s layout.
Convert urls to links? Set it to yes, if you want the plugin to find urls in post and make them clickable.
Path to images of emoticons. specify here the path to your emoticon images - see How to use smileys below.
Enable captcha test. (Needs NP_Captcha installed.) Activate captcha support. See detailed instructions.

Available SkinVars and/or TemplateVars

You can use fallowing skinvar (where myforum is the short name of your forum ):
<%MiniForum(action,forum,template,number of posts per page)%>.
Allowed actions are (case insensitive):

  • shownew - insert a past 24 hours new shout notification
  • showposts - inserts posts
  • showform - inserts form
  • script - inserts javascript for updating postlist

Number of posts per page has meaning only for showposts and script actions. You schould specify the same number in both showposts and script skinvars.

Examples:

  • <%MiniForum(script,myforum,mytemplate)%> - inserts javascript for auto-refresh
  • <%MiniForum(ShowPosts,myforum,mytemplate)%> - inserts list of posts from the forum myforum using template mytemplate
  • <%MiniForum(ShowForm,myforum,mytemplate)%> - shows a form for adding posts to the forum myforum using template mytemplate
  • <%MiniForum(ShowPosts,myforum)%> - inserts list of posts from the forum myforum using default template
  • <%MiniForum(ShowForm,myforum)%> - shows a form for adding posts to the forum myforum using default template
  • <%MiniForum(ShowPosts)%> - inserts list of posts from the default forum using default template
  • <%MiniForum(ShowForm)%> - shows a form for adding posts to the default forum using default template

Miniforum templates

Template for postlist header Part before posts. Allowed templatevars: <%title%>,<%description%> (taken from settings of the current forum) and <%navigation%>, which places content of the navigation template (see template for navigation below).
Template for post body One item in postlist. Allowed templatewars:
<%name%> - It will be replaced with corresponding tempelate for the tag name. (See template for tag <%name%> ....),
<%date%>,<%time%> - format of date and time can be customized in templates too
<%body%> which represents content of the post.
You can use templatevar <%gravatar%> for gravatar support since v0.6.0 (See gravatar support section in this manual.). To use avatar from NP_Profile (as of 0.6.12), use <%profileavatar%> to obtain the URL to the avatar image. To display the image use it like <img src=”<%profileavatar%>” alt=”avatar” style=”width:50px” />
Template for postlist footer Simillar to header template
Form body for logged users Form for adding new message. This version will be shown to logged in users. Don’t change names of inputs and textarea!
Form body for not logged users This version will be shown to non-registered visitors. Don’t change names of inputs and textarea! You can use <%captcha%> to insert the captcha image here. See details about captcha support.
Template for navigation (tag <%navigation%>) Template for templatevar <%navigation%>, which can be used in header amd footer templates. Allowed templatevars:
<%first-page%> - link to the first page,
<%prev-page%> - link to previous page,
<%cur-page%> - number of current page,
<%page-count%> - number of pages,
<%next-page%> - link to next page,
<%last-page%> - link to the last page
Template to display tag <%name%>, when there isn’t any link entered.Allowed templatevars : <%user-name%>,<%user-link%>
Template do display tag <%name%>, when there is a mail or an url entered. Allowed templatevars : <%user-name%>,<%user-link%>
Template to display tag <%name%> for registered users. Allowed templatevars : <%user-name%>,<%user-link%>
Template to display date Date format (for <%date%>). See http://php.net/date
Template to display time Time format (for <%time%>). See http://cz.php.net/date
Text for next page link Will be used in <%next-page%> (see template for navigation)
Text for previous page link Will be used in <%previous-page%> (see template for navigation)
Text for first page link Will be used in <%first-page%>(see template for navigation)
Text for last page linkWill be used in <%last-page%> (see template for navigation)
Convert urls to links? Set it to yes, if you want the plugin to find urls in post and make them clickable.
Convert emoticons to images? Set it to yes, if you want to see images instead of text smileys. See smileys section of documentation
Default gravatar image Path to image which will be used for users without gravatar. For deteails about gravatar support see gravatar support section in this manual.
Size of gravatar image uh, size of gravatar image ...

Smileys

The plugin doesn’t contain any pictures of emoticons. There are three ways how to get smileys working:

  1. Using smileys from NP_Smiley plugin. You don’t have to install this plugin. Just copy it to the plugin directory. In the options turn on smileys conversion and change path to nucleus/plugins/emoticons
  2. Using smileys from NP_FancyText plugin. You don’t have to install this plugin. Just copy it to the plugin directory. In the options turn on smileys conversion and change path to nucleus/plugins/fancytext/smiles (Note: If you are using BOLG:CMS you don’t have to change path).
  3. Using your custom smileys. Just place your images to any directory (e.g. to skin direcory).Then change the path in the options. Then you’ll probably have to edit file emoticons.php (in plugins/miniforum directory). This file contains filenames of images, which will be used to replace text-smileys.

Gravatar

If you don’t know what the gravatar is, look here. If you want to use gravatar add

<img src="<%gravatar%>" title="gravatar image" />

into post body template and edit gravatar size and default gravatar image fields in template setup.

Forum auto-refreshing

Thanks Admun for this great feature. It’s using AJAX to refresh posts (So page isn’t reloaded when refreshing). Don’t worry, users with disabled javascript still have acces to all posts.

If you want to use this feature insert:
<%MiniForum(script,[forumname],[forumtemplate])%>
after <body> in your skin. ie: <%MiniForum(script,default)%>.

Captcha

Captcha is well-known antispam system. Nuclues CMS has it’s own captcha solution provided by great plugin NP_Captcha. You need this plugin installed in order to use captcha support in NP_MiniForum.

Remeber please that the captcha is not well-accessible and it’s wery annoying for most of the users. Try to use another antispam solution if it’s possible. NP_MiniForum provides support for NP_Blacklist which is very good but it’s now dead (for details visit this forum thread).

Using NP_Captcha with NP_MiniForum

  1. install the NP_Captcha plugin
  2. add templatevar <%captcha%> to your template, field Form body for not logged users. (It’s located in the NP_MiniForum templates.) This templatevar will be substituted by a captcha image.
  3. add form field for a captcha solution
<input type="text" name="captcha" />

(You can copy and paste it from here). The name of this field must be captcha exactly.

  1. turn on captcha support in options of the NP_MiniForum plugin
  2. enjoy your spam-free guestbook ;-)

Tips & Tricks

Miniforum on separated page

Make a copy of your default skin and call it guestbook (or whatever). You’ll just need a Main Index part, so you can delete the rest safely (Archive, Archive list etc.). Edit the Main Index skinpart and replace
<%blog(defaultskin/index,10)%>
with
<%MiniForum(ShowPosts,default)%>
<%MiniForum(ShowForm,default)%>

Then create file (in nucleus root - the directory where your index.php and config.php files are placed) guestbook.php and insert:

<?php 
session_start(); 
$CONF['Self'] = 'guestbook.php'; 
 
include('./config.php'); 
 
selectSkin('guestbook'); 
selector(); 
 
?>

Wishlist

Do you have any ideas how to improve this plugin? You can write them into forum thread of NP_MiniForum!

Are you going to make any improvement of NP_MiniForum? It’s great but first try to contact me (josef.adamcik@pepiino.info) beacause I can send you the actual version of code and we can discuss the development.

Bugs

Please, report any bugs to the forum thread of this plugin or send me an e-mail.

History

  • Version 0.6.11
    • add new shout notification
  • Version 0.6.10 download, released 2006-09-05
    • [FIX] problem with hyphen in url (when converting)
  • Version 0.6.9 download, released 2006-03-27
    • fixed php5 reference issue
  • Version 0.6.8 download, released 2006-03-18
    • fixed some bugs
  • Version 0.6.7 download, released 2006-02-23
    • fixed bug: now checking if smileys are turned on or not
  • Version 0.6.6 download, released 2006-02-22
    • fixed bug: now sending content-type with encoding in response to refresh request
  • Version 0.6.5 download, released 2006-01-12
    • NP_Captcha support
  • Version 0.6.4 download
    • option to specify amount of shown posts in skinwar (user request)
  • Version 0.6.3 download
    • added check for spam attempts using NP_BlackList. thx admun
  • Version 0.6.2 download
    • fixed ISS problem in administration
    • fixed one SQL compatibility issue
  • Version 0.6.1 download
    • now xhtml valid
  • Version 0.6.0 download
    • multiple templates
    • remember me function
    • gravatar support (thanks z3rg)
    • some bugs fixed
  • Version 0.5.2 Download - still only development version.
  • Version 0.5.1 Download - only development version. Admun is AJAXizing NP_MiniForum. More in forum
  • Version 0.4.1, released 2005-05-01 Download
    • fixed little bug (urls like something.com/something.php?foo=foo wasn’t recognized)
  • Version 0.4.0, released 2005-04-24 Download
    • urls are converted to links
    • support for graphical smileys
  • Version 0.3.1, released 2005-03-21 Download
    • Fixed some major bugs
  • Version 0.3.0, (not released)
    • Nucleus CMS and Blog:CMS versions merged (So you can use this version in both now.)
    • linebreaks are converted to <br /> tags (can be turned of in plugin options)
    • You can make another tempelate for tag <%name%> for members. (So you can discriminate between non-member’s post and member’s.)
    • Checks word length in post. If word is too long (maximum length can be set in options) plugin splits it into more parts separated by ‘-’, accordingly users can’t break layout of your page.
    • Few bugs fixed
  • Version 0.2, released 2005-02-26
    • First public release

Note

As you can see, my english isn’t the best. Feel free to correct my mistakes and any unclear formulations. This is WIKI. LOL

:: Back to plugins ::

 
miniforum.txt · Last modified: 2009/05/27 22:12 by ftruscot