Coda Clips

Friendly pre-formated TinyUrl link to Tweet your TXP articles

<p><img src="<txp:site_url />img/twitter.gif" width="18" height="18" alt="Twitter" class="icon" /> <a href="http://twitter.com/home?status=I%20am%20currently%20reading%20%3Ca%20href='<txp:php>echo file_get_contents("http://tinyurl.com/api-create.php?url=".permlink(array())).'\'%3E'.$thisarticle['url_title'];</txp:php>%3C/a%3E" title="Publish it on Twitter!" class="tooltip" onclick="window.open(this.href); return false;">Tweet!</a></p>

Added to by Patrick Lefevre

Install Clip


Display modified and changed article dates with real name authors

<p>Published by <txp:author /> on <txp:posted format="%m %d %Y - %H:%I" /><txp:php>
$changed = modified(array( 'format'=>'%m %d %Y - %H:%I'));
echo $changed == posted(array('format'=>'%m %d %Y - %H:%I')) ? '' : ' | Changed by '.safe_field("RealName", "txp_users", "name='".safe_field("LastModID", "textpattern", "ID='".$thisarticle['thisid']."'")."'").' on '.$changed.'';</txp:php></p>

Added to by Patrick Lefevre

Install Clip


A TXP form to display authors within an unordered list

<txp:php>
// privileges are set here for all authors except for administrator (1) and managing editor (2)
$authors = safe_rows('Realname, privs', 'txp_users', 'privs > 2');
if ($authors > 1) {
echo '<h3>Our Authors:</h3>'."\r".'<ul>'."\r";
foreach($authors as $key => $value) {
$name = sanitizeForUrl($authors[$key][Realname]);
echo '<li><a href="'.hu.'authors/'.$name.'" title="About this author...">'.$authors[$key][Realname].'</a></li>';
}
echo '</ul>'."\r";
}
</txp:php>

Added to by Patrick Lefevre

Install Clip


Two-level navigation menu by catgories and their assigned articles

<txp:category_list parent="**SelectionInsertionPlaceholder**" exclude="**SelectionInsertionPlaceholder**" wraptag="ul" break="li" > 
<txp:variable name="catclass" value="passive" />
<txp:if_category name='<txp:category />'>
 <txp:variable name="catclass" value="active" />
</txp:if_category>
<txp:category title="1" link="1" class='<txp:variable name="catclass" />' />
<txp:article_custom category='<txp:category />' wraptag="ul" break="li" sort="title asc">
<txp:variable name="artclass" value="passive" />
<txp:if_article_id>
 <txp:variable name="artclass" value="active" />
</txp:if_article_id>
<txp:permlink class='<txp:variable name="artclass" />'><txp:title /></txp:permlink>
</txp:article_custom>
</txp:category_list>

Added to by Robert Wetzlmayr

Install Clip


Respect plural when displaying comment count number

<txp:if_comments><p class="comments-nbr"><txp:php>
global $thisarticle;
$nbr = comments_count(array());
$nbr > 1 ? $plural = 's' : '';
echo( ($nbr == 0 ? '' : ($nbr > 1 ? $nbr.' comment' : $nbr.' comment'.$nbr) );
</txp:php></p></txp:if_comments>

Added to by Patrick Lefevre

Install Clip


Hide Notes in Textpattern

<txp:hide><<**SelectionInsertionPlaceholder**>></txp:hide>

Added to by Graham Bancroft

Install Clip


Page Title

<txp:page_title />

Added to by Sam Brown

Install Clip


Custom Form

<txp:output_form form="<<**SelectionInsertionPlaceholder**>>" />

Added to by Sam Brown

Install Clip


Sponsored Links: