Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-29 11:26:56

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

jmd_wiki_events: Wikipedia events based on date

Download 0.1

<txp:jmd_wiki_events/> is a rewrite of mdn_wikitoday. It returns a list of Wikipedia events based on either the article’s date or the current date, depending on its context. Wikipedia events are stored in a table for two months before being updated.

Before you use the plugin, ensure your server uses PHP5 and that you’ve installed the table via Extensions>jmd_wiki_events.

Tag overview

Tag Attributes Context Description
<txp:jmd_wiki_events/> limit, reverse Page, article Returns an unordered list of events from Wikipedia.
<txp:jmd_wiki_events_display/> jmd_wiki_events Same as <txp:jmd_wiki_events/>.
<txp:jmd_wiki_events_link/> class, title jmd_wiki_events Returns a link to the Wikipedia page
<txp:jmd_wiki_events_date/> format jmd_wiki_events Returns the date used for the Wikipedia events

<txp:jmd_wiki_events/>

If the tag is used in an article form, the article’s date will be used for the events. In a page template, the current date will be used.

Attribute Available values Default value Description
limit INT Unlimited Limit the number of events (list items)
reverse 1, 0 0 Reverse the sort order of the events
<txp:jmd_wiki_events/>

<txp:jmd_wiki_events_display/>

<txp:jmd_wiki_events limit="20">
	This happened today:
	<txp:jmd_wiki_events_display/>
</txp:jmd_wiki_events>

<txp:jmd_wiki_events_link/>

Attribute Default value Description
class class attribute for the link
title title attribute for the link
<txp:jmd_wiki_events>
	<txp:jmd_wiki_events_link>Today's events</txp:jmd_wiki_events_link>
	<txp:jmd_wiki_events_display/>
</txp:jmd_wiki_events>

<txp:jmd_wiki_events_date/>

Attribute Available values Default value Description
format strftime format Y-m-d Display the events’ date
<txp:jmd_wiki_events>
	Events for <txp:jmd_wiki_events_date/>
	<txp:jmd_wiki_events_display/>
</txp:jmd_wiki_events>

Example

<txp:jmd_wiki_events limit="10" reverse="1">
	<p>
		I made <a href="<txp:jmd_wiki_events_link/>">this link</a> all 
		by myself.
	</p>

	<h2>
		<txp:jmd_wiki_events_link class="wiki" title="Check out the original">
			<txp:jmd_wiki_events_date/>: Historical events
		</txp:jmd_wiki_events_link>
	</h2>

	<txp:jmd_wiki_events_display/>
</txp:jmd_wiki_events>

Credits

  • Mark Norton for mdn_wikitoday’s wicked HTML parser
  • “Ruhh” for prompting and testing this plugin

Last edited by jm (2008-03-31 08:35:26)

Offline

#2 2008-05-19 18:38:03

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: jmd_wiki_events: Wikipedia events based on date

Darn, I don’t have PHP5.


<txp:Ruhh />

Offline

Board footer

Powered by FluxBB