For those that accidentally opened this file

This file (help.html) contains popup help for the Nucleus Admin Area.

Future Items

Future items allow you to let an item become visible only at the time you specified. This date must be in the future. Before that time has come, the item will not be viewable anywhere in the public part of your site.

Drafts

Draft items are not yet viewable in the public blog. They might come in handy when you are working on a story, and something comes in between. Your draft items will be listed on the main page, so you can continue your when you have the time to do so. When editing drafts, choose the 'Add now' radiobutton and hit the 'Edit item' button to make them visible.

Extended part

Items have an optional extended part that you can use for continued stories. e.g. when a story is too long to put on the main page of your blog, you can write an introduction in the body part and the rest in the extended part. When viewing your main blog page, you will then see 'read more' links (as defined by the templates).

If you want to write an introduction only for some of your items, you could use the smartbody template variable to make a selection out of the body text and the extended text.

Short Blog Name

The short blog name is used mainly in the admin area to indicate which items are associated with which blog.

It can also be used in alternative index files, to make a second weblog available:

<?
	include('config.php');
	selectBlog('shortblogname');
	selector();
?>

Default Skin

The default skin selected in the blog settings is the skin that should be used when the blog should be displayed, and there is no other skin selected (through arguments in the URL)

Notify Address

This is one or multiple e-mail addresses to which notification e-mails will be sent when new comments are added. Leave empty if you don't want notification. The given e-mail addresses must, of course, be valid ones.

If you're using multiple addresses, you should use a semicolon (;) as a separator.

Note: As the maximum length of the settings fields is 128 characters, there's only a limited amount of e-mail addresses you can list.

Max comments

This is the maximum number of comments that will be shown on the main page. This is NOT a restriction on the total number of comments that can be made. On the detail pages, all comments will be shown, even if there are more than the maximum amount chosen.

Inside template, this variable can be overridden by an optional parameter of the comments templatevar.

Time Offset

If the time on your server is not equal to the time where you live, you might want to add an offset to the server time in order to get the correct time. Use negative values to subtract (negation sign). The current server time is listed as a reference.

Example

If your local time is 20:35 and the server time is listed as 14:35, you'll need to set the time offset equal to 6 in order to get your blog time to 20:35

Update File

Nucleus can edit a file for you whenever a new item is added to the blog. The contents of that file will be a timestamp of the last change. The use of such a file could be useful for services which check a file on your server once in a while to see if there were updates, and generate 'updated weblogs' from that. Pointing them to your main blog could cause false update warnings to be sent out when visitors add comments or when you change something to the skins or templates.

When you don't need an update file, just leave the field empty.

Please note that the location of the update file is relative to the admin-area, so you might want to use an absolute path (something like /path/to/your/website/update.txt). Also make sure the update file already exists and is writable (chmod it to 666 if you want to be sure).

Blog Admin

Blog administrators have the following extra rights:

A blog can have multiple admins, but there must be at least one admin at all times.

Superadmin

A superadmin has full access to all functions and all weblogs, even if not on the team.

On top of that: a super-admin has the right to create new weblogs, to change general settings, to change templates, to change skins and to manage the members (creation/ manipulation/ deletion of members).

Usually, there will be only one super-admin, the site administrator.

Can Login?

As a superadmin, you can disallow individual members to login to the admin area.

Default Blog

This is the blog that will be used when no other blog has been specified in the request.

Cookies

Cookie Lifetime

You can choose if you want to use session cookies or cookies with a lifetime of a month to store the login information of your members. The difference is that session cookies get deleted when you exit the browser, and that cookies with one month lifetime will stay on the computer until you don't use/visit the site for a month. Using the latter option, you'll never have to login again (unless you log out of course)

Cookie Path & Cookie Domain

These settings are advanced settings. Normally, you shouldn't change them at all. In that case, cookie path is a simple slash ('/') and cookie domain is empty.

Secure Cookies

Normally, this should be set to 'no'. You should only set it to 'yes' when you have a HTTPS url and want cookies only to be sent over such a https connection.

'Last Visit' Cookie

You can setup Nucleus to store a cookie in which the time of the visitors last visit is stored. This can be used to put indications next to new items

Language

You can choose a language to be used when nucleus creates content for you. The content generated by Nucleus includes the admin-area, the error messages, forms in skins, ...

There are two places where a language can be chosen: the global site settings include a language option. Next to that, logged in members can override this setting if they want to.

When both of these settings are invalid, 'english' is used as the default language.

Account Creation

You can either allow or disallow your visitors to create their own 'member' account. They won't be allowed to add items to a blog (unless the admin adds them to a team), but they can login to the administration area and change their settings, and even delete or modify the comments they made.

New Member: can login ?

When you allow creation of member accounts by your visitors, this setting defines whether or not accounts created in that way will have the ability to login to the administration area.

Message Service

For the privacy of your members, you can hide all e-mail addresses and allow members to send an e-mail message to each other through the script. The message that will be sent out will however contain the e-mail addresses of both users, so they can then do continued communication through regular e-mail. This service can be disabled.

Non-members

By default, non members cannot use the message service (because there's no way to check the validity of the e-mail address they enter). You can relax this restriction by allowing non-members to use the message service too. When submitting a message, they will be asked to enter their e-mail address, which will show up in the From: headers of the e-mail you receive.

Disable Site

It's possible to disable your entire Nucleus site. You might want to do this when you are doing some configuring, or when something went horribly wrong :-)

The URL that needs to be configured is an URL to which the visitor will be redirected.

Exceptions: the admin-area is still available, and super-admins can still see the entire site. (don't forget to re-enable your site afterwards ;-))

Templates: Items

When items are shown, the following setup is repeated for each item:

item header
item body
item footer

These three blocks all refer to a template-part, which define what the result looks like.

Variables

Within these template, a series of so called template variables can be used to insert item data.

Example

An example

Templates: Items

An example for the item body template:

<b><%title%></b>
<br />
<%body%>
<br />
<i>
 <a href="<%itemlink%>">link</a> -
 <%date%> <%time%> -
 <a href="<%authorlink%>"><%author%></a> -
 <%comments%>
</i>

The result would become something like this:

This is an item
This is the text for the item
link - August 8th 2002 18:51 - karma - no comments

Templates: comments

There are three possible structures for a comments block.

1. When comments are displayed (like on detail pages, or on the main page when there are less than the maximum allowed amount of comments)

comments header
  comments body (repeated)
comments footer

2. When there are no comments at all

no comments

3. When there are comments, but there are more than the maximum allowed number. (only applies when not on a detailed item page)

too much comments

Templates: Comment headers/footers

The following vars are available in the comments header and footer templates, as well as in the templates for no comments and too much comments:

Name Description
itemid ID of the current item
itemlink link to the detailed page for the current item
commentcount the total number of comments for the current item
commentword distinction between 1 "comment" and many "comments" as defined elsewhere in the template

An example for the 'too much comments'-template

<a href="<%itemlink%>">
<%commentcount%> <%commentword%>
</a>

Templates: Link to extended entry

This is the template that will be used to format the morelink templatevar that is available in the item templates. Available variables are the same as in the item templates.

When there's no extended part of the item, the <%morelink%> templatevar will have no effect.

An example is given below:

<a href="<%itemlink%>">[Read More!]</a>

Templates: Archive Lists

The archive lists are formatted as listed below:

archivelist header
  archivelist listitem (repeated for each archive)
archivelist footer

Available variables: (in the header and footer, only blogid is allowed)

Name Description
blogid ID of the weblog
archivelink link to the archive, which you can embed in a <a href=".."> tag.
month Number of the month (2 digits: 01-12)
year Year (4 digits)
day Day of month (2 digits; only when in day mode)

A more flexible way to add the date of the archive to the listitem, is to use strftime variables. If you find this too complicated, use the following:

<a href="<%archivelink%>">%B, %Y</a><br />

To change the language to your local settings, change the locale.

Templates: Category Lists

The category lists are formatted as listed below:

categorylist header
  categorylist listitem (repeated)
categorylist footer

Available variables: (in the header and footer, only blogid, blogurl and self are allowed)

Name Description
blogid ID of the weblog
blogurl URL of the blog (as defined in blogsettings)
self Current page, without parameters (e.g. index.php)
catlink a link to the most recent items for a category, which you can embed in a <a href=".."> tag.
catid Category ID
catname Category name
catdesc Category description

View an example

Templates: Category Lists

(go back)

Header

<ul>
  <li><a href="<blogurl%>">All</a></li>

List Item

  <li><a href="<%categorylink%>"><%catname%></a></li>

Footer

</ul>

Results in:

Templates: Locale

This is actually not a template-part, it's a setting. Setting it allows the date and time preferences when to be localized. Names of months and days will be in the desired language, etc.

The possible values depend according to which machine Nucleus is running on. Some possible values are

More info in the Open Group Specification for strftime. (opens a new window)

The locale is used for the date and time format, for the dateheaders, and for the archivelist items

Templates: Date and Time formats

These are used to format dates and times into the <%date%> and <%time%> vars (see template vars). The formatting is done according to the locale

More info on the available vars. If want to get started quickly, use "%x" to format the date and "%X" to format the time.

Template: Date headers/footers

The date header and date footer can contain date and time vars. More info on the available vars. If you want to get started quickly, use "%x" to format the date. The language which is used to format the date, is determined by the locale-setting in the template.

In the date header, the template variable <%%daylink%%> is allowed to insert a link to the archive for that day. Note the double '%'! It's necessary to avoid %d to be expanded as the current day of the month.

Sample for date header:

<div class="day">
<h1>%d %B</h1>

Sample for date footer:

</div>

And another example for the date head using daylink

<div class="day">
<h1>%d %B</h1>
<a href="<%%daylink%%>">(archive)</a>

Templates: Highlight

The highlighting is used when performing searches. This is actually used in a regular expression, so you might want to escape some characters by putting a backslash before them. The place where the highlighted word will come, is indicated by "\0".

Example:

<span style='background-color:yellow'>\0</span>

Templates: nothing found

Shown when a search has been performed and no results were found.

Available variables:

Name Description
blogid ID of the weblog
query the query that was used in the search

Example

No search results found for <b><%query%></b>

Templates: Comment body

This is the part of the template used to display a single comment. Available variables are listed below:

Name Description
commentid ID of the comment
itemid ID of the item
blogid ID of the weblog
itemlink link to the detailed item page
body comment body
user user name
userid users URL or e-mail address
userlink a smart link to either the e-mail or URL for non members, or the member detail page for members. Note: this link already includes the <a href="..."> and </a> tags ! (when no valid URL or e-mail is available, only the name of the member will be shown)
userlinkraw same as above, but without the <a href.., empty when no valid URL or e-mail available
memberid ID of the member (0 for non-members)
host host from where comment was added
ip IP-address from where comment was added
commentcount total amount of comments for the item
commentword 1 'comment', 2 'comments'
date date on which comment was added
time time at which comment was added
authtext the extra text for members, empty for non members
short a cut off version of the body, which truncates after the first line break. A link is added at the end according to the template

Example

Templates: Comment Body

An example for the comment body template is given below:

<b>Comment by <%userlink%></b>
<br />
<%body%>
<br />
<small>
 (from <%host%> on <%date%> at <%time%>)
</small>

Templates: Media & Popups

These templates are used to format links to popup image windows and media objects (non-pictures). The available variables for each of the templates are described below

Popup Link Code

Name Description
popuplink an <a href... link ready to use
rawpopuplink only the url inside href="..."
popupcode javascript code to open window
popuptext the alternate text (link text)

Inline Image Code

Name Description
image an IMG-tag, ready to use

Media Object Link Code

Name Description
media an A-tag, ready to use

Templates: Member Extra

This is a template you can use to add an extra indication that a comment-author is a member. It ends up in the <%authtext%> variable for use in the comment body

No special variables are allowed here.

Templates: Comments Read More

This is the format of the link that will be added at the end of <%short%>, which is a variable for use in the comment body

The variables allowed here are all those that are available in the comment body (except for <%short%>)

Example:

 <a href="<%itemlink%>">[more]</a>

Templates: commentword

Most likely, you'll rather want to write "1 comment" than "1 comment(s)". The "One comment" and "Many comments" template parts can be used for this purpose. They will be used to fill the <%commentword%> variable that you can use elsewhere.

If there is only 1 comment, <%commentword%> will be equal to the contents of the "one comment" part. If there are many comments (more than one), <%commentword%> will be equal to the contents of the "two (or more) comments" part.

Typical values are "comment" and "comments". No special variables can be used.

Templates: Edit Link

This template defines how the edit-templatevar will be marked up. You can use any of the template variables here.

Example:

<a href="<%editlink%>" 
   onclick="<%editpopupcode%>">edit</a>

Skins: Main Index

This skinpart is used to show the most recent entries of your weblog. It's usually the home page of your site.

Very basic buildup for a main index:

<html>
  <head>
    <title>My Weblog</title>
  </head>
  <body>

    <h1>My Weblog</h1>
    <%blog(mytemplate,20)%>

  </body>
</html>

This will show the 20 most recent items of the default weblog (unless overridden), using the 'mytemplate' template.

Skins: Detail Pages

These pages are used to show the full items, all comments that were made and a form to add comments.

Very basic buildup for a detailed item page:

<html>
  <head>
    <title>My Weblog :: Item</title>
  </head>
  <body>

    <h1>Item</h1>
    <%item(detailed)%>

    <h1>Comments</h1>
    <%comments(detailed)%>

    <h1>Add Comment</h1>
    <%commentform%>

  </body>
</html>

This will show the item and comments using the 'detailed' template, and add a standard commentform.

Skins: Archive List

An overview of all the months for which archives are available, and links to those archives

Very basic buildup for an archive list:

<html>
  <head>
    <title>My Weblog :: Archives</title>
  </head>
  <body>

    <h1>Archives</h1>
    <%archivelist(default)%>

  </body>
</html>

This will show the list of all available archive files, using the 'default' template

Skins: Archive

An archive for one month. Behaves like a main index, but shows all the items from a certain month.

Very basic buildup for an archive page:

<html>
  <head>
    <title>My Weblog :: Archive</title>
  </head>
  <body>

    <h1>Archive</h1>
    <%archive(default)%>

  </body>
</html>

This will show the requested archive using the 'default' template

Skins: Search

Used to show search results.

Very basic buildup for a searchresults page:

<html>
  <head>
    <title>My Weblog :: Search</title>
  </head>
  <body>

    <h1>Search</h1>
    <%searchform%>

    <h1>Searchresults</h1>
    <%searchresults(default)%>

  </body>
</html>

This will show search results using the 'default' template.

Skins: Errors

Used when there is an error

<html>
  <head>
    <title>My Weblog :: Error</title>
  </head>
  <body>

    <h1>Error!</h1>
    <%errormessage%>

    <br /><br />

    <a href="javascript:history.back();">Back</a>

  </body>
</html>

This will show the error message, plus a link to go back.

Skins: Member

Used to show member details.

Very basic buildup for a member-detail page:

<html>
  <head>
    <title>My Weblog :: Member details</title>
  </head>
  <body>

    <h1>Info about <%member(name)%></h1>
    Website:
    <a href="<%member(url)%>"><%member(url)%></a>

    <h1>Send Message</h1>
    <%membermailform%>

  </body>
</html>

This will show the members name, website address and a mailform.

Skins: Image Popup

Used when a media file (image) needs to be shown in a popup window. This skin defines the layout that will be used in that case.

Very basic buildup for an imagepopup page:

<html>
<head>
  <title><%imagetext%></title>
  <style type="text/css">
   img { border: none; }
  </style>
</head>
<body>
  <a href="javascript:window.close();"><%image%></a>
</body>
</html>

Shortnames & Display Names

Weblogs, templates and skin should all have a short name next to the full name or description.

A short name consists of only the characters a-z and 0-9, and cannot contain spaces

Display names are used for members. They can contain a-z, A-Z, 0-9 and spaces, but the spaces cannot be placed at the beginning or end of the name.

Template: 'New' indication

When the 'last visit' cookie option is activated, the contents of the 'Indication of new item'-template is copied into the <%new%> variable for items that have been added since the last visit. The <%new%> variable can e.g. be used in the item body-template.

When the 'last visit' cookie is disabled, or the item is not 'new', this template part will not be used.

Time variables overview

The following conversion specifiers are recognized in the format string (taken from the PHP documentation for the strftime function). More info in the Open Group Specification

Ping Userland

When updating your weblog, you can choose to send an update notification (ping) to weblogs.com. This websites provides a list of recently updated weblogs to everyone who requests it. Lot's of websites are using this data, so you might receive some extra hits when enabling the ping.

For this feature to work correctly, you need to fill out both the weblog URL and the weblog name in the blogsettings.

Convert breaks

By default, Nucleus converts linebreaks in your items to <br /> tags, so a linebreak will also show up in your (X)HTML output

Advanced users, or users striving for the semantic web (br tags don't add any information, they're just used for markup), might find this feature anoying, and turn this feature off.

Media

Nucleus allows you to upload media files (images, video, sound, ...) to your website

Some settings are needed to do this:

Each member has his own collection of media files. Uploading is only possible when a member is on the team of at least one of the blogs, to prevent abuse.

If media items are used inside a weblog item, they are taken from the media dir of the author of that item.

Protect Member Names

When this option is enabled, non-logged in members cannot add comments using the same name as registered members. The reason to do this would be to avoid guest impersonating members.

Plugin URL

This setting is the base URL for plugin admin areas. Usually it will look like the following

http://hostname.com/nucleus/plugins/

Adding items

When adding items to a weblog, there are four kinds of template variables that you can use in the body text, title or extended part:

Skinvar: referer

Inserts the refering URL (can be empty)

Arguments

None

Skintypes

all

Examples

<a href="<%referer%>">back</a>

Skinvar: itemid

Inserts the ID of the currently selected item

Arguments

None

Skintypes

item

Examples

<%itemid%>

Skinvar: itemlink

Adds a permanent link for the item.

Arguments

None

Skintypes

item

Examples

<%itemlink%>

Skinvar: itemtitle

Inserts the title of the item, with HTML-stripped off and entities encoded

Arguments

None

Skintypes

item

Examples

<%itemtitle%>

Skinvar: archivedate

Inserts a formatted date for an archive date. Using no parameters, this will either insert '15 august 2002' or 'august 2002' if the archive is for august 2002

Arguments

Skintypes

archive

Examples

Archive for <%archivedate%>
Archive for <%archivedate(dutch)%>
Archive for <%archivedate(en,%B %Y)%>

Skinvar: blog

Inserts the most recently added items of the currently active blog (usually the default one) into the skin.

Arguments

Required:

Optional:

Skintypes

index, item, archive, archivelist, search

Examples

<%blog(default,15)%>
<%blog(mytemplate)%>
<%blog(mytemplate,5,mycategory)%>

Skinvar: otherblog

Inserts the most recently added items of a given blog into the skin.

Arguments

Required:

Optional:

Skintypes

all

Examples

<%otherblog(myblog,default,15)%>
<%otherblog(yourblog,mytemplate)%>
<%otherblog(yourblog,mytemplate,15,mycategory)%>

Skinvar: item

Shows the currently selected item (without comments) using a given template

Arguments

Skintypes

item

Examples

<%item(mytemplate)%>

Skinvar: comments

Shows the comments for the currently selected item using a given template.

Arguments

Skintypes

item

Examples

<%comments(mytemplate)%>

Skinvar: archive

Shows the archive for the selected month and the selected blog (usually the default one), using a given template

Arguments

Required

Optional

Skintypes

archive

Examples

<%archive(mytemplate)%>
<%archive(mytemplate,mycategory)%>

Skinvar: otherarchive

Shows the archive for the selected month, using the given blog and template

Arguments

Required

Optional

Skintypes

archive

Examples

<%otherarchive(myblog,mytemplate)%>
<%otherarchive(myblog,mytemplate,mycategory)%>

Skinvar: archivelist

Shows the list of available archives for the currently selected blog (usually the default one), using a given template

Arguments

Required

Optional

Skintypes

index, archive, archivelist, search, item

Skinvar: archivedaylist

The same as the archivelist skinvar, but shows an entry for each day instead of for each month

Arguments

Required

Optional

Skintypes

index, archive, archivelist, search, item

Examples

<%archivedaylist(mytemplate)%>
<%archivedaylist(mytemplate,mycategory)%>

Skinvar: otherarchivedaylist

The same as the otherarchivelist skinvar, but shows an entry for each day instead of for each month

Arguments

Required

Optional

Skintypes

all

Examples

<%otherarchivedaylist(yourblog,mytemplate)%>
<%otherarchivedaylist(yourblog,mytemplate,mycategory)%>

Skinvar: otherarchivelist

Shows the list of available archives for a given blog, using a given template

Arguments

Required

Optional

Skintypes

all

Examples

<%otherarchivelist(yourblog,mytemplate)%>
<%otherarchivelist(yourblog,mytemplate,mycategory)%>

Skinvar: categorylist

Inserts a list of categories for a blog (defaults to the currently selected blog), using a given template

Arguments

Required

Optional

Skintypes

index, archive, archivelist, search, item

Examples

<%categorylist(mytemplate)%>
<%categorylist(mytemplate,myweblog)%>

Skinvar: category

Inserts some information about the currently selected category. When no category is selected, does nothing.

Arguments

Optional

Skintypes

all

Examples

<%category%>
<%category(id)%>
<%category(desc)%>
<%category(name)%>

Skinvar: ifcat

Inserts some text only if there is currently a category selected

Arguments

Required

Skintypes

all

Examples

<%ifcat(Current Category: )%><%category%>

Skinvar: searchresults

Shows the searchresult for the current query

Arguments

Required:

Optional:

Skintypes

search

Examples

<%searchresults(mytemplate)%>

Skinvar: othersearchresults

Shows the searchresult in a give blog for the current query, using the given template

Arguments

Required:

Optional:

Skintypes

search

Examples

<%othersearchresults(myblog,mytemplate)%>

Skinvar: query

Inserts the current search query.

Arguments

None

Skintypes

search

Examples

<%query%>

Skinvar: version

Inserts the current Nucleus version.

Arguments

None

Skintypes

all

Examples

<%version%>

Skinvar: previtem

Inserts the ID of the previous item in the blog

Arguments

None

Skintypes

item

Examples

<%previtem%>

Skinvar: nextitem

Inserts the ID of the next item in the blog

Arguments

None

Skintypes

item

Examples

<%nextitem%>

Skinvar: todaylink

Inserts a link to the main page of the weblog. Takes into account the currently selected blog and category.

Arguments

None

Skintypes

all

Examples

<%todaylink%>

Skinvar: archivelink

Inserts a link to the archive for the currently selected blog and category (or the default blog when no blog selected)

Arguments

None

Skintypes

all

Examples

<%archivelink%>

Skinvar: nextlink

Inserts a link to the next item

Arguments

None

Skintypes

item

Examples

<%nextlink%>

Skinvar: prevlink

Inserts a link to the previous item

Arguments

None

Skintypes

item

Examples

<%prevlink%>

Skinvar: errormessage

Inserts the message corresponding to the error that occurred

Arguments

None

Skintypes

error

Examples

<%errormessage%>

Skinvar: imagetext

Inserts the caption text for a popup image

Arguments

None

Skintypes

imagepopup

Examples

<%imagetext%>

Skinvar: image

Inserts the selected image (for popup images)

Arguments

None

Skintypes

imagepopup

Examples

<%image%>

Skinvar: vars

Inserts a hidden form-input field with the itemid.

Arguments

None

Skintypes

item

Skinvar: sitevar

Includes a site variable

Arguments

Skintypes

all

Examples

<%skinvar(name)%>
<%skinvar(url)%>
<a href="mailto:<%skinvar(email)%>">Admin</a>

Skinvar: blogsetting

Inserts a setting specific to the currently selected blog (usually the default one)

Arguments

Skintypes

index, archive, archivelist, search, item, member

Examples

<%blogsetting(name)%>
<%blogsetting(id)%>
<%blogsetting(desc)%>
<a href="<%blogsetting(url)%>">...</a>

Skinvar: member

Inserts some info about a member (on member detail pages)

Arguments

Skintypes

member

Examples

<%member(realname)%>
<%member(url)%>

Skinvar: preview

Inserts an item-preview into the page, using a given template (to be used in conjunction with additemform)

Arguments

Skintypes

index

Examples

<%preview(mytemplate)%>

Skinvar: additemform

Shows an add-item form for the currently selected blog (usually the default one). Mostly used in conjunction with preview

Arguments

None

Skintypes

index

Examples

<%additemform%>

Skin/Templatevar: include

Includes a textfile into the output. The contents of the file is not parsed in any way, so you cannot use skin/templatevars or use PHP code (see parsedinclude and phpinclude if you want parsed includes)

Arguments

Skintypes

all

Examples

<%include(filename.txt)%>
<%include(/home/user/myself/filename.txt)%>
<%include(http://mydomain.com/filename.html)%>

Skin/Templatevar: phpinclude

Includes a php-file into the output. The contents of the file is parsed by the PHP parser, so be careful. Nucleus skin/templatevars are not parsed! (see parsedinclude and include for other include options).

Your file will be included using the standard php include() command. This command will however be called from inside a class method, so you'll need to declare which global variables you want to access yourself. Most of the standard variables are automatically declared global by Nucleus itsself.

Arguments

Skintypes

all

Examples

<%phpinclude(filename.php)%>
<%phpinclude(/home/user/myself/filename.php)%>

Skin/Templatevar: phpinclude : vars

The following global variables are accessible from within files included by the phpinclude skin/templatevar:

$GATEWAY_INTERFACE, $SERVER_NAME, $SERVER_SOFTWARE
$SERVER_PROTOCOL, $REQUEST_METHOD, $QUERY_STRING
$DOCUMENT_ROOT, $HTTP_ACCEPT, $HTTP_ACCEPT_CHARSET
$HTTP_ACCEPT_ENCODING, $HTTP_ACCEPT_LANGUAGE
$HTTP_CONNECTION, $HTTP_HOST, $HTTP_REFERER
$HTTP_USER_AGENT, $REMOTE_ADDR, $REMOTE_PORT
$SCRIPT_FILENAME, $SERVER_ADMIN, $SERVER_PORT
$SERVER_SIGNATURE, $PATH_TRANSLATED, $SCRIPT_NAME
$REQUEST_URI, $argv, $argc, $PHP_SELF
$HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS
$HTTP_POST_FILES, $HTTP_ENV_VARS, $HTTP_SERVER_VARS
$HTTP_SESSION_VARS, $PATH_INFO, $HTTPS
$HTTP_RAW_POST_DATA, $HTTP_X_FORWARDED_FOR

For others variables, you'll need to add 'global $varname;' explicitly in your code

Skin/Templatevar: parsedinclude

Includes a file into the output. The contents of the file is parsed by the Nucleus skin/template parser, so you can use skin/templatevars. (see phpinclude and include for other include options)

Arguments

Skintypes

all

Examples

<%parsedinclude(filename.txt)%>
<%parsedinclude(/home/user/myself/filename.txt)%>

Notes

From inside the included file, you can call <%parsedinclude(filename)%> again. To avoid endless loops, the maximum depth level you can go is 3.

Skin/Templatevar: plugin

Calls a plugin

Arguments

Skintypes

all

Examples

<%plugin(Calendar)%>
<%plugin(LastComments,myweblog)%>

Skinvar: commentform

Adds a commentform to an item page.

Arguments

Optional:

Skintypes

item

Examples

<%commentform%>
<%commentform(../action.php)%>
<%commentform(../action.php,http://host/thanks.html)%>

Skinvar: loginform

Shows a login form or a message indicating that the visitor is logged in

Arguments

None

Skintypes

all

Examples

<%loginform%>

Skinvar: membermailform

Shows a form through which a logged-in member can send a message to the member which details are being shown (on member detail pages)

Arguments

Optional:

Skintypes

member

Examples

<%membermailform%>

Skinvar: searchform

Shows a search form for the current blog.

Arguments

Optional:

Skintypes

index, archive, archivelist, search, item

Examples

<%searchform%>
<%searchform(otherweblog)%>

Skinvar: nucleusbutton

Inserts a nucleus button, with link to the Nucleus website. It's highly suggested to place such a button on your website ;-)

Arguments

Optional:

Skintypes

all

Examples

<%nucleusbutton%>
<%nucleusbutton(nucleus/nucleus.gif,46,43)%>

Skinvar: self

Inserts the filename of the page currently being displayed (index.php or whatever you changed it to)

Arguments

None

Skintypes

all

Examples

<%self%>

Template variables: Overview

What?

Template variables largely work in exact the same way as skin variables, with the only difference that they are being used inside templates. The variables are called using <%varname%>, and include some text depending on the variable function. Some variables also have extra optional parameters.

Available variables

Templatetypes

These template variables can currently be used in the following template-parts: item header, item body, item footer, date header, date footer, morelink, editlink

The variables image, popup and media can also be used inside weblog items.

Template variables: Basic variables

All these variables concern the item that's currently being parsed.

Name Description
title item title
body body text
more extended text
category name of the category
categorylink raw link to the category
karma Total karma score
authorlink raw link to the author
itemlink raw permanent link for the item
author name of the author
smartbody either the body text or the extended text
morelink 'read more'-link
date Formatted date
time Formatted time
daylink raw link to the daily archive
comments comments block or commentcount
itemid ID of the item
blogurl URL of the blog

Template variables overview...

Template variables: Advanced variables

Name Description
authorid ID of the current items author
blogid ID of the blog
catid ID of the category for the current item
query search query (if there is one)
syndicate_title Syndicated title
syndicate_description Syndicated body text
karmaposlink raw vote link
karmaneglink raw vote link
new 'New Item!'-text
include includes a file, whithout parsing
parsedinclude includes a file, parsing it
phpinclude includes a file, parsing by PHP
plugin executes a plugin
edit inserts an 'edit this item' link
editlink raw 'edit item' link (links to bookmarklet)
editpopupcode javascript code to open a popup window for editlink
image inline image from media library
popup popup image from media dir
media other media object from media dir

Template variables overview...

Templatevar: author

Inserts the name of the author

Arguments

Examples

<%author%>
<%author(realname)%>

Templatevar: smartbody

Examines the current item and then decides to show either the body text or the expanded text.

When the body text is empty, the extended text is chosen. Otherwise the body text is shown.

Using this, the body text can be your full text, and the extended part could be seen as an 'introduction', which you want to show on the front page.

Templatevar: morelink

Inserts a link to the detail page for the item, as defined in the template (link to extended entry). This is empty when there is no extended part.

Note that the contents of the 'link to extended entry' templatepart is also parsed and can thus also contain templatevariables.

Templatevar: date

Inserts a date using the date format specified in the template. Optionally, a custom date format can be given as a parameter.

Arguments

Examples

<%date%>
<%date(%x)%>

Templatevar: time

Inserts a time using the time format specified in the template. Optionally, a custom time format can be given as a parameter.

Arguments

Examples

<%time%>
<%time(%X)%>

Templatevar: comments

Inserts a comments 'block'. More information about the structure of this block.

Arguments

Examples

<%comments%>
<%comments(5)%>

Templatevar: syndicate_title

Inserts the title of the item, with HTML tags-stripped off, and shortened to 100 characters. When the text needs to be shortened, "..." is added at the end of the text.

This variable was originally intended for use in the XML-RSS skin that comes with Nucleus, but can also be of use in other situations.

Arguments

Examples

<%syndicate_title%>
<%syndicate_title(25)%>

Templatevar: syndicate_description

Inserts the body of the item, with HTML tags-stripped off, and shortened to 250 characters. When the text needs to be shortened, "..." is added at the end of the text.

This variable was originally intended for use in the XML-RSS skin that comes with Nucleus, but can also be of use in other situations.

Arguments

Examples

<%syndicate_description%>
<%syndicate_description(25)%>

Templatevar: image

Inserts an inline image into an item body or template.

In normal use, the image-templatevar is generated automatically when adding images through the media library. You can call it from within templates too, though. Note that in this last case, the image will come out of the media dir of the current item's author.

Arguments

Examples

<%image(myphoto.jpg|100|200|this is me)%>
<%image(myphoto.jpg|50%|50%|this is me, but smaller)%>

Templatevar: popup

Inserts a popup image into an item body or template.

In normal use, the popup-templatevar is generated automatically when adding images through the media library. You can call it from within templates too, though. Note that in this last case, the image will come out of the media dir of the current item's author.

Arguments

Examples

<%popup(myphoto.jpg|100|200|this is me)%>
<%popup(myphoto.jpg|50%|50%|this is me, but smaller)%>

Templatevar: media

Inserts a media object into an item body or template.

In normal use, the media-templatevar is generated automatically when adding images through the media library. You can call it from within templates too, though. Note that in this last case, the object will come out of the media dir of the current item's author.

Arguments

Examples

<%media(mysong.mp3|listen to my new song)%>

Templatevar: edit

From within your template, you can add an 'edit item' link by using this template variable. By default, it will link to a popup-bookmarklet-window, but that behaviour can be changed through the editlink template.

Note: only logged in members that are allowed to edit the item will see this link. In other cases, the edit-templatevar does nothing at all.

Example

An example for the item body template

<b><%title%></b>
<br /><%body%> <%morelink%>
<br /><i><%edit%> <%comments%></i>

Results in

Title
This is an item
edit - 5 comments

Templatevar: editlink

Insert a link to the 'edit item' bookmarklet. This can be used in the editlink template for simplicity.

Example

The 'edit link'-template could look like this:

<a href="<%editlink%>" 
   onclick="<%editpopupcode%>">edit</a> -

Templatevar: editpopupcode

To open a popup window for the 'edit link' window, you'll need to add some javascript code to your link. To avoid having to enter this code in the 'edit link'-template, you can insert it using the editpopupcode-templatevar.

Example

See the example for the editlink templatevar

Plugins

Nucleus allows you to install custom plugins, to extend the functionality. Plugins can do different things:

  1. Act as a skin variable
  2. Act as a template variable
  3. Hook into events generated by Nucleus. The 'move up' and 'move down' links in 'manage plugins' screen can be used to define the order in which plugins will be called when such an event occurs. The first plugin in the list will be called first, the last one will be called last.
  4. Act as actors when called through action.php

Note the responsibility to write a working plugin, is for the plugin author.