06-22-2000, 10:42 AM
Hi Ed and congrats for the new appointment :)
I need your help please.
My BB members love smilies, it seems, and we have a nifty and useful collection of nice ones. However, I've discovered that the animated ones create problems aplenty for Netscape users.
So, I created a sub dir in the smilies dir, called netscape, and put there a copy of all the smilies, only not animated (same name though).
Then, I added a field to the smilie table in the database, called smiliepath2, and placed there the paths to the smilie/netscape/ images.
Then, I put the following in global.php, at around like 202 (where it says // smilies):
if (strstr($HTTP_USER_AGENT,"MSIE")) {
if ($allowsmilie==1 and $dosmilies==1) {
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie");
while ($smilie=$DB_site->fetch_array($smilies)) {
if ($smilie[smilietext]!="") {
$bbcode=str_replace($smilie[smilietext],"<img src=\"$smilie[smiliepath]\" border=0>",$bbcode);
}
}
}
} else {
if ($allowsmilie==1 and $dosmilies==1) {
$smilies=$DB_site->query("SELECT smilietext,smiliepath2 FROM smilie");
while ($smilie=$DB_site->fetch_array($smilies)) {
if ($smilie[smilietext]!="") {
$bbcode=str_replace($smilie[smilietext],"<img src=\"$smilie[smiliepath2]\" border=0>",$bbcode);
}
}
}
}
But it doesn't work. Now all the smilies are coming from the smilies/netscape/ dir -- which means my "if (strstr($HTTP_USER_AGENT,"MSIE"))" is not working.
Can you please advise me what I am doing wrong, and what I should do to get it right?
Thanks,
Bira
I need your help please.
My BB members love smilies, it seems, and we have a nifty and useful collection of nice ones. However, I've discovered that the animated ones create problems aplenty for Netscape users.
So, I created a sub dir in the smilies dir, called netscape, and put there a copy of all the smilies, only not animated (same name though).
Then, I added a field to the smilie table in the database, called smiliepath2, and placed there the paths to the smilie/netscape/ images.
Then, I put the following in global.php, at around like 202 (where it says // smilies):
if (strstr($HTTP_USER_AGENT,"MSIE")) {
if ($allowsmilie==1 and $dosmilies==1) {
$smilies=$DB_site->query("SELECT smilietext,smiliepath FROM smilie");
while ($smilie=$DB_site->fetch_array($smilies)) {
if ($smilie[smilietext]!="") {
$bbcode=str_replace($smilie[smilietext],"<img src=\"$smilie[smiliepath]\" border=0>",$bbcode);
}
}
}
} else {
if ($allowsmilie==1 and $dosmilies==1) {
$smilies=$DB_site->query("SELECT smilietext,smiliepath2 FROM smilie");
while ($smilie=$DB_site->fetch_array($smilies)) {
if ($smilie[smilietext]!="") {
$bbcode=str_replace($smilie[smilietext],"<img src=\"$smilie[smiliepath2]\" border=0>",$bbcode);
}
}
}
}
But it doesn't work. Now all the smilies are coming from the smilies/netscape/ dir -- which means my "if (strstr($HTTP_USER_AGENT,"MSIE"))" is not working.
Can you please advise me what I am doing wrong, and what I should do to get it right?
Thanks,
Bira