$user_album_set = array(); foreach($user_albums_list as $album) $user_album_set[$album['aid']] = 1;
// Create a timestamp. $timestamp = time();
$reset_votes = isset($_POST['reset_votes'.$pid]);
$reset_potd = isset($_POST['reset_potd'.$pid]); $reset_potd_date = isset($_POST['reset_potd_date'.$pid]); $reset_potdn = isset($_POST['reset_potdn'.$pid]); $reset_potw = isset($_POST['reset_potw'.$pid]); $reset_potw_date = isset($_POST['reset_potw_date'.$pid]); $reset_potwn = isset($_POST['reset_potwn'.$pid]);
if ($reset_votes) $update .= ", pic_rating = '0', votes = '0'";
if (GALLERY_ADMIN_MODE) { if ($reset_potd) $update .= ", potd = '1', potd_date = '$timestamp'"; if ($reset_potdn) $update .= ", potd = '2'"; if ($reset_potw) $update .= ", potw = '1', potw_date = '$timestamp'"; if ($reset_potwn) $update .= ", potw = '2'"; }
<tr> <td class="tableb" colspan="3" align="center"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="20%" align="center"><input type="radio" name="galleryicon" id="galleryicon{$CURRENT_PIC['pid']}" value="{$CURRENT_PIC['pid']}" {$isgalleryicon_selected}{$isgalleryicon_disabled}class="checkbox">{$lang_editpics_php['gallery_icon']}</td> <td width="20%" align="center"><input type="checkbox" name="delete{$CURRENT_PIC['pid']}" id="delete{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="delete{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_pic']}</label></td> <td width="20%" align="center"><input type="checkbox" name="reset_vcount{$CURRENT_PIC['pid']}" id="reset_vcount{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="reset_vcount{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['reset_view_count']}</label></td> <td width="20%" align="center"><input type="checkbox" name="reset_votes{$CURRENT_PIC['pid']}" id="reset_votes{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="reset_votes{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['reset_votes']}</label></td> <td width="20%" align="center"><input type="checkbox" name="del_comments{$CURRENT_PIC['pid']}" id="del_comments{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="del_comments{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_comm']}</label></td> </tr> </table> </td> </tr> EOT; } }
<tr> <td class="tableb" colspan="3" align="center"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="20%" align="center"><input type="radio" name="galleryicon" id="galleryicon{$CURRENT_PIC['pid']}" value="{$CURRENT_PIC['pid']}" {$isgalleryicon_selected}{$isgalleryicon_disabled}class="checkbox">{$lang_editpics_php['gallery_icon']}</td> <td width="20%" align="center"><input type="checkbox" name="delete{$CURRENT_PIC['pid']}" id="delete{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="delete{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_pic']}</label></td> <td width="20%" align="center"><input type="checkbox" name="reset_vcount{$CURRENT_PIC['pid']}" id="reset_vcount{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="reset_vcount{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['reset_view_count']}</label></td> <td width="20%" align="center"><input type="checkbox" name="reset_votes{$CURRENT_PIC['pid']}" id="reset_votes{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="reset_votes{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['reset_votes']}</label></td> <td width="20%" align="center"><input type="checkbox" name="del_comments{$CURRENT_PIC['pid']}" id="del_comments{$CURRENT_PIC['pid']}" value="1" class="checkbox"><label for="del_comments{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['del_comm']}</label></td></tr> </table> </td> </tr> EOT; if (GALLERY_ADMIN_MODE){ echo <<<EOT <tr> <td class="tableb" colspan="3" align="center"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <tr> <td width="25%" align="center"> <b><input type="checkbox" name="reset_potd{$CURRENT_PIC['pid']}" value="YES" class="checkbox" />{$lang_editpics_php['potdnew']}</b></td><td width="25%" align="center"><b><input type="checkbox" name="reset_potdn{$CURRENT_PIC['pid']}" value="NO" class="checkbox" />{$lang_editpics_php['potdold']}</b> <td width="25%" align="center"> <b><input type="checkbox" name="reset_potw{$CURRENT_PIC['pid']}" value="YES" class="checkbox" />{$lang_editpics_php['potwnew']}</b></td><td width="25%" align="center"><b><input type="checkbox" name="reset_potwn{$CURRENT_PIC['pid']}" value="NO" class="checkbox" />{$lang_editpics_php['potwold']}</b> </td> </tr> </table> </td> </tr> EOT; } } }
$lang_meta_album_names = array(
'potd' => 'Photo of the Day', 'potdarch' => 'Photo of the Day Archive', 'potw' => 'Photo of the Week', 'potwarch' => 'Photo of the Week Archive', 'by' => 'by our member ',
// File editpics.php
'potdnew' => 'Set as P.o.t.Day', 'potdold' => 'Move to POTD archive', 'potwnew' => 'Set as P.o.t.Week', 'potwold' => 'Move to POTW archive',
case 'topn': // Most viewed pictures
case 'potdarch': // Last uploads if ($ALBUM_SET && $CURRENT_CAT_NAME) { $album_name = $lang_meta_album_names['potdarch'].' - '. $CURRENT_CAT_NAME; } else { $album_name = $lang_meta_album_names['potdarch']; } $query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE (approved = 'YES' && potd = '2') $ALBUM_SET"; $result = db_query($query); $nbEnr = mysql_fetch_array($result); $count = $nbEnr[0]; mysql_free_result($result); if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, potd_date'; $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE (approved = 'YES' && potd = '2') $ALBUM_SET ORDER BY potd_date DESC $limit"; $result = db_query($query); $rowset = db_fetch_rowset($result); mysql_free_result($result); if ($set_caption) foreach ($rowset as $key => $row){ $user_link = ($CONFIG['display_uploader'] && $row['owner_id'] && $row['owner_name']) ? '<span class="thumb_title"><a href ="profile.php?uid='.$row['owner_id'].'">'.$row['owner_name'].'</a></span>' : ''; $caption = $user_link.'<span class="thumb_caption">'.localised_date($row['potd_date'], $lastup_date_fmt).'</span>'; $rowset[$key]['caption_text'] = $caption; } $rowset = CPGPluginAPI::filter('thumb_caption_lastup',$rowset); return $rowset; break; case 'potwarch': // Last uploads if ($ALBUM_SET && $CURRENT_CAT_NAME) { $album_name = $lang_meta_album_names['potwarch'].' - '. $CURRENT_CAT_NAME; } else { $album_name = $lang_meta_album_names['potwarch']; } $query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE (approved = 'YES' && potw = '2') $ALBUM_SET"; $result = db_query($query); $nbEnr = mysql_fetch_array($result); $count = $nbEnr[0]; mysql_free_result($result); if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, potw_date'; $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE (approved = 'YES' && potw = '2') $ALBUM_SET ORDER BY potw_date DESC $limit"; $result = db_query($query); $rowset = db_fetch_rowset($result); mysql_free_result($result); if ($set_caption) foreach ($rowset as $key => $row){ $user_link = ($CONFIG['display_uploader'] && $row['owner_id'] && $row['owner_name']) ? '<span class="thumb_title"><a href ="profile.php?uid='.$row['owner_id'].'">'.$row['owner_name'].'</a></span>' : ''; $caption = $user_link.'<span class="thumb_caption">'.localised_date($row['potw_date'], $lastup_date_fmt).'</span>'; $rowset[$key]['caption_text'] = $caption; } $rowset = CPGPluginAPI::filter('thumb_caption_lastup',$rowset); return $rowset; break;
case 'lasthits': display_thumbnails('lasthits', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false); flush(); break;
case 'potd': if ($cat == 0) { include('potd.php'); } flush(); break; case 'potw': if ($cat == 0) { include('potw.php'); } flush(); break;