Changeset 1098
- Timestamp:
- 10/06/08 11:05:03 (2 months ago)
- Files:
-
- trunk/swisscenter/base/db_abstract.php (modified) (3 diffs)
- trunk/swisscenter/config/config_movie.php (modified) (7 diffs)
- trunk/swisscenter/config/config_tv.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swisscenter/base/db_abstract.php
r871 r1098 111 111 112 112 foreach ($movies as $movie_id) 113 db_sqlcommand("update movies set ".db_array_to_set_list($columns)." where file_id=".$movie_id,false); 113 { 114 if (count($columns)>0) 115 db_sqlcommand("update movies set ".db_array_to_set_list($columns)." where file_id=".$movie_id,false); 116 // Determine whether any details other than title are available 117 db_sqlcommand("update movies set details_available='".(scdb_movie_details_available($movie_id) ? 'Y' : 'N')."' where file_id=".$movie_id,false); 118 } 114 119 } 115 120 … … 219 224 220 225 foreach ($tv as $tv_id) 221 db_sqlcommand("update tv set ".db_array_to_set_list($columns)." where file_id=".$tv_id,false); 226 { 227 if (count($columns)>0) 228 db_sqlcommand("update tv set ".db_array_to_set_list($columns)." where file_id=".$tv_id,false); 229 // Determine whether any details other than title are available 230 db_sqlcommand("update tv set details_available='".(scdb_tv_details_available($tv_id) ? 'Y' : 'N')."' where file_id=".$tv_id,false); 231 } 222 232 } 223 233 … … 253 263 } 254 264 265 // ---------------------------------------------------------------------------------------- 266 // Determine whether any details other than title are available 267 // ---------------------------------------------------------------------------------------- 268 269 function scdb_movie_details_available( $movie_id ) 270 { 271 $attribs = implode('',db_row("select year, certificate, synopsis from movies where file_id=$movie_id")); 272 $actors = db_value("select count(actor_id) from actors_in_movie where movie_id=$movie_id"); 273 $directors = db_value("select count(director_id) from directors_of_movie where movie_id=$movie_id"); 274 $genres = db_value("select count(genre_id) from genres_of_movie where movie_id=$movie_id"); 275 if (empty($attribs) && $actors==0 && $directors==0 && $genres==0) 276 return false; 277 else 278 return true; 279 } 280 281 function scdb_tv_details_available( $tv_id ) 282 { 283 $attribs = implode(db_row('',"select year, certificate, synopsis from tv where file_id=$tv_id")); 284 $actors = db_value("select count(actor_id) from actors_in_tv where tv_id=$tv_id"); 285 $directors = db_value("select count(director_id) from directors_of_tv where tv_id=$tv_id"); 286 $genres = db_value("select count(genre_id) from genres_of_tv where tv_id=$tv_id"); 287 if (empty($attribs) && $actors==0 && $directors==0 && $genres==0) 288 return false; 289 else 290 return true; 291 } 292 255 293 /************************************************************************************************** 256 294 End of file trunk/swisscenter/config/config_movie.php
r1095 r1098 175 175 176 176 echo '<table class="form_select_tab" width="100%"><tr> 177 <td valign="top" width="4%" ><input type="checkbox" name="movie[]" value="'.$movie["FILE_ID"].'"></input></td>177 <td valign="top" width="4%"'.($movie["DETAILS_AVAILABLE"]=='Y' ? '' : ' bgcolor="red"').'><input type="checkbox" name="movie[]" value="'.$movie["FILE_ID"].'"></input></td> 178 178 <td valign="top" width="33%"> 179 <a href="?section=movie&action=display_info&movie_id='.$movie["FILE_ID"].'">'. $movie["TITLE"].'</a><br>179 <a href="?section=movie&action=display_info&movie_id='.$movie["FILE_ID"].'">'.highlight($movie["TITLE"], $_REQUEST["search"]).'</a><br> 180 180 Certificate : '.nvl($cert).'<br> 181 181 Year : '.nvl($movie["YEAR"]).'<br> … … 210 210 $img_url = img_gen(file_albumart($filename) ,130,400,false,false,false,array('hspace'=>0,'vspace'=>4) ); 211 211 $edit_url = '?section=movie&action=display_info&movie_id='.$movie["FILE_ID"]; 212 $thumb_html .= '<td valign="top" ><input type="checkbox" name="movie[]" value="'.$movie["FILE_ID"].'"></input></td>212 $thumb_html .= '<td valign="top"'.($movie["DETAILS_AVAILABLE"]=='Y' ? '' : ' bgcolor="red"').'><input type="checkbox" name="movie[]" value="'.$movie["FILE_ID"].'"></input></td> 213 213 <td valign="middle"><a href="'.$edit_url.'">'.$img_url.'</a></td>'; 214 $title_html .= '<td width="25%" colspan="2" align="center" valign="middle"><a href="'.$edit_url.'">'. $movie["TITLE"].'</a></td>';214 $title_html .= '<td width="25%" colspan="2" align="center" valign="middle"><a href="'.$edit_url.'">'.highlight($movie["TITLE"], $_REQUEST["search"]).'</a></td>'; 215 215 } 216 216 … … 245 245 $where .= "and m.title like '%$_REQUEST[search]%' "; 246 246 247 if (!empty($_REQUEST["filter"]) ) 248 $where .= "and (m.details_available='N' or m.details_available is null)"; 249 247 250 // If the user has changed category, then shunt them back to page 1. 248 251 if (un_magic_quote($_REQUEST["last_where"]) != $where) … … 261 264 message($message); 262 265 263 $this_url = '?last_where='.urlencode($where).'& search='.$_REQUEST["search"].'&cat_id='.$_REQUEST["cat_id"].'§ion=MOVIE&action=DISPLAY&page=';266 $this_url = '?last_where='.urlencode($where).'&filter='.$_REQUEST["filter"].'&search='.$_REQUEST["search"].'&cat_id='.$_REQUEST["cat_id"].'§ion=MOVIE&action=DISPLAY&page='; 264 267 265 268 echo '<form enctype="multipart/form-data" action="" method="post"> … … 274 277 <img align="absbottom" border="0" src="/images/select_all.gif" onclick=\'handleClick("movie[]", true)\'> 275 278 <img align="absbottom" border="0" src="/images/select_none.gif" onclick=\'handleClick("movie[]", false)\'> 279 <a href="'.url_remove_param($this_url,'filter').'"><img align="absbottom" border="0" src="/images/filter.gif"></a> 280 <a href="'.url_set_param($this_url,'filter','NODETAILS').'"><img align="absbottom" border="0" src="/images/filter_red.gif"></a> 276 281 </td><td width"50%" align="right"> 277 282 '.str('SEARCH').' : … … 531 536 $columns["TITLE"] = $_REQUEST["title"]; 532 537 533 // Update the MOVIES table?534 if (count($columns)>0)535 {536 $columns["DETAILS_AVAILABLE"] = 'Y';537 scdb_set_movie_attribs($movie_list, $columns);538 }539 540 538 // Add Actors/Genres/Directors? 541 539 if ($_REQUEST["update_actors"] == 'yes') … … 560 558 scdb_add_genres($movie_list,un_magic_quote($_REQUEST["genres"])); 561 559 if (!empty($_REQUEST["genre_new"])) 562 scdb_add_genres($movie_list, explode(',',un_magic_quote($_REQUEST["genre_new"]))); 563 } 564 560 scdb_add_genres($movie_list, explode(',',un_magic_quote($_REQUEST["genre_new"]))); 561 } 562 563 // Update the MOVIES attributes 564 scdb_set_movie_attribs($movie_list, $columns); 565 565 566 // Process the "Viewed" checkboxes 566 567 if ($_REQUEST["update_viewed"] == 'yes') trunk/swisscenter/config/config_tv.php
r1057 r1098 170 170 171 171 echo '<table class="form_select_tab" width="100%"><tr> 172 <td valign="top" width="4%" ><input type="checkbox" name="tv[]" value="'.$tv["FILE_ID"].'"></input></td>172 <td valign="top" width="4%"'.($tv["DETAILS_AVAILABLE"]=='Y' ? '' : ' bgcolor="red"').'><input type="checkbox" name="tv[]" value="'.$tv["FILE_ID"].'"></input></td> 173 173 <td valign="top" width="33%"> 174 <a href="?section=tv&action=display_info&tv_id='.$tv["FILE_ID"].'">'. $tv["PROGRAMME"].' - '.$tv["TITLE"].'</a><br>174 <a href="?section=tv&action=display_info&tv_id='.$tv["FILE_ID"].'">'.highlight($tv["PROGRAMME"], $_REQUEST["search"]).' - '.highlight($tv["TITLE"], $_REQUEST["search"]).'</a><br> 175 175 Series : '.nvl($tv["SERIES"]).'<br> 176 176 Episode : '.nvl($tv["EPISODE"]).'<br> … … 202 202 $img_url = img_gen(file_albumart($tv["DIRNAME"].$tv["FILENAME"]) ,130,400,false,false,false,array('hspace'=>0,'vspace'=>4) ); 203 203 $edit_url = '?section=tv&action=display_info&tv_id='.$tv["FILE_ID"]; 204 $thumb_html .= '<td valign="top" ><input type="checkbox" name="tv[]" value="'.$tv["FILE_ID"].'"></input></td>204 $thumb_html .= '<td valign="top"'.($tv["DETAILS_AVAILABLE"]=='Y' ? '' : ' bgcolor="red"').'><input type="checkbox" name="tv[]" value="'.$tv["FILE_ID"].'"></input></td> 205 205 <td valign="middle"><a href="'.$edit_url.'">'.$img_url.'</a></td>'; 206 $title_html .= '<td width="25%" colspan="2" align="center" valign="middle"><a href="'.$edit_url.'">'. $tv["PROGRAMME"].' - '.$tv["TITLE"].(empty($tv["EPISODE"]) ? '' : str('EPISODE_SUFFIX',$tv["EPISODE"])).'</a></td>';206 $title_html .= '<td width="25%" colspan="2" align="center" valign="middle"><a href="'.$edit_url.'">'.highlight($tv["PROGRAMME"], $_REQUEST["search"]).' - '.highlight($tv["TITLE"], $_REQUEST["search"]).(empty($tv["EPISODE"]) ? '' : str('EPISODE_SUFFIX',$tv["EPISODE"])).'</a></td>'; 207 207 } 208 208 … … 237 237 $where .= "and (t.programme like '%$_REQUEST[search]%' or t.title like '%$_REQUEST[search]%') "; 238 238 239 if (!empty($_REQUEST["filter"]) ) 240 $where .= "and (t.details_available='N' or t.details_available is null)"; 241 239 242 // If the user has changed category, then shunt them back to page 1. 240 243 if (un_magic_quote($_REQUEST["last_where"]) != $where) … … 253 256 message($message); 254 257 255 $this_url = '?last_where='.urlencode($where).'& search='.$_REQUEST["search"].'&cat_id='.$_REQUEST["cat_id"].'§ion=TV&action=DISPLAY&page=';258 $this_url = '?last_where='.urlencode($where).'&filter='.$_REQUEST["filter"].'&search='.$_REQUEST["search"].'&cat_id='.$_REQUEST["cat_id"].'§ion=TV&action=DISPLAY&page='; 256 259 257 260 echo '<form enctype="multipart/form-data" action="" method="post"> … … 266 269 <img align="absbottom" border="0" src="/images/select_all.gif" onclick=\'handleClick("tv[]", true)\'> 267 270 <img align="absbottom" border="0" src="/images/select_none.gif" onclick=\'handleClick("tv[]", false)\'> 271 <a href="'.url_remove_param($this_url,'filter').'"><img align="absbottom" border="0" src="/images/filter.gif"></a> 272 <a href="'.url_set_param($this_url,'filter','NODETAILS').'"><img align="absbottom" border="0" src="/images/filter_red.gif"></a> 268 273 </td><td width"50%" align="right"> 269 274 '.str('SEARCH').' : … … 420 425 foreach ( db_toarray("select * from users order by name") as $row) 421 426 echo '<input type="checkbox" name="viewed[]" value="'.$row["USER_ID"].'" '. 422 (viewings_count( 6, $details[0]["FILE_ID"], $row["USER_ID"])>0 ? 'checked' : '').427 (viewings_count( MEDIA_TYPE_TV, $details[0]["FILE_ID"], $row["USER_ID"])>0 ? 'checked' : ''). 423 428 '>'.$row["NAME"].'<br>'; 424 429 … … 550 555 $columns["EPISODE"] = $_REQUEST["episode"]; 551 556 552 // Update the TV table?553 if (count($columns)>0)554 {555 $columns["DETAILS_AVAILABLE"] = 'Y';556 scdb_set_tv_attribs($tv_list, $columns);557 }558 559 557 // Add Actors/Genres/Directors? 560 558 if ($_REQUEST["update_actors"] == 'yes') … … 582 580 } 583 581 582 // Update the TV attributes 583 scdb_set_tv_attribs($tv_list, $columns); 584 584 585 // Process the "Viewed" checkboxes 585 586 if ($_REQUEST["update_viewed"] == 'yes')