Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing variables from different sections..?

Status
Not open for further replies.

WyrdRain

Technical User
Apr 18, 2008
2
US
Okay, I know this isn't a typical request, but I've all but given up on getting any support from my host's support sites.

Does anyone know anything about invisionfree forums? I recently installed a style switcher which uses a javascript file to change images such as the new topic/reply/etc buttons, forum markers, banner, etc. So I know how to make a variable and display an image for it. But how do I make the image appear in the right spot? All the images of IF forums are defined on another page.

So as far as I know, I have two (technically three) options.

1) I need to figure out how to make the script (or whatever I have to use) in the images section recognize the variables defined in the board wrappers.

2) Alternatively, I need to figure out how to make the script in the images section identify a variable with something defined in the CSS, as I've found out I could set a variable there, but can't seem to display it properly..

3) This option doesn't use JavaScript, and is really rather primative, but would work all the same. I can use Divs or tables to draw the css variable, but either option results in a vertical alignment. o.o' Everyone who looks at the reply/new topic/poll buttons thinks it's kind of cool, but it doesn't work AT ALL for edit/quote/delete etc, which are meant to be in a very thin line not much bigger than the font of a username. > <' If anyone reads this who doesn't know how to do either of the javascript things I asked about, but knows how to horizontally align tables and/or divs, it would be equally appreciated.

Please, I really need help..
 
Can you clarify what you mean by "variable"? I've re-read this post several times now, and it just makes no sense to me with the traditional JS meaning of the word "variable". Or, perhaps you can clarify generally what you wish to do.

If you simply want a CSS switcher, you don't need to code JS to replace images, etc - you can use a different CSS and enable / disable it.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Yes, I mean the typical meaning of the term. Let me show you the basic code I'm using. Also, please note, this is not a website, but a forum.

<script type="text/javascript">
// Customizable Skin Chooser by darkturkey (dark.xmgfree.com) copyright 2005
// Initial skins are for example, and have individual copyrights listed within them
//
// add skins in the appropriate area as: addSkin('name','url','header-optional','footer-optional','code url-optional');
// i.e. addSkin('Invision Blue','// NOTE1: dont use the character '&' or '?' for names
// NOTE2: when using the character ' in a name enter \'

var nSN=0; var skinUrl = new Array(); var skinName = new Array();
var skinHeader = new Array(); var skinFooter = new Array(); var buttonCode = new Array();

function addSkin(sName,sUrl,sHeader,sFooter,sCode) {
skinUrl[nSN] = sUrl; skinName[nSN] = sName;
if (sHeader==null) skinHeader[nSN] = ''; else skinHeader[nSN] = sHeader;
if (sFooter==null) skinFooter[nSN] = ''; else skinFooter[nSN] = sFooter;
if (sCode==null) buttonCode[nSN] = ''; else buttonCode[nSN] = sCode;
nSN++;
}

addSkin('Select a Skin','');
addSkin('Default Forum Skin','');
addSkin('Blue iLLusion', ' '<center>Blue ILLusion Skin converted to InvisionFree by <b>Locke</b> of the <a href=" Skin Zone</b></a> with permission from <b>Scyth</b> of <a href=" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" alink="#000000" vlink="#000000"><table align="center" width="85%" cellpadding="8" cellspacing="0" class="border"><tr><td>', '</td></tr></table>', 'addSkin('BoHeGaHa', '
function goSkin(change) {
var path = location.pathname;
var domain = path.substring(0,path.lastIndexOf('/')) +'/';
var expire = new Date ();
expire.setTime(expire.getTime() + (180 * 24 * 3600 * 1000));
document.cookie = "mySkin" + "=" + escape(change) + ";expires=" + expire.toGMTString() + "; path=" + domain;
}

function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}

var chosenSkin = getCookie('mySkin');
if (getCookie('mySkin')==null) chosenSkin='Default Forum Skin';
var skinForm = '<form method="POST"><select class="forminput" onChange="goSkin(this.options[this.selectedIndex].text); location=document.URL;">';
var skinTop ='';
var skinBottom ='';
for (i=0; i<nSN; i++) {
if (chosenSkin==skinName) {
document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="'+skinUrl+'">');
skinTop = skinHeader;
skinBottom = skinFooter;
skinForm += '<option selected>'+skinName+'</option>';
if (buttonCode!='') document.write('<script type="text/javascript" src="'+buttonCode+'"><\/script>');
}
else
skinForm += '<option>'+skinName+'</option>';
}
skinForm = skinForm + '</select></form>';
document.write(skinTop);
</script>


What exactly I'm trying to do is change the forum markers, buttons, and possibly banner for the skins used on my forum, which you may find here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top