Code help
- Started
- Last post
- 26 Responses
- Claymantis
At the top of the content there should be a title image.
Its generated from some php code.
title-whatevertheimage.gif
I'm not sure why the image isn't showing up.
If someone could help me that would be amazing!
- dbloc0
- why is it not generating the full code... title-code.gifClaymantis
- Claymantis0
the image is in the right folder... not sure why it wont show up
- BattleAxe0
are the image names being stored in a database? or are you just reading from a folder?
check the field name size on the database , seems like the file names are not being added to the end and it could be because of million reasons the one mentioned above being one of them
do you want to post your php code or how the file names get generated , that seems to be the start of the problem
- d_rek0
title-.gif isn't loading. It's either incorrectly named or incorrectly pathed.
- dbloc0
just name them all title-.gif and it will work
- dbloc0
<div id="title"><img src="images/title-.gif" class="titleimg"></div>
- BattleAxe0
it seems like such a quick fix but, I think he mentioned something about the names being generated by a script , and not hard coded so the processing script could be the issue
- Claymantis0
No word of a lie the site started doing this out of nowhere...
No one has even edited this site in months...
So I'm not sure why there is nothing showing up...
- TResudek0
Claymantis - obviously whatever variable you are trying to echo for the full file name isn't being found. My questions to you:
What is the variable name (it'll start with a $)?
Where is that variable coming from?
- spraycan0
putting an hypen at the end of a file name will generate errors .
- acescence0
If I remember correctly, we helped you with this site before- adding a new item to the nav. I think it was generating the filenames from an array of nav items stored somewhere? I don't recall how the titles were sourced though, not sure we saw that part of the code. post the php.. http://www.pastebin.org/
- BattleAxe0
I see that this page is not part of your menu options which all of your menu options link to pages with a working header , maybe you need to add it to the menu ?
- comicsans0
Your images directory contains no file called title-.gif as shown by dbloc above.
I'm guessing you are trying to generate a filename on the fly within your php and botching it. To prove this change it to something fixed like title-fees.gif and an image will appear. Without seeing your php it is impossible to guess what you have done wrong.
- Filenames are generally case sensitive, fees is not the same as FEES for example.comicsans
- Claymantis0
if (($header_images) && ($sub != 'form')) {
print "<div class=\"pics\">\n";
foreach ($header_images as $img) {
print "<img src=\"images/$img.jpg\" class=\"featureshot\">\n";
} // End foreach
print "</div>\n";
print "<div id=\"title\">";
} elseif ((!$header_images) || ($sub == 'form')) {
print "<div id=\"title-noimg\">";
} // End ifprint "<img src=\"images/title-";
if ($sub) {
print $sub;
} else {
print $current;
} // End ifprint ".gif\" class=\"titleimg\"></div>\n";
- Claymantis0
The title images worked one day... and then the next day they didnt work.
I didn't move any image... nor did I change any code...
For some reason code.php just stop calling the header title...
- Claymantis0
Thats the thing! I didn't touch it...
- something had to have changed. Did you move the location of the images?dbloc
- nope.Claymantis
- Something was definitely changed. Could be any other file in the site too.juhls
- acescence0
some important info missing here, where is $sub defined? where is $current defined?
- Claymantis0
Not sure... I'm not good with PHP...
I think the client tried to use contribute and messed things up...
- acescence0
search the site files for instances of $sub and $current, that's the root of your problem. are there any files being included on the page?