|
Post by Wormopolis on Nov 13, 2011 18:35:33 GMT -8
"those" as in the buttons on my reply page
|
|
|
Post by Dragon on Nov 15, 2011 16:45:09 GMT -8
I'm confused Wormo... I need a code to put the ubbc button up so I can paste in the link and be done with it.
So Im confused by your last two posts because I dont see the code to do it.
|
|
|
Post by Dragon on Nov 15, 2011 22:56:22 GMT -8
|
|
|
Post by Wormopolis on Nov 16, 2011 10:06:21 GMT -8
hit reply instead of using quick reply and you will see what Im talking about
$h*!_my_dad_says this become a broken link because of the asterisk. its a broken link even without the code running.
|
|
|
Post by Dragon on Nov 16, 2011 20:43:59 GMT -8
Ah, I see now. Can I please get that ?
Kind of sucks since I cant fix that problem
|
|
|
Post by Wormopolis on Nov 16, 2011 21:09:16 GMT -8
you cant use certain symbols in URLs. thats just how browsers are.
change that word back.
|
|
|
Post by Wormopolis on Nov 16, 2011 21:26:22 GMT -8
<script type="text/javascript"> <!-- // convert certain links to images in posts // predefined image links in UBBC table // request by dragon // code by Wormopolis
// this array is for converting linksinto preset images var imageChangeArray=[ // [url - link must match entire string, url to image] ['www.youtube.com','http://www2.mssociety.org.uk/images/youtube_logo_small.jpg'], ['www.google.com','http://www.score.org/sites/default/files/Google_small2.png'], ['www.proboards.com','http://images.proboards.com/hotlink/proboards_orange_36x36.png'] //no comma last entry ];
// this array is for UBBC images in tray for posting links var ubbcImageButtonArray=[ // [url to button image, url to post image (doesnt have to be same), hovertitle] ['http://www2.mssociety.org.uk/images/youtube_logo_small.jpg','http://www2.mssociety.org.uk/images/youtube_logo_small.jpg', 'Youtube'], ['http://www.score.org/sites/default/files/Google_small2.png','http://www.score.org/sites/default/files/Google_small2.png', 'Google'], ['http://images.proboards.com/hotlink/proboards_orange_36x36.png','http://images.proboards.com/hotlink/proboards_orange_36x36.png', 'ProBoards'] //no comma last entry ]; var ubbcBtnHeight=36; var ubbcBtnWidth=36;
if (document.postForm) { var trayTable=document.postForm.color.parentNode; trayTable.appendChild(document.createElement('br')); for (ub=0; ub<ubbcImageButtonArray.length; ub++) { var nwbtn=document.createElement('a'); nwbtn.href='javascript: add("[url=","][img]'+ubbcImageButtonArray[ub][1]+ '[/img][/url]");'; nwimg=document.createElement('img'); nwimg.border=0; nwimg.src=ubbcImageButtonArray[ub][0]; nwimg.title=ubbcImageButtonArray[ub][2]; nwimg.height=ubbcBtnHeight; nwimg.width=ubbcBtnWidth; nwbtn.appendChild(nwimg); trayTable.appendChild(nwbtn); } } for (ic=0; ic<imageChangeArray.length; ic++) imageChangeArray[ic][0]=new RegExp(imageChangeArray[ic][0],'i'); for (td=document.getElementsByTagName('td'), tt=0; tt<td.length; tt++) { if (td[tt].width=='80%' && td[tt].className.match(/windowbg/) && td[tt].getElementsByTagName('hr')[0]) { var postSpot=td[tt].getElementsByTagName('hr')[0].nextSibling; for (lnks=postSpot.getElementsByTagName('a'), ll=0; ll<lnks.length; ll++) { for (ic=0; ic<imageChangeArray.length; ic++) { if (lnks[ll].href.match(imageChangeArray[ic][0])) { lnks[ll].innerHTML='<img border="0" src="' + imageChangeArray[ic][1] + '">'; break; } } } } }
// --> </script>
|
|
|
Post by Wormopolis on Nov 21, 2011 0:38:46 GMT -8
did it work?
|
|
|
Post by Dragon on Nov 22, 2011 18:16:20 GMT -8
Well that sorta means that certain links cant be put in then, cant remove the symbol without making the link useless.
The code seems to work ok, havent seen any problems yet that I know of though the posting UBBC button you see under reply seems crunched? That might simply be a loading issue because Ive seen it do that before, but yeah.
Thanks for the coding.
|
|
|
Post by Wormopolis on Nov 22, 2011 20:11:50 GMT -8
when special characters are used in a URL they have to be encoded. that is why you see things like %20 in them
|
|