Changeset 229
- Timestamp:
- 07/06/10 13:08:59 (19 months ago)
- Location:
- branches/fuze
- Files:
-
- 1 added
- 1 edited
-
modules/mod_latestphoto/module.php (modified) (2 diffs)
-
templates/_default_/modules/mod_latestphoto.tpl (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/fuze/modules/mod_latestphoto/module.php
r181 r229 26 26 27 27 if (!$cfg['showclubs']) { $catsql .= " AND a.NSDiffer=''"; } 28 29 $col = 1; $maxcols = $cfg['maxcols'];30 28 31 29 $sql = "SELECT f.*, f.pubdate as fpubdate, a.id as album_id, a.title as album … … 36 34 37 35 $result = $inDB->query($sql); 38 36 $is_photo = false; 37 39 38 if ($inDB->num_rows($result)){ 40 $photos = array(); 41 echo '<table cellspacing="2" border="0" width="100%">'; 39 $photos = array(); 40 $is_photo = true; 41 42 42 while($con = $inDB->fetch_assoc($result)){ 43 if ($col==1) { echo '<tr>'; } echo '<td align="center" valign="middle" class="mod_lp_photo" width="'.round(100/$maxcols, 0).'%">';44 echo '<table width="100%" height="100" cellspacing="0" cellpadding="0">';45 43 if ($cfg['showtype']=='full'){ 46 echo '<tr><td align="center"><div class="mod_lp_titlelink"><a href="/photos/photo'.$con['id'].'.html" title="'.$con['title'].'">'.$con['title'].'</a></div></td></tr>';47 }48 echo '<tr>49 <td valign="middle" align="center">';50 echo '<a href="/photos/photo'.$con['id'].'.html" title="'.$con['title'].'">';51 echo '<img class="photo_thumb_img" src="/images/photos/small/'.$con['file'].'" alt="'.$con['title'].'" border="0" />';52 echo '</a>';53 echo '</td></tr>';54 if ($cfg['showtype']=='full'){55 echo '<tr>';56 echo '<td align="center">';57 if($cfg['showalbum']){58 echo '<div class="mod_lp_albumlink"><a href="/photos/'.$con['album_id'].'" title="'.$con['album'].'">'.$con['album'].'</a></div>';59 }60 44 if($cfg['showcom'] || $cfg['showdate']){ 61 echo '<div class="mod_lp_details">';62 echo '<table cellpadding="2" cellspacing="2" align="center" border="0"><tr>';63 45 if ($cfg['showdate']){ 64 echo '<td><img src="/images/icons/date.gif" border="0"/></td>'; 65 echo '<td>'.$inCore->dateFormat($con['fpubdate']).'</td>'; 46 $con['fpubdate'] = $inCore->dateFormat($con['fpubdate']); 66 47 } 67 48 if ($cfg['showcom']){ 68 echo '<td><img src="/images/icons/comments.gif" border="0"/></td>'; 69 echo '<td><a href="/photos/photo'.$con['id'].'.html#c">'.$inCore->getCommentsCount('photo', $con['id']).'</td>'; 49 $con['comments'] = $inCore->getCommentsCount('photo', $con['id']); 70 50 } 71 echo '</tr></table>';72 echo '</div>';73 51 } 74 echo '</td>';75 echo '</tr>';76 52 } 77 echo '</table>'; 78 //echo '</div>'; 79 80 echo '</td>'; if ($col==$maxcols) { echo '</tr>'; $col=1; } else { $col++; } 53 $photos[] = $con; 81 54 } 82 if ($col>1) { echo '<td colspan="'.($maxcols-$col+1).'"> </td></tr>'; } 83 echo '</table>'; 84 if ($cfg['showmore']){ 85 echo '<div style="text-align:right"><a style="text-decoration:underline" href="/photos/latest.html">Âñå íîâûå ôîòî</a> →</div>'; 86 } 87 } else { echo '<p>Íåò ìàòåðèàëîâ äëÿ îòîáðàæåíèÿ.</p>'; } 55 } 88 56 57 $smarty = $inCore->initSmarty('modules', 'mod_latestphoto.tpl'); 58 $smarty->assign('photos', $photos); 59 $smarty->assign('cfg', $cfg); 60 $smarty->assign('is_photo', $is_photo); 61 $smarty->display('mod_latestphoto.tpl'); 89 62 90 63 return true;
Note: See TracChangeset
for help on using the changeset viewer.
