topical media & game development
[] readme course(s) preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthought(s) appendix reference(s) example(s) resource(s) _

talk show tell print


          if (isset(_COOKIE['admin_Id'])) {
          } else {
          header('Location: index.php');
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
  <html xmlns="">
  <!-- DW6 -->
  <!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
  <title>Climate Portal Content Management System</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="cms.css" type="text/css" />
  <style type="text/css">
  .style1 {color: #FFFFFF}
  .style3 {color: #CCFFCC}
  .style5 {font-size: 24px}
  .style6 {color: #D4D0C8}
  <body bgcolor="#cccccc">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <td width="15" nowrap="nowrap"><img src="file: 
D|/Program%20Files/%5Bwebdesign%5D/dreamweaver%208/Dreamweaver%208/Configuration/BuiltIn/StarterPages/mm_spacer.gif" alt="" width="15" height="1" border="0" /></td>

<td height="74" colspan="3" class="logo" nowrap="nowrap"><br /> <span class="style1"> CLIMATE<span class="style3">PORTAL</span> <span class="style5">CMS</span></span> </td> <td width="4">&nbsp;</td> <td width="574">&nbsp;</td> </tr> <tr bgcolor="#ffffff"> <td colspan="6"></td> </tr> <tr bgcolor="#a4c2c2"> <td width="15" nowrap="nowrap">&nbsp;</td> <td height="36" colspan="3" id="navigation" class="navText"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="style6">ADD ITEM </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EDIT ITEM </a>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CATEGORIES </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; USER MANAGEMENT</a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RSS ADMIN</a></span></td> <td width="4">&nbsp;</td> <td width="574">&nbsp;</td> </tr> <tr bgcolor="#ffffff"> <td colspan="6"><img src="file:
D|/Program%20Files/%5Bwebdesign%5D/dreamweaver%208/Dreamweaver%208/Configuration/BuiltIn/StarterPages/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>

</tr> <tr bgcolor="#ffffff"> <td colspan="2" valign="top" bgcolor="#a4c2c2">&nbsp;</td> <td width="50" valign="top"><img src="file:
D|/Program%20Files/%5Bwebdesign%5D/dreamweaver%208/Dreamweaver%208/Configuration/BuiltIn/StarterPages/mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>

<td width="536" valign="top"><br /> <br /> <table border="0" cellspacing="0" cellpadding="0" width="600"> <tr> <td width="600" class="pageName"><p>Edit a Video </p></td> </tr> <tr> <td class="bodyText"> <?php contentid = _GET['contentid']; delete_image = _POST['delete']; title = addslashes(_POST['title']); contentdate = addslashes(_POST['date']); sourcename = addslashes(_POST['sourcename']); sourceurl = addslashes(_POST['sourceurl']); binary = addslashes(_POST['contentbinary']); state = addslashes(_POST['contentstate']); description = addslashes(_POST['contentdescription']); videoformat = addslashes(_POST['videoformat']); videoresolution = addslashes(_POST['videoresolution']); videolength = addslashes(_POST['videolength']); videosize = addslashes(_POST['videosize']); update = _POST['update']; upload = _POST['upload']; health = _POST['health']; politics = _POST['politics']; wildlife = _POST['wildlife']; energy = _POST['energy']; business = _POST['business']; climate = _POST['climate']; pollution = _POST['pollution']; technology = _POST['technology']; lifestyle = _POST['lifestyle']; environment = _POST['environment']; region = _POST['region']; keywords = _POST['keywords']; if(delete_image) { unlink(image); query = "UPDATE content set content_binary = 0 where content_id=contentid"; result = mysql_query(query); if(!result) { die('Invalid query: ' . mysql_error()); } } if(upload) { target_path = "uploads/"; target_path = target_path . basename( _FILES['uploadedfile']['name']); echo "<tr><td>"; if(move_uploaded_file(_FILES['uploadedfile']['tmp_name'], target_path)) { file_upload_name = basename( _FILES['uploadedfile']['name']); binary = "uploads/".file_upload_name; } else{ echo "There was an error uploading the file, please try again!"; } echo "</td></tr>"; } if(update){ query = "UPDATE content, content_type_video set content.content_title = 'title', content.content_date = 'contentdate', content.content_binary = 'binary', content.content_source_name = 'sourcename', content.content_sourceurl = 'sourceurl', content.content_state = 'state', content.content_description = 'description', content_type_video.video_format = 'videoformat', content_type_video.video_resolution = 'videoresolution', content_type_video.video_length='videolength', content_type_video.video_size='videosize' where content.content_id = contentid AND content_type_video.content_id=contentid"; query2= "UPDATE content_matrix set'health', content_matrix.politics = 'politics', content_matrix.wildlife='wildlife','energy','business', content_matrix.climate='climate', content_matrix.pollution='pollution','technology','lifestyle', content_matrix.environment='environment', content_matrix.region='region' WHERE content_matrix.content_id='contentid'"; keywords = split(' ', strtolower(keywords)); query3 = "DELETE from `content_keywords` WHERE content_id = 'contentid'"; result = mysql_query(query3); if(!result) { die('Invalid query: ' . mysql_error()); } foreach (keywords as word) { word = trim(word); query3 = "INSERT ignore into keywords (keyword_id, keyword_name) values ('', 'word')"; result3 = mysql_query(query3); if(!result) { die('Invalid query: ' . mysql_error()); } query3 = "SELECT * from keywords WHERE keyword_name = 'word'"; result3 = mysql_query(query3); if(!result) { die('Invalid query: ' . mysql_error()); } row = mysql_fetch_array(result3); keywordid = row['keyword_id']; query3 = "INSERT into content_keywords (content_keyword_id, content_id, keyword_id) values ('', 'contentid','keywordid')"; result = mysql_query(query3); if(!result) { die('Invalid query: ' . mysql_error()); } } result = mysql_query(query); result2 = mysql_query(query2); if(!result) { die('Invalid query: ' . mysql_error()); } } query = "SELECT * FROM `content` , `content_type_video` WHERE content.content_id = 'contentid' AND content_type_video.content_id ='contentid'"; result = mysql_query(query); if(!result) { die('1: Invalid query: ' . mysql_error()); } query2 = "SELECT * FROM `content_matrix` WHERE content_id='contentid'"; result2 = mysql_query(query2); if(!result2) { die('2: Invalid query: ' . mysql_error()); } query3 = "SELECT * FROM `keywords`, `content_keywords` where content_keywords.content_id='contentid' AND content_keywords.keyword_id=keywords.keyword_id"; result3 = mysql_query(query3); if(!result3) { die('3: Invalid query: ' . mysql_error()); } row = mysql_fetch_array(result); row2 = mysql_fetch_array(result2); image = row['content_binary']; ?> <form method="post" enctype="multipart/form-data" action=""> <table> <tr> <td width="150"> Title: </td> <td> <input type="text" name="title" size="30" value="<?php echo row['content_title']; ?>" /> </td> </tr> <tr> <td width="150"> Date: </td> <td> <input type="text" name="date" size="30" value="<?php echo row['content_date']; ?>"/> </td> </tr> <?php if(image) { ?> <tr> <td width="150"> Image: </td> <td>
<img src="video.jpg"></a> </td> <td> <form name="input" method="post" action=""> <input type="hidden" name="contentbinary" value="<?php echo row['content_binary']; ?>"> <input type="hidden" name="delete" value="1"> <input type="submit" value="Delete Video"> </form> </td> </tr> <?php } else { ?> <tr> <td width="150"> <input type="hidden" name="upload" value="1" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> </td> <td> </td> </tr> <?php } ?> <tr> <td width="150"> Sourcename: </td> <td> <input type="text" name="sourcename" size="30" value="<?php echo row['content_source_name']; ?>"/> </td> </tr> <tr> <td> Source url: </td> <td> <input type="text" name="sourceurl" size="30" value="<?php echo row['content_sourceurl']; ?>"/> </td> </tr> <tr> <td width="150"> Content state: </td> <td> <input type="text" name="contentstate" size="30" value="<?php echo row['content_state']; ?>"/> <tr> <td width="150"> Content Description: </td> <td> <input type="text" name="contentdescription" size="30" value="<?php echo row['content_description']; ?>"/> </td> </tr> <tr> <td width="150"> Video Format: </td> <td> <input type="text" name="videoformat" size="30" value="<?php echo row['video_format']; ?>"/> </td> </tr> <tr> <td width="150"> Video Resolution: </td> <td> <input type="text" name="videoresolution" size="30" value="<?php echo row['video_resolution']; ?>"/> </td> </tr> <tr> <td width="150"> Video Length: </td> <td> <input type="text" name="videolength" size="30" value="<?php echo row['video_length']; ?>"/> </td> </tr> <tr> <td width="150"> Video Size: </td> <td> <input type="text" name="videosize" size="30" value="<?php echo row['video_size']; ?>"/> </td> </tr> <tr> <td> Categories: </td> <td> Health: <input type="checkbox" name="health" value="1" <?php health=row2['health']; if(health == "1"){echo " CHECKED";}?>> <br /> Politics: <input type="checkbox" name="politics" value="1" <?php politics=row2['politics']; if(politics == "1"){echo " CHECKED";}?>> <br /> Wildlife <input type="checkbox" name="wildlife" value="1" <?php wildlife=row2['wildlife']; if(wildlife == "1"){echo " CHECKED";}?>> <br/> Energy <input type="checkbox" name="energy" value="1" <?php energy=row2['energy']; if(energy == "1"){echo " CHECKED";}?>> <br /> Business <input type="checkbox" name="business" value="1" <?php business=row2['business']; if(business == "1"){echo " CHECKED";}?>> <br /> Climate <input type="checkbox" name="climate" value="1" <?php climate=row2['climate']; if(climate == "1"){echo " CHECKED";}?>> <br /> Pollution <input type="checkbox" name="pollution" value="1" <?php pollution=row2['pollution']; if(pollution == "1"){echo " CHECKED";}?>> <br /> Technology <input type="checkbox" name="technology" value="1" <?php technology=row2['technology']; if(technology =="1"){echo " CHECKED";}?>> <br /> Lifestyle <input type="checkbox" name="lifestyle" value="1" <?php lifestyle=row2['lifestyle']; if(lifestyle == "1"){echo " CHECKED";}?>> <br /> Environment <input type="checkbox" name="environment" value="1" <?php environment=row2['environment']; if(environment == "1"){echo " CHECKED";}?>> <br /> </td> </tr> <tr> <td width="150"> Region: </td> <td> <input type="text" name="region" size="30" value="<?php echo row2['region']; ?>"/> </td> </tr> <tr> <td width="150"> Keywords: </td> <td> <input type="text" name="keywords" size="30" value="<?php while(row3 = mysql_fetch_array(result3)) { echo row3['keyword_name']; echo " "; } ?> "/> </td> </tr> <tr> <td></td> <td><input type="submit" value="Update" name="update" /> </td> </tr> </table> <input type="hidden" name="contenttype" value="3"> <input type="hidden" name="contentid" value="<?php echo contentid; ?>"> </form> <p><br /> </p></td> </tr> </table> </td> <td width="4">&nbsp;</td> <td width="574">&nbsp;</td> </tr> <tr> <td colspan="6"> <img src="file:

alt="" width="1" height="1" border="0" /></td> </tr> <tr> <td width="15">&nbsp;</td> <td width="4">&nbsp;</td> <td width="50">&nbsp;</td> <td width="536">&nbsp;</td> <td width="4">&nbsp;</td> <td width="574">&nbsp;</td> </tr> </table> </body> </html>

(C) A. Eliëns 2/9/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.