当前位置: 首页>>代码示例>>PHP>>正文


PHP Blog::detect_file_type方法代码示例

本文整理汇总了PHP中Blog::detect_file_type方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::detect_file_type方法的具体用法?PHP Blog::detect_file_type怎么用?PHP Blog::detect_file_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Blog的用法示例。


在下文中一共展示了Blog::detect_file_type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handlePhotoUpload

 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 NIGGA!';
         return $file;
     } else {
         echo 'NO NIGGA!!!';
         return FALSE;
     }
 }
开发者ID:mayoalexander,项目名称:fl-two,代码行数:24,代码来源:upload.php

示例2: date

 /**
  * 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.';
 }
开发者ID:mayoalexander,项目名称:fl-two,代码行数:37,代码来源:login.php

示例3: Blog

<?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'];
开发者ID:mayoalexander,项目名称:fl-two,代码行数:31,代码来源:push.php


注:本文中的Blog::detect_file_type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。