Specified logos don't work while random do work!!!
petrellis - May 20, 2008 - 10:26
| Project: | Logo Tool |
| Version: | 5.x-2.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | petrellis |
| Status: | active |
Description
Hello there from beautifull Greece,
First of all i need to tell you that this module is a great one for the problem that solves and that makes happy all of us.
Now let's go deeper in the problem.
Till now i was using the module with the random logo option and everything was ok.
In a new project i have i need to use the specified logos but they don't seem to work for some reason that i dont understand.
Let me tell you again that when i am swithcing to random logos everything works fine but when i am coming back in specified ones i can see in all the pages the drupal standard logo.
Do you have any idea about it?
Thanks in advance,
Emmanouil Petrellis

#1
Hiya!
No worries, it's probably just that you're not formating your entries correctly. Post your specified logos here and I'll take a look at them (obviously *exactly* how they appear on your settings page - use
<code></code>tags for formatting).Thanks,
Pobster
#2
I am using this:
node/3|logo0.jpgI am not taking any errors but when i am going to the specified node i keep seeing the default logo!!!
Emmanouil Petrellis
#3
Hmmm... Do you see the logo when you navigate to; .../admin/settings/logotool/logos
Pobster
#4
Yes i can see it. Actually i have many logos uploaded and i can see them all.
And don't forget that when i am switching in random mode everything works fine. In every page load i can see different logo.
The problem is in specified logos mode.
Emmanouil Petrellis
#5
Just making sure the server could see it ;o) Actually before I suggest anything else... Is "node/3" written next to it as the connected link/ path? I've attached my own severs example which is just for admin* pages.
Pobster
#6
As you can see in the attached image it is.
Any other ideas?
Emmanouil Petrellis
#7
A couple, but I'm running low... ;o)
...Do you have Drupals cache enabled? If so, could you try disabling it? The problem is unlikely this but anything is worth trying before I ask you to hack the logo.php file...
Pobster
#8
Caching mode is disabled.
Emmanouil Petrellis
#9
Bugger okay, do this then - open up your logo.php file, we're going to try and find out what the variable holds when the logo.php file has hold of it. There's several things which can go wrong with browser caching, Drupal caching, even server image caching/ proxy caching - but it sounds like none of that is causing this issue... So...
Comment out this line (near the bottom);
// Output image//$im = @readfile($logo);
The reason is that now the error renderer will activate. So make it display something useful, change it (it's near the beginning of the code);
/*** Create an image and display a message in it (for error reporting)
*/
function logotool_display_error($text = "Error Creating Logo") {
$text = variable_get('logotool_logo', ''); // display the current logo variable
$im = imagecreate(181, 20);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 255, 0, 0);
imagestring($im, 5, 2, 1, $text, $textcolor); // you'll possibly need to edit these parameters to fit all the variable into the error image
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
} // logotool_display_error
...Just one thing before you do this... Is your installation in a folder? Do you access it in any other way than http://www.something.com?
Pobster
#10
My installation is in the root folder of my webserver.
I did that and now i am taking the following error instead the image:
Error creating file
Is this good or bad? :)
Emmanouil Petrellis
#11
That isn't what I expected to see! That's not even an error message Logotool is programmed to output! Is the message returned *as* an image or is it text?
Pobster
#12
Ok i add the extra line and now it output the misc/druplicon.png
But we knew that right?
Actually this is the problem from the begining, that we see the druplicon.png instead of the specified logo (logo0.jpg)...
Emmanouil Petrellis
#13
It is returned as an image.
Emmanouil Petrellis
#14
If you commented out the first line I mentioned then there's no way your installation should have output any logos at all as it forces the output of the error routine. You did comment out that line as well as adding the other one right?
Pobster
#15
Okay forget I said that, it seems that was just a breakdown in communications ;o)
Okay so the error is that your installation isn't changing the logo variable formed from the page in question. Change that error routine again, this time to;
/*** Create an image and display a message in it (for error reporting)
*/
function logotool_display_error($text = "Error Creating Logo") {
$text = LT_CWD; // display the current working directory variable
$im = imagecreate(181, 20);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 255, 0, 0);
imagestring($im, 5, 2, 1, $text, $textcolor); // you'll possibly need to edit these parameters to fit all the variable into the error image
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
} // logotool_display_error
Obviously you'll need to be viewing node/3 or whatever it was... As this is where the error is. (You were doing that when you made the change above right?)
Pobster
#16
Yes i did.
I am not taking a logo but the path of the druplicon logo that is misc/druplicon.png
Is this right?
Emmanouil Petrellis
#17
Yes i am viewing node/3
Now i am taking this:
files/logos
Emmanouil Petrellis
#18
I'm not quite sure what you mean, I'll elaborate on what I'm trying to get you to achieve.
Currently your logo path is set to logo.php so that file can only generate an image else you'll get an error.
If there is an error in generating your logo (which we're forcing by commenting out the line which actually outputs the image) then an error message is returned *as*an*image* as text cannot be returned. By cycling through the different variables available to us we can gain information an exactly what is going on internally with the script.
BTW, could you post all your Logotool settings? Preferrably as a screenshot (it'll show me easily for instance if you're using a rich text editor like FCKeditor which could be entering text formatting in your settings area which would mess up the variables completely). And you said that random images worked fine right?
Pobster
#19
Yes i understand what you are saying.
I attach an image with my settings.
Emmanouil Petrellis
#20
Ah good this is easy, see where it says "... FULL SYSTEM PATH..." - that's not a full system path ;o) You need to enter something like...
/var/www/localhost/htdocs/files/logosrather than the suggested link which is only there to get the default logo displayed correctly in the first instance of the module being enabled. Phew! That's a relief! Had an awful feeling this was going to be more serious!Pobster
PS. I've not been to Greece, but I love Cyprus and I'm going back there at the end of the month - can't wait!
#21
Ok i have a surprise for you!!!
I changed the path with the FULL SYSTEM PATH but the bug is still there!!!
The random logos keep playing correctly but when i am going to the specified logos it shows me all the time the default logo!!!
Actually nothing changed!!!
Emmanouil Petrellis
#22
...And you've changed the logo.php file back to the default one? (Rather than the one we've changed)...
...This is not good news...
...Just to check, does the screen which displays all the logos now look any different?
Pobster
#23
Yes i changed it too...
As i can see the problem is that the variable for the logo takes all the time the default logo value...
Can you imagine why?
Emmanouil Petrellis
#24
The only reason I can think of is perhaps your server doesn't support $_GET...? It's highly unlikely though... Could you post a link to your site? I don't need to do anything administrative to it, just wanted to look for anything which might be obvious?
...Actually just to test something which I *know* works... Add an entry for administrative pages like;
admin*/image.jpg
And see if that works?
Pobster
#25
Actually there is something more obvious you can try (and tbh, it's probably going to work now - I'd just forgotten about it)...
http://drupal.org/node/141366
To correct line 26 of logo.php should be changed from:
$logo = $_GET['logo'] ? $_GET['logo'] : variable_get('logotool_logo', '');to;
$logo = isset($_GET['logo']) ? $_GET['logo'] : variable_get('logotool_logo', '');Pobster
#26
No it doesn't work.
It keeps working in the same way... It shows all the time the default logo!!!
Emmanouil Petrellis
#27
Did you try the admin* logo? And could you post a link to your site?
Pobster
#28
Ok this is the link for the site
http://adw.digitalparty.eu/
Right now i have the settings for the specified logos and it displays the default one.
Emmanouil Petrellis
#29
Hmmmm this is odd... Whatever page I view all I see is a black box for the logo? And if I navigate to http://adw.digitalparty.eu/files/logos/logo0.jpg I see that black box? I'm sure logo0.jpg isn't meant to be a black box?... Or is it? What is logo0.jpg?
Pobster
#30
Yes it is a test logo image.
And yes it is a black box!!!
lol
Emmanouil Petrellis
#31
Hehe ;o) Just assumed that was an error! Mind you... I'm confused now as the black box appears on every page? What are your settings currently?
Pobster
#32
node/7|logo1.jpgwhere node/7 is the press link and logo1.jpg is a brown box!!!!
Emmanouil Petrellis
#33
Do you want to see how the random logo is working?
#34
I'm going out in a minute so just a couple more questions and then I'm going to have to leave it till tomorrow...
Did you try the admin link?
Is there any module you've enabled which might affect Logotool calling hook_init (which is what changes the page variable).
A long shot... Is your servers clock configured correctly? There's a comparison against the time for time delayed rotation, but I noticed that you've not set it anyway. I'm unsure if it'll make any difference...
LEAVE that
issetchange in your logo.php file... I'm assuming all the other changes are back to normal now though?Don't worry about the random logos, it works differently so it's not really comparable in this sort of situation.
Pobster