Loading...
 

CustomWikiMeta

Customize your Wiki authors information (in the editdate section)


In BRANCH-1-9, as of 8th Feb 2005, an array called $contributors is available to templates called from tiki-index.php. This may be used to customize the way that authors information is presented in the "editdate" section of a wiki page. The array contains, at most, the 10 next most recent editors for the page and never contains the most recent editor nor the Tiki users 'system' and 'admin'.

This functionality has some wrinkles when minor edits are (or have been) enabled, due to the way that authors' information is stored under such circumstances (an author of a minor edit may be displayed in preference to a major author).



Default style for most themes:

Created by:system last modification: Monday 07 of February, 2005 [15:21:16 UTC] by poohbar

Image
in tiki-show_page.tpl
<p class="editdate">
  {tr}Created by{/tr}: {$creator|userlink}
  {tr}last modification{/tr}:
  {$lastModif|tiki_long_datetime} {tr}by{/tr} {$lastUser|userlink}
</p>



))PmWiki(( style - good for business uses:

Last edited by poohbar, based on work by reg, demo and anonymoose. Page last modified on Monday 07 of February, 2005 [15:21:16 UTC].

Image
in tiki-show_page.tpl
<p class="editdate">
  {tr}Last edited by{/tr} {$lastUser|userlink}
  {section name=author loop=$contributors}
   {if $smarty.section.author.first}, {tr}based on work by{/tr}
   {else}
    {if !$smarty.section.author.last},
    {else} {tr}and{/tr}
    {/if}
   {/if}
   {$contributors[author]|userlink}
  {/section}.<br />                                         
  {tr}Page last modified on{/tr} {$lastModif|tiki_long_datetime}.
</p>



Collaborative style as used in StylesDamian and kuroBK.css themes:

Contributors to this page: poohbar, reg, demo and anonymoose. Page last modified on Monday 07 of February, 2005 [15:21:16 UTC].

Image
in tiki-show_page.tpl
<p class="editdate">
  {tr}Contributors to this page{/tr}: {$lastUser|userlink}
  {section name=author loop=$contributors}
   {if !$smarty.section.author.last},
   {else} {tr}and{/tr}
   {/if}
   {$contributors[author]|userlink}
  {/section}.<br />
  {tr}Page last modified on{/tr} {$lastModif|tiki_long_datetime}.
</p>

Performance
  • The wikilib->get_contributors(...) call adds 1 database query per wiki page.
  • The ))PmWiki(( and collaborative styles typically add three database queries for each uncached author userlink. The author userlink is normally cached on a per-user basis (but across the entire wiki) and for 2 hours. One could always remove "|userlink" from the codes above to prevent these database accesses (and the linking to user information, of course).

For more information

See EditTemplates for more information on customizing .tpl files.
See CustomHome for information about creating custom home pages.

Development

[+]

Page last modified on Thursday 10 February 2005 12:24:26 GMT-0000

Upcoming Events

No records to display

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.