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

portal-cms-edit_video_web.php



  <?php
  
          if (isset(_COOKIE['admin_Id'])) {
          } else {
          header('Location: index.php');
          }
  
  include(<config.php>);
  ?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <!-- DW6 -->
  <head>
  <!-- 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}
  -->
  </style>
  </head>
  <body bgcolor="#cccccc">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
          <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 an Embedded Video </p></td> </tr> <tr> <td class="bodyText"> <?php contentid = _GET['contentid']; 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']); videocode = addslashes(_POST['videocode']); videolength = addslashes(_POST['videolength']); videosize = addslashes(_POST['videosize']); update = _POST['update']; 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(update){ echo "ID IS: contentid"; 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 content_matrix.health='health', content_matrix.politics = 'politics', content_matrix.wildlife='wildlife', content_matrix.energy='energy', content_matrix.business='business', content_matrix.climate='climate', content_matrix.pollution='pollution', content_matrix.technology='technology', content_matrix.lifestyle='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> <tr> <td width="150"> Video Code: </td> <td> <textarea rows="10" cols="20" name="videocode"><?php echo row['video_code']; ?></textarea> </td> </tr> <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> 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"> Video Format: </td> <td> <input type="text" name="videoformat" size="30" value="<?php echo row['video_format']; ?>"/> </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:
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> <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.