Changeset 219
- Timestamp:
- 07/02/10 14:19:31 (19 months ago)
- Location:
- branches/fuze
- Files:
-
- 1 added
- 1 edited
-
modules/mod_bestphoto/module.php (modified) (2 diffs)
-
templates/_default_/modules/mod_bestphoto.tpl (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/fuze/modules/mod_bestphoto/module.php
r181 r219 21 21 if (!isset($cfg['showmore'])) { $cfg['showmore'] = 1; } 22 22 23 $col = 1; $maxcols = $cfg['maxcols'];24 25 23 $sql = "SELECT f.*, f.id as fid, f.pubdate as fpubdate, 26 24 a.id as album_id, a.title as album, … … 35 33 36 34 $result = $inDB->query($sql) ; 37 35 $is_best = false; 38 36 if ($inDB->num_rows($result)){ 39 echo '<table cellspacing="2" border="0" width="100%">'; 37 $is_best = true; 38 $cons = array(); 40 39 while($con = $inDB->fetch_assoc($result)){ 41 $votes = $con[$cfg['sort']];42 if ($col==1) { echo '<tr>'; } echo '<td align="center" valign="middle" class="mod_lp_photo" width="'.round(100/$maxcols, 0).'%">';43 echo '<table width="100%" height="100" cellspacing="0" cellpadding="0">';44 40 if ($cfg['showtype']=='full'){ 45 echo '<tr><td align="center"><div class="mod_lp_titlelink"><a href="/photos/photo'.$con['id'].'.html" title="'.$con['title'].' ('.$con['rating'].')">'.$con['title'].'</a></div></td></tr>';46 }47 echo '<tr>';48 echo '<td valign="middle" align="center">';49 echo '<a href="/photos/photo'.$con['id'].'.html" title="'.$con['title'].'">';50 echo '<img class="photo_thumb_img" src="/images/photos/small/'.$con['file'].'" alt="'.$con['title'].' ('.$con['rating'].')" border="0" />';51 echo '</a>';52 echo '</td></tr>';53 if ($cfg['showtype']=='full'){54 echo '<tr>';55 echo '<td align="center">';56 if($cfg['showalbum']){57 echo '<div class="mod_lp_albumlink"><a href="/photos/'.$con['album_id'].'" title="'.$con['album'].'">'.$con['album'].'</a></div>';58 }59 41 if($cfg['showcom'] || $cfg['showdate']){ 60 echo '<div class="mod_lp_details">';61 echo '<table cellpadding="2" cellspacing="2" align="center" border="0"><tr>';62 42 if ($cfg['showdate']){ 63 43 include_once($_SERVER['DOCUMENT_ROOT'].'/core/lib_karma.php'); 64 44 if ($cfg['sort'] == 'rating'){ 65 echo '<td style="font-weight:bold">'.cmsKarmaFormat($con['rating']).'</td>';45 $con['votes'] = cmsKarmaFormat($con['rating']); 66 46 } else { 67 echo '<td>'.$votes.'</td>';47 $con['votes'] = $con[$cfg['sort']]; 68 48 } 69 49 } 70 50 if ($cfg['showcom']){ 71 echo '<td><img src="/images/icons/comments.gif" border="0"/></td>'; 72 echo '<td><a href="/photos/photo'.$con['id'].'.html#c">'.$inCore->getCommentsCount('photo', $con['id']).'</td>'; 51 $con['comments'] = $inCore->getCommentsCount('photo', $con['id']); 73 52 } 74 echo '</tr></table>';75 echo '</div>';76 53 } 77 echo '</td>';78 echo '</tr>';79 54 } 80 echo '</table>'; 81 //echo '</div>'; 82 echo '</td>'; if ($col==$maxcols) { echo '</tr>'; $col=1; } else { $col++; } 55 $cons[] = $con; 83 56 } 84 if ($col>1) { echo '<td colspan="'.($maxcols-$col+1).'"> </td></tr>'; }85 echo '</table>';86 if ($cfg['showmore']){87 echo '<div style="text-align:right"><a style="text-decoration:underline" href="/photos/top.html">'.$_LANG['BESTPHOTO_ALL_BEST_PHOTO'].'</a> →</div>';88 }89 } else { echo '<p>'.$_LANG['BESTCONTENT_NOT_MATERIALS'].'</p>'; }57 } 58 $smarty = $inCore->initSmarty('modules', 'mod_bestphoto.tpl'); 59 $smarty->assign('cons', $cons); 60 $smarty->assign('cfg', $cfg); 61 $smarty->assign('is_best', $is_best); 62 $smarty->display('mod_bestphoto.tpl'); 90 63 91 92 64 return true; 93 65
Note: See TracChangeset
for help on using the changeset viewer.
