<?php require '../admin/coreclass.php'; session_start(); // if user is not login..redirect him to login page if (!isset($_SESSION['login'])) { header('Location: ../index.php'); } if (isset($_POST['upload'])) { } if (isset($_POST['remove'])) { $imageurl = $_POST['imageurl']; $img = new stockphoto(); $img->removeImage($imageurl); echo '<script>alert("Successfully removed the image: ' . $imageurl . '");history.go(-1);</script>'; } switch ($_POST['task']) { case 'cancel': header('location: my_banners.php'); exit; break; case 'add': //print_r($_SESSION); $clientID = $_SESSION['clientID']; $insertclientID = $_SESSION['insertclientID']; $clientname = $_POST['clientname']; $bannername = $_POST['bannername']; if (isset($_POST['imageurl'])) { $imageurl = $_POST['imageurl']; } $clickurl = $_POST['clickurl'];
<?php require '../../admin/coreclass.php'; session_start(); // print_r($_SESSION); $clientID = $_SESSION['clientID']; // get the clientid $bannerID = $_SESSION['bannerID']; $file_type = $_FILES['userfile']['type']; $tmp_file_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $upload_dir = '../../images/ads/'; $msize = ini_get('post_max_size'); $max_file_size = $msize; // found problem here... $photo = new stockphoto(); if (isset($_FILES) && isset($_POST['fileupload'])) { $upload = new upload_image($file_type, $tmp_file_name, $file_name, $upload_dir, $max_file_size); $upload->upload(); $upload->get_upload_directory(); $upload->get_message(); $filename = $upload->get_uploaded_file(); $photo->addNewImage($upload->upload_dir . $upload->file_name, '', '', ''); $photo->addImageToClient($clientID); //$photo->updateBannerClient( $bannerID ); $_SESSION['insertclientID'] = $photo->insertclientID; // Get the newly inserted id } ?> <!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">
$caption = $_POST['caption']; $alttext = $_POST['alttext']; $file_type = $_FILES['userfile']['type']; $tmp_file_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $uploaddir = '../' . $upload_dir; if ($file_name != "") { $upload = new upload_image($file_type, $tmp_file_name, $file_name, $uploaddir, $max_file_size); $upload->upload(); $upload->get_upload_directory(); $upload->get_message(); $filename = $upload->get_uploaded_file(); $photo = new stockphoto(); $photo->updateImage($post_imgID, $upload->upload_dir . $upload->file_name, $photoby, $caption, $alttext); } else { $photo = new stockphoto(); $photo->updateImage($post_imgID, "", $photoby, $caption, $alttext); $info = $photo->getImageDetails($post_imgID); $file_name2 = $info[0]->image_filename; $photoby = $info[0]->image_photographer_author; $caption = $info[0]->image_captions; $alttext = $info[0]->image_alttext; echo "<script>alert('Successfully saved the image.');window.close();</script>\n"; } } ?> <!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"> <head> <title>Image Details</title> </head>
$action->track_activity($userID, $action->saving_article, 'Saving the article ' . $_SESSION['title']); $gotoURL = "../admin/my_articles2.php"; } } } $_SESSION['task'] = 'submit'; $_SESSION['title'] = $article_title; $_SESSION['to'] = 'News Editor'; $gotoURL = "../admin/my_articles2.php"; break; case 'edit': // update the task status $sql = "update tasks set status = 'In Progress' where taskID = '{$articletask}' "; $db->query($sql); if (isset($_SESSION['article_imgs'])) { $photo = new stockphoto(); $photo->addImageToArticle($_SESSION['article_imgs'], $_SESSION['articleID']); } switch ($_SESSION['stageID']) { case 1: // this article belongs to news draft stage, but it is edited by the writer.. // maybe he has left to put something on the article, right.. $modified = time(); $sql = " update articles "; $sql .= " set articles.stageID=" . $_SESSION['stageID']; $sql .= " , articles.title = '{$article_title}' "; $sql .= " , articles.modified = '{$modified}' , "; $sql .= " articles.status = '--' "; $sql .= " , articles.article_body = '{$article_body}' "; $sql .= " where articles.articleID=" . $_SESSION['articleID']; $result = $db->query($sql);
<?php require '../../admin/coreclass.php'; session_start(); $file_type = $_FILES['userfile']['type']; $tmp_file_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $upload_dir = '../../images/uploads/'; $msize = ini_get('post_max_size'); $max_file_size = $msize; $photo = new stockphoto(); if (isset($_FILES) && isset($_POST['fileupload'])) { $upload = new upload_image($file_type, $tmp_file_name, $file_name, $upload_dir, $max_file_size); $upload->upload(); $upload->get_upload_directory(); $upload->get_message(); $filename = $upload->get_uploaded_file(); $photo->addNewImage($upload->upload_dir . $upload->file_name, '', '', ''); } ?> <!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"> <head> <title>Upload Image</title> </head> <body> <link rel="stylesheet" type="text/css" href="../../templates/admin2.css" /> <table > <form method="post" action="uploadimage2.php" enctype="multipart/form-data" name="filename"> <tr> <th width="347" class="fileuploadtitle"> Upload Image: <?php
$tmp_file_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $uploaddir = '../' . $upload_dir; $photoby = $_POST['photoby']; $caption = $_POST['caption']; $alttext = $_POST['alttext']; $msize = ini_get('post_max_size'); $max_file_size = $msize; print_r($_SESSION['article_imgs']); if (isset($_FILES) && isset($_POST['fileupload'])) { $upload = new upload_image($file_type, $tmp_file_name, $file_name, $uploaddir, $max_file_size); $upload->upload(); $upload->get_upload_directory(); $upload->get_message(); $filename = $upload->get_uploaded_file(); $photo = new stockphoto(); $photo->addNewImage($upload->upload_dir . $upload->file_name, $photoby, $caption, $alttext); $id = $photo->insertID; $_SESSION['article_imgs'][$id] = $id; //$photo->insertImageToArticle( $_SESSION['articleID']); } ?> <!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"> <head> <title>Upload Image</title> </head> <body> <link rel="stylesheet" href="../../templates/admin2.css" type="text/css" /> <table class="adminform" > <form method="post" action="uploadimage.php" enctype="multipart/form-data" name="filename">
if (isset($_POST['imageID'])) { // is image checked?? $article_images = $_POST['imageID']; if ($article_images == -1) { $sql = " select * from article_imgs ai"; $sql .= " where ai.articleID=" . intval($articleID); $db->query($sql); $result = array(); while ($row = $db->fetcharray()) { $imagesets[] = $row; } $photo = new stockphoto(); $photo->notshowArticle_image($imagesets, $articleID); } if ($article_images) { $photo = new stockphoto(); $photo->showArticle_image($article_images, $articleID); } } // if keywords was set by the editor if ($keywords) { $sql = " select * from article_keywords ak "; $sql .= " where ak.articleID=" . intval($articleID); $db->query($sql); if ($db->getnumrows() > 0) { $sql = " update article_keywords "; $sql .= " set keywords= '{$keywords}' "; $sql .= " where articleID=" . intval($articleID); $db->query($sql); } else { $sql = " insert into article_keywords ( articleID, keywords )";
$file_type = $_FILES['userfile']['type']; $tmp_file_name = $_FILES['userfile']['tmp_name']; $file_name = $_FILES['userfile']['name']; $uploaddir = '../' . $upload_dir; $photoby = $_POST['photoby']; $caption = $_POST['caption']; $alttext = $_POST['alttext']; $msize = ini_get('post_max_size'); $max_file_size = $msize; if (isset($_FILES) && isset($_POST['fileupload'])) { $upload = new upload_image($file_type, $tmp_file_name, $file_name, $uploaddir, $max_file_size); $upload->upload(); $upload->get_upload_directory(); $upload->get_message(); $filename = $upload->get_uploaded_file(); $photo = new stockphoto(); $photo->addNewImage($upload->upload_dir . $upload->file_name, $photoby, $caption, $alttext); $photo->insertImageToArticle($_SESSION['articleID']); } ?> <!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"> <head> <title>Upload Image</title> </head> <body> <link rel="stylesheet" href="../../templates/admin2.css" type="text/css" /> <table class="adminform" > <form method="post" action="uploadimage4.php" enctype="multipart/form-data" name="filename"> <tr class="table_header"> <th colspan="2" class="tdcaptions" >Upload Image : <?php