Changeset 225
- Timestamp:
- 07/05/10 13:52:23 (19 months ago)
- Location:
- branches/fuze
- Files:
-
- 2 edited
-
modules/mod_latestblogs/module.php (modified) (2 diffs)
-
templates/_default_/modules/mod_latestblogs.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/fuze/modules/mod_latestblogs/module.php
r181 r225 47 47 48 48 $result = $inDB->query($sql); 49 $is_blog = false; 50 if ($inDB->num_rows($result)){ 49 51 50 if ($inDB->num_rows($result)){ 51 echo '<table cellspacing="2" cellpadding="4" border="0">'; 52 52 $is_blog = true; 53 53 $count = 1; 54 54 $posts = array(); 55 55 56 while($con = $inDB->fetch_assoc($result)){ 56 57 … … 67 68 } 68 69 69 $link = $model->getPostURL(null, $con['bloglink'], $con['seolink']); 70 $text = strip_tags($con['title']); 71 72 if (strlen($text)>70) { $text = substr($text, 0, 70). '...'; } 73 echo '<tr>'; 74 echo '<td valign="top">'; 75 echo '<a class="mod_blog_userlink" href="'.$model->getBlogURL(null, $con['bloglink']).'">'.$con['blog'].'</a> → '; 76 77 echo '<a class="mod_blog_link" href="'.$link.'">'.$text.'</a> ('.$inCore->dateFormat($con['fpubdate']).')</td>'; 78 echo '</tr>'; 70 $con['href'] = $model->getPostURL(null, $con['bloglink'], $con['seolink']); 71 $con['title'] = strip_tags($con['title']); 72 if (strlen($con['title'])>70) { $con['title'] = substr($con['title'], 0, 70). '...'; } 73 $con['fpubdate'] = $inCore->dateFormat($con['fpubdate']); 74 $con['bloghref'] = $model->getBlogURL(null, $con['bloglink']); 79 75 80 76 $count++; 81 77 82 78 } 83 79 $posts[] = $con; 84 80 } 85 86 echo '</table>'; 87 88 if ($cfg['showrss']){ 89 echo '<table align="right" style="margin-top:5px"><tr>'; 90 echo '<td width="16"><img src="/images/markers/rssfeed.png" /></td>'; 91 echo '<td><a href="/rss/blogs/all/feed.rss" style="text-decoration:underline;color:#333">'.$_LANG['LATESTBLOGS_RSS'].'</a></td>'; 92 echo '</tr></table>'; 93 } 94 } else { echo '<p>'.$_LANG['LATESTBLOGS_NOT_POSTS'].'</p>'; } 81 82 } 83 84 $smarty = $inCore->initSmarty('modules', 'mod_latestblogs.tpl'); 85 $smarty->assign('posts', $posts); 86 $smarty->assign('cfg', $cfg); 87 $smarty->assign('is_blog', $is_blog); 88 $smarty->display('mod_latestblogs.tpl'); 95 89 96 90 return true; -
branches/fuze/templates/_default_/modules/mod_latestblogs.tpl
r181 r225 1 {if $is_blog} 1 2 <table width="100%" cellspacing="0" cellpadding="5" border="0" > 2 3 {foreach key=tid item=post from=$posts} 3 4 <tr> 4 <td class="mod_blog_karma">{$post.karma}</td>5 5 <td> 6 6 <div> 7 7 <a class="mod_blog_userlink" href="{$post.bloghref}">{$post.blog}</a> → 8 <a class="mod_blog_link" href="{$post.href}">{$post.title}</a> ({$post. date})8 <a class="mod_blog_link" href="{$post.href}">{$post.title}</a> ({$post.fpubdate}) 9 9 </div> 10 10 </td> … … 12 12 {/foreach} 13 13 </table> 14 {if $cfg.showrss} 15 <a href="/rss/blogs/all/feed.rss" class="mod_latest_rss">{$LANG.LATESTBLOGS_RSS}</a> 16 {/if} 17 {else} 18 <p>{$LANG.LATESTBLOGS_NOT_POSTS}</p> 19 {/if}
Note: See TracChangeset
for help on using the changeset viewer.
