Closed (fixed)
Project:
Logo Tool
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2006 at 02:44 UTC
Updated:
11 Sep 2006 at 06:54 UTC
I think there is a path misspelling. You have defined the logotool subfolder as "logos", yet in the module code you have written this:
$items[] = array('path' => 'logotool/logo',
I think it shoud be "logos", not "logo"
As a result I think that even though the image files are being read by the table, they are not being recognized for displaying on the page and hence the red x in a white box in the place of the logo
Comments
Comment #1
pobster commentedNope you're completely wrong... Don't you think maybe then the module perhaps wouldn't work...? I don't know why people can't look to themselves more when something doesn't work. There's a link on the module page showing a site using the module, therefore you can see it working! A bad workman(woman?) always blames their tools...
Right seeing as you've taken the time to look at my code (although bizarrely only part of it) I'll explain exactly whats happening. You see, as you've not taken any time at all to tell me anything about your problem - I absolutely have no idea on how else to help you.
Here goes;
This defines the 'LogoTool_Current_Working_Directory' for most this will be /var/www/localhost/htdocs/modules/logotool/logos
$items[] = array('path' => 'logotool/logo' this sets a CALLBACK to an individual logo. A callback is a path without a menu item attached to it. When someone visits the 'logotool/logo' path the function defined here; 'callback' => 'logotool_logo' is called. The reason I called it '...logo' is because indeed, it displays ONE logo from the logos folder.
The second callback is a MENU_NORMAL_ITEM which means that it creates a path with a menu link. In this case it's 'path' => 'admin/settings/logotool/logos' which when accessed calls the function 'logotool_logos'. This function displays the entire contents of your LT_CWD (logos) folder.
This is the display function, lets step through it...
$logo = $_GET['logo'] ? variable_get('logotool_folder', LT_CWD).'/'.str_replace('../', '', $_GET['logo']) : variable_get('logotool_logo', '');Defines the entire $logo path variable and does a hackish check on whether someone is trying to view things on your server which it does by stripping any instance of '../' in the provided logo url.
Okay this uses a function from includes/image.inc to gain information about your logo file. It then sets the header so a browser knows that it's looking at an image file.
$im = @readfile($logo);VERY simply, this dumps the logo image on the screen. The '@' is supposed to supress error messages.
Right, if an image WASN'T dumped from above the variable $im will be empty. If it is, then this code is run to create an image telling you there's been a error. This is probably the image you're seeing as you've evidentally done something wrong and the fact that your image is being displayed as a red x in a white box tells me that your php installation doesn't support png files. To see what it does support, use phpinfo.
Now... If you want to talk to me about what it is that you're doing wrong then I'm happy to help.
Pobster
Comment #2
blueroo commentedThen what am I dooing wrong?
Comment #3
pobster commentedWell you could start by giving me a clue as to what your settings and set up are?
Pobster (who is definitely NOT a mind reader)
Comment #4
pobster commented