Update of /cvsroot/php-blog/serendipity/templates/default
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12960/templates/default
Modified Files:
Tag: branch-smarty
entries.tpl
Log Message:
- Replace some of this $bydate etc. logic, since it's really unnecessary and bad for performance
TODO: Fix entries_summary.tpl
- Don't attempt to show category images, if there are none
Index: entries.tpl
===================================================================
RCS file: /cvsroot/php-blog/serendipity/templates/default/Attic/entries.tpl,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -d -r1.1.2.10 -r1.1.2.11
--- entries.tpl 23 Sep 2004 15:49:59 -0000 1.1.2.10
+++ entries.tpl 26 Sep 2004 00:47:47 -0000 1.1.2.11
@@ -1,64 +1,66 @@
<!-- ENTRIES START -->
- {section name=date loop=$bydate}
+ {foreach from=$entries item="dategroup"}
<div class="serendipity_Entry_Date">
- {if $dateref[date] eq 'sticky'}
+ {if $dategroup.is_sticky}
<h3 class="serendipity_date">STICKY POSTINGS</h3>
{else}
- <h3 class="serendipity_date">{$dateref[date]|@formatTime:DATE_FORMAT_ENTRY}</h3>
+ <h3 class="serendipity_date">{$dategroup.date|@formatTime:DATE_FORMAT_ENTRY}</h3>
{/if}
- {section name=x loop=$bydate[date]}
- <h4 class="serendipity_title"><a href="{$bydate[date][x].entryLink}">{$bydate[date][x].title}</a></h4>
+ {foreach from=$dategroup.entries item="entry"}
+ <h4 class="serendipity_title"><a href="{$entry.link}">{$entry.title}</a></h4>
<div class="serendipity_entry">
- {if is_array($bydate[date][x][categories])}
+ {if $entry.categories}
<span class="serendipity_entryIcon">
- {section name=cat loop=$bydate[date][x][categories]}
- <a href="{$serendipityHTTPPath}{$serendipityRewritePrefix}{$CONST.PATH_CATEGORIES}/{$bydate[date][x][categories].categoryid}-{$bydate[date][x][categories].category_name|@makeFilename}"><img class="serendipity_entryIcon" title="{$bydate[date][x][categories].category_name|@escape}{$bydate[date][x][categories].category_description|@emptyPrefix}" alt="{$bydate[date][x][categories].category_name|@escape}" src="{$bydate[date][x][categories].category_icon}" /></a>
- {/section}
+ {foreach from=$entry.categories item="category"}
+ {if $category.category_icon}
+ <a href="{$serendipityHTTPPath}{$serendipityRewritePrefix}{$CONST.PATH_CATEGORIES}/{$category.category_id}-{$category.category_name|@makeFilename}"><img class="serendipity_entryIcon" title="{$category.category_name|@escape}{$category.category_description|@emptyPrefix}" alt="{$category.category_name|@escape}" src="{$category.category_icon}" /></a>
+ {/if}
+ {/foreach}
</span>
{/if}
<div class="serendipity_entry_body">
- {$bydate[date][x].body}
+ {$entry.body}
</div>
- {if $bydate[date][x].is_extended}
- <div class="serendipity_entry_extended"><a id="extended"></a>{$bydate[date][x].extended}</div>
+ {if $entry.is_extended}
+ <div class="serendipity_entry_extended"><a id="extended"></a>{$entry.extended}</div>
{/if}
- {if $bydate[date][x].has_extended and not $is_single_entry}
- <br /><a href="{$bydate[date][x].entryLink}#extended">{$bydate[date][x].title|@printf:VIEW_EXTENDED_ENTRY}</a><br /><br />
+ {if $entry.has_extended and not $is_single_entry}
+ <br /><a href="{$entry.link}#extended">{$entry.title|@printf:VIEW_EXTENDED_ENTRY}</a><br /><br />
{/if}
<div class='serendipity_entryFooter'>
- {$CONST.POSTED_BY} {$bydate[date][x].username}
- {if is_array($bydate[date][x].categories)}
- {$CONST.IN} {section name=cat loop=$bydate[date][x].categories}<a href="{$serendipityHTTPPath}{$serendipityRewritePrefix}{$CONST.PATH_CATEGORIES}/{$bydate[date][x].categories[cat].categoryid}-{$bydate[date][x].categories[cat].category_name|@makeFilename}">{$bydate[date][x].categories[cat].category_name|@escape}</a> {/section}
+ {$CONST.POSTED_BY} {$entry.username}
+ {if $entry.categories}
+ {$CONST.IN} {foreach from=$entry.categories item="category"}<a href="{$serendipityHTTPPath}{$serendipityRewritePrefix}{$CONST.PATH_CATEGORIES}/{$category.categoryid}-{$category.category_name|@makeFilename}">{$category.category_name|@escape}</a> {/foreach}
{/if}
- {$CONST.AT} <a href="{$bydate[date][x].entryLink}">{$bydate[date][x].timestamp|@formatTime:'%H:%M'}</a>
+ {$CONST.AT} <a href="{$entry.link}">{$entry.timestamp|@formatTime:'%H:%M'}</a>
- {if $bydate[date][x].has_comments}
+ {if $entry.has_comments}
{if $use_popups}
- | <a href="{$serendipityHTTPPath}comment.php?serendipity[entry_id]={$bydate[date][x].id}&serendipity[type]=comments" onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;">{$bydate[date][x].label_comments} ({$bydate[date][x].comments})</a>
+ | <a href="{$serendipityHTTPPath}comment.php?serendipity[entry_id]={$entry.id}&serendipity[type]=comments" onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;">{$entry.label_comments} ({$entry.comments})</a>
{else}
- | <a href="{$bydate[date][x].entryLink}#comments">{$bydate[date][x].label_trackbacks} ({$bydate[date][x].comments})</a>
+ | <a href="{$entry.link}#comments">{$entry.label_comments} ({$entry.comments})</a>
{/if}
{/if}
- {if $bydate[date][x].has_trackbacks}
+ {if $entry.has_trackbacks}
{if $use_popups}
- | <a href="{$serendipityHTTPPath}comment.php?serendipity[entry_id]={$bydate[date][x].id}&serendipity[type]=trackbacks" onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;">{$bydate[date][x].label_trackbacks} ({$bydate[date][x].trackbacks})</a>
+ | <a href="{$serendipityHTTPPath}comment.php?serendipity[entry_id]={$entry.id}&serendipity[type]=trackbacks" onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;">{$entry.label_trackbacks} ({$entry.trackbacks})</a>
{else}
- | <a href="{$bydate[date][x].entryLink}#trackbacks">{$bydate[date][x].label_trackbacks} ({$bydate[date][x].trackbacks})</a>
+ | <a href="{$entry.entryLink}#trackbacks">{$entry.label_trackbacks} ({$entry.trackbacks})</a>
{/if}
{/if}
- {if $bydate[date][x].is_entry_owner}
- | <a href="{$serendipityBaseURL}serendipity_entries.php?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]={$bydate[date][x].id}">{$CONST.EDIT_ENTRY}</a>
+ {if $entry.is_entry_owner}
+ | <a href="{$serendipityBaseURL}serendipity_entries.php?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=edit&serendipity[id]={$entry.id}">{$CONST.EDIT_ENTRY}</a>
{/if}
- {$bydate[date][x].add_footer}
+ {$entry.add_footer}
</div>
</div>
<!--
@@ -66,13 +68,13 @@
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
- rdf:about="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/ei_{$bydate[date][x].id}.rdf"
- trackback:ping="{$serendipityBaseURL}comment.php?type=trackback&entry_id={$bydate[date][x].id}"
- dc:title="{$bydate[date][x].title}"
- dc:identifier="{$bydate[date][x].rdf_ident}" />
+ rdf:about="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/ei_{$entry.id}.rdf"
+ trackback:ping="{$serendipityBaseURL}comment.php?type=trackback&entry_id={$entry.id}"
+ dc:title="{$entry.title}"
+ dc:identifier="{$entry.rdf_ident}" />
</rdf:RDF>
-->
- {$bydate[date][x].plugin_display_dat}
+ {$entry.plugin_display_dat}
{if $CONST.DATA_UNSUBSCRIBED}
<br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_UNSUBSCRIBED|@printf:UNSUBSCRIBE_OK}</div><br />
@@ -114,9 +116,9 @@
<div class="serendipity_commentsTitle">{$CONST.COMMENTS}</div>
<div class="serendipity_center">{$CONST.DISPLAY_COMMENTS_AS}
{if $is_cview_linear}
- ({$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$serendipityHTTPPath}{$serendipityIndexFile}?url={$bydate[date][x].commURL}&serendipity[cview]={$CONST.VIEWMODE_THREADED}#comments">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>)
+ ({$CONST.COMMENTS_VIEWMODE_LINEAR} | <a href="{$serendipityHTTPPath}{$serendipityIndexFile}?url={$entry.commURL}&serendipity[cview]={$CONST.VIEWMODE_THREADED}#comments">{$CONST.COMMENTS_VIEWMODE_THREADED}</a>)
{else}
- (<a href="{$serendipityHTTPPath}{$serendipityIndexFile}?url={$bydate[date][x].commURL}&serendipity[cview]={$CONST.VIEWMODE_LINEAR}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED})
+ (<a href="{$serendipityHTTPPath}{$serendipityIndexFile}?url={$entry.commURL}&serendipity[cview]={$CONST.VIEWMODE_LINEAR}#comments">{$CONST.COMMENTS_VIEWMODE_LINEAR}</a> | {$CONST.COMMENTS_VIEWMODE_THREADED})
{/if}
</div>
{$COMMENTS}
@@ -145,11 +147,12 @@
</div>
{/if}
- {$bydate[date][x].plugin_backend_preview}
- {/section}
+ {$entry.plugin_backend_preview}
+ {/foreach}
</div>
-
- {/section}
+ {foreachelse}
+ {$CONST.NO_ENTRIES_TO_PRINT}
+ {/foreach}
<div class='serendipity_entryFooter' style="text-align: center">
{if $footer_prev_page}
|