All pastes #108651 Raw Edit

Untitled

public text v1 · immutable
#108651 ·published 2006-07-31 16:40 UTC
rendered paste body
<xar:set name="currentcids">
xarVarGetCached('Blocks.articles','cids')
</xar:set>

<xar:if condition="!isset($currentcids)">

<xar:set name="catarray">#xarModAPIFunc('categories','user','getchildren',array('cid'=&gt; 44))#</xar:set>
<xar:else />
<xar:set name="currentcid">current($currentcids)</xar:set>
<xar:set name="catarray">#xarModAPIFunc('categories','user','getchildren',array('cid'=&gt; $currentcid))#</xar:set>
</xar:if>

<xar:if condition="!empty($linkarticle.author)">
<h2>
<xar:ml>
<xar:mlstring>
By Author : #(1)
</xar:mlstring>
<xar:mlvar>
#$linkarticle.author#
</xar:mlvar>
</xar:ml>
</h2>
<br />
</xar:if>
<br />
<xar:foreach in="$catarray" value="$lcat">
<xar:if condition="is_array($lcat)">
<xar:comment>Get the articles in each category for pubtype 6 - currently weblinks</xar:comment>
<xar:set name="linklist">
#xarModAPIFunc('articles','user','getall',array('ptid'=&gt;8, 'cids'=&gt;array($lcat.cid),'extra' => array('dynamicdata','rating')))#
</xar:set>
<!--pre><xar:set name="foo">print_r($linklist)</xar:set></pre-->
<xar:comment>Setup the link targets for each category - remove spaces and replace with underscores</xar:comment>
<xar:set name="newtarget">str_replace(' ','_',$lcat['name'])</xar:set>
<a name="#$newtarget#"></a>
<div class="catgroup" style="margin:25px 0 0 0;">
	<h1>
<img src="/themes/dli2/modules/categories/images/#$lcat.image#" width="30px" style="margin:0 0 -10px 0;" /> #$lcat.name#
	</h1>
	<br />
#$lcat.description#
<xar:if condition="count($linklist) lt '1'">
<p class="catindent"><xar:mlstring>No links available in this category.</xar:mlstring></p>
	<xar:else />
<!--START ALTERNATING ROWS-->
	<xar:comment>
<xar:set name="k">0</xar:set>
<xar:foreach in="$linklist" value="$linkarticle">
<xar:set name="k">$k + 1</xar:set>
<xar:if condition="($k % 2 eq 1)">
<xar:set name="myclass">'downloads_normal'</xar:set>
			<xar:else />
<xar:set name="myclass">'downloads_alt'</xar:set>
			</xar:if>
</xar:comment>
<!--END ALTERNATING ROWS-->
<table style="margin:15px 0 0 0; border-collapse:collapse;width:500px;">
<xar:foreach in="$linklist" value="$linkarticle">
<tr style="border-top:1px solid #3b3b3b;">
<td class="" style="width:320px;">	<a href="#xarModURL('articles','user','display',array('aid' => $linkarticle.aid))#"><strong>#$linkarticle.title#</strong></a>  
<br /><small><xar:if condition="!empty($linkarticle.summary)">#$linkarticle.summary#</xar:if></small>

	<!--xar:set name="len">strlen($summary)</xar:set>
		<xar:set name="max_length">750</xar:set>
		<xar:if condition="$len gt $max_length">
<xar:set name="string">substr($summary, 0, $max_length)</xar:set>
	<xar:set name="pos">strrpos($string, " ")</xar:set>
			<xar:if condition="$pos eq false">
<xar:set name="summary">substr($string, 0, $max_length)</xar:set>
						#$summary#
						<xar:else />
<xar:set name="summary">substr($string, 0, $pos)</xar:set>
					#$linksarticle.summary#
						</xar:if>
<a href="#xarModURL('articles','user','display',array('aid' => aid))#">...</a>
						<xar:else />
						#$summary#
					</xar:if-->							


				</td>
	<td class="" style="width:80px;">
	<xar:if condition="!empty($linkarticle.rating)">
<div style="background-image:url('themes/dli2/modules/ratings/images/star.png'); background-repeat:repeat-x; width:#$linkarticle.rating#%;height:17px;border:0;margin:2px 0 2px 0;"></div>
						</xar:if>
				</td>
<td  class="" style="text-align:right; width:100px;">								<xar:if condition="!empty($linkarticle.attachment)">
	<xar:set name="anything">$linkarticle['attachment_output']</xar:set>
			<xar:foreach in="$anything" value="$fileInfo">
<a href="#$fileInfo['fileDownload']#"><img src="themes/dli2/img/minidownload.png" height="10px">Download</a>
				</td>
			</tr>
			<tr>
<td  class="" colspan="3" style="text-align:right;padding:0 5px 5px 0;">
					<small>
						<xar:ml>
						<xar:mlstring>
				<strong>Added By:</strong> #(1)
						</xar:mlstring>
						<xar:mlvar>
			#xarusergetvar('name',$linkarticle.authorid)#
						</xar:mlvar>
					</xar:ml>
<strong>on:</strong> #xarLocaleGetFormattedDate('short',$linkarticle.pubdate)#
<xar:if condition="!empty($linkarticle.notes)"><strong>Version:</strong> #$linkarticle.notes#</xar:if>
					</small>
	</xar:foreach>
</xar:if>
	</td>
	</tr>
</xar:foreach>
<tr>
<td colspan="3" style="border-top:1px solid #3b3b3b; text-align:right;"><a href="#$returnurl##top">Back to top</a></td>
</tr>
</table>
<br />
</xar:if>
</div><!--CLOSE CAT DIV-->
</xar:if>
</xar:foreach>

<xar:if condition="!empty($showcols)">
<xar:if condition="$showcols eq 1">
<a href="#xarModURL('articles','user','view',array('numcols' => 1))#">
<xar:mlstring>
single-column display
</xar:mlstring>
</a>
<xar:else />
<a href="#xarModURL('articles','user','view')#">
<xar:ml>
<xar:mlstring>
	#(1)-column display
</xar:mlstring>
	<xar:mlvar>
		#$showcols#
	</xar:mlvar>
</xar:ml>
</a>
</xar:if>
</xar:if>
<xar:template file="alphapager" type="module" />
<div style="text-align: center;">
<xar:comment>$pager (combining the pager and the sort links) will be removed in later versions</xar:comment>
<p>#$viewpager#</p>
<xar:if condition="isset($sortlinks) and count($sortlinks) gt 0">
<xar:mlstring>Sort by </xar:mlstring>
<xar:foreach in="$sortlinks" value="$sortitem">
<xar:if condition="!empty($sortitem['slink'])">
<a href="#$sortitem['slink']#">#$sortitem['stitle']#</a>
	<xar:else/>
#$sortitem['stitle']#
</xar:if>
</xar:foreach>
</xar:if>
</div><!--CLOSE PAGER DIV-->
<xar:if condition="!empty($showprevnext)">
<xar:categories-navigation layout="prevnext" />
</xar:if>
<xar:comment>
<xar:template file="navtabs-user" type="module" />
</xar:comment>