Beispiel #1
0
 public function handlePhotoUpload($file)
 {
     $config = new Blog();
     unset($file['trackmp3']);
     $file['writeup'] = $file['blogentry'];
     $file['blog_story_url'] = 'http://freela.be/l/' . $file['twitter'] . '/';
     $file['submission_date'] = date('Y-m-d H:s:i');
     if ($file['type'] == 'video') {
         $file['blogentry'] = '<video src="' . $file['photo'] . '" controls preload="metadata" loop=1 class="blog-post-media-video"></video>';
     } elseif ($file['type'] == 'photo') {
         $file['blogentry'] = '<img src="' . $file['photo'] . '" class="blog-post-media-image">';
     }
     // get twitpic url
     $file['twitpic'] = $this->getTwitpicURL($file);
     // add $file['filetype']
     $file['filetype'] = $config->detect_file_type($file['photo']);
     if ($this->saveToBackUpDatabase($file)) {
         echo 'YES N***A!';
         return $file;
     } else {
         echo 'NO N***A!!!';
         return FALSE;
     }
 }
Beispiel #2
0
 /**
  * Register page
  * Show the register form (with the register-with-facebook button). We need the facebook-register-URL for that.
  */
 function add_promo($file_id)
 {
     //echo '<pre>';
     $data = $_POST;
     $date = date('Y-m-d');
     include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
     $config = new Blog();
     include ROOT . 'inc/connection.php';
     $sql = "INSERT INTO  `amrusers`.`images` (\n        `id` ,\n        `user_name` ,\n        `title` ,\n        `desc` ,\n        `caption` ,\n        `image` ,\n        `date` ,\n        `rate` ,\n        `status` ,\n        `twitpic` ,\n        `type` ,\n        `assiged_to` ,\n        `paypal_url` ,\n        `bae_write_up` ,\n        `price`\n        )\n        VALUES (\n        NULL ,  '" . $data['user_name'] . "',  '" . $data['title'] . "',  '" . $data['description'] . "',  '',  '" . $data['img_path'] . "', \n        CURRENT_TIMESTAMP ,  '',  '',  '',  '',  '',  '',  '',  ''\n        );\n        ";
     // add to feed
     $type = $config->detect_feed_type($data['img_path']);
     $twitter = $config->parse_twitter_from_title($data['title']);
     $trackname = $config->parse_title_from_title($data['title']);
     $title = '[' . strtoupper($type) . '] ' . $trackname;
     $file = $data['img_path'];
     $photo = $data['photo'];
     $filetype = $config->detect_file_type($data['img_path']);
     $blog_story_url = $config->create_url($data['title']);
     $short_url = $config->create_url($data['title'], 'short');
     if ($data['post_to_twitter'] == true) {
         $twitpic = $config->getTwitpicURL($photo, $twitter . ' ' . $title, $short_url);
     }
     $sql1 = 'INSERT INTO `amrusers`.`feed` (`id`, `type`, `user_name`, `blogtitle`, `blog_story_url`, `tags`, `photo`, `blogentry`, `writeup`, `twitter`, `project_title`, `mixtapephoto`, `mixtapeurl`, `trackname`, `trackmp3`, `twitpic`, `poster`, `filetype`, `thumbnail`, `views`, `beattitle`, `beaturl`, `beatdownload`, `rate`, `featured`, `userphoto`, `embeddedplayer`, `playerpath`, `short_url`, `youtube`, `email`, `phone`, `blogtitleencode`, `onsale`, `follow_up`, `submission_date`, `approved`, `blog_post_key`) 
     VALUES (NULL, \'' . $type . '\', \'' . $data['user_name'] . '\', \'' . $title . '\', \'' . $blog_story_url . '\', \'tags,\', \'' . $photo . '\', \'blogentry\', \'writeup\', \'' . $twitter . '\', \'project_title\', \'albumphoto\', \'albumurl\', \'' . $trackname . '\', \'' . $file . '\', \'' . $twitpic . '\', NULL, \'' . $filetype . '\', \'thumbnail\', \'0\', \'beattitle\', \'beaturl\', \'beatdl\', \'0\', \'0\', \'photourl\', \'embed\', \'playerpath\', \'' . $short_url . '\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\');';
     // $result2 = mysqli_query($con,$sql1);
     if ($result = mysqli_query($con, $sql1)) {
         // if ($result = mysqli_query($con,$sql)){
         echo 'File Successfully inserted!';
     } else {
         echo 'Oops, the file was not pushed! Something went wrong!!';
     }
     //echo 'so here we are.';
 }
Beispiel #3
0
<?php

include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
$config = new Blog();
$type = $config->detect_file_type($_GET['img_path']);
?>
<form class='push_file_form' >
<h4 class="success-feedback" >Please, provide more information before pushing to profile!</h4>
  <div class="photo-upload-results"></div>
	<input type="text" placeholder='Enter Twitter' name='twitter' id="twitter" class="form-control col-md-10" required>
  <i class="count col-md-2"></i>

	<input type="text" placeholder='Enter Trackname' name='title' id="title" class="form-control" required>

	<input type="hidden" name='id' id='id' value="<?php 
echo $_GET['id'];
?>
"  class="form-control">
	<input type="hidden" name='user_name' id='user_name' value="<?php 
echo $_GET['user_name'];
?>
" class="form-control">
	<!-- <input type="hidden" name='title' value="<?php 
echo $_GET['title'];
?>
"> -->
  <?php 
if ($type == 'audio/mp3') {
    echo "<input type='file' name='img_path' id='poster' class='form-control' required>";
} else {
    $poster = $_GET['img_path'];