<?php $SqlFile = "SELECT * FROM trn_content_picture WHERE CONTENT_ID = ".$CONID." AND CAT_ID = ".$CID." AND DIV_NAME = 'Other' ORDER BY ORDER_ID ASC"; $QueryFile = mysql_query($SqlFile) or die(mysql_error()); $numFile = mysql_num_rows($QueryFile); if($numFile > 0){ ?> <div class="box-otherfile-main"> <div class="box-title cf"> <h2>ไฟล์อื่นๆที่เกี่ยวข้อง</h2> </div> <div class="box-news-main gray"> <?php while ($rowFile = mysql_fetch_array($QueryFile)) { $file = str_replace("../../","",$rowFile['IMG_PATH']); if((file_exists($file)) OR ($rowFile['IMG_TYPE'] == 4)){ $ext = getEXT($file); if(file_exists($file)){ $size = formatSizeUnits(filesize($file)); $link = 'download.php?p='.$rowFile['PIC_ID']; }else{ $size = 'Unknow'; $link = $rowFile['IMG_PATH']; } ?> <div class="box-notice iconFile <?=returnFileType($ext) ?>"> <div class="box-text"> <p class="text-title"><?=$rowFile['IMG_NAME'] ?></p> <p class="text-detail"> <span><?=$typeCap ?>: .<?=$ext ?></span> <span><?=$sizeCap ?>: <?=$size ?></span>
</div> <div class="cp-circle-control"></div> <ul class="cp-controls"> <li><a class="cp-play" tabindex="<?=$rowPic['PIC_ID'] ?>">play</a></li> <li><a class="cp-pause" style="display:none;" tabindex="<?=$rowPic['PIC_ID'] ?>">pause</a></li> </ul> </div> <? $thumbRender .= '<img src="images/tumb-sound.jpg">' . "\n\t"; }else if($rowPic['DIV_NAME'] == 'video'){ if($rowPic['IMG_TYPE'] == 3){ echo '<iframe data-type="embed" width="754" height="460" src="https://www.youtube.com/embed/'.$rowPic['IMG_PATH'].'?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>'."\n\t"; $thumbRender .= '<img src="http://img.youtube.com/vi/'.$rowPic['IMG_PATH'].'/maxresdefault.jpg">'."\n\t"; }else{ $ext = getEXT($rowPic['IMG_PATH']); $path = $rowPic['IMG_PATH']; if($rowPic['IMG_TYPE'] == 2){ $path = str_replace("../../","",$path); } echo '<video width="754" height="460" controls data-type="video">'."\n\t"; echo '<source src="'.$path.'" type="video/'.$ext.'">'."\n\t"; echo '</video>'."\n\t"; $thumbRender .= '<img src="images/tumb-vdo.jpg">'."\n\t"; } }else{ echo '<img class="img-slide-show" data-type="image" style="max-width:754px;max-height: 562px" src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t"; $thumbRender .= '<img src="' . callThumbListFrontEndByID($rowPic['PIC_ID'], $rowPic['CAT_ID'], true) . '">'."\n\t"; } echo '</div>'."\n\t";
echo $row['PIC_ID']; ?> ">play</a></li> <li><a class="cp-pause" style="display:none;" tabindex="<?php echo $row['PIC_ID']; ?> ">pause</a></li> </ul> </div> <?php } else { if ($row['DIV_NAME'] == 'video') { if ($row['IMG_TYPE'] == 3) { echo '<iframe width="754" height="460" src="https://www.youtube.com/embed/' . $row['IMG_PATH'] . '?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>' . "\n\t"; } else { $ext = getEXT($row['IMG_PATH']); $path = $row['IMG_PATH']; if ($row['IMG_TYPE'] == 2) { $path = str_replace("../../", "", $path); } echo '<video width="754" height="460" controls>' . "\n\t"; echo '<source src="' . $path . '" type="video/' . $ext . '">' . "\n\t"; echo '</video>' . "\n\t"; } } else { $path = $row['IMG_PATH']; if ($row['IMG_TYPE'] == 1) { $path = str_replace("../../", "", $path); } echo '<img src="' . $path . '">' . "\n\t"; }
<? while($row = mysql_fetch_array($query)) { $IMG_PATH = str_replace("../../","",$row['IMG_PATH']); $iconType = getEXT($IMG_PATH) ; ?> <div class="box-notice iconFile <?php echo $iconType; ?> "> <div class="box-text"> <p class="text-title"><? echo $row['CONTENT_DESC'] ?></p> <p class="text-detail"> <span><?php echo $typeCap; ?> : <? echo getEXT($IMG_PATH) ?></span> <span><?php echo $sizeCap; ?> : <?php echo formatSizeUnits(filesize($IMG_PATH)); ?> </span> </p> </div> <div class="box-btn cf"> <a href="<?php echo $IMG_PATH; ?> " target="_blank" class="btn red"><?php echo $downloadCap;
} else { chmod($path1, 0777); } if (!is_dir($path2)) { mkdir($path2, 0777); } else { chmod($path2, 0777); } if (!is_dir($path3)) { mkdir($path3, 0777); } else { chmod($path3, 0777); } $output1 = time() . '_' . rand(111, 999) . '.' . getEXT($_FILES["MyPhotograph"]["name"]); $output2 = time() . '_' . rand(111, 999) . '.' . getEXT($_FILES["MyResume"]["name"]); $output3 = time() . '_' . rand(111, 999) . '.' . getEXT($_FILES["MyApplication"]["name"]); if (count($_FILES['MyPhotograph']) > 0) { if (move_uploaded_file($_FILES["MyPhotograph"]["tmp_name"], $path3 . $output1)) { unset($insert); $insert['CONTENT_ID'] = "'" . $retrunID . "'"; $insert['IMG_TYPE'] = 1; $insert['IMG_PATH'] = "'" . $path3 . $output1 . "'"; $insert['CAT_ID'] = "'" . $eapp_sub_cat . "'"; $insert['ORDER_ID'] = "1"; $insert['IMG_NAME'] = "'MyPhotograph'"; $sql = "INSERT INTO trn_content_picture (" . implode(",", array_keys($insert)) . ") VALUES (" . implode(",", array_values($insert)) . ")"; mysql_query($sql, $conn) or die($sql); } } if (count($_FILES['MyResume']) > 0) { if (move_uploaded_file($_FILES["MyResume"]["tmp_name"], $path3 . $output2)) {
if (isset($_POST['email']) && $_POST['email'] == "") { $error[] = "Please enter email."; } //if(isset($_POST['pass']) && $_POST['pass']=="") { // $error[]="Please enter password."; //} if (count($error) <= 0) { $sel_cs = "UPDATE `cs_sites` SET \r\n firstname='" . $_POST['firstname'] . "',\r\n lastname='" . $_POST['lastname'] . "',\r\n site_url='" . $_POST['site_url'] . "', \r\n site_admin='" . $_POST['site_admin'] . "',\r\n fb_app_id='" . $_POST['fb_app_id'] . "',\r\n twitter_app_id='" . $_POST['twitter_app_id'] . "',\r\n linkedin_app_id='" . $_POST['linkedin_app_id'] . "',\r\n gplus_app_id='" . $_POST['gplus_app_id'] . "',\r\n yahoo_app_id='" . $_POST['yahoo_app_id'] . "',\r\n insta_app_id='" . $_POST['insta_app_id'] . "',\r\n admin_email='" . $_POST['email'] . "' where id='" . $_SESSION['admin_id'] . "'"; re_db_query($sel_cs); if (isset($_POST['pass']) && $_POST['pass'] != "") { $u_update = "update cs_sites set admin_password='******'pass']) . "' where id='" . $_SESSION['admin_id'] . "'"; re_db_query($u_update); } if ($_FILES['admin_img']['name'] != "") { $filename = basename($_FILES['admin_img']['name']); $ext = strtolower(getEXT($filename)); $orgfilename = "cs_admin_" . $_SESSION['admin_id'] . "." . $ext; $uploaddir = DIR_FS . "img/cs_admin/" . $orgfilename; move_uploaded_file($_FILES['admin_img']['tmp_name'], $uploaddir); $u_update = "update cs_sites set admin_img='" . $orgfilename . "' where id='" . $id . "'"; re_db_query($u_update); } $_SESSION['msg'] = "update"; header("location:site_setting.php"); exit; } } if (!isset($_POST['update_account'])) { $site_data_qry = "select * from cs_sites where id='" . $_SESSION['admin_id'] . "'"; $site_data_sql = re_db_query($site_data_qry); if (re_db_num_rows($site_data_sql) > 0) {
<div class="box-news-main gray"> <? while($row = mysql_fetch_array($query)) { $IMG_PATH = str_replace("../../","",$row['IMG_PATH']); $iconType = getEXT($IMG_PATH); ?> <div class="box-notice iconFile <?php echo $iconType; ?> "> <div class="box-text"> <p class="text-title"><? echo $row['CONTENT_DESC_LOC'] ?></p> <p class="text-detail"> <span>ประเภท: <? echo getEXT($IMG_PATH) ?></span> <span>ขนาด: <?php echo formatSizeUnits(filesize($IMG_PATH)); ?> </span> </p> </div> <div class="box-btn cf"> <a href="<?php echo $IMG_PATH; ?> " target="_blank" class="btn red"><?php echo $downloadCap; ?> </a> </div>
<?php require ("assets/configs/config.inc.php"); require ("assets/configs/connectdb.inc.php"); require ("assets/configs/function.inc.php"); header("Content-type: application/javascript; charset=UTF-8"); echo '$(document).ready(function(){'; $index = 1; $sql = "SELECT * FROM trn_content_picture WHERE CONTENT_ID = ".intval($_GET['CONID'])." AND CAT_ID = ".intval($_GET['CID'])." AND DIV_NAME = '".$_GET['NAME']."' ORDER BY ORDER_ID ASC"; $query = mysql_query($sql, $conn); while ($row = mysql_fetch_array($query)) { switch (getEXT($row['IMG_PATH'])) { case "wav": $type = 'wav'; break; case "oga": case "ogg": $type = 'oga'; break; default : $type = 'm4a'; break; } $path = $row['IMG_PATH']; if($row['IMG_TYPE'] == 2){ $path = str_replace("../../","",$path); } $path = $type.': "'.$path.'"'; echo "\n\t"; ?> var myCirclePlayer<?=$index++?> = new CirclePlayer("#jquery_jplayer_<?=$row['PIC_ID']?>",
function frontend_move_image_upload_dir($dir, $file, $width, $height, $crop, $thumbwidth, $thumbheight) { $path1 = 'upload'; $path2 = $path1 . '/' . $dir; $path3 = $path2 . '/' . date("Y_m") . '/'; $path4 = $path3 . '/thumbnail/'; $old_path1 = 'assets/plugin/upload/php/files/'; if (!is_dir($path1)) { mkdir($path1, 0777); } else { chmod($path1, 0777); } if (!is_dir($path2)) { mkdir($path2, 0777); } else { chmod($path2, 0777); } if (!is_dir($path3)) { mkdir($path3, 0777); } else { chmod($path3, 0777); } if (!is_dir($path4)) { mkdir($path4, 0777); } else { chmod($path4, 0777); } $output = time() . '_' . rand(111, 999) . '.' . getEXT($file); $original_path = $old_path1 . $file; $thumb_path = $old_path1 . 'thumbnail/' . $file; copy($original_path, $path3 . $output); copy($original_path, $path4 . $output); unlink($original_path); unlink($thumb_path); chmod($path1, 0755); chmod($path2, 0755); chmod($path3, 0755); chmod($path4, 0755); return '../../' . $path3 . $output; }