topical media & game development
portal-cms-post.php
<html>
<body>
<?php
include(<config.php>);
_POST['title'];
_POST['date'];
_POST['description'];
_POST['binary'];
_POST['sourcename'];
_POST['sourceurl'];
_POST['contenttype'];
_POST['contentstate'];
_POST['audioformat'];
_POST['audiolength'];
_POST['audiobitrate'];
_POST['audiosize'];
_POST['videoformat'];
_POST['videoresolution'];
_POST['videolength'];
_POST['videocode'];
_POST['videosize'];
_POST['articlelanguages'];
_POST['pictureformat'];
_POST['pictureresolution'];
_POST['picturesize'];
_POST['health'];
_POST['politics'];
_POST['wildlife'];
_POST['energy'];
_POST['business'];
_POST['climate'];
_POST['pollution'];
_POST['technology'];
_POST['lifestyle'];
_POST['region'];
_POST['environment'];
_POST['keywords'];
_POST['upload'];
/* Dit gedeelte van de code is verantwoordelijk voor de upload.
De file die geupload word, word verplaatst naar de worldwritable map uploads/
*/
if(target_path = "uploads/";
target_path . basename(
_FILES['uploadedfile']['tmp_name'],
file_upload_name = basename( binary = "uploads/".file_upload_name .
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
echo "</td></tr>";
}
/* De content word hier in de database gestopt. Voor elk item zijn de basis velden hetzelfde */
if(get_magic_quotes_gpc()==1) {
title', 'binary', 'sourceurl', 'contenttype',
'title = addslashes(description = addslashes(binary = addslashes(date = addslashes(sourcename = addslashes(sourceurl = addslashes(query = "INSERT INTO content (content_id, content_title, content_date, content_date_added,
content_binary, content_source_name, content_sourceurl, content_state, content_type, content_description) VALUES (
'', 'date', UNIX_TIMESTAMP(), 'sourcename', 'contentstate', 'description')";
}
query);
result) {
die('Invalid query: ' . mysql_error());
}
/* Er word hier een onderscheid gemaakt tussen de vier verschillende contenttypes. Elk contenttype heeft zn eigen
individuele velden die ingevuld moeten worden */
if(query = "INSERT INTO content_type_audio (content_type_audio_id, audio_format, audio_length, audio_bitrate, audio_size, content_id) VALUES ('', 'audiolength','audiosize', 'contenttype == 2) {
videoformat', 'videolength', 'lastid', 'contenttype == 3) {
articlelanguages', 'contenttype == 4) {
pictureformat', 'picturesize', 'result = mysql_query(result) {
die('Invalid query: ' . mysql_error());
}
/* De categorieen waaronder een item valt, worden hier in de database gestopt */
health', 'wildlife', 'business',
'pollution', 'lifestyle', 'region', 'result = mysql_query(result) {
die('Invalid query: ' . mysql_error());
}
/* De keyword string word gesplitst in individuele keywords door te splitten op een spatie. Vervolgens worden alle
keywords met de 'ignore' vlag in de database gestopt. Doordat het keyword_name veld uniek is, zullen alleen
keywords die nog niet in de database staan opgeslagen worden */
keywords));
foreach (keyword) {
keyword);
word')";
query);
if(!query = "SELECT * from keywords WHERE keyword_name = 'result = mysql_query(result) {
die('Invalid query: ' . mysql_error());
}
result);
row['keyword_id'];
lastid', 'result = mysql_query(result) {
die('Invalid query: ' . mysql_error());
}
}
?>
<!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/
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"> </td>
<td width="574"> </td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="6"></td>
</tr>
<tr bgcolor="#a4c2c2">
<td width="15" nowrap="nowrap"> </td>
<td height="36" colspan="3" id="navigation" class="navText"></a>
<span class="style6">ADD ITEM </a> <a
href="edit_item.php">EDIT ITEM </a>
CATEGORIES </a>
USER MANAGEMENT</a></span>
RSS ADMIN</a></span></td>
<td width="4"> </td>
<td width="574"> </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"> </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 width="536" valign="top"><br />
<br />
<table border="0" cellspacing="0" cellpadding="0" width="600">
<tr>
<td width="600" class="pageName"><p>Add Item </p></td>
</tr>
<tr>
<td class="bodyText">
Thanks for posting!
Returning you back to the admin..
<meta HTTP-EQUIV="refresh" content=2;url=<index.php>>
<p><br />
</p></td>
</tr>
</table> </td>
<td width="4"> </td>
<td width="574"> </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"> </td>
<td width="4"> </td>
<td width="50"> </td>
<td width="536"> </td>
<td width="4"> </td>
<td width="574"> </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.