Changeset 1072

Show
Ignore:
Timestamp:
09/16/06 23:25:35 (2 years ago)
Author:
jm3
Message:

now cleaned up and working with user ids isntead of raw paths

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/testing/new-profile-icons.php

    r1071 r1072  
    1 <% if( $type ) { %> 
    2 Try another format: 
     1<title> 
     2        Test page: Create thumbnail for user 
     3<title> 
     4<% 
     5        include_once( "../modules/utils.inc.php" ); 
     6%> 
     7 
     8<% if( $user ) { %> 
     9Try another user: 
    310<% } %> 
    411<form> 
    5         <select name="type" onchange="form.submit();"> 
    6                 <option value=""> pick a format </option> 
    7                 <option value="png">png</option> 
    8                 <option value="jpg">jpg</option> 
    9                 <option value="gif">gif</option> 
     12        <select name="user" onchange="form.submit();"> 
     13                <option value=""> pick a user </option> 
     14                <option value="pheezy">pheezy</option> 
     15                <option value="jm3">jm3</option> 
     16                <option value="eyeofaphrodite">eyeofaphrodite</option> 
    1017        </select> 
    1118</form> 
    1219<% 
    1320 
    14         if( $type ) { 
    15                 $i = "icons/profile.$type"; 
    16                 $out = thumbnailify_profile_image( $i ); 
    17                 echo "Before: <a href='$i'><img src='$i' border='0'/></a> <br/>"; 
    18                 $s = "icons/small.png"; 
    19                 echo "(During:) <a href='$s'><img src='$s' border='0'/></a><br/>"; 
    20                 echo "After: &nbsp; <a href='$out'><img src='$out' border='0'/></a>"; 
     21        if( $user ) { 
     22                $i = make_thumbnail_for_user( $user ); 
     23                echo "created thumbnail: <br/><a href='$i'><img src='$i' border='0'/></a> <br/>"; 
    2124        } 
    22  
    23         # returns the PATH to the new thumbnail image 
    24         function thumbnailify_profile_image( $i ) { 
    25                 $out = "icons/thumb.png"; 
    26                 imagepng( get_png_thumbnail_from_image( $i ), $out ); 
     25         
     26        # returns the PATH to the newly created thumbnail 
     27        function make_thumbnail_for_user( $u ) { 
     28                $i = get_profile_image( $u ); 
     29                $out = "/" . get_user_folder( $u ) . "/thumb.png"; 
     30                imagepng( get_png_thumbnail_from_image( $i ), get_root() . $out ); 
    2731                return $out; 
    2832        } 
    2933 
     34        # returns an image OBJECT of the newly created thumbnail 
    3035        function get_png_thumbnail_from_image( $i ) { 
    3136                $goal = 64;