Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 2 of 2
Goto page Previous  1, 2
 
Reply with quote Download Post 
Post Re: Problems Generating Some Thumbnails 
 
It is designed to be in the signature.. But it is only if you want.. You just have to use img tag with the url provided..
Thanks again..
 



 
DanielcSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Problems Generating Some Thumbnails 
 
Who provides the URL?

You need to make sure to replace all spaces by %20 for example...
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Problems Generating Some Thumbnails 
 
I use .htaccess to generate the url's... The url's are written by the user..
Code: [Download] [Hide] [Select]
<?php

/**
 * Ranking Image Builder for Miiconsola.com
 * Desarrollado por Danielc
 * @version 1.0
 * @copyright 2009
 */
define('IN_ICYPHOENIX', true);
define('IMG_THUMB', true);
define('CT_SECLEVEL', 'MEDIUM');
$ct_ignoregvar = array('');
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', '../');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);

$username = isset($_GET["usuario"]) ? $_GET["usuario"]: "Usuario no especificado";
$jpg = isset($_GET["jpg"]) ? $_GET["jpg"]: 0;
//message_die(GENERAL_ERROR,"Usuario = $username", '', __LINE__, __FILE__, $sql);
$username = str_replace('\"','',$username);
$font_size = 7;
$n_font_size = 11;
$avatar_size =     83;
$avatar_pos_x = 13;
$avatar_pos_y = 8.5;
$ruta_avatar = "";
$name_pos_x = 109;
$name_pos_y = 22.5;
$points_pos_x = 214;
$points_pos_y = 41.5;
$base_img = imagecreatefrompng(IP_ROOT_PATH . 'images/ranking_base.png');
$rank_image = imagecreatetruecolor(imagesx($base_img), imagesy($base_img));
$partidas = 0;
$ganadas = 0;
$perdidas = 0;
$puntos = 0;
$ranking = 0;
$star = imagecreatefrompng(IP_ROOT_PATH . 'images/ranking_star.png');
$fuente = IP_ROOT_PATH . 'fuentes/doom.ttf';
$req_thumb_size = 400;
$pic_thumbnail_prefix = '';


if ($username != "Usuario no especificado") {
    $sql = 'SELECT user_avatar, user_allowavatar, ranking_perdidas, ranking_ganadas, ranking_puntos
            FROM ' . USERS_TABLE . '
            WHERE username = "' . $username . '"';
    if (($result = $db->sql_query($sql))) {
        if($user_info = $db->sql_fetchrow($result))
        {
            imagecopy($rank_image,$base_img,0,0,0,0,imagesx($base_img),imagesy($base_img));
            if ($user_info['user_allowavatar'] != 0) {
                if ($user_info['user_avatar'] != "") {
                    $ruta_avatar = IP_ROOT_PATH . "images/avatars/" . $user_info['user_avatar'];
                } else    {
                    $ruta_avatar = IP_ROOT_PATH . "images/ranking_noavatar.png";
                }

            } else {
                $ruta_avatar = IP_ROOT_PATH . "images/ranking_noavatar.png";
            }
            $ganadas = $user_info['ranking_ganadas'];
            $perdidas = $user_info['ranking_perdidas'];
            $partidas = $ganadas + $perdidas;
            $puntos = $user_info['ranking_puntos'];
            $ranking = ($ganadas + $perdidas) == 0 ? 0 :$puntos / ($partidas);
            $file_part = explode('.', strtolower($ruta_avatar));
            $pic_filetype = $file_part[count($file_part) - 1];
            switch ($pic_filetype){
                case 'jpg':
                case 'jpeg':
                    $avatar = imagecreatefromjpeg($ruta_avatar);
                    break;
                case 'gif':
                    $avatar = imagecreatefromgif($ruta_avatar);
                    break;
                case 'png':
                    $avatar = imagecreatefrompng($ruta_avatar);
                    break;
                default:
                    $avatar = imagecreatefromjpeg($ruta_avatar);
            }

            $av_x = imagesx($avatar);
            $av_y = imagesy($avatar);
            if ($av_x > $avatar_size || $av_y > $avatar_size) {
                if ($av_x > $av_y) {
                    imagecopyresampled($rank_image,$avatar,$avatar_pos_x,$avatar_pos_y,0 ,0,$avatar_size,$avatar_size * ($av_y / $av_x) ,$av_x, $av_y);
                } elseif ($av_y > $av_x) {
                    imagecopyresampled($rank_image,$avatar,$avatar_pos_x,$avatar_pos_y,0 ,0,$avatar_size* ($av_x / $av_y),$avatar_size  ,$av_x, $av_y);
                } else {
                    imagecopyresampled($rank_image,$avatar,$avatar_pos_x,$avatar_pos_y,0 ,0,$avatar_size,$avatar_size  ,$av_x, $av_y);
                }

            } else {
                imagecopy($rank_image,$avatar,$avatar_pos_x,$avatar_pos_y,0,0,$av_x,$av_y);
            }

            $textcolor = ImageColorAllocate($rank_image,255,255,255);
            imagettftext($rank_image,$n_font_size,0,$name_pos_x,$name_pos_y,$textcolor,$fuente,$username);
            $name_pos_y += 19;
            imagettftext($rank_image,$font_size,0,$name_pos_x,$name_pos_y,$textcolor,$fuente,"Partidas: $partidas");
            $name_pos_y += 14;
            imagettftext($rank_image,$font_size,0,$name_pos_x,$name_pos_y,$textcolor,$fuente,"Ganadas: $ganadas");
            $name_pos_y += 14;
            imagettftext($rank_image,$font_size,0,$name_pos_x,$name_pos_y,$textcolor,$fuente,"Perdidas: $perdidas");
            imagettftext($rank_image,$font_size,0,$points_pos_x,$points_pos_y,$textcolor,$fuente,"Puntos: $puntos");
            $points_pos_y += 4;
            imagecopy($rank_image,$star,$points_pos_x,$points_pos_y,0 ,0,imagesx($star), imagesy($star) );
            $points_pos_y += 18;
            $points_pos_x += 6 + imagesx($star);
            imagettftext($rank_image,11,0,$points_pos_x,$points_pos_y,$textcolor,$fuente,$ranking);

            if ($jpg == 0) {
                $pic_id = "www.rankings.miiconsola.com/$username.png";
                $pic_thumbnail_prefix = 'mid_' . md5($pic_id);
                $pic_thumbnail = $pic_thumbnail_prefix . '_' . $username . '.png';
                $pic_thumbnail_fullpath = POSTED_IMAGES_THUMBS_PATH . $pic_thumbnail;
                //if(!file_exists($pic_thumbnail_fullpath)) {
                imagepng($rank_image, $pic_thumbnail_fullpath,9, PNG_ALL_FILTERS);
                @chmod($pic_thumbnail_fullpath, 0777);
                //}
                header('Content-type: image/png');
                imagepng($rank_image, NULL,9, PNG_ALL_FILTERS);
            } else {
                //message_die(GENERAL_ERROR,"jpg = 1. Comprobando.. jpg = $jpg", '');
                $pic_id = "www.rankings.miiconsola.com/$username.jpg";
                $pic_thumbnail_prefix = 'mid_' . md5($pic_id);
                $pic_thumbnail = $pic_thumbnail_prefix . '_' . $username . '.jpg';
                $pic_thumbnail_fullpath = POSTED_IMAGES_THUMBS_PATH . $pic_thumbnail;
                imagejpeg($rank_image,$pic_thumbnail_fullpath, 75);
                @chmod($pic_thumbnail_fullpath, 0777);
                header('Content-type: image/jpeg');
                imagejpeg($rank_image, NULL, 75);
            }

            imagedestroy($rank_image);
        } else {
            message_die(GENERAL_ERROR,"Usuario no encontrado.", '');
        }
    } else {
        message_die(GENERAL_ERROR,"No se pudo obtener la informaciĆ³n para el usuario", '');
    }
} else {
    message_die(GENERAL_ERROR,"Usuario no especificado", '');
}
?>


That is the code...

So, i must do what you say in the .htaccess or in the php file?? I was thinking on double rewrite the url via htaccess, but i don't think that is the best method..

Could you help me?
 



 
DanielcSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Problems Generating Some Thumbnails 
 
Did you solve this or is the issue still open?
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Problems Generating Some Thumbnails 
 
I solve it generating the thumbnails manually and rewriting the urls.

Thanks for your help!
 



 
DanielcSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 2 of 2
Goto page Previous  1, 2


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events