Jump to content

Chrisj

Members
  • Posts

    547
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Chrisj

  1. Thanks so much for your guidance. Greatly appreciated. I added 'PRICE" etc., this to the php: if (!empty($get_videos)) { $len = count($get_videos); foreach ($get_videos as $key => $video) { $video = PT_GetVideoByID($video, 0, 0, 0); $pt->last_video = false; if ($key == $len - 1) { $pt->last_video = true; } $final .= PT_LoadPage('search/list', array( 'ID' => $video->id, 'USER_DATA' => $video->owner, 'THUMBNAIL' => $video->thumbnail, 'URL' => $video->url, 'TITLE' => $video->title, 'DESC' => $video->markup_description, 'VIEWS' => $video->views, 'VIEWS_NUM' => number_format($video->views), 'TIME' => $video->time_ago, 'DURATION' => $video->duration, 'PRICE' => $video_play_price )); } } if (empty($final)) { $final = $list; } Then I replaced the html line to look like this: <div class style="float:left;" data-id="{{ID}}">{{PRICE}}</div> But only see {{PRICE}} displayed. Any suggestion on what I've done incorrectly, will be welcomed. Much thanks again
  2. Thanks for your reply. I believe this file corresponds with the initial code I posted. Does this help: <?php include('/assets/langs/english.php'); if (empty($_GET['keyword'])) { header("Location: " . PT_Link('login')); exit(); } $keyword = PT_Secure($_GET['keyword']); $category_id = (isset($_GET['category_id'])?$_GET['category_id']:0); $list = '<div class="text-center no-content-found empty_state"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-video-off"><path d="M16 16v1a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2m5.66 0H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>' . $lang->no_videos_found_for_now . '</div>'; $list2 = '<div class="text-center no-content-found empty_state"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-video-off"><path d="M16 16v1a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2m5.66 0H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg></div>'; $final = ''; if ($pt->config->total_videos > 1000000) { if($category_id == 0){ $get_videos = $db->rawQuery("SELECT * FROM " . T_VIDEOS . " WHERE MATCH (title) AGAINST ('$keyword') OR tags LIKE '%$keyword%' ORDER BY id ASC LIMIT 20"); }else{ $get_videos = $db->rawQuery("SELECT * FROM " . T_VIDEOS . " WHERE category_id=$category_id AND ( MATCH (title) AGAINST ('$keyword') OR tags LIKE '%$keyword%' ) ORDER BY id ASC LIMIT 20"); } } else { if($category_id == 0){ $get_videos = $db->rawQuery("SELECT * FROM " . T_VIDEOS . " WHERE title LIKE '%$keyword%' OR tags LIKE '%$keyword%' ORDER BY id ASC LIMIT 20"); }else{ $get_videos = $db->rawQuery("SELECT * FROM " . T_VIDEOS . " WHERE category_id=$category_id AND ( title LIKE '%$keyword%' OR tags LIKE '%$keyword%' ) ORDER BY id ASC LIMIT 20"); } } if (!empty($get_videos)) { $len = count($get_videos); foreach ($get_videos as $key => $video) { $video = PT_GetVideoByID($video, 0, 0, 0); $pt->last_video = false; if ($key == $len - 1) { $pt->last_video = true; } $final .= PT_LoadPage('search/list', array( 'ID' => $video->id, 'USER_DATA' => $video->owner, 'THUMBNAIL' => $video->thumbnail, 'URL' => $video->url, 'TITLE' => $video->title, 'DESC' => $video->markup_description, 'VIEWS' => $video->views, 'VIEWS_NUM' => number_format($video->views), 'TIME' => $video->time_ago, 'DURATION' => $video->duration )); } } if (empty($final)) { $final = $list; } $get_users = $db->rawQuery("SELECT * FROM " . T_USERS . " WHERE ((`username` LIKE '%$keyword%') OR CONCAT( `first_name`, ' ', `last_name` ) LIKE '%$keyword%') ORDER BY id ASC LIMIT 50"); if (!empty($get_users)) { $len = count($get_users); foreach ($get_users as $key => $user) { $user = PT_UserData($user, array('data' => true)); $pt->last_user = false; if ($key == $len - 1) { $pt->last_user = true; } $final2 .= PT_LoadPage('search/user-list', array( 'ID' => $user->id, 'USER_DATA' => $user, )); } } if (empty($final2)) { $final2 = $list2; } $pt->videos = $get_videos; $pt->users = $get_users; $pt->page = 'search'; $pt->title = $lang->search . ' | ' . $pt->config->title; $pt->description = $pt->config->description; $pt->keyword = $pt->config->keyword; $pt->content = PT_LoadPage('search/content', array( 'VIDEOS' => $final, 'USERS' => $final2, 'KEYWORD' => $keyword ));
  3. I am using a php web video script which, when searched, displays a list of thumbnail image search results, with a View button, below each image. I'm trying to add the numeric price under each one, but haven't gotten it correct yet. Here is the list.html page code: <div class="col-md-3 col-sm-6 no-padding-right-at-all no-padding-mobile-left"> <div class="video-latest-list video-wrapper" data-id="{{ID}}" data-views="{{VIEWS}}"> <div class="video-thumb"> <img src="{{THUMBNAIL}}" alt="{{TITLE}}"> <div class="video-duration">{{DURATION}}</div> </div> <div class="video-title"> <h4 title="{{TITLE}}">{{TITLE}}</h4> </div> <div class="video-info"> <div style="float:right;"><button class="btn btn-main" data-action="multiple_select_button" data-selected="0" data-id="{{ID}}">View</button></div> <div class style="float:left;" data-id="{{ID}}">{{VIDEOS video_play_price}}</div> </div> </div> </div> In my attempt to display the price, added this line: <div class style="float:left;" data-id="{{ID}}">{{VIDEOS video_play_price}}</div> I am assuming the data-id="{{ID}}" identifies the particular thumbnail/video? and I know that the current price resides in the 'videos' table, in the db, under the column titled 'video_play_price', but with my line of code the only thing that appears under the thumbnail is {{VIDEOS video_play_price}} (as you probably know). Any help to display the numeric price pertaining to each video(thumbnail), will be appreciated.
  4. Thanks again for your reply/suggestion, but I don't know how to code that in particular
  5. I believe I have it working now: $charge = ( $video_cost *0.50 ); if ($wallet >= $amout) { $new_wallet = (string)($wallet - $amout); $db->startTransaction(); $inserted_records = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); $video_cost_new = $video->video_play_price?$video->video_play_price:$video_cost; $uploader_amount = ( $video_cost_new *0.50 ); Can you help me with some code that would set the default price as a minimum , so the uploader can't set a price below the default price?
  6. Hi, Thanks again. "try the following" where?
  7. Thanks for your reply. I added: echo('$video_play_price: '.$video_play_price.PHP_EOL); echo('$charge: '.$charge.PHP_EOL); echo('$amout: '.$amout.PHP_EOL); $uploader_amount = $video_play_price - $charge; $uploader_amount = $amout - $charge; exit; to the end of the file. Then added this: display_errors = on to the php.ini file, but don't see anything displayed. Any additional help will be welcomed.
  8. Yes, I've tried this without success: $amout = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); $amout += $video->video_play_price?$video->video_play_price:$video_cost; } $charge = ( $amout *0.50 ); if ($wallet >= $amout) { $new_wallet = (string)($wallet - $amout); $db->startTransaction(); $inserted_records = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); $uploader_amount = $amout - $charge;
  9. Can anyone else help me with this coding, please?
  10. Thank you for your reply, but the code you describe, I don't see it and how it works. I understand, but I can't put it in code that you're suggesting
  11. Thank you again. Yes, what I'm trying to change is the amount that uploaders are credited which is calculated as half of $video_cost which is the default price. Yes, "if they set their video with a custom price of half the default price, they would get 100% of the cost and the site would get nothing", so I need to set default price as minimum somehow. "already have an example: the earlier code that was calculating the total for all the videos to play", yes, but I don't know how or where to put that modified example, I didn't write this code, and my knowledge (as you can tell) is limited. any additional direction will be welcomed.
  12. Yes, initially for testing purposes "the uploader only gets half the default video price and your site keeps the rest". Regarding "that would mean the uploader is setting a price for you that doesn't affect what they get", if they raise the price they get a bigger 50%, right? Currently, the uploader sets the price but isn't getting 50% "do the same thing when crediting the uploader", can you give me an example, please?
  13. Thanks for your replies. Yes, "$uploader_amount is supposed to be how much the uploader of each video to view gets for the view, and originally is the default video amount minus $charge". The uploader can now optionally change the default price, and I believe it is this line: $amout += $video->video_play_price?$video->video_play_price:$video_cost; I'm trying to get it so when the default price is changed, and a purchase is made, $uploader_amount should then be how much the uploader of each video to view gets for the view, not the default video amount minus $charge, but new video price amount minus $charge. These two attempts were unsuccessful: $uploader_amount = $video_play_price - $charge; $uploader_amount = $amout - $charge; any additional help will be appreciated.
  14. This code, that I didn't write, but am trying to modify, generates the cost of a video purchase. One line (line 32) is a formula , I believe for setting a purchase price amount: $amout += $video->video_play_price?$video->video_play_price:$video_cost; Another line (line 50) is a formula for deducting to create another amount: $uploader_amount = $video_cost - $charge; I think line 50 is correct except for I don't think $video_cost in the final price, but I'm no expert at reading this code. I tried this without success: $uploader_amount = $video_play_price - $charge; Here is the full code, any help with line 50, will be appreciated. <?php if (IS_LOGGED == false) { $data = array('status' => 400, 'error' => 'Not logged in'); echo json_encode($data); exit(); } if (!empty($_POST['id'])) { if (!is_array($_POST['id'])) { $id_array[] = $_POST['id']; } else { $id_array = $_POST['id']; } // get cost video $db->where('name', 'video_play_price'); $db_cost = $db->getOne('config'); $video_cost = (float)$db_cost->value; $count_video = count($id_array); $user_id = $user->id; $wallet = (float)str_replace(',', '', $user->wallet); $amout = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); $amout += $video->video_play_price?$video->video_play_price:$video_cost; } // $amout = $video_cost * $count_video; $charge = ( $video_cost *0.50 ); if ($wallet >= $amout) { $new_wallet = (string)($wallet - $amout); $db->startTransaction(); $inserted_records = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); $uploader_amount = $video_cost - $charge; // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); // add data to paid table $insert_buy = $db->insert('u_paid_videos', [ 'id_user' => $user_id, 'id_video' => $video_id, 'session_key' => $_SESSION['session_key'], 'video_play_price' => (string)$video_cost, 'video_title' => $video->title, 'user_id_uploaded' => $video->user_id, //'up_credit'=>$video_cost, 'up_credit'=>$uploader_amount, ]); if ($insert_buy) { $inserted_records++; } //add wallet users' video $userwallet = $db->where('id', $video->user_id)->getOne(T_USERS); //$videouserwallet = $userwallet->wallet+$video_cost; $videouserwallet = $userwallet->wallet+$uploader_amount; $db->where('id', $video->user_id); $update_wallet = $db->update(T_USERS, [ // 'wallet' => $videouserwallet, 'wallet' => number_format($videouserwallet, 2, '.', ''), ]); } $db->where('id', $user_id); $update_wallet = $db->update(T_USERS, [ 'wallet' => $new_wallet, ]); if (($inserted_records == $count_video) && $update_wallet) { $db->commit(); echo json_encode([ 'status' => 200 ]); exit(); } else { $db->rollback(); echo json_encode([ 'status' => 400, 'error' => 'Buy process error' ]); exit(); } } else { echo json_encode([ 'status' => 400, 'error_num' => 1, 'error' => 'Not enough money' ]); exit(); } } else { echo json_encode([ 'status' => 400, 'error' => 'Bad Request, Invalid or missing parameter' ]); exit(); }
  15. I am purchasing a web script and will be installing it on my host server where I have two domain accounts, and the domains are resolved to the server.I asked the developer if I decided to change the domain name, at some point after install, what I could do, and was told to make the change it the config.php file. After I make that change, and I make the changes needed in WHM/cPanel, besides copying the db over, what else would need to be done to have a complete domain change?
  16. Thanks again. How do I "onclick events for View buttons have to be reassigned ", would it be a modification to the code I posted in my initial request here?
  17. I received help with this, and that helper is not currently available. But I'm guessing it has to do with the script.js file and this portion of it: function PT_MultipleBuyVideo() { var checked = getSelectedVideos(); if (!checked) { return false; } swal({ title: "", type: "info", html:"Simply proceed to purchase " + countSelectedVideos() + " videos", showCancelButton: true, cancelButtonText: "Close", customClass: 'sweetalert-lg', confirmButtonText:'Proceed' }).then(function(){ $.ajax({ url: PT_Ajax_Requests_File() + 'aj/buy-video', type: 'POST', dataType: 'json', data: {id:checked}, }).done(function(data){ if (data.status == 200) { for (var i = 0; i < checked.length; i++) { var button = $("button[data-action='multiple_select_button'][data-id='" + checked[i] + "']") buttonMultipleSelectingStyle(button, 'purchased'); } swal({ title: "Success", type: "success", html:"", showCancelButton: true, cancelButtonText: "Close", customClass: 'sweetalert-lg', confirmButtonText:'Go To Video(s)' }).then(function(){ window.location.href='/paid-list'; }); } else { if (data.error_num == 1) { swal( 'Error!', 'Not enough money', 'error' ); } else { swal( 'Error!', 'Something went wrong. Please try again later!', 'error' ); } } }).fail(function() { swal( 'Error!', 'Something went wrong. Please try again later!', 'error' ); }) }); } function buttonMultipleBuy(command) { var button = $("button[data-action='multuple-buy-video']"); if (command == 'hide') { button.hide(); } else if (command == 'show') { button.show(); } } buttonMultipleBuy('hide'); $("button[data-action='multiple_select_button']").click(function(){ if ($(this).attr('data-selected') == 1) { // uncheck buttonMultipleSelectingStyle($(this), 'uncheck'); } else { // check buttonMultipleSelectingStyle($(this), 'check'); } if (countSelectedVideos()) { buttonMultipleBuy('show'); } else { buttonMultipleBuy('hide'); } }); function countSelectedVideos() { var checked = 0; $("button[data-action='multiple_select_button']").each(function(i){ if ($(this).attr('data-selected') == 1) { checked++; } }); return checked; } function getSelectedVideos() { var checked = []; $("button[data-action='multiple_select_button']").each(function(i){ if ($(this).attr('data-selected') == 1) { checked.push($(this).attr('data-id')); } }); return checked; } function buttonMultipleSelectingStyle(button, action) { if (action == 'check') { button.attr('data-selected', 1); button.css('backgroundColor', '#FF4500'); button.html('Selected'); } else if (action == 'uncheck') { button.attr('data-selected', 0); button.css('backgroundColor', '#04abf2'); button.html('View'); } else if (action == 'purchased') { button.attr('data-selected', 0); button.css('backgroundColor', '#04abf2'); button.html('Purchased'); button.attr('disabled', 'disabled'); } } Any additional help is appreciated
  18. Thanks for you reply. Here is the page html: <div class="col-md-3 col-sm-6 no-padding-right-at-all no-padding-mobile-left"> <div class="video-latest-list video-wrapper" data-id="{{ID}}" data-views="{{VIEWS}}"> <div class="video-thumb"> <img src="{{THUMBNAIL}}" alt="{{TITLE}}"> <div class="video-duration">{{DURATION}}</div> </div> <div class="video-title"> <h4 title="{{TITLE}}">{{TITLE}}</h4> </div> <div class="video-info"> <div style="float:right;"><button class="btn btn-main" data-action="multiple_select_button" data-selected="0" data-id="{{ID}}">View</button></div> </div> </div> </div>
  19. The php web video script that I'm using displays a page of searched results (thumbnail images) with a 'View' button underneath each one. When the 'View' button(s) is selected the button(s) changes from "View" to "Selected", and then a separate "View All Selected" button is used to proceed. The issue I'm having is, when the page of searched list is initially displayed all "View" buttons can be selected, however, if you select the "Show More" button at the bottom of the page, to display more of the searched results, all have a "View" button, but none are selectable. In other words, when these "View" buttons are clicked, these buttons don't change to "Selected" (only the initial page - not the 'Show More" part of the page). Here is a file pertaining to this page: <div class="content pt_shadow"> <div class="col-md-12"> <div class="upload-head"> <div style="float: right;"> <button class="btn btn-main" data-action="multuple-buy-video" onclick="PT_MultipleBuyVideo();">View all selected</button> </div> <h4><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg> {{LANG search_results}}: {{KEYWORD}}</h4> <hr> </div> <div class="videos-latest-list row"> {{VIDEOS}} </div> <?php if (count($pt->videos) > 0 && empty($_GET['is_channel'])) { ?> <div class="watch-video-show-more desc load-more" data-type="search" data-keyword="{{KEYWORD}}"> {{LANG show_more}} </div> <?php } ?> <div class="clear"></div> </div> <div class="clear"></div> </div> Can you provide some suggestions or coding example of what needs to be modified to get the Show More results to also be available to Select? Any help is appreciated
  20. Thanks for your reply. I didn't write this code, so I don't know the answer to your question, and I'm not familiar with 'label switching'. Any additional help/guidance is appreciated ...
  21. thanks for your reply. I wasn't as clear as I could have been, no they are separate pages/files
  22. can you elaborate? I'm not understanding your specific solution
  23. The php web video script that I'm using has two Forms. One for uploading videos, and one for editing the Form (in the User account > My Channel > Manage > edit-video). When I complete the edit-video Form and then select Publish, the Publish button changes to 'Please Wait'. But, when I select "Publish" on the Upload Form nothing appears to happen, for a while until the video is finished uploading. But the line of code seems to be the same in each of the files: $('#submit-btn').val("{{LANG please_wait}}"); I'd like help so as to when the Upload Form "Publish button is selected it changes to Please Wait as, the edit-video Form does. Here is the edit-video Form <script> code: <script> $(function () { $('.edit-thumb').on('click', function(event) { $('#thumbnail').trigger('click'); }); $('#thumbnail').on('change', function(event) { readURL(this); }); $('#description').keyup(function(event) { str = $(this).val().replace(/(?:\r\n|\r|\n)/g, '<br />'); $('.video-description p').html(str); }); $('#title').keyup(function(event) { $('.video-title p').html($(this).val()); }); $("#mySingleFieldTags").tagit({ allowSpaces: true }); $('#edit-form form').ajaxForm({ url: '{{LINK aj/edit-video}}' + '?hash=' + $('.main_session').val(), beforeSend: function() { $('#submit-btn').attr('disabled', true); $('#submit-btn').text("{{LANG please_wait}}"); }, success: function(data) { if (data.status == 200) { $('#video-success').html(data.message); window.location.href = '/manage-videos/'; //window.location.href = '{{URL}}'; } else { $('#submit-btn').attr('disabled', false); $('#submit-btn').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg> {{LANG publish}}'); $('.errors').removeClass('hidden').html(data.message); } } }); }); </script> Here is the Upload video Form <script> code: <script> $(function () { var video_drop_block = $("[data-block='video-drop-zone']"); if (typeof(window.FileReader)){ video_drop_block[0].ondragover = function() { video_drop_block.addClass('hover'); return false; }; video_drop_block[0].ondragleave = function() { video_drop_block.removeClass('hover'); return false; }; video_drop_block[0].ondrop = function(event) { event.preventDefault(); video_drop_block.removeClass('hover'); var file = event.dataTransfer.files; $('#upload-video').find('input').prop('files', file); }; } $("#mySingleFieldTags").tagit({ allowSpaces: true }); var bar = $('.bar'); var percent = $('.percent'); var prcsvdo = $('.pt_prcs_vdo'); var is_uploaded = false; var video_thumb = Array(); $('#upload-video').submit(function(event) { let file_size = $(".upload-video-file").prop('files')[0].size; if (file_size > "{{CONFIG max_upload}}") { swal({ title: '{{LANG error}}', text: "{{LANG file_is_too_big}} <?php echo pt_size_format($pt->config->max_upload); ?>", type: 'error', confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'OK', buttonsStyling: true, confirmButtonClass: 'btn btn-success', }).then(function(){ swal.close(); $('.upload-video-file').val(''); }, function() { swal.close(); $('.upload-video-file').val(''); }); return false; } else{ var filename = $('.upload').val().split('\\').pop(); $('#title').val(filename); $('#upload-form').removeClass('hidden'); $('.upload').addClass('hidden'); } }); $('#choose-thumnail-cr').bind('slid.bs.carousel', function (e) { var vsthumb = video_thumb[$(this).find('.active').index()]; $("#video-thumnail").val(vsthumb); }); $('#upload-video').ajaxForm({ url: '{{LINK aj/upload-video-ffmpeg}}?hash=' + $('.main_session').val(), dataType:'json', beforeSend: function() { $('.progress').removeClass('hidden'); var percentVal = '0%'; bar.width(percentVal); percent.html(percentVal); }, uploadProgress: function(event, position, total, percentComplete) { if(percentComplete > 50) { percent.addClass('white'); } var percentVal = percentComplete + '%'; bar.width(percentVal); percent.html(percentVal); if (percentComplete == 100) { prcsvdo.html('<svg width="30" height="10" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="#000"><circle cx="15" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite" /><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite" /></circle><circle cx="60" cy="15" r="9" fill-opacity="0.3"><animate attributeName="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcMode="linear" repeatCount="indefinite" /><animate attributeName="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcMode="linear" repeatCount="indefinite" /></circle><circle cx="105" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite" /><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite" /></circle></svg> {{LANG porcessing_video}}'); $('.progress').find('.bar').removeClass('upload-progress-bar'); } }, success: function(data) { percentVal = '0%'; bar.width(percentVal); $('.progress').addClass('hidden'); if (data.status == 200) { $('#video-location').val(data.file_path); Snackbar.show({text: '<i class="fa fa-check"></i> ' + data.file_name + ' {{LANG successfully_uplaoded}}'}); $('#submit-btn').attr('disabled', false); $('.upload-video-file').val(''); $('#title').val(data.file_name); $("#video-thumnails").removeClass('hidden'); var i = 0; var url = '{img}'; video_thumb = data.images; $("#video-thumnails").find('.item').each(function(index, el) { if (i == 0) { $("#video-thumnail").val(data.images[i]); } $(el).html($("<img>",{ src:url.replace('{img}',data.images[i]) })); i++; }); } else if(data.status == 401){ swal({ title: '{{LANG oops}}!', text: "{{LANG upload_limit_reached}}!", type: 'info', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: '{{LANG upgrade_now}}', cancelButtonText: '{{LANG cancel}}', confirmButtonClass: 'btn btn-success margin-right', cancelButtonClass: 'btn', buttonsStyling: false }).then(function(){ window.location.href = '{{LINK go_pro}}'; }, function() { window.location.href = '{{LINK }}'; }); } else if(data.status == 402){ swal({ title: '{{LANG error}}', text: data.message, type: 'error', confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'OK', buttonsStyling: true, confirmButtonClass: 'btn btn-success', }).then(function(){ swal.close(); $('.upload-video-file').val(''); }, function() { swal.close(); $('.upload-video-file').val(''); }); } else { Snackbar.show({showAction: false,backgroundColor: '#e22e40',text: '<div>'+ data.error +'</div>'}); } } }); $('#upload-form form').ajaxForm({ url: '{{LINK aj/ffmpeg-submit}}'+'?hash=' + $('.main_session').val(), beforeSend: function() { $('#submit-btn').attr('disabled', true); $('#submit-btn').val("{{LANG please_wait}}"); }, success: function(data) { if (data.status == 200) { window.location.href = data.link; } else if(data.status == 402){ swal({ title: '{{LANG error}}', text: data.message, type: 'error', confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'OK', buttonsStyling: true, confirmButtonClass: 'btn btn-success', }).then(function(){ window.location.href = '{{LINK upload-video}}'; }, function() { window.location.href = '{{LINK }}'; }); } else { $('#submit-btn').attr('disabled', false); $('#submit-btn').val('{{LANG publish}}'); Snackbar.show({text: '<div>'+ data.message +'</div>'}); } } }); $('.upload-video-file').on('change', function() { $('#upload-video').submit(); }); }); function PT_OpenUploadForm() { $('#upload-video').find('input').trigger('click'); } </script> Any help will be appreciated
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.