I'm trying to get this module working on a local server on a Mac. I followed the instructions, but all I get is a broken image in the header. The logos are displayed correctly in the "Logotool Logos" tab of the script administration. Checking the HTML source code of any page the header looks like this:

<div id="branding">
<img src="/logo.php" alt="" id="logo" />
</div>

Obviously, the path isn't being replaced, although I set the "Path to custom logo" to logo.php. Caching is set to normal. What am I doing wrong?

Comments

pobster’s picture

Tell me more, when the logos are displayed correctly what does the source tell you the path to the logo.php file is?

Thanks,

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

Anonymous’s picture

All my images are called image1.jpg, image2.jpg,... On the Logotool image list, they are all show up correctly linked with:

<img src="/logo.php?logo=image1.jpg">

and so on for each one, yet in the header they won't show up. In the "Path to custom logo" I indeed only have to write "logo.php", without any slashes and other things?

pobster’s picture

Hmmm... It seems strange that <img src="/logo.php?logo=image1.jpg"> should work, yet <img src="/logo.php"> doesn't... What happens if you simply type http://www.yoursite.com/logo.php - do you get a logo (random or whatever you've set)??

It sounds like you're doing everything correctly, I'm wondering whether your theme is at fault.

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

Anonymous’s picture

As I wrote, I'm testing this locally on a Mac with Apache. Maybe something isn't set up properly. This is what I get when I call the script directly:

Notice: Undefined index: logo in /Applications/MAMP/htdocs/logo.php on line 26

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/logo.php:26) in /Applications/MAMP/htdocs/logo.php on line 50

And then a huge amount of cryptic binary code follows, which probably is the image. Maybe there's a problem with the MIME-type as well next to the header already sent, although it's strange that the logos are displayed correctly in the list.

Anonymous’s picture

Oh yeah, I'm using the Barlow theme.

pobster’s picture

Change line 26 of the logo.php file to this;

$logo = isset($_GET['logo']) ? $_GET['logo'] : variable_get('logotool_logo', '');

And let me know if that fixes it...

Thanks,

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

Anonymous’s picture

Yes, now it works :)

Anonymous’s picture

Ok, it works, but I noticed that in the HTML source code, it still says "" even though all the logos are displayed correctly. Furthermore, in the logo list it lists a file called "logo.php" which says "Unsupported filetype". This seems a bit confusing.

Anonymous’s picture

Sorry, the HTML wasn't displayed in the message before. In the source code it says

<img src="/logo.php" alt="" id="logo" />
pobster’s picture

The path was always correct that wasn't the problem, the problem was one which was pointed out to me several weeks ago and I failed to take any notice because I didn't think it'd cause anyone any problems unless someone perhaps had very strict php settings... Yes, that's you ;o)

I'm a bit confused about why the logo.php file is appearing in your logo settings screen, you said that it's in your top level folder hence the path "/logo.php" - where are your logos, are they in the top level folder as well?

Thanks,

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

Anonymous’s picture

No, the logos are in "files/logos".

pobster’s picture

Then remove the logo.php file from "files/logos" - you must have copied it there by accident. It's impossible for there to be any another explanation as to why it's being displayed in your list of logos.

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

Anonymous’s picture

Sorry, I forgot that I copied logo.php into the logo folder too when fiddling around with the script %)

Everything works how it should now, the "isset" command was the only thing that was missing.

pobster’s picture

No worries! Glad you got sorted.

Thanks,

Pobster

--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------

pobster’s picture

Status: Active » Closed (fixed)