Jump to content

ldb358

Members
  • Posts

    199
  • Joined

  • Last visited

    Never

Posts posted by ldb358

  1. you could use a get variable and redirect like:

    header("Location: /gallery/?user=".$myusername);
    

     

    or you could have the index.php script in the gallery directory load the information based on the session that is set in the previous script

     

    also you should be registering your sessions like this:

     

    $_Session['username'] = $myusername;
    

     

    as session_register is deprecated

     

  2. heres a fix of mine

    <?php
        $date = -1*(mktime(0, 0, 0, 9, 19, 2009)-time());
        $diff = date('m,d,Y,h,i,s',$date);
        $unit = array('month','day','year','hour','minute','second');
        $diff = explode(',',$diff);
        $output = '';
        foreach($diff as $key => $time){
            if($time < 1){
                continue;
            }else if($time == 1){
                if($output != ''){
                    $output .= ', '.$time.' '.$unit[$key];
                }else{
                    $output .= ' '.$time.' '.$unit[$key];
                }
            }else{
                if($output != ''){
                    $output .= ', '.$time.' '.$unit[$key].'s';
                }else{
                    $output .= ' '.$time.' '.$unit[$key].'s';
                }
            }
        }
        $output .= ' ago';
        echo $output;
    ?>

  3. try:

        $diff = date('m,d,Y,h,i,s',mktime(0, 0, 0, 9, 19, 2009)-time());
        $unit = array('month','day','year','hour','minute','second');
        $diff = explode(',',$diff);
        $output = '';
        foreach($diff as $key => $time){
            if($time < 1){
                continue;
            }else if($time = 1){
                if($output != ''){
                    $output .= ', '.$time.' '.$unit[$key];
                }else{
                    $output .= ' '.$time.' '.$unit[$key];
                }
            }else{
                if($output != ''){
                    $output .= ', '.$time.' '.$unit[$key].'s';
                }else{
                    $output .= ' '.$time.' '.$unit[$key].'s';
                }
            }
        }
        $output .= ' ago';
        echo $output;
    

    to lower the amount of things shown just take away from the date format

  4. yeah i just found a bug in my thumbnail script it was creating a gif instead of a jpg where is should have and all the browsers except ie 7 were able to display it correctly despite this, so it wasn't an ie issue but an script issue

  5. im creating an image gallery that generates thumbnails and html for a portfolio but ive run into an issue with images saved as image.tn.jpg they have an unknown file type when loaded in ie7. does any one know how to fix it so that i can still have a .tn in the file name(make it easier to check if the image is a tn)?

     

    example of project:

    <div class='portfolioitem'><img src='pics/book01.tn.jpg' alt='image:book01.jpg' title='book01' /></div>

  6. function generate_thumbnail($image, $max, $output){
        if(!file_exists($output)){
            $size = getimagesize($image);
            if($size[0] > $size[1]){
                $type = trim(str_replace('image/',' ', image_type_to_mime_type($size[2])));
                $newheight = $max*($size[1]/$size[0]);
                switch($type){
                    case "png":
                    $oimage = imagecreatefrompng($image);
                    break;
                    case "jpg":
                    case "jpeg":
                    $oimage = imagecreatefromjpeg($image);
                    break;
                    case "gif":
                    $oimage = imagecreatefromgif($image);
                    break;
                    default:
                    trigger_error("Invalid Image Type", E_USER_WARNING);
                    break;
                }
                $nimage = imagecreatetruecolor( $max , $newheight );
                imagecopyresampled($nimage,$oimage, 0,0, 0, 0, $max , $newheight, $size[0] , $size[1]);
                imagegif($nimage,$output,100);
            }else{
                $type = trim(str_replace('image/',' ', image_type_to_mime_type($size[2])));
                $newwidth = $max*($size[0]/$size[1]);
                switch($type){
                    case "png":
                    $oimage = imagecreatefrompng($image);
                    break;
                    case "jpg":
                    case "jpeg":
                    $oimage = imagecreatefromjpeg($image);
                    break;
                    case "gif":
                    $oimage = imagecreatefromgif($image);
                    break;
                    default:
                    trigger_error("Invalid Image Type", E_USER_WARNING);
                    break;
                }
                $nimage = imagecreatetruecolor( $newwidth , $max );
                imagecopyresampled($nimage,$oimage, 0,0, 0, 0, $newwidth , $max , $size[0] , $size[1]);
                imagegif($nimage,$output,100);
            }
        }
    }

    where the $image is the beginning image and the $output is the new image to be generated

  7. i have a client who wants a web site that would

      -include 2 public pages

      -a admin only section for mass email and web site updating

     

    i would also be in charge of finding a host(could use recommendations), purchasing the domains and maintaining the site

     

    i think that i could easy build this site but what is a fair amount to charge for this, they want an offer and are going to compare it to two other offers so it needs to be competitive and as this would be my first client i have no idea what is fair

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