Jump to content

Chrisj

Members
  • Posts

    551
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Chrisj

  1. I saw a website that had the drop-down menu in the search bar (on the right - where it shows "all Images" and a down arrow) - see SearchBar1 image attached. My current one on my web page looks like SearchBar2 image attached.

    I'm looking for guidance on how to change my code so that the drop-down menu looks more like SearchBar1 image. Any help will be appreciated. Here's my current code (which works successfully):

    <form method="get" action="../search.php" name="myForm" />
    <select size="1" name="type" class="dropdown_box" />
    <a href="#" class="dropdowmSubstitute" role="button">
    <span class="textContainer">
    <span class="dropdownText">
    <option value="any string here">ALL</option>
    </span>
    </span>
    <span class="arrowContainer">
    <span class="dropdownArrow">▼</span>
    </span>
    </a>
    <option value="1">Choice1</option>
    <option value="2">Choice2</option>
    </select>
    <input autocomplete="off" id="keyword" name="keyword" value="SEARCH WORDS" onfocus="if (this.value=='SEARCH WORDS') {this.value=''; this.style.color='#696969';}" onclick="clickclear(this, 'Search [var.site_name]')" onblur="clickrecall(this,'Search [var.site_name]')" value="" />
    <input type="submit" value="VIEW"/>
    </form>
    

    post-20454-0-78832700-1441382273_thumb.png

    post-20454-0-15679000-1441382286_thumb.png

  2. Thanks for that reply. Much appreciated.

    However, I'm hoping I can get clarification on:

     

     

     

    - Subject too

     

    I'm not sure what you mean there.

     

     

    And I understand this:
     

     

     

    - The $to email should be the sender (the $from doesn't change as that's the system email)

     

    but I don't know how to change $members_email to "the sender".

     

    Any additional assistance will be welcomed.

     

    Much thanks again.

  3. I'm using an existing php web site script where a user can turn on or off the ability to be notified (by email) if an internal message on the site has arrived into user's inbox. I'd like to modify the script so that the sender, of the internal message, be notified (by email), if the recipient has chosen not to be notified of internal messages.

     

    This is (part) the existing code:

    // check if receipients allow notifications is yes , send them a notification that they have an message
    
                	if (notification_preferences($to_id, 'privatemessage') == true) {
    
                		// send pm notification email to recipients registartion email addy
                    		$email_template	= 'email_templates/newmessage.htm';
                    		$subject 		= $config['email_new_email'];
    
                    		// at this point we do not have any email to send to
                    		$to 			= $members_email;
                    		$from 		= $config['notifications_from_email'];
    
                    		//send email template to TBS for rendering of variable inside
                   		$template = $email_template;
                    		$inner_template1 = "themes/$user_theme/templates/inner_email_compose.htm";
    
                    		$TBS = new clsTinyButStrong;
                    		$TBS->NoErr = true;
    
                    		$TBS->LoadTemplate("$template");
                    		$TBS->tbs_show(TBS_NOTHING);
                    		$message = $TBS->Source;
    
                    		//load postage.php
                    		include ('includes/postage.php');
    
                    		$blk_notification			= 1;
                    		$message_type			= $config['word_success']; // Success
                    		$error_message			= $config['error_25']; //25 == Request has been completed XXXXX=>success
                    		unset($_SESSION['update_token']);
                    		$_SESSION['update_token']	= '';
                	}
    

    If I replace the last } with } else { and then add the above code - modified - to notify the sender (by email) if the recipient has chosen not to be notified of internal messages. But I don't what to change in the code above, that would instruct it to } else { send something to the sender(of the internal message) email address. Can you help me with this part of my attempted modification? I've attached the entire code in txt (instead of php). Any help will be appreciated. 

  4. In Chrome, and IE8, when this link is selected:

     



    <a href="../upload/[blk1.thumbnail]"><form action="../upload/[blk1.thumbnail]"><input type="image" src="../images/MI.png"></form></a>


     

    the file appears successfully.

     

    In IE10 and IE9, instead of the file appearing successfully, a dialog box appears asking "Do you want to open or save (the file name) from www...com? OPEN SAVE CANCEL

     

    In FF it says "You have chosen to open (the file name) which is application/ocet-stream from www...com OPEN SAVE CANCEL

     

    What can I add (or change) so that the file appears, upon selecting the link, in IE10, IE9 and FF? instead of a dialog box appearing?

  5. I have tried other players and am now testing the mediaelement.js player, which works in all browsers, playing the video, and shows the 'poster' image in all browsers, except no 'poster' image appears in IE8.
     
    As I know the "poster' isn't supported by IE8, I'm looking for help with a work-around to place a thumbnail image as a substitute (for IE8) for the 'poster' image. Any help will be appreciated. Here's my current code:
     
    <video id="video" poster="http://www.-domain-.com/img/testImage.jpg" preload="none" controls="controls" width="240" height="220" >
    <source type="video/mp4" src="http://www.-domain-.com/video/testVideo.mp4"/>
    <object width="240" height="220" type="application/x-shockwave-flash" data="http://www.-domain-.com/mediaelement/flashmediaelement.swf">
     <param name="movie" value="http://www.-domain-.com/mediaelement/flashmediaelement.swf"     />    
    <param name="flashvars" value="controls=true&file=http://www.-domain-.com/video/testVideo.mp4" />
    <!-- Image as a last resort -->
    <img src="http://www.-domain-.com/img/testImage.jpg" width="240" height="220" title="No video playback capabilities" />
    </object>
    </video>
    

     

  6.  I have video-js code on a web page like this:

    <video id="video2" class="video-js vjs-default-skin" controls preload="auto" width="140" height="120"
    poster="/video/countdown.jpg" data-setup="{}">
    <source src="/video/vid1.mp4" type='video/mp4' />
    </video>
    

    Do you see anything wrong with this code?

    I have that code several times on the same page. It all plays successfully in Chrome, but in IE11 while a few players play their video(self-hosted),
    I see this "The video player aborted due to corruption problem or because the video used features your browser did not support"

    And in Firefox 37.0, I see this:
    "A network error caused the video download to fail part-way".

    The code in the header is

    <link href="/video-js/video-js.css" rel="stylesheet">
    <script src="/video-js/video.js"></script>
    <script>videojs.options.flash.swf = "/video-js/video-js.swf"</script>
    

    I suspect something simple in the code is a bit off.

    Do you know the solution? I look forward to any comments/insight/solutions.

     

     

  7. I'm using the PHP script for a video web site, and have added the ability to show the user's avatar (that he adds to his User Profile) as his uploaded video's Thumbnail image, in place of the thumbnail that's generated by the uploaded video itself (if the User leaves his avatar blank, the thumbnail generated by the video will show).


    It works successfully when the videos uploaded are short and not when the videos are longer.


    When I comment-out the added code (the nine commented-out lines near the bottom of the convertor.php code -posted below), all files upload successfully and the video-generated thumbnail appears.


    When I remove the commenting-out of those lines of code, only shorter videos show the avatar thumbnail, and only shorter videos(200KB for example) upload at all. Longer videos (25,000KB for example) don't appear to have uploaded. (maybe it's a timed-out thing when that code is looking for a thumbnail?)


    Any insight or suggestion will be appreciated.



    $sql = "SELECT file_name FROM pictures WHERE user_id = $user_id LIMIT 1";
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    $pic_file = $row['file_name'];
    $output_file = $base_path."/uploads/thumbs/".$file_name_no_extension.'.jpg';
    $input_file = $base_path."/pictures/".$pic_file;
    echo "Input file = ".$input_file;
    echo " and Output file = ".$output_file."<br>";
    copy($input_file, $output_file);

  8. Thanks for your reply/code, however it did not work successfully.

     

    I'm using a PHP script where this Form ultimately uploads a video. It has been modified so that the user, while filling in the Form, can optional add an image file to his Form info, then upon selecting the Submit button the image is renamed and uploads the Form info and (optional) image, after Submit the next page is where the user selects a video file to upload (and the image is linked to the video). When the video is searched a link appears next to the video thumbnail image. The link is for viewing the (optional) image file. When am image file has not been uploaded via the Form, the link showed only "Access Forbidden", until the NoInfoAvailable1.png code was added (successfully)(to show something more informative than "Access Forbidden"). However, now using your new code provided in the posting, upon not uploading an image, via the Form, I now again see "Access Forbidden" instead of NoInfoAvailable1.png. Any additional help will be appreciated.

  9. Thanks for your reply.

    Can you describe what's going on here, please?:

            if(!isset($error)){
                $uploadedFile = $_FILES['file']['tmp_name'];
                $thumbnail = $_SESSION['user_id'] . '-' . $randomString . "." . $extension;
                move_uploaded_file($uploadedFile, "upload/" . $thumbnail);
            }else{
                //Make sure NoInfo image has png extension
                $thumbnail = $_SESSION['user_id'] . '-' . $randomString . ".png";
                copy("upload/NoInfoAvailable1.png", "upload/" . $thumbnail);
            }
    

    And here:

     

     

     

    if(isset($error)){echo $error;}

    Thanks

  10. Can you please explain ALL that this code does?

    if (isset($_POST['form_submitted'])):
    
        // $randomString needed regardless of passing tests so put outside error condition
        $randomString = time();
    
        if((isset($_FILES) && $_FILES['file']['error'] != 0) || !isset($_FILES)){
    
            //Unable to upload file to temp
            //Set variable for final move/copy condtion with no message
            $error = '';
    
        }else{
    
            $allowedExts = array("doc", "gif", "jpeg", "jpg", "txt", "pdf", "png", "txt");
            $temp = explode(".", $_FILES['file']['name']);
            $extension = strtolower( end($temp) );
    
            if(!in_array($extension,$allowedExts)){
    
                $error = '<div id="errorMessage">>> Error: Invalid File Name </div>';
    
            }elseif($_FILES['file']['size'] >= 100000){
    
                $error = '<div class="errorMessage1">>> Error: Image File Size Exceeds Limit</div>';
    
            }
        }
    
            if(!isset($error)){
                $uploadedFile = $_FILES['file']['tmp_name'];
                $thumbnail = $_SESSION['user_id'] . '-' . $randomString . "." . $extension;
                move_uploaded_file($uploadedFile, "upload/" . $thumbnail);
            }else{
                //Make sure NoInfo image has png extension
                $thumbnail = $_SESSION['user_id'] . '-' . $randomString . ".png";
                copy("upload/NoInfoAvailable1.png", "upload/" . $thumbnail);
            }
                $_SESSION['thumbnail'] = $thumbnail;
                $file_location = '<a href="http://www....com/upload/' . $thumbnail . '">' . $thumbnail . '</a>';
    
    endif;
    if(isset($error)){echo $error;}
    

    Thank you. I look forward to being enlightened.

     

  11. I have this code, for an Upload Form, that works successfully renaming and moving an uploaded file to the upload/ folder. 
    If an image isn't uploaded, what code can I add to put a default file where the file would have been if it were uploaded? This code is what's working currently:
     
    if ($form_submitted == 'yes') {
    $allowedExts = array("gif", "jpeg", "jpg", "txt", "rtf", "png");
    $temp = explode(".", $_FILES["file"]["name"]);
    $extension = strtolower( end($temp) );
    if (!in_array($extension,$allowedExts) && $_FILES["file"]["name"] != "" )
    {
    echo ("<div id=\"errorMessage\"> >> Error: Invalid File Name </div>");
    }
    else if ($_FILES["file"]["size"] >= 100000)
    {
    echo ("<div class=\"errorMessage1\"> >> Error: Image File Size Exceeds Limit </div>");
    }
    $length = 20;
    $randomString = (time());
    $thumbnail = $_SESSION['user_id'] . '-' . $randomString . "." . $extension;
    move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail);
    $_SESSION['thumbnail'] = $thumbnail;
    $file_location = '<a href="http://www....com/upload/' . $thumbnail . '">' . $thumbnail . '</a>';
    }
    

    This is my attempt to "put a default file where the file would have been if it were uploaded", but my additions didn't suceed:

    if ($form_submitted == 'yes') {
      $defaultFilePath = '../upload/Default.png'; // set this.
      $allowedExts = array("gif", "jpeg", "jpg", "txt", "rtf", "png");
      $temp = explode(".", $_FILES["file"]["name"]);
      $extension = strtolower( end($temp) );
      if (!in_array($extension,$allowedExts) && $_FILES["file"]["name"] != "" )
        {
        echo ("<div id=\"errorMessage\"> >> Error: Invalid File Name </div>");
        $source = $defaultFilePath;
      }
      else if ($_FILES["file"]["size"] >= 100000)
      {
      echo ("<div class=\"errorMessage1\"> >> Error: Image File Size Exceeds Limit </div>");
        $source = $_FILES["file"]["tmp_name"];
      }
      $length = 20;
      $randomString = (time());
      $thumbnail = $_SESSION['user_id'] . '-' . $randomString . "." . $extension;
      if ($source === $defaultFilePath)
      {
      copy($source, "upload/" . $thumbnail);
      }
      else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail);
      }
      $_SESSION['thumbnail'] = $thumbnail;
      $file_location = '<a href="http://www...com/upload/' . $thumbnail . '">' . $thumbnail . '</a>';
    }
    
    Any help with getting this to work correctly will be appreciated.

     

  12. Thanks for your reples. In reply to "otherwise the browser wouldn't know the url to retrieve the video from in order to play it"

     

    When a video, thru my website, is ready to be played, this shows in the browser:

     

    www........com/results.php?x=178&y=16

     

    So, the video url doesn't appear in the browser, the video(mp4) plays in the flowplayer that pops-up in a box over the page, but you can right-click (in Chrome) "Copy video URL", so someone could simply copy the url and play it over and over using my data transfer cost.

     

    Can a random string be added to the file name via the player, or something, so the theif doesn't have the correct path/link?

  13. In my php web site the video player appears and plays the video. In Chrome you can right click on the player screen and choose 'inspect element' etc, but another choice is 'Copy video URL'. How can I block that, or hide (or disguise/rename) video URLs?

  14. How can I style this drop-down list/box in IE, so it looks the same as how I have it in Chrome?

    (see attached images)

     

    Here's the current code:

    <form method="get" action="../search.php" name="myForm" />
    <select size="1" name="type" class="dropdown_box" />
    <option value="1">CHANNEL 1</option>
    <option value="2">CHANNEL 2</option>
    <option value="any string here">ALL CHANNELS</option>
    </select>
    <input autocomplete="off" id="keyword" name="keyword" value="Enter text" onfocus="if (this.value=='Enter text') {this.value=''; this.style.color='#696969';}" onclick="clickclear(this, 'Search [var.site_name]')" onblur="clickrecall(this,'Search [var.site_name]')" value="" />
    <input type="submit" value="VIEW"/>
    </form>
    
    /*input,select.dropdown_box {*/
    input.common-input, select.dropdown_box {
    width:100px;
    height: 40px;
    color:#cccccc;
    border:1px solid #cccccc;
    background: #ffffff;
    }
    
    input:focus,select:focus{background:#ffffff}
    

    Any help will be appreciated.

    post-20454-0-73008300-1417913886_thumb.png

    post-20454-0-14285800-1417913893_thumb.png

  15. I'm trying to add a file size limit to my upload form-code (below)

     

    Is this correct?



    if ( $_FILES["file"]["size"] < 100000


    If that's correct, do I need any additional code to make that line of code functional?

     



    $allowedExts = array("gif", "jpeg", "jpg", "pdf", "doc", "docx", "txt", "rtf", "png");
    $temp = explode(".", $_FILES["file"]["name"]);
    $extension = strtolower( end($temp) );
    if (!in_array($extension,$allowedExts))
    {
    echo ("Error - Invalid File Name");
    }
    $length = 20;
    $randomString = (time());
    $thumbnail = $_SESSION['user_id'] . '-' . $randomString . "." . $extension;
    move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail);
    $sql = "INSERT INTO videos ( filename ) VALUES( '$thumbnail' )";
    mysql_query($sql);
    $file_location = '<a href="http://www.......com/upload/' . $thumbnail . '">' . $thumbnail . '</a>';


    Thanks. I look forward to any help.

     

  16. Thanks for that reply.

    I did go to Google Chrome > Developer Tools > Network --- refreshed --- and then selected the php page 'results1.php > Headers > Request Headers > view source     and I see this:

     

     

    GET /results1.php?x=63&y=11 HTTP/1.1

    Host: .......com
    Connection: keep-alive
    Cache-Control: max-age=0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
    Accept-Encoding: gzip,deflate,sdch
    Accept-Language: en-US,en;q=0.8
    Cookie: user=chrisj; pass=23c50817fd4612579a4aa31634388a2b8815e9; PHPSESSID=32d4133605a93870317c09aa3e8918
    Query String Parametersview sourceview URL encoded

     

    And I don't see the line "Header set Content-Disposition attachment" anywhere. I look forward to any additional reply/thoughts/guidance.

    thanks again

×
×
  • 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.