Post by Xargo on Feb 14, 2006 11:56:25 GMT -8
Name: Fix message icon preview v1.1
Cross browser: Internet Explorer, Firefox, Netscape and Opera
Place: Global footer
Description:
I recently found a script made by CrAzY_J similar to this one, but I thought that needed improvement so here is version 1.1.
The code fixes the Proboards bug that when you create/modify a reply or topic the boring standard topic icon still shows up as preview instead of your new costumized flashy one. For example if you change the smiley to a much better one, and you then create a new topic and choose the smiley in the list the boring standard topic icon will still show up instead of the one you chose. This script fixes that.
You can now choose which icons that are costumized and which not. You also don't have to give one certain directory containing all the icons anymore, and all the icons don't have to be in the same directory. Just a seperated URL for every icon you costumized. It will be more clear when you see the script array.
Code explanation:
Purple -> The name of the topic icon. (More explanation below)
URL -> The new url of the topic icon you chose.
Notice you can't write the name of the topic icon that appears in the list, here is the correct list for every topic icon:
Standard -> xx
Thumbs up -> thumbup
Thumbs down -> thumbdown
Exclamation Point -> exclamation
Question Mark -> question
Lamp -> lamp
Smiley -> smiley
Angry -> angry
Cheesy -> cheesy
Laugh -> laugh
Sad -> sad
Wink -> wink
Code:
<script type="text/javascript">
// Change message icon preview
// Do not redistribute this code without the creator's permission
// Created by CrAzY_J and improved by Xargo
var cIcons = [
["smiley", "www.geocities.com/leandoronline/images/smiley.gif"],
["cheesy", "http://www.geocities.com/leandoronline/images/cheesy.gif[/color]"] //The last one doesn't need a comma behind it.
];
if( document.postForm )
{
document.postForm.icon.onchange = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
document.postForm.icon.onkeyup = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
}
</script>[/size]
Cross browser: Internet Explorer, Firefox, Netscape and Opera
Place: Global footer
Description:
I recently found a script made by CrAzY_J similar to this one, but I thought that needed improvement so here is version 1.1.
The code fixes the Proboards bug that when you create/modify a reply or topic the boring standard topic icon still shows up as preview instead of your new costumized flashy one. For example if you change the smiley to a much better one, and you then create a new topic and choose the smiley in the list the boring standard topic icon will still show up instead of the one you chose. This script fixes that.
You can now choose which icons that are costumized and which not. You also don't have to give one certain directory containing all the icons anymore, and all the icons don't have to be in the same directory. Just a seperated URL for every icon you costumized. It will be more clear when you see the script array.
Code explanation:
Purple -> The name of the topic icon. (More explanation below)
URL -> The new url of the topic icon you chose.
Notice you can't write the name of the topic icon that appears in the list, here is the correct list for every topic icon:
Standard -> xx
Thumbs up -> thumbup
Thumbs down -> thumbdown
Exclamation Point -> exclamation
Question Mark -> question
Lamp -> lamp
Smiley -> smiley
Angry -> angry
Cheesy -> cheesy
Laugh -> laugh
Sad -> sad
Wink -> wink
Code:
<script type="text/javascript">
// Change message icon preview
// Do not redistribute this code without the creator's permission
// Created by CrAzY_J and improved by Xargo
var cIcons = [
["smiley", "www.geocities.com/leandoronline/images/smiley.gif"],
["cheesy", "http://www.geocities.com/leandoronline/images/cheesy.gif[/color]"] //The last one doesn't need a comma behind it.
];
if( document.postForm )
{
document.postForm.icon.onchange = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
document.postForm.icon.onkeyup = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
}
</script>[/size]