Bones
Code Helper
Posts: 131
Bones said 0 great things
|
Post by Bones on Jul 6, 2011 21:55:48 GMT -8
Browsers Tested: Firefox 3.6, Internet Explorer 9 This code allows you to redirect a board's link to any desired link. Place in MAIN FOOTER or GLOBAL FOOTER (if you wish to affect sub-boards as well) <script> (function(boards){ //Board Redirector (Main Footer or Global footer to also affect sub-boards) if(boards && /^(home|boardindex)$/.test(pb_action)){ var tBL = document.getElementsByTagName('table'),a,b,c,d,e,r1 for(a=0;a<tBL.length;a++){ if(tBL[a].width=="100%" && tBL[a].offsetParent && tBL[a].offsetParent.offsetParent.className=="bordercolor") for(b=tBL[a].rows,c=1;c<b.length;c++){ if(b[c].cells[1] && b[c].cells[1].onclick && /\!pb_bubble/.test(b[c].cells[1].onclick.toString())){ d = b[c].cells[1].getElementsByTagName('a')[0]; if(/board=(\w+)/.test(d.href) && (RegExp.$1 in boards)){ r1 = RegExp.$1; if(boards[r1][1])d.innerHTML = '<b>'+boards[r1][1]+'</b>'; d.href = boards[r1][0]; if(boards[r1][2]!=true){d.target = "_blank"; d.style.cssText = 'padding-right:13px; background:url("data:image/png;base64,' +'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSB' +'JbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9' +'kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFA' +'AAAAElFTkSuQmCC") no-repeat scroll right center transparent;' d.onclick = function(evt){evt=evt||window.event; evt.cancelBubble = true; if(evt.stopPropagation)evt.stopPropagation();} b[c].cells[1].onclick = function(){window.open(this.getElementsByTagName('a')[0].href);} }else { b[c].cells[1].onclick = function(){if(!pb_bubble)location.href = this.getElementsByTagName('a')[0].href;} } b[c].cells[1].onmouseover = function(){var ac=arguments.callee; window[ac.bHilite](this); setWindowStatus(ac.bTitle);} b[c].cells[1].onmouseover.bTitle = (d.innerText||d.textContent); b[c].cells[1].onmouseover.bHilite = "mouseOverHighlightCell" + (pb_action=="boardindex"?"B":""); if(boards[r1][3]==true) b[c].cells[2].lastChild.innerHTML = b[c].cells[3].lastChild.innerHTML = b[c].cells[4].lastChild.innerHTML = ""; } } } } } })({ //programming: ['http://godricshollow.info/', '(OPTIONAL:string)new board title',(OPTIONAL: boolean)open in same window, (OPTIONAL: boolean)clear post/topics/lastPost] }) </script> Line Syntax: board_id: ['new url', '(OPTIONAL:string)new board title', (OPTIONAL: boolean)open in same window, (OPTIONAL: boolean)clear post/topics/lastPost]
- board_id:
The ID of the board you want to change
- new url
the url of the site that will open when the board is clicked.
- '(OPTIONAL:string)new board title'
Text to use for new name of board, should be enclosed in double or single quotes
- (OPTIONAL: boolean)open in same window
Specify whether link is to open in same window or new window [true or false]. If omitted the default is new window
- (OPTIONAL: boolean)clear post/topics/lastPost
Empties out the contents of the post, thread and last post columns for that board [true or false]. If omitted then contents for those columns are left untouched.
OPTIONAL means you can leave it out of the line and the default action will be used instead. Each one should be separated by commas. If you wish to skip an optional to get to another optional then make sure to add a comma for each skipped optional. |
add a line for each board you wish to redirect (example): database1: ['http://support.proboards.com/?board=database',,true,false] ,database2: ['http://wormocodes.proboards.com/?board=codedb', 'WormoCodes',true] ,database3: ['http://socal.proboards.com/index.cgi?board=PBCODES', 'Socal',false,true]each added line after the first should START with a comma NOTE: this line in the code //programming: ['http://godricshollow.info/', '(OPTIONAL:string)new board title',(OPTIONAL: boolean)open in same window, (OPTIONAL: boolean)clear post/topics/lastPost] is commented out and is there only to serve as a guide on what is required in each position when constructing your own line, it should not be counted as a line so don't count it as the first line. Edit:
- Apr 17, 2012 - clarification on using the "guide line" comment within the code to construct your own line. This is basically for people who elect to skip reading the pretty colored text and go commando...
|
|
|
Post by Wormopolis on Jul 7, 2011 7:27:27 GMT -8
whats up with
background:url("data:image/png;base64,' +'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSB' +'JbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9' +'kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFA' +'AAAAElFTkSuQmCC")
?
|
|
Bones
Code Helper
Posts: 131
Bones said 0 great things
|
Post by Bones on Jul 7, 2011 14:33:00 GMT -8
whats up with background:url("data:image/png;base64,' +'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSB' +'JbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9' +'kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFA' +'AAAAElFTkSuQmCC") ? Data URI supplying an inline image indicating whether link opens in new window rather than same window (slightly different than how it is commonly used on the internet where it instead indicates whether link leads to an external site rather than another page on same site) Supported by all browser except of course IE7 and below (IE8 supports it only for images, IE9 catches up with other browsers) *updated code with additional parameters
|
|
|
Post by Wormopolis on Jul 7, 2011 17:50:47 GMT -8
ah.. and since I tested it on IE7 that explains it...
|
|
Bones
Code Helper
Posts: 131
Bones said 0 great things
|
Post by Bones on Jul 8, 2011 16:52:51 GMT -8
ah.. and since I tested it on IE7 that explains it... Code should still work on IE7, you just won't see the image other browsers see, it's merely cosmetic anyway Edit: Are you getting an error in IE7?
|
|
|
Post by Wormopolis on Jul 8, 2011 17:14:15 GMT -8
no error that I saw. I looked for the image after you mentioned it and didnt see it. my work laptop still runs IE7.
|
|
Bones
Code Helper
Posts: 131
Bones said 0 great things
|
Post by Bones on Jul 9, 2011 2:18:57 GMT -8
There are addons that add data URI support to IE6 and IE7 such as the Reify Toolbar which is a version of Greasemonkey for IE browsers.
|
|