I swear I'm not making this up, it's the weirdest thing I've ever seen.
I'm writing a Twitter module for Zencart, and basically using an image to 'skin' it with. I've got one div to show the 'skin' image, and another nested div offset to show the feed generated and formatted by the PHP.
Of course, everything works great in FF. However, in IE, I can't get the preferred image to show up in the div. Here's the kicker, though... if I play with the CSS and change the background-image: url() to a different, older image, they show up fine, in both IE and FF. In fact, there doesn't seem to be any ryhme or reason as far as differentiating, other than the images that DO show up weren't created today. Any new image I create WON'T work, but I can plug darn near any OLD image in and it shows up fine in both FF and IE.
I've tried gif's, png's, jpg's, different widths, different heights, different resolutions...
I thought it might be something to do with my setup, but I've duplicated it on another PC with different image tools.
I also am running a local version of SVN on Windows, so I thought that might have something to do with it, but I've checked the whole thing in and out and refreshed the depository, still the same results.
If anyone has ANY ideas, I'll look at them! This has been driving me crazy for two days!!!
I'll post my code, but I doubt the coding is the issue....
//twitter.php
<div class="twitterBox">
<div class="twitterFeed">
<dl>
<?php
//User Variables
$rssURL = " $ttlDisplay = 5;
//End User Variables
$insideitem = false;
$tag = "";
$description = "";
$link = "";
$pubdate = "";
$ttlDisplayed =0;
function startElement($parser, $name, $attrs) {
global $insideitem, $tag, $description, $link, $pubdate;
if ($insideitem) {
$tag = $name;
} elseif ($name == "ITEM") {
$insideitem = true;
}
}
function endElement($parser, $name) {
global $insideitem, $tag, $title, $description, $link, $pubdate, $ttlDisplay, $ttlDisplayed;
if ($name == "ITEM") {
if($ttlDisplayed < $ttlDisplay){
echo '<div class="tweetDateline">Tweeted: ' . $pubdate . '</div>';
echo '<div class="tweetItem">' . $description . "</div><br />";
$description = "";
$link = "";
$insideitem = false;
$pubdate="";
$ttlDisplayed++;
}
}
}
function characterData($parser, $data) {
global $insideitem, $tag, $title, $description, $link, $pubdate;
if ($insideitem) {
switch ($tag) {
case "DESCRIPTION":
$data = formatDescription($data);
$description .= $data;
break;
case "LINK":
$link .= $data;
break;
case "PUBDATE":
$pubdate .= $data;
$post= strtotime($pubdate);
$pubdate = date('m/d/Y',$post);
break;
}
}
}
function formatDescription($value){
//The Twitter XML description starts with the username and a colon, we want to strip that off
$intColon = strpos($value,":");
$newDescription = substr($value,$intColon + 2,strlen($value));
return $newDescription;
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
$fp = fopen($rssURL,"r")
or die("Error reading RSS data.");
while ($data = fread($fp, 4096))
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);
?>
</dl>
</div>
</div>
relavant css...
<style type="text/css">
/*twitter css*/
.twitterBox{
display: block;
width: 150px;
height: 450px;
position: relative;
background-color: fuchsia;
background-image: url(images/new2.gif);
background-repeat: no-repeat;
background-position: top;
}
.twitterFeed{
position:absolute;
top:40px;
left: 1.5px;
background-color: #ffffff;
font-size: smaller;
width: 143px;
height:380px;
overflow: auto;
padding-left: .5em;
}
.tweetDateLine{
text-decoration: underline;
font-family: sans-serif;
font-size: smaller;
}
.tweetItem{
font-family: sans-serif;
}
</style>
I'm writing a Twitter module for Zencart, and basically using an image to 'skin' it with. I've got one div to show the 'skin' image, and another nested div offset to show the feed generated and formatted by the PHP.
Of course, everything works great in FF. However, in IE, I can't get the preferred image to show up in the div. Here's the kicker, though... if I play with the CSS and change the background-image: url() to a different, older image, they show up fine, in both IE and FF. In fact, there doesn't seem to be any ryhme or reason as far as differentiating, other than the images that DO show up weren't created today. Any new image I create WON'T work, but I can plug darn near any OLD image in and it shows up fine in both FF and IE.
I've tried gif's, png's, jpg's, different widths, different heights, different resolutions...
I thought it might be something to do with my setup, but I've duplicated it on another PC with different image tools.
I also am running a local version of SVN on Windows, so I thought that might have something to do with it, but I've checked the whole thing in and out and refreshed the depository, still the same results.
If anyone has ANY ideas, I'll look at them! This has been driving me crazy for two days!!!
I'll post my code, but I doubt the coding is the issue....
//twitter.php
<div class="twitterBox">
<div class="twitterFeed">
<dl>
<?php
//User Variables
$rssURL = " $ttlDisplay = 5;
//End User Variables
$insideitem = false;
$tag = "";
$description = "";
$link = "";
$pubdate = "";
$ttlDisplayed =0;
function startElement($parser, $name, $attrs) {
global $insideitem, $tag, $description, $link, $pubdate;
if ($insideitem) {
$tag = $name;
} elseif ($name == "ITEM") {
$insideitem = true;
}
}
function endElement($parser, $name) {
global $insideitem, $tag, $title, $description, $link, $pubdate, $ttlDisplay, $ttlDisplayed;
if ($name == "ITEM") {
if($ttlDisplayed < $ttlDisplay){
echo '<div class="tweetDateline">Tweeted: ' . $pubdate . '</div>';
echo '<div class="tweetItem">' . $description . "</div><br />";
$description = "";
$link = "";
$insideitem = false;
$pubdate="";
$ttlDisplayed++;
}
}
}
function characterData($parser, $data) {
global $insideitem, $tag, $title, $description, $link, $pubdate;
if ($insideitem) {
switch ($tag) {
case "DESCRIPTION":
$data = formatDescription($data);
$description .= $data;
break;
case "LINK":
$link .= $data;
break;
case "PUBDATE":
$pubdate .= $data;
$post= strtotime($pubdate);
$pubdate = date('m/d/Y',$post);
break;
}
}
}
function formatDescription($value){
//The Twitter XML description starts with the username and a colon, we want to strip that off
$intColon = strpos($value,":");
$newDescription = substr($value,$intColon + 2,strlen($value));
return $newDescription;
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
$fp = fopen($rssURL,"r")
or die("Error reading RSS data.");
while ($data = fread($fp, 4096))
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);
?>
</dl>
</div>
</div>
relavant css...
<style type="text/css">
/*twitter css*/
.twitterBox{
display: block;
width: 150px;
height: 450px;
position: relative;
background-color: fuchsia;
background-image: url(images/new2.gif);
background-repeat: no-repeat;
background-position: top;
}
.twitterFeed{
position:absolute;
top:40px;
left: 1.5px;
background-color: #ffffff;
font-size: smaller;
width: 143px;
height:380px;
overflow: auto;
padding-left: .5em;
}
.tweetDateLine{
text-decoration: underline;
font-family: sans-serif;
font-size: smaller;
}
.tweetItem{
font-family: sans-serif;
}
</style>