***********END LOGIN TOP ***************** */ if ($showcontent == 1) { echo '<p><a href="registrationlist.php">RETURN TO REGISTRATION LIST</a></p>'; //SET VARIABLES WE WILL NEED LATER $showform = 0; $errormessage = ""; //ONCE WE HAVE PRESSED SUBMIT, DO SOMETHING.... if (isset($_POST['submit'])) { $_GET['x'] = $_POST['x']; //SET ALL POST VARIABLES $FORMFIELD['first'] = htmlchars(cleanse($_POST['first'])); $FORMFIELD['mi'] = htmlchars(cleanse($_POST['mi'])); $FORMFIELD['last'] = htmlchars(cleanse($_POST['last'])); $FORMFIELD['email'] = strtolower(htmlchars(cleanse($_POST['email']))); $FORMFIELD['username'] = strtolower(htmlchars(cleanse($_POST['username']))); $FORMFIELD['gender'] = $_POST['gender']; $FORMFIELD['status'] = $_POST['status']; $FORMFIELD['bio'] = cleanse($_POST['bio']); //check for empty fields if ($FORMFIELD['first'] == "") { $errormessage .= "<p>FIRST NAME IS MISSING.</p>"; } if ($FORMFIELD['last'] == "") { $errormessage .= "<p>LAST NAME IS MISSING.</p>"; } if ($FORMFIELD['email'] == "") { $errormessage .= "<p>EMAIL IS MISSING.</p>"; } if ($FORMFIELD['username'] == "") { $errormessage .= "<p>USERNAME IS MISSING.</p>";
$FORMFIELD['middleName'] = htmlchars(cleanse($_POST['middleName'])); $FORMFIELD['lastName'] = htmlchars(cleanse($_POST['lastName'])); $FORMFIELD['userName'] = strtolower(cleanse($_POST['userName'])); $FORMFIELD['rank'] = htmlchars(cleanse($_POST['rank'])); $FORMFIELD['institution'] = htmlchars(cleanse($_POST['institution'])); $FORMFIELD['address1'] = htmlchars(cleanse($_POST['address1'])); $FORMFIELD['address2'] = htmlchars(cleanse($_POST['address2'])); $FORMFIELD['address3'] = htmlchars(cleanse($_POST['address3'])); $FORMFIELD['city'] = htmlchars(cleanse($_POST['city'])); $FORMFIELD['state'] = htmlchars(cleanse($_POST['state'])); $FORMFIELD['zip'] = htmlchars(cleanse($_POST['zip'])); $FORMFIELD['email'] = strtolower(cleanse($_POST['email'])); $FORMFIELD['telephone'] = htmlchars(cleanse($_POST['telephone'])); $FORMFIELD['secQ'] = htmlchars(cleanse($_POST['secQ'])); $FORMFIELD['secA'] = htmlchars(cleanse($_POST['secA'])); $FORMFIELD['membership'] = htmlchars(cleanse($_POST['membership'])); //Check telephone if (!preg_match('/^[0-9]{10}$/', $FORMFIELD['telephone'])) { $errormessage .= '<p>The telephone does not have the required format</p>'; } //See if username has already been used try { $sql = 'SELECT * FROM registration WHERE userName = :userName AND ID != :ID'; $q = $pdo->prepare($sql); $q->bindValue(':userName', $FORMFIELD['userName']); $q->bindValue(':ID', $_POST['x']); $q->execute(); $count = $q->rowCount(); } catch (PDOException $e) { echo 'Error fetching users: ' . $e->getMessage(); exit;
function gnarty_menu_page_cb() { global $wpdb; if (isset($_POST['ok'])) { if ($_POST['webgrab'] == 'phimletvn') { $info_url_html = xem_web($_POST['urlgrab']); $url_play = explode('<a rel="nofollow" href="/xem-', $info_url_html); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name = explode('<h1 class="title">', $info_url_html); $info_name = explode('</h1>', $info_name[1]); $info_name_en = explode('<h2 class="title gray maggin_bottom_10">', $info_url_html); $info_name_en = explode('</h2>', $info_name_en[1]); $info_dienvien = explode('<div class="grid_2 omega label">Diễn viên:</div><div class="grid_7 alpha">', $info_url_html); $info_dienvien = explode('</div>', $info_dienvien[1]); $info_nam = explode('Phát hành: <strong>', $info_url_html); $info_nam = explode('</strong></li>', $info_nam[1]); $info_sx = explode('Sản xuất: <strong>', $info_url_html); $info_sx = explode('</strong></li>', $info_sx[1]); $info_time = explode('<div class="row bg_2 clearfix"><div class="grid_2 omega label">Tập:</div><div class="grid_7 alpha">', $info_url_html); $info_time = explode('</div>', $info_time[1]); $info_tt = explode('<div class="grid_2 omega label">Giới thiệu:</div>', $info_url_html); $info_tt = explode('</div>', $info_tt[1]); $info_tag = get_ascii($info_name[0] . ", " . $info_name_en[0]); } else { if ($_POST['webgrab'] == 'tvphimhd') { $info_url_html = $html = xem_web($_POST['urlgrab']); $vantoan = explode('[id]', $info_url_html); $vantoan = explode('|[/id]', $vantoan[1]); $vantoan = $vantoan[0]; $s = explode('|', $vantoan); $total_plays = count($s); $info_name[0] = explode_by("<title>Xem phim ", "-", $html, true); $info_name_en = explode('<div class="mota-right"><h2>', $info_url_html); $info_name_en = explode('</h2>', $info_name_en[1]); $info_img = explode('<img class="poster" src="', $info_url_html); $info_img = explode('"', $info_img[1]); $info_daodien[0] = explode_by("Thời lượng:", "Diễn viên:", $html, true); $info_dienvien[0] = explode_by("Diễn viên:", "Thời lượng:", $html, true); $info_time[0] = explode_by("Thời lượng:", "Từ khóa:", $html, true); $info_nam[0] = explode_by("Năm phát hành:", "Đạo diễn:", $html, true); $info_tt[0] = explode_by('<div class="description">', "</div>", $html, true); } else { if ($_POST['webgrab'] == 'phim3s') { $info_url_html = $html = file_get_contents($_POST['urlgrab']); $link_watch = explode_by('</div></div><a href="', '" class="btn-watch"', $info_url_html); $link_watch = 'http://phim3s.net/' . $link_watch; $link_watch = file_get_contents($link_watch); $ep_list = explode_by('<div class="serverlist">', '</ul></div></div>', $link_watch); $url_play = explode('<a', $ep_list); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name[0] = explode_by("<title>Xem phim", " | ", $html); $info_name_en[0] = explode_by(" | ", "full HD</title>", $html); $info_img[0] = explode_by('<img class="photo" src="', '" alt', $html); $info_daodien[0] = explode_by("<dt>Đạo diễn:</dt>", "<dt>Diễn viên:</dt>", $html, true); $info_dienvien[0] = explode_by("<dt>Diễn viên:</dt>", "<dt>Thể loại:</dt>", $html, true); $info_time[0] = explode_by("<dt>Thời lượng:</dt>", "<dt>Lượt xem:</dt>", $html, true); $info_nam[0] = explode_by("<p>Năm phát hành: ", "</p", $html, true); $info_tt[0] = explode_by('<div class="tabs-content" id="info-film">', '<div class="tags">', $html, true); $info_tag = get_ascii($info_name[0] . ", " . $info_name_en[0]); } else { if ($_POST['webgrab'] == 'xemphimfullhd') { $info_url_html = $html = xem_web($_POST['urlgrab']); $link_watch = explode_by('<a class="xem w-bt" href="', '"', $html, false); $link_watch = xem_web($link_watch); $ep_list = explode_by('<div class="list_episodes content">', '<br class="clr"/>', $link_watch, false); $url_play = explode('<a ', $ep_list); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name[0] = explode_by("<title>Phim ", " | ", $html, false); $info_name_en[0] = explode_by(" | ", " | ", $html, false); $info_img[0] = explode_by('<link href="', '"', $html, false); $info_daodien[0] = explode_by("<p>Đạo diễn:", "</p", $html, true); $info_dienvien[0] = explode_by("<p>Diễn viên:", "</p", $html, true); $info_time[0] = explode_by("<p>Thời lượng:", "</p", $html, true); $info_nam[0] = explode_by("<p>Năm phát hành: ", "</p", $html, true); $info_tt[0] = explode_by('<div id="movie_description" class="tab_click entry">', "</div>", $html, true); } else { if ($_POST['webgrab'] == 'phim1k') { $info_url_html = $html = curl_by($_POST['urlgrab']); //$link_watch = 'http://phim1k.net'.explode_by('href="http://adf.ly/2397534/','"',$html); $link_watch = explode_by('href="http://adf.ly/2397534/', '"', $html); if (substr($link_watch, 0, 7) != 'http://') { $link_watch = 'http://phim1k.net' . $link_watch; } $link_watch = curl_by($link_watch); $ep_list = explode_by('<div class="server_content">', '<div class="f_i_desc">', $link_watch, false); $url_play = explode('<a ', $ep_list); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name[0] = explode_by("<h1>", "</h1>", $html, true); $info_name_en[0] = explode_by("<span class=\"f_i_title_en\">", "</span>", $html, false); $info_img[0] = explode_by('<meta property="og:image" content="', '" />', $html, false); $info_daodien[0] = explode_by("<strong>Đạo diễn:</strong>", "</span", $html, true); $info_dienvien[0] = explode_by("<strong>Diễn viên:</strong>", "</span", $html, true); //$info_time[0] = explode_by("<p>Thời lượng:","</p",$html,true); $info_nam[0] = explode_by("<strong>Năm phát hành:</strong>", "</span", $html, true); $info_tt[0] = explode_by('<div class="content" style="line-height: 20px;">', "</div>", $html, true); } else { if ($_POST['webgrab'] == 'phim14') { $info_url_html = $html = curl_by($_POST['urlgrab']); $link_watch = explode_by('<a class="watch_button now" href="', '"', $html, false); $link_watch = curl_by($link_watch); $ep_list = explode_by('<ul id="server_list">', '<div class="blockrow blockinfo">', $link_watch, false); $url_play = explode('<a ', $ep_list); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name[0] = explode_by("<title>Phim ", "(", $html, false); $info_name_en[0] = explode_by("(", ")", $html, false); $info_img[0] = explode_by('<div class="thumbnail"><img src="', '"', $html, false); $info_daodien[0] = explode_by('div class="alt1">Đạo diễn:', "Diễn viên:", $html, true); $info_dienvien[0] = explode_by('Diễn viên:', "Thể loại:", $html, true); $info_time[0] = explode_by('<div class="alt1">Thời lượng:', "</div", $html, true); $info_nam[0] = explode_by('<div class="alt2">Năm phát hành:', "</div", $html, true); $info_tt[0] = explode_by('</a></span></div>', '<div class="title hr"><span>', $html, true); } elseif ($_POST['webgrab'] == 'animefc') { $info_url_html = xem_web($_POST['urlgrab']); $url_play_phim = explode('<a href="http://animefc.info/xem-phim', $info_url_html); $url_play_phim = explode('"', $url_play_phim[1]); $url_play_phim = 'http://animefc.info/xem-phim' . $url_play_phim[0]; $url_play_phim_html = xem_web($url_play_phim); $url_play_phim_html = explode_by('<div id="servers" class="serverlist">', '<!-- / server -->', $url_play_phim_html, false); $url_play = explode('data-type="watch" class="" href="', $url_play_phim_html); //print_r($url_play);exit(); $total_play = count($url_play); $total_plays = $total_play - 1; $info_img[0] = explode_by('<meta property="og:image" content="', '"', $info_url_html, false); $info_name = explode('title="Phim ', $info_url_html); $info_name = explode('"', $info_name[1]); $info_name_en = explode('<h3>', $info_url_html); $info_name_en = explode('</h3>', $info_name_en[1]); $info_nam = explode('<p>Năm Sản Xuất: <strong>', $info_url_html); $info_nam = explode('</strong></p>', $info_nam[1]); $info_time = explode('<p>Thời lượng: <strong>', $info_url_html); $info_time = explode('</strong></p>', $info_time[1]); $info_tt = explode('<div id="noidung" class="tabs_content">', $info_url_html); $info_tt = explode('<div class="f_d_tag">', $info_tt[1]); $info_tag = explode('<div class="f_d_tag">', $info_url_html); $info_tag = explode('</div>', $info_tag[1]); $info_tag = str_replace('Tags:', '', $info_tag); $info_tag = multi_between('rel="tag">', '</a>', $info_tag); $info_tag = implode(', ', $info_tag); } else { if ($_POST['webgrab'] == 'phimbb') { $info_url_html = $html = curl_by($_POST['urlgrab']); $link_watch = 'http://phimbb.net/xem-phim/' . explode_by('<a href="xem-phim/', '"', $html, true); $link_watch = curl_by($link_watch); $ep_list = explode_by('<div id="servers">', '</div>', $link_watch, false); $url_play = explode('<a ', $ep_list); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name[0] = explode_by("<h1>»", "</h1>", $html, false); $info_name_en[0] = explode_by("<p class=\"tt-en\">»", "</p>", $html, false); $info_img = explode('<div class="cover">', $html); $info_img = explode('"></a>', $info_img[1]); $info_img = explode('<img src="', $info_img[0]); $info_img = explode('"', $info_img[1]); $info_img[0] = $info_img[0]; $info_daodien[0] = explode_by('<p class="half">» Đạo diễn:', '</p>', $html, true); $info_dienvien[0] = explode_by('<p>» Diễn viên: ', '</p>', $html, true); //$info_time[0] = explode_by('<div class="alt1">Thời lượng:',"</div",$html,true); //$info_nam[0] = explode_by('<div class="alt2">Năm phát hành:',"</div",$html,true); $info_tt[0] = explode_by('id="movie_description">', '</div>', $html, false); $info_tt[0] = str_replace('PhimBB.Net', '', $info_tt[0]); } else { if ($_POST['webgrab'] == 'phimkk') { $info_url_html = $html = curl_by($_POST['urlgrab']); $link_watch = 'http://phimkk.com/xem-phim/' . explode_by('<a href="xem-phim/', '"', $html, true); $link_watch = curl_by($link_watch); $ep_list = explode_by('<div id="servers">', '</div>', $link_watch, false); $url_play = explode('<a ', $ep_list); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name[0] = explode_by("<h1>»", "</h1>", $html, false); $info_name_en[0] = explode_by("<p class=\"tt-en\">»", "</p>", $html, false); $info_img = explode('<div class="cover">', $html); $info_img = explode('"></a>', $info_img[1]); $info_img = explode('<img src="', $info_img[0]); $info_img = explode('"', $info_img[1]); $info_img[0] = $info_img[0]; $info_daodien[0] = explode_by('<p class="half">» Đạo diễn:', '</p>', $html, true); $info_dienvien[0] = explode_by('<p>» Diễn viên: ', '</p>', $html, true); //$info_time[0] = explode_by('<div class="alt1">Thời lượng:',"</div",$html,true); //$info_nam[0] = explode_by('<div class="alt2">Năm phát hành:',"</div",$html,true); $info_tt[0] = explode_by('id="movie_description">', '</div>', $html, false); $info_tt[0] = str_replace('Phimkk.com', '', $info_tt[0]); } elseif ($_POST['webgrab'] == 'phim85') { $info_url_html = xem_web($_POST['urlgrab']); $url_play_phim = explode('<a href="http://www.phim85.com/xem-phim/', $info_url_html); $url_play_phim = explode('" alt="', $url_play_phim[1]); $url_play_html_phim = 'http://www.phim85.com/xem-phim/' . $url_play_phim[0]; $url_play_phim = xem_web($url_play_html_phim); $url_play = explode('<li class=""><a href="xem-', $url_play_phim); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name = explode('<h1>PHIM', $info_url_html); $info_name = explode(' - ', $info_name[1]); $info_name_en = explode('<a href="year/', $info_name[1]); $info_daodien = explode('<dt>Đạo diễn - Director:</dt>', $info_url_html); $info_daodien = explode('</dd>', $info_daodien[1]); $info_dienvien = explode('<dt>Diễn viên - Stars:</dt>', $info_url_html); $info_dienvien = explode('</dd>', $info_dienvien[1]); $info_nam = explode('<dt>Năm phát hành - Year:</dt>', $info_url_html); $info_nam = explode('</dd>', $info_nam[1]); $info_sx = explode('<p class="m-l">Nhà sản xuất: ', $info_url_html); $info_sx = explode('</p>', $info_sx[1]); $info_time = explode('<dt>Thời lượng - Runtime:</dt>', $info_url_html); $info_time = explode('</dd>', $info_time[1]); $info_tt = explode('<div style="margin-top:5px;" class="title hr"><span>Nội dung phim:</span></div>', $info_url_html); $info_tt = explode('<div class="blocktitle">Phim cùng thể loại</div>', $info_tt[1]); $info_tag = get_ascii($info_name[0] . ", " . $info_name_en[0]); } elseif ($_POST['webgrab'] == 'congdongvip') { $info_url_html = xem_web($_POST['urlgrab']); $url_play_phim = explode('<p class="play"><a href="http://phim.congdongvip.com/', $info_url_html); $url_play_phim = explode('" title="', $url_play_phim[1]); $url_play_html_phim = 'http://phim.congdongvip.com/' . $url_play_phim[0]; $url_play_phim = xem_web($url_play_html_phim); $url_play = explode('" onclick="setupplayer', $url_play_phim); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name = explode('<h1><a property="v:title" rel="v:url" title="Phim ', $info_url_html); $info_name = explode('" href="/phim/', $info_name[1]); $info_name_en = explode('" href="/phim/', $info_name[0]); $info_daodien = explode('<p>Đạo diễn: ', $info_url_html); $info_daodien = explode('</a></p>', $info_daodien[1]); $info_dienvien = explode('<p>Diễn viên:', $info_url_html); $info_dienvien = explode('</a></p>', $info_dienvien[1]); $info_nam = explode('<p class="m-l">Năm phát hành: ', $info_url_html); $info_nam = explode('</p>', $info_nam[1]); $info_sx = explode('<p class="m-l">Nhà sản xuất: ', $info_url_html); $info_sx = explode('</p>', $info_sx[1]); $info_time = explode('<p class="m-l">Thời lượng: ', $info_url_html); $info_time = explode('</span></p>', $info_time[1]); $info_tt = explode('<div class="icontents row-content">', $info_url_html); $info_tt = explode('<div class="xt"><a href="#" id="show-movie-info">', $info_tt[1]); $info_tag = get_ascii($info_name[0] . ", " . $info_name_en[0]); } elseif ($_POST['webgrab'] == 'phim8') { $info_url_html = xem_web($_POST['urlgrab']); $url_play_phim = explode('<a href="http://phim8.info/xem-phim/', $info_url_html); $url_play_phim = explode('" alt="Xem phim trực tuyến"', $url_play_phim[1]); $url_play_html_phim = 'http://phim8.info/xem-phim/' . $url_play_phim[0]; $url_play_phim = xem_web($url_play_html_phim); $url_play = explode('<a href="xem-', $url_play_phim); $total_play = count($url_play); $total_plays = $total_play - 1; $info_name = explode('<dt>Tên Phim:</dt>', $info_url_html); $info_name = explode(' - ', $info_name[1]); $info_name_en = explode(' 2', $info_name[1]); $info_daodien = explode('<dt>Đạo diễn:</dt>', $info_url_html); $info_daodien = explode('</a></dd>', $info_daodien[1]); $info_dienvien = explode('<dt>Diễn viên:</dt>', $info_url_html); $info_dienvien = explode('</a></dd>', $info_dienvien[1]); $info_nam = explode('<dt>Năm phát hành:</dt>', $info_url_html); $info_nam = explode('</a></dd>', $info_nam[1]); $info_sx = explode('<dt>Sản xuất:</dt>', $info_url_html); $info_sx = explode('</dd>', $info_sx[1]); $info_time = explode('<dt>Thời lượng:</dt>', $info_url_html); $info_time = explode('</dd>', $info_time[1]); $info_tt = explode('NỘI DUNG PHIM</span></div>', $info_url_html); $info_tt = explode('<span>Tags:</span>', $info_tt[1]); $info_tag = get_ascii($info_name[0] . ", " . $info_name_en[0]); } } } } } } } } $info_tag = get_ascii($info_name[0] . ", " . $info_name_en[0]) . ", Phim " . $info_name[0] . ", Phim " . $info_name_en[0] . ", " . $info_name[0] . " vietsub" . ", " . $info_name_en[0] . " vietsub"; $phimid = $_GET['phimid']; if (!$phimid) { $phimid = 0; } else { ?> <script type="text/javascript">$(document).ready(function () {$('#addfilm_new').hide();});</script> <?php } $begin = $_POST['episode_begin']; $end = $_POST['episode_end']; ////BEGIN CHECK EPISODE if (!is_numeric($begin) && !is_numeric($end)) { $episode_begin = 1; $episode_end = $total_plays; } elseif (!is_numeric($begin) && !is_numeric($end)) { $episode_begin = 1; $episode_end = 10; } elseif (!is_numeric($begin)) { $episode_begin = $episode_end = $end; } else { $episode_begin = $begin; $episode_end = $end; } ////END CHECK EPISODE if (!$_POST['last-submit']) { ?> <form name="themeform" enctype="multipart/form-data" method="post" class="gnarty-grab"> <!-- thong tin bo phim --> <h1 style="padding: 16px 0px 16px 0px;">Thêm tập phim vào phim có sắn</h1> <div class="form_item"> <label>Chọn phim:</label> <?php echo gnarty_acp_film($phimid); ?> </div> <div id="addfilm_new"> <h1 style="padding: 16px 0px 16px 0px;">Thêm phim mới</h1> <div class="form_item"> <label>Tên bộ phim:</label> <input type="text" class="flat" size="30" name="tenphim" value="<?php echo htmltxt($info_name[0]); ?> " maxlength="250"> </div> <div class="form_item"> <label>Tên tiếng anh:</label> <input class="flat" size="30" name="tentienganh" value="<?php echo htmltxt($info_name_en[0]); ?> " maxlength="250"> </div> <div class="form_item"> <label>Đạo diễn:</label> <input type="text" class="flat" size="30" name="daodien" value="<?php echo htmltxt($info_daodien[0]); ?> " maxlength="250"> </div> <div class="form_item"> <label>Diễn viên:</label> <input type="text" class="flat" size="30" name="dienvien" value="<?php echo htmltxt($info_dienvien[0]); ?> " maxlength="250"> </div> <div class="form_item"> <label>Thời lượng:</label> <input class="flat" size="30" name="thoiluong" value="<?php echo htmltxt($info_time[0]); ?> " maxlength="250"> </div> <div class="form_item"> <label>Năm sản xuất:</label> <input class="flat" size="30" name="namsanxuat" value="<?php echo htmltxt($info_nam[0]); ?> " maxlength="250"> </div> <div class="form_item"> <label>Chất lượng:</label> <input class="flat" size="30" name="chatluong" value="HD" maxlength="250"> </div> <div class="form_item"> <label>Ảnh </label> <input value="<?php echo $info_img[0]; ?> " id="phimimg_name" name="phimimg_name" type="text" /> <img width="120" height="180" src="<?php echo $info_img[0]; ?> " alt="" /> </div> <table cellpadding="0" cellspacing="0" width="100%"> <!-- <tr> <td class="form_item" width="180">Thể loại:</td> <td class="form_item"><?php //echo ipos_category($theloai); ?> </td> </tr>--> </table> <div class="form_item"> <label>Giới thiệu phim:</label> <textarea name="phimtxt" style="width:630px; height: 130px;"><?php echo htmltxt($info_tt[0]); ?> </textarea> </div> <div class="form_item"> <label>Từ khóa tìm kiếm:</label> <textarea name="phimtag" style="width:630px; height: 70px;"><?php echo htmltxt($info_tag); ?> </textarea> </div> </div> <?php if (isset($url_play)) { ?> <div class="form_item"> <strong>Link debug (cho dễ xem số tập)</strong> <pre><?php print_r($url_play); ?> </pre> </div> <?php } ?> <!-- <div class="form_item"> <label>Server chưa phim:</label> <?php // echo ipos_set_type(); ?> </div>--> <table cellpadding="0" cellspacing="0" width="100%"> <tr><td colspan="3"><h1 style="padding: 16px 0px 16px 0px;">Danh sách tập phim</h1></td></tr> <?php if (isset($_POST['webgrab'])) { $from = (int) $_POST['from']; $to = (int) $_POST['to']; if (!($from == -1 && $to == -1)) { $episode_begin = $from; $episode_end = $to; } } /* var_dump($episode_begin); var_dump($episode_end); exit(); */ for ($i = $episode_begin; $i <= $episode_end; $i++) { if ($_POST['webgrab'] == 'phimletvn') { $play_url = explode('phim-', $url_play[$i]); $play_url = explode('.let" class="button">', $play_url[1]); $play_url = 'http://phim.let.vn/xem-phim-' . $play_url[0] . '.let'; $html_link_play = xem_web($play_url); $link_phim = explode('<div class="maggin_top_5"><a href="', $html_link_play); $link_phim = explode('"', $link_phim[1]); $link_phim = $link_phim[0]; $play_embed[$i] = $link_phim; $name = explode('class="button"><span>', $url_play[$i]); $name = explode('</span></a>', $name[1]); } else { if ($_POST['webgrab'] == 'tvphimhd') { $num = $i - 1; $play_url = explode(';', $s[$num]); $play_embed[$i] = trim($play_url[1]); $name[0] = trim($play_url[0]); } else { if ($_POST['webgrab'] == 'xemphimfullhd') { $name[0] = explode_by('">', '</a>', $url_play[$i], true); $link_m = explode_by('href="', '"', $url_play[$i], true); $link_m = str_replace("http://xemphimfullhd.com/", "http://m.xemphimfullhd.com/", $link_m); $html_link = curl_by($link_m); $link_m = explode_by('http://xemphimfullhd.com/play.php?url=', "'", $html_link, false); if (!$link_m) { $link_m = explode_by('?file=', "'", $html_link); } $play_embed[$i] = $link_m; } else { if ($_POST['webgrab'] == 'phim1k') { $name[0] = explode_by('class="">', '</a>', $url_play[$i], true); $link_m = "http://phim1k.net" . explode_by('href="', '"', $url_play[$i], false); $html_link = curl_by($link_m); $link_m = explode_by('proxy.link=', "&", $html_link, false); if (!$link_m) { $idytb = explode_by('allowfullscreen="" src="', '&', $html_link, false); $idytb = explode_by('embed/', '?s', $idytb, false); if ($idytb) { $link_m = "http://www.youtube.com/v/{$idytb}"; } else { $link_m = explode_by('<embed src="', '"', $html_link); } } $play_embed[$i] = $link_m; } elseif ($_POST['webgrab'] == 'phim14') { $name[0] = explode_by('">', '</a>', $url_play[$i], true); $link_m = explode_by('href="', '"', $url_play[$i], false); $html_link = curl_by(str_replace("phim14.net", "m.phim14.net", $link_m)); $link_m = explode_by('vantoan|||', ".mp4", $html_link, false); $link_m = base64_decode($link_m); $play_embed[$i] = $link_m; } elseif ($_POST['webgrab'] == 'phim85') { $play_url = explode('phim', $url_play[$i]); $play_url = explode('">', $play_url[1]); $play_url = 'http://www.phim85.com/xem-phim' . $play_url[0]; $html_link_play = xem_web($play_url); $link_phim = explode('proxy.link=', $html_link_play); $link_phim = explode('&', $link_phim[1]); $link_phim = $link_phim[0]; $html_link_play_2 = xem_web($url_play_html_phim); $link_phim_2 = explode('proxy.link=', $html_link_play_2); $link_phim_2 = explode('&', $link_phim_2[1]); $link_phim_2 = $link_phim_2[0]; if ($i == 1) { $play_embed[$i] = $link_phim_2; $name = explode('"><font color="#00FF00">[', $url_play[$i]); $name = explode(']</font>', $name[1]); } else { $play_embed[$i] = $link_phim; $name = explode('.html"><b>', $url_play[$i]); $name = explode('</b></a>', $name[1]); } } elseif ($_POST['webgrab'] == 'phim8') { $play_url = explode('phim/', $url_play[$i]); $play_url = explode('">', $play_url[1]); $play_url = 'http://phim8.info/xem-phim/' . $play_url[0]; $html_link_play = xem_web($play_url); $link_phim = explode('proxy.link=', $html_link_play); $link_phim = explode('&', $link_phim[1]); $link_phim = $link_phim[0]; $html_link_play_2 = xem_web($url_play_html_phim); $link_phim_2 = explode('proxy.link=', $html_link_play_2); $link_phim_2 = explode('&', $link_phim_2[1]); $link_phim_2 = $link_phim_2[0]; if ($i == 1) { $play_embed[$i] = $link_phim_2; $name = explode('<font color="#00FF00">[', $url_play[$i]); $name = explode(']</font>', $name[1]); } else { $play_embed[$i] = $link_phim; $name = explode('.html"><b>', $url_play[$i]); $name = explode('</b></a>', $name[1]); } } else { if ($_POST['webgrab'] == 'animefc') { $name[0] = explode_by('">', '</a>', $url_play[$i], true); $link = explode('"', $url_play[$i]); $html_link = xem_web($link[0]); $linkphim = explode('"proxy.link":"', $html_link); $linkphim = explode('"', $linkphim[1]); $play_embed[$i] = $linkphim[0]; } elseif ($_POST['webgrab'] == 'congdongvip') { $play_url = explode('(', $url_play[$i]); $play_url = explode(',', $play_url[1]); $play_url = 'http://phim.congdongvip.com/xml/' . $play_url[0] . '.xml'; $html_link_play = xem_web($play_url); $link_phim = explode('<location>', $html_link_play); $link_phim = explode('</location>', $link_phim[1]); $link_phim = $link_phim[0]; $play_embed[$i] = $link_phim; $name_play = explode('<title>', $html_link_play); $name = explode('</title>', $name_play[1]); } elseif ($_POST['webgrab'] == 'phimkk') { $name[0] = explode_by('html">', '</a>', $url_play[$i], false); //exit('aaaaa' . $url_play[$i]);exit(); $name[0] = strip_tags($name[0]); $name[0] = str_replace(array('[', ']'), '', $name[0]); $link_m = 'http://phimkk.com/' . str_replace(' ', '%20', explode_by('href="', '"', $url_play[$i], false)); $html_link = curl_by($link_m); $play_embed[$i] = explode_by('&file=', "&", $html_link, false); if (empty($play_embed[$i])) { $url = explode_by('<div id="mediaplayer"', '</div>', $html_link, false); $play_embed[$i] = explode_by('src=\'', '\'', $url, false); } } elseif ($_POST['webgrab'] == 'phimbb') { $name[0] = explode_by('html">', '</a>', $url_play[$i], false); //exit('aaaaa' . $url_play[$i]);exit(); $name[0] = strip_tags($name[0]); $name[0] = str_replace(array('[', ']'), '', $name[0]); $link_m = 'http://phimbb.net/' . str_replace(' ', '%20', explode_by('href="', '"', $url_play[$i], false)); $html_link = curl_by($link_m); $play_embed[$i] = explode_by('&file=', "&", $html_link, false); if (empty($play_embed[$i])) { $url = explode_by('<div id="mediaplayer"', '</div>', $html_link, false); $play_embed[$i] = explode_by('src=\'', '\'', $url, false); } } } } } } $sub = htmlchars(stripslashes(trim(urldecode($sub)))); $is_sub = preg_match("#no_sub([^/]+)#", $sub); if ($is_sub) { $linksub = ''; } else { $linksub = $sub; } $play_embed[$i] = htmlchars(stripslashes(trim(urldecode($play_embed[$i])))); ?> <tr> <td class="form_item" width="12%"> TẬP <input onclick="this.select()" type="text" name="name[<?php echo $i; ?> ]" value="<?php echo $name[0]; ?> " size="2" style="text-align:center; width: 40px;"> </td> <td class="form_item" width="50%"> <p class="url"><span>FULL</span><input type="text" name="url[<?php echo $i; ?> ]" size="50" value="<?php echo $play_embed[$i]; ?> "></p> </td> <td class="form_item" width="32%">SUB <input type="text" name="sub[<?php echo $i; ?> ]" style="width:210px;" value="<?php echo $linksub; ?> "></td> </tr> <?php } ?> </table> <div class="form_item"> <input type="hidden" name="episode_begin" value="<?php echo $episode_begin; ?> "> <input type="hidden" name="episode_end" value="<?php echo $episode_end; ?> "> <input type="hidden" name="from" value="<?php echo $from; ?> "> <input type="hidden" name="to" value="<?php echo $to; ?> "> <input type="hidden" name="ok" value="SUBMIT"> <button class="button button-primary" value="Submit" name="last-submit" type="submit">Gửi đi</button> </div> </form> <?php } $currentUser = wp_get_current_user(); //Thêm phim mới if ($_POST['film'] == 'dont_edit') { $arr = array('post_title' => $_POST['tenphim'], 'post_content' => $_POST['phimtxt'], 'post_status' => 'draft', 'post_author' => $currentUser->ID); $newPostID = wp_insert_post($arr); $linkphim = array(); $stt = 0; foreach ($_POST['name'] as $k => $val) { if (isset($_POST['url'][$k]) && !empty($_POST['url'][$k])) { $linkphim[$stt] = $val . '#' . $_POST['url'][$k] . '#' . $stt; $stt++; } } update_post_meta($newPostID, 'phim_en', $_POST['tentienganh']); update_post_meta($newPostID, 'phim_tl', $_POST['thoiluong']); update_post_meta($newPostID, 'phim_nsx', $_POST['namsanxuat']); update_post_meta($newPostID, 'phim_hd', $_POST['chatluong']); update_post_meta($newPostID, 'Image', $_POST['phimimg_name']); //update tags, dien vien wp_set_object_terms($newPostID, explode(',', $_POST['phimtag']), 'post_tag', true); wp_set_object_terms($newPostID, explode(',', $_POST['dienvien']), 'dien-vien', true); //end update tags, dien vien if (check_fiml_meta($newPostID) == false) { add_film_meta($newPostID); } $meta_value = implode("\n", $linkphim); $data = explode('|', $meta_value); if ($meta_value != "") { $episode_post = implode("\n", $linkphim); $episode_film = $newPostID; $list_episode = explode("\n", $episode_post); $count_ep = count($list_episode); for ($i = 0; $i < $count_ep; $i++) { $tap[$i] = explode('#', trim($list_episode[$i])); $ten_tap[$i] = trim($tap[$i][0]); $link_tap[$i] = trim($tap[$i][1]); $thu_tu[$i] = trim($tap[$i][2]); if (FilmEpisodeNewEpisode($ten_tap[$i], $newPostID, 0, $link_tap[$i], $thu_tu[$i], time())) { //$tb .= $ten_tap [$i] . ' - '; } else { echo '<div id="message" class="error fade" style="background-color: rgb(218, 79, 33);"><br/><b>L?i ! t?p ' . $ten_tap[$i] . ' server ' . $_POST['episode_server'] . ' d� t?n t?i</b><br/><br/></div>'; } } } wp_safe_redirect(admin_url('post.php?post=' . $newPostID . '&action=edit', 'Đã thêm xong')); } else { $postID = $_POST['film']; $linkphim = array(); $stt = 0; foreach ($_POST['name'] as $k => $val) { if (isset($_POST['url'][$k]) && !empty($_POST['url'][$k])) { $linkphim[$stt] = $val . '#' . $_POST['url'][$k] . '#' . $stt; $stt++; } } $from = $_POST['from']; $to = $_POST['to']; //xóa tập phim cũ if ($from == -1 && $to == -1) { $wpdb->delete($wpdb->prefix . 'film_episode', array('episode_film' => $postID)); } if (check_fiml_meta($postID) == false) { add_film_meta($postID); } $meta_value = implode("\n", $linkphim); $data = explode('|', $meta_value); if ($meta_value != "") { $episode_post = implode("\n", $linkphim); $episode_film = $postID; $list_episode = explode("\n", $episode_post); $count_ep = count($list_episode); for ($i = 0; $i < $count_ep; $i++) { $tap[$i] = explode('#', trim($list_episode[$i])); $ten_tap[$i] = trim($tap[$i][0]); $link_tap[$i] = trim($tap[$i][1]); $thu_tu[$i] = trim($tap[$i][2]); if (FilmEpisodeNewEpisode($ten_tap[$i], $postID, 0, $link_tap[$i], $thu_tu[$i], time())) { //$tb .= $ten_tap [$i] . ' - '; } else { echo '<div id="message" class="error fade" style="background-color: rgb(218, 79, 33);"><br/><b>L?i ! t?p ' . $ten_tap[$i] . ' server ' . $_POST['episode_server'] . ' d� t?n t?i</b><br/><br/></div>'; } } } wp_update_post(array('ID' => $postID)); wp_safe_redirect(admin_url('post.php?post=' . $postID . '&action=edit', 'Đã thêm xong')); } //end update link phim } else { ?> <form action="" method="post" class="gnarty-grab"> <h1 style="padding: 16px 0px 16px 0px;">Grab link</h1> <div class="form_item"> <label>Website:</label> <select name="webgrab"> <option value="phim3s">Phim3s.net</option> <option value="phimletvn">Phim.Let.Vn</option> <option value="tvphimhd">tvphimhd.Com</option> <option value="xemphimfullhd">xemphimfullhd.com</option> <option value="phim1k">phim1k.net</option> <option value="phim14">phim14.net</option> <option value="phimbb">phimbb.net</option> <option value="phimkk">phimkk.com</option> <option value="phim85">phim85.com</option> <option value="phim8">phim8.info</option> <option value="congdongvip">phim.congdongvip.com</option> <option value="animefc">animefc.info</option> </select> </div> <div class="form_item"> <label>Link:</label> <input maxlength="250" onclick="this.select()" value="Điền link vào đây" name="urlgrab" size="30" class="flat" type="text" /> </div> <div class="form_item"> <label>Get từ tập : </label> <input type="text" name="from" value="-1" size="5" style="width:50px;" /> </div> <div class="form_item"> <label>Đến tập : </label> <input type="text" name="to" value="-1" size="5" style="width:50px;" /><br /> <i>Nếu để cả 2 ô là <strong>-1</strong> thì sẽ lấy tất cả tập phim,sau đó xóa hết các tập phim cũ và thêm mới.</i> </div> <div class="form_item"> <input class="button button-primary button-large" type="submit" name="ok" value="Submit" /> </div> </form> <?php } }
$showcontent = 0; if (!isset($_SESSION['userid'])) { //go log in $_SESSION['loginRedirect'] = 1; header("Location: login.php"); exit; } elseif (isset($_SESSION['userid']) && $_SESSION['usertype'] == 1) { $showcontent = 1; } if ($showcontent == 1) { echo '<p><a href="pagelist.php">RETURN TO PAGES LIST</a></p>'; $showform = 0; $errormessage = ""; if (isset($_POST['submit'])) { $_GET['x'] = $_POST['x']; $FORMFIELD['title'] = htmlchars(cleanse($_POST['title'])); $FORMFIELD['details'] = cleanse($_POST['details']); //check for empty fields if ($FORMFIELD['title'] == "") { $errormessage .= "<p> TITLE IS MISSING.</p>"; } if ($FORMFIELD['details'] == "") { $errormessage .= "<p> DETAILS IS MISSING.</p>"; } try { $sql = 'UPDATE pages_raroman SET title= :title, details= :details WHERE ID = :ID'; $s = $pdo->prepare($sql); $s->bindValue(':title', $FORMFIELD['title']);
function event_news_submit() { global $url, $subject, $info, $text, $category, $keywords, $g_user_id; if (empty($subject)) { $this->error = 'reikia antraðtës<br>'; } if (empty($category)) { $this->error .= 'reikia temos<br>'; } if (empty($info)) { $this->error .= 'reikia santraukos<br>'; } if (!isset($g_user_id)) { $this->error .= 'reikia prisijungti prie sistemos<br>'; } if ($this->error) { return true; } $mail_text = "\n\t\t\n{$subject}\n{$info} \nhttp://art.scene.lt/control/\n\t\t\n \n "; $info = do_ubb($info); $text = do_ubb($text); $subject = htmlchars($subject); $this->db->query("INSERT INTO avnews (subject, info, full_text, posted, visible, category_id, submiter, keywords) \n\t\t\tVALUES ('{$subject}', '{$info}', '{$text}', NOW(), 0, {$category}, {$g_user_id}, '{$keywords}')"); $this->result = 'ok'; mail("*****@*****.**", 'art.scene atsiusta naujiena', $mail_text, "MIME-Version: 1.0\nContent-Type: text/plain; charset=Windows-1257\nContent-Transfer-Encoding: 8bit\nFrom: art.scene automatas <*****@*****.**>\n"); return true; }
function show_reply_message() { global $g_user_id, $message, $comment, $subject; if (!$g_user_id) { return 'prisijunk'; } // tikrinam ar ciuvo $info = $this->get_message_info($message); if (!$info) { return 'nër tokios þinutës'; } if ($g_user_id != $info['parent_id']) { return 'þinutë ne tau'; } $this->tpl->set_file('temp', 'users/tpl/msg_list.html', 1); $comment = undo_ubb($info['info']); $lines = explode("\n", $comment); $comment = ''; foreach ($lines as $line) { $comment .= "> " . $line . "\n"; } $subject = "re: " . $info['subject']; $subject = htmlchars(stripslashes($subject)); $this->tpl->set_var('msg', $info); $this->tpl->set_var('comment', $comment); $this->tpl->set_var('subject', $subject); $this->tpl->set_var('error_str', $this->error); $this->tpl->set_var('url', $_SERVER['REQUEST_URI']); return $this->tpl->process('out', 'reply_msg'); }
/** * kvieciama komentuojant darba */ function event_work_comment() { global $url, $subject, $comment, $parent_id, $g_user_id, $g_usr, $g_tpl; if (empty($comment)) { $this->error .= 'tuðèias komentaras<br>'; } if (empty($parent_id)) { $this->error .= 'neþinomas darbas<br>'; } if (empty($g_user_id)) { $this->error .= 'reikia prisijungti prie sistemos<br>'; } if (!$g_usr->can_i_comment()) { $this->error .= 'ðiuo metu negali komentuoti'; } if ($this->error) { return true; } $comment = do_ubb($comment); $comment = smartWrap($comment, 30); // [alias] skaidom ilgus piktybiðkus þodþius $subject = htmlchars($subject); // patikrinam kad nebutu netyciom dubliu $this->db->query("SELECT * FROM avcomments\n\t\t\tWHERE table_name='{$this->table}' AND parent_id={$parent_id} AND subject='{$subject}' AND info='{$comment}' LIMIT 1"); if ($this->db->not_empty()) { $this->error .= 'nesiøsk dukart<br>'; } if ($this->error) { return true; } $this->db->query("INSERT INTO avcomments (subject, info, posted, parent_id, table_name, user_id) \n\t\t\tVALUES ('{$subject}', '{$comment}', NOW(), {$parent_id}, '{$this->table}', {$g_user_id})"); $this->db->query("UPDATE avworks_stat SET comment_count = comment_count + 1 WHERE work_id={$parent_id}"); $this->db->clear_cache_tables('avcomments'); // siunciam meila autoriui $work = $this->db->get_array("SELECT * FROM avworks WHERE id='{$parent_id}'"); $author = $work['submiter']; $user_info = $this->db->get_array("SELECT * FROM u_user_info WHERE uid='{$author}'"); $this->db->clear_cache_name('workcomments'); if ($user_info['mail_comments'] && $author != $g_user_id) { $user = $this->db->get_array("SELECT * FROM u_users WHERE id='{$author}'"); $g_tpl->set_file('comment', 'darbai/tpl/mail_comment.txt'); $g_tpl->set_var('id', $parent_id); $g_tpl->set_var('work_title', $work['subject']); $g_tpl->set_var('title', $subject); $g_tpl->set_var('username', $g_usr->username); $g_tpl->set_var('info', undo_ubb($comment)); $g_tpl->set_var('date', date('Y.m.d')); mail($user['email'], 'komentaras apie tavo darbà', $g_tpl->process('', 'comment'), "MIME-Version: 1.0\nContent-Type: text/plain; charset=Windows-1257\nContent-Transfer-Encoding: 8bit\nFrom: art.scene automatas <*****@*****.**>\n", "*****@*****.**"); } redirect($url); }
require_once 'connect.php'; require_once 'functions.inc.php'; include_once 'menu.inc.php'; $showform = 0; $errormessage = ""; if (isset($_POST['submit'])) { $FORMFIELD['first'] = htmlchars(cleanse($_POST['first'])); $FORMFIELD['mi'] = htmlchars(cleanse($_POST['mi'])); $FORMFIELD['last'] = htmlchars(cleanse($_POST['last'])); $FORMFIELD['email'] = strtolower(cleanse($_POST['email'])); $FORMFIELD['username'] = strtolower(cleanse($_POST['username'])); $FORMFIELD['pwd'] = cleanse($_POST['pwd']); $FORMFIELD['pwd2'] = cleanse($_POST['pwd2']); $FORMFIELD['gender'] = $_POST['gender']; $FORMFIELD['status'] = $_POST['status']; $FORMFIELD['bio'] = htmlchars(cleanse($_POST['bio'])); //check for empty fields if ($FORMFIELD['first'] == "") { $errormessage .= "<p> FIRST NAME IS MISSING.</p>"; } if ($FORMFIELD['last'] == "") { $errormessage .= "<p> LAST NAME IS MISSING.</p>"; } if ($FORMFIELD['email'] == "") { $errormessage .= "<p> EMAIL IS MISSING.</p>"; } if ($FORMFIELD['username'] == "") { $errormessage .= "<p> USERNAME IS MISSING.</p>"; } if ($FORMFIELD['pwd'] == "") { $errormessage .= "<p> PASSWORD IS MISSING.</p>";
$row = $s->fetch(); $year = $row['theYear']; //IF USER IS REGISTERED THEY CANNOT RE-REGISTER if ($count > 1 && ($_SESSION['both'] = 2)) { echo '<h4 class="heading1">You are already signed up for both the 2015 and 2016 conference. You cannot sign up again.</h>'; $showform = 1; header("refresh:3;url=index.php"); } } //WHEN SUBMIT ADJUST THE PRICE if (isset($_POST['submit'])) { //VARIABLES USED LATER $_SESSION['both'] = 0; //USER CAN REGISTER $FORMFIELD['year'] = htmlchars(cleanse($_POST['year'])); $FORMFIELD['guestName'] = htmlchars(cleanse($_POST['guestName'])); $_SESSION['year'] = $FORMFIELD['year']; //REGULAR MEMBER CACLULATION if ($_SESSION['membership'] == 'regular') { $membership = 30; if ($_POST['memberradio'] == 'member1') { if ($_POST['radio1'] == 'radio1') { if (isset($_POST['radio2'])) { $value = $_POST['radio2']; //echo "The value is: ".$value; if ($value == 'radio4') { $total = $regularRegPrice + $regularLunch + $membership; $memberPrice = $regularRegPrice; $lunchPrice = $regularLunch; } else { if ($value == 'radio5' || $value == 'radio6') {
function event_work_submit() { global $url, $subject, $info, $work, $category, $thumbnail, $color, $g_user_id, $g_usr, $g_tpl; if (empty($subject)) { $this->error = 'reikia pavadinimo<br>'; } if (empty($category)) { $this->error .= 'reikia kategorijos<br>'; } $work = $_FILES['work']; if (empty($work) || 'none' == $work) { $this->error .= 'reikia atsiøsti darbà<br>'; } if (!isset($g_user_id)) { $this->error .= 'reikia prisijungti prie sistemos<br>'; } if ($error = $this->check_cannot_post()) { $this->error .= $error; } if ($this->error) { return true; } $work_name = $_FILES['work']['name']; $work_size = $_FILES['work']['size']; $work_types = array('gif', 'jpg', 'png', 'swf'); $work_type = substr($work_name, strlen($work_name) - 3, 3); if (!in_array(strtolower($work_type), $work_types)) { $this->error .= 'blogas darbo failas, gali bûti tik .jpg, .gif, .png, .swf<br>'; } if ($thumbnail != '' && $thumbnail != 'none') { $thumb_name = $_FILES['thumbnail']['name']; $thumb_size = $_FILES['thumbnail']['size']; $thumb_types = array('gif', 'jpg', 'png'); $thumb_type = substr($thumb_name, strlen($thumb_name) - 3, 3); if (!in_array(strtolower($thumb_type), $thumb_types)) { $this->error .= 'blogas maþas paveiksliukas, gali bûti tik .jpg, .gif, .png<br>'; } } if ($work_size < 10240) { $this->error .= 'per maþas darbo failas, limitas 10kb<br>'; } if ($this->flash_category != $category && $work_size > 30720000) { $this->error .= 'per didelis darbo failas, limitas 300kb<br>'; } if ($this->error) { return true; } // kopijuojam darba! $work_name = clean_name($work_name); $work_dest = $this->ini->read_var('avworks', 'works_dir') . $work_name; while (file_exists($work_dest)) { $work_name = "_" . $work_name; $work_dest = $this->ini->read_var('avworks', 'works_dir') . $work_name; } $work = $_FILES['work']['tmp_name']; copy($work, $work_dest); unlink($work); // gaminam thumbnaila // jei ok dedam atsiusta thumbnail if ($thumbnail != 'none') { // vadinam taip pat kaip darba, kad nereiktu tikrinti dublikatu $thumbnail = $_FILES['thumbnail']['tmp_name']; $thumb_dest = $this->ini->read_var('avworks', 'thumbnails_dir') . $work_name . '.jpg'; $exec_src = $this->ini->read_var('avworks', 'convert_exec') . " -resize " . $this->thumb_x . "x" . $this->thumb_y . " {$thumbnail} jpg:{$thumb_dest}"; exec($exec_src); $thumbnail_name = $work_name . '.jpg'; if (!file_exists($thumb_dest)) { //galbut animuotas gifas? padarom pirma kadra if (file_exists($thumb_dest . '.0')) { $this->error = ''; rename($thumb_dest . '.0', $thumb_dest); } else { $this->error .= 'nepavyko padaryti maþo paveiksliuko<br>'; } } else { $this->error = ''; } } // jei problemos, gaminam is atsiusto darbo if (($thumbnail == 'none' || $this->error) && $category != $this->flash_category) { // vadinam taip pat kaip darba, kad nereiktu tikrinti dublikatu $thumb_dest = $this->ini->read_var('avworks', 'thumbnails_dir') . $work_name . '.jpg'; $exec_src = $this->ini->read_var('avworks', 'convert_exec') . " -resize " . $this->thumb_x . "x" . $this->thumb_y . " {$work_dest} jpg:{$thumb_dest}"; exec($exec_src); $thumbnail_name = $work_name . '.jpg'; if (!file_exists($thumb_dest)) { //galbut animuotas gifas? padarom pirma kadra if (file_exists($thumb_dest . '.0')) { $this->error = ''; rename($thumb_dest . '.0', $thumb_dest); } else { $this->error .= 'nepavyko padaryti maþo paveiksliuko<br>'; } } else { $this->error = ''; } } elseif ($this->error) { $this->error .= 'nepavyko padaryti maþo paveiksliuko<br>'; } // jei problemos, dedam default if ($this->error || empty($thumbnail_name)) { $thumbnail_name = 'nothumbnail.gif'; } isset($color) || ($color = ''); isset($info) || ($info = ''); //wordwrap($comment, 30, " ", true) // senas variantas //smartWrap($text,30); // naujas variantas $info = smartWrap(do_ubb($info), 30); $subject = wordwrap(htmlchars($subject), 20, " ", true); // cia html'o nebus, todel standartinis wordwrap $color = clean_hex($color); $this->db->query("INSERT INTO avworks (subject, info, posted, thumbnail, file, submiter, category_id, color, file_size)\n\t\t\t\t\t\t\tVALUES ('{$subject}', '{$info}', NOW(), '{$thumbnail_name}', '{$work_name}', {$g_user_id}, {$category}, '{$color}', {$work_size})"); // TODO: update avworks_stat $last_id = $this->db->get_insert_id(); $this->db->query("insert into avworks_stat \n (work_id, subject, info, posted, thumbnail, file, submiter, category_id, \n views, color, file_size, submiter_name, category_name) \nselect w.id, w.subject, w.info, w.posted, w.thumbnail, w.file, w.submiter, w.category_id, \n w.views, w.color, w.file_size, \n u.username, c.name from avworks w, u_users u, avworkcategory c\nwhere w.submiter = u.id AND c.id = w.category_id AND w.id={$last_id}"); $g_tpl->set_file('new_work', 'darbai/tpl/mail_new_work.txt'); $g_tpl->set_var('id', $this->db->get_insert_id()); $g_tpl->set_var('title', $subject); $g_tpl->set_var('username', $g_usr->username); $g_tpl->set_var('info', undo_ubb($info)); $g_tpl->set_var('date', date('Y.m.d')); $this->db->clear_cache_tables('avworks'); // $g_usr->mass_mail('art.scene naujas darbas', $g_tpl->process('temp', 'new_work'), 'mail_works'); $this->result = true; return true; }
function enviarMail($mensaje, $aQuien, $motivo) { logDebug("ENVIO EMAIL: " . $aQuien . " " . $motivo . " " . $mensaje . " From: " . htmlchars(Parametro::obtV(Parametro::FROM))); // mail($aQuien, $motivo, $mensaje, "From: " . Parametro::obtV(Parametro::FROM)); }
function RemoveHack($str) { $str = htmlchars(stripslashes(trim(urldecode($str)))); return $str; }