Results 1 to 3 of 3

Thread: Text on PNG path issues....

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Text on PNG path issues....

    The code below works...
    PHP Code:
    if ($context['allow_calendar']) {
        
               
    $font 'arial.ttf';      
               
    $text date("d");
               
    $dow date("l");
               
    $im ImageCreateFromPNG('../forums/Themes/BlackBox/images/mainlinks_f/calendar.png');

               
    $black ImageColorAllocate($im,50,50,50);
               
    $white ImageColorAllocate($im,255,255,255);
               
    $lft = (strlen($text)==2) ? 16;
               
    $fSize 7;
               switch (
    strlen($dow)) {
                       Case 
    6:
                           
    $l2 12;
                           break;    
                       Case 
    7:
                           
    $l2 10;
                           break;
                       Case 
    8:
                           
    $l2 7;
                           break;
                       Case 
    9:
                           
    $l2 4;
                           
    $fSize=6.5;
                           break;                   
              }
                 
    imagettftext($im260$lft43$black$font$text);
                 
    imagettftext($im$fSize0$l210$white$font$dow);
               
    ImagePNG($im,'../forums/Themes/BlackBox/images/mainlinks_f/calendar1.png');
                 
    imagedestroy($im);
                    
            echo 
    '<td class="linktd"><a href="index.php?action=calendar" title="CALENDAR"><img src="../forums/Themes/BlackBox/images/mainlinks_f/calendar1.png" border=0></a></td>';


    if I change the paths in these:

    PHP Code:
    $im ImageCreateFromPNG('../forums/Themes/BlackBox/images/mainlinks_f/calendar.png');
    ImagePNG($im,'../forums/Themes/BlackBox/images/mainlinks_f/calendar1.png'); 
    to

    PHP Code:
    $im ImageCreateFromPNG($settings['theme_url'] . '/images/mainlinks_f/calendar.png');
    ImagePNG($im,$settings['theme_url'] . '/images/mainlinks_f/calendar1.png'); 
    it no longer works?
    $settings['theme_url'] is set yes. cause I can echo it and the path is correct... it doesnt want to load or write the image.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Text on PNG path issues....

    but, what is $settings['theme_url'] set to? we would definitely need to know. if you don't have the fopen url wrappers on in php.ini, you won't be able to open remote files (if your variable is set to a URL, that is).

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Text on PNG path issues....

    Is $settings something read from a database? Could it be a slashes problem?


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width