Jump to content
Larry Ullman's Book Forums

Jaepee

Members
  • Posts

    76
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Jaepee

  1. Suprisingly I see all kinds of people using iPads, iPhones, and iMac laptops at Google. Although the Chief engineer of facilites has a Samsung Galaxy S3, He asked to see my iPhone 4s and he said he liked it better than the Android...lol.

    The buses pick up workers from all over the valley and bus them in to work. All have wifi and they can start work from inside the bus. It's amazing how spoiled those Googlers are!!! Everyone gets free food, 2 meals a day, all kinds of perks. I guess its an awesome gig if you want to write code for 75+ hrs a week. Check this link out they put a race car in their building http://blu.re/psHv

  2. Update I added the following code to fix the problem with firefox

    , unfortunately have not found a remedy for safari :(

    window.onscroll = function(){
     var pn = document.body.parentNode.scrollHeight;
     document.getElementById('modalMask').style.height = pn +'px';
    };
    

    maybe not the best way to do it, but it worked.

    I'll keep on trying for safari..

    Running Mac OSX 10.7.5

    FireFox Mac 15.0.1

    Safari 5.1.7

    jp

  3. Hi everybody! hope all is well.

     

    So I have made a modified modal window(using Larry's example) and it works great except on my iPad (kinda).

    The modal is a confirmation window and the mask background area is not covered completely. If a user scrolls up the background is exposed.

     

    Does anyone have a suggestion on how to remedy this. You can see a picture of what i am talking about below.

     

    http://blure.com/sharE/?b_id=10&img=VMpzXeAm9sc7.jpg

     

    Thank you everyone.

    Jp

     

  4. I might consider a non login version however I would need to make a more secure upload script (i.e. porn)... I really would not want objectionable material easily uploaded, to prevent this I am requiring valid email.

  5. Thanks Guys. Its still a work in progress. But is a website ever really done? I would venture to say, No. At least I'm finally doing something creative since I've had the domain for 13 years now... I guess I am not procrastinating any longer. One thing I am proud of is that I coded/integrated in the album script a Pin It button that users can Instantly Pin their pictures to pinterest.com

     

    J.P.

  6. Okay Well I have spent most of the summer coding actualy (since December) and learning how to code PHP. Along the way I have learned HTML, CSS, dabbling still in Javascript, jQuery, objective-C (want to program my Mac ) MySql and well thats about it. My project I figured I would share it now, it's http://blurE.com/ (itsblurry.com) Its a picture hosting application. It's almost usable and 100% hand coded using Textmate and the PHP I've learn from Larry's books. So I thought I'd share it. Suggestions are Welcome.

     

    http://blure.com/sha...FujS7VAobTy.jpg Here is a Picture I took East of Yosemite Nat'l Park

     

    I also have a url shortener http://blu.re/ which I would like to incorporate somehow to make picture sharing more url friendly than the above link..

     

    Thanks Guys

     

    j.p.

    • Upvote 1
  7. Hi Edward I had a similar error message with a search script I made(e.g. clicking the back button). The following code fixed my problem.

     

    
    // call this before session_start(); // 
    session_cache_limiter ('private, must-revalidate');
    $cache_limiter = session_cache_limiter();
    //
    session_cache_expire(60); // 60 minutes
    

     

    I beleive it keeps the form data from the headers stored in the server cache for 60 minutes.

     

    jp

    • Upvote 1
  8. <input type="text" name="a" value= "<? $product_search; ?>" /> I beleive is incorrect.
    

    it should be

    use 'post'
    <input type="text" name="product_search" size="40" maxlength="60"   />
    

    Then

    $product_search = $_POST['product_search']; // you have to assign your GET or POST data to the variable that you are trying to match in the database...
    

     

    if (isset($_POST['product_search']) {
    $product_search = $_POST['product_search'];
    }
    

     

    I highly recommend that you read more than just the e-commerce section of the book. Doing so will enable you to fully understand the internal workings of php and the code that is above.

     

    cheers

    jp

  9. Hi all,

     

    I was wondering if class properties that are only assigned in a particular method belong only to that method. Like the

    getC()

    method and

    insert()
    

    method

    $r, $t, $q are unique to each method is that correct to assume?

    <?php
    // comment (doT) php
    //
    class Comments extends database { // picture comments class im new to this OOP thing
    
    protected $_picId;
    protected $_comments;
    
    function __construct($pic) {
    $this->_picId = $pic;
    $this->getC(); // returns all comments if there are any from database
    
    } // construct on instantiation get all comments
    
    protected function getC() { // gets comments from submitted picture id
    
    $this->_picId = $pic; // $pic picture id from _GET array
    $q = "SELECT comment_id, picture_id, DATE_FORMAT(comment_date, '%b %e %Y %r'), name_of_commentor, db, comment FROM db WHERE picture_id=$this->_picId";
    $r = @mysqli_query($this->dbc, $q);
    $t = mysqli_num_rows($r);
    if ($t == 1) {
    $this->_comments = mysqli_fetch_array($r, MYSQLI_ASSOC);
    return $this->_comments;
    } else {
    return false;
    }
    
    } // end of getC function
    
    protected function insert($picture_id, $noc, $bid, $comment) {
    
    $p = mysqli_real_escape_string($this->dbc, $picture_id);
    $n = mysqli_real_escape_string($this->dbc, $noc);
    $b = mysqli_real_escape_string($this->dbc, $bid);
    $c = mysqli_real_escape_string($this->dbc, $comment);
    // this function inserts a comment of a picture in the database
    $q = "INSERT INTO db (picture_id, comment_date, name_of_commentor, db_id, comment) VALUES ('$p', NOW(), '$n', '$b', '$c')";
    $r = @mysqli_query($this->dbc, $q);
    $t = mysqli_num_rows($r);
    if ($t == 1) {
     return true;
    } else {
     return false;
    }
    }
    } // end of Comments class 
    

     

    Thanks all in advanced

     

    jAe pEe

  10. Hi everyone, hope all is well.

     

    First, I wanted to say thanks again to Larry for making his books and supporting them with this forum. Second, thanks to all the active forum members and all of their support, while I haven't been posting that much I do find myself coming to the forums quite often to read and learn as much as I can. I have learned leaps and bounds. I also try and help out other forum users when I can.

    I was looking at my phpinfo(); function and saw a class that appears to come with the php installation.

    It is called IMAGICK. I read on the php.net page about some of the methods that come with this class and started to code a simple image Rotation script and a Thumbnail generation script.

     

    My question, is it perfectly safe to use IMAGICK vs. Writing my own scripts to handle rotation and thumbnail generation. Does anyone have any suggestions on my code to make better?

     

    Here is a simple sample code that I wrote using some functions on the php.net page

     

    http://www.php.net/manual/en/class.imagick.php

     

    $image = new Imagick("/home/{$JAEPEE}/public/{$user_folder}/{$main_pic}"); // main image
    $thumb = new Imagick("/home/{$JAEPEE}/{$folder}/thumbs/{$thumb}");  // thb
    // this code rotates an image ... //
    $image->rotateImage(new ImagickPixel(), $degrees); // main 180 flip // 270 rotate left // rotate right //
    $thumb->rotateImage(new ImagickPixel(), $degrees); // thb// 180 -> flip//  270 -> rotates left // 90 -> rotates right //
    
    // thumbnail code ...
    //$image1->thumbnailImage(150,150,true); // creates thumbnail to size 150
    //$image1->cropThumbnailImage(150,150); // crops and keeps aspect ratio
    
    // writes image to folder
    $m = $image->writeImage("/home/{$JAEPEE}/public/{$user_folder}/{$main_pic}");
    $t = $image1->writeImage("/home/{$JAEPEE}/public/{$user_folder}/thumbs/{$thumb}"); // saves the thumbnail at the given destination
    if ($t && $m) {
    echo 'Image was rotated';
    } else {
    echo 'No go on the rotate';
    }
    

     

    The rotate feature works pretty darn good, and it's really fast too.

    Thanks Everyone

    jp

×
×
  • Create New...