vForums Support > Programming & Coding :: Code Requests & Support :: > [F] Board Code Mod Merge

[F] Board Code Mod Merge - Posted By dog199200 (dog199200) on 18th Apr 08 at 7:50pm
Can i get these two codes merged together, they dont work seperate

so i need this code:

Code:
 
  1. <script>
  2. /*Seperate Boards By Gradient
  3. Coded By Wrighty
  4. Do Not: Rip, Repost or Claim*/
  5.  
  6. var g = {
  7.     grad: 'http://i25.photobucket.com/albums/c51/dog199200/Deluxeanime/galbule.png',
  8.     r: get('tr','tag'),
  9.     init: function(){
  10.         for(i=0; i<this.r.length; i++){
  11.             if(this.r[i].id.match(/board_(\w)/) && this.r[i].innerHTML.match(/new posts/i) && this.r[i+1].id.match(/board_(\w)/)){
  12.                 var d = document.createElement('tr');
  13.                 var c = document.createElement('td');
  14.                 c.colSpan='3';
  15.                 c.style.cssText = 'height: 10px; background-image: url('+this.grad+');';
  16.                 d.appendChild(c);
  17.                 this.r[i].parentNode.insertBefore(d, this.r[i].nextSibling);
  18.                 i = i+1;
  19.             }
  20.         }
  21.     }
  22. };
  23. g.init();
  24. </script>
 


added into this:

Code:
 
  1. <style>
  2. .boardtotals{
  3.     display: none;
  4. }
  5. </style>
  6. <script>
  7. /*Board Mod
  8. Created By Wrighty*/
  9.  
  10. for(i=0; i<get('td','tag').length; i++){
  11.     if(get('td','tag')[i].innerHTML.match(/New Posts/) && get('td','tag')[i].className== "window1 boardstatus"){
  12.         get('td','tag')[i+1].width = '55%';
  13.         var a = get('td','tag')[i].parentNode.insertCell(3);
  14.         with(a){
  15.             className = 'window1';
  16.             width= '50px';
  17.             align= 'center';
  18.             innerHTML = (get('td','tag')[i+1].innerHTML.match(/\s(\d+)\sPosts/))? RegExp.$1 : '0';
  19.         }
  20.         var b = get('td','tag')[i].parentNode.insertCell(3);
  21.         with(b){
  22.             className = 'window1';
  23.             width= '50px';
  24.             align= 'center';
  25.             innerHTML = (get('td','tag')[i+1].innerHTML.match(/(\d+)\sTopics\s/))? RegExp.$1 : '0';
  26.         }
  27.     }
  28.     if(get('td','tag')[i].colSpan == '3'){
  29.         if(get('td','tag')[i].width == '100%' && get('td','tag')[i].className.match(/title1/)){
  30.             get('td','tag')[i].colSpan = '5';
  31.         }
  32.         if(get('td','tag')[i].className.match(/categorytitle/)){
  33.             get('td','tag')[i].colSpan = '5';
  34.             var r = document.createElement('tr');
  35.             var a = document.createElement('td');
  36.             var b = document.createElement('td');
  37.             var c = document.createElement('td');
  38.             var d = document.createElement('td');
  39.             var e = document.createElement('td');
  40.             a.className = b.className = c.className = d.className = e.className = 'title1'
  41.             a.appendChild(document.createTextNode(' '));
  42.             b.appendChild(document.createTextNode('Forum'));
  43.             c.appendChild(document.createTextNode('Last Post'));
  44.             d.appendChild(document.createTextNode('Topics'));
  45.             e.appendChild(document.createTextNode('Posts'));
  46.             r.appendChild(a);
  47.             r.appendChild(b);
  48.             r.appendChild(c);
  49.             r.appendChild(d);
  50.             r.appendChild(e);
  51.             get('td','tag')[i].parentNode.parentNode.insertBefore(r,get('td','tag')[i].parentNode.nextSibling);
  52.         }
  53.     }
  54. }
  55. </script>
 


and by not working i mean that the Gradient doesn't run under the topic and post cells, also they dont load at the same time so it look really tacky

Re: Board Code Mod Merge - Posted By Michael (wrighty) on 19th Apr 08 at 2:34am
Have you tried swapping their position? (Which is above the other I mean!)

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 19th Apr 08 at 4:53am
there not in the same place, thats why they need to be combined to work.

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 20th Apr 08 at 6:48pm
bump

Re: Board Code Mod Merge - Posted By Marc (cr0w) on 21st Apr 08 at 2:48am
Posted By dog199200 on 19th Apr 08 at 4:53am
 
there not in the same place, thats why they need to be combined to work.


Wrighty is suggesting that you switch their positions as code conflicts are quite often due to placement issues. {Wink}

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 21st Apr 08 at 3:29am
but they cant be, one is in a skins header/footer and the other isn't, also i have tried to put them in the same board and it doesn't work no matter which order they are in

Re: Board Code Mod Merge - Posted By Marc (cr0w) on 21st Apr 08 at 4:09am
Which is in a skin and which isn't? {Smile}

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 21st Apr 08 at 4:13am
the board mod isn't but it can go in either place, but the seperate Boards By Gradient would be skin to have different gradient to match the skins.

Re: Board Code Mod Merge - Posted By Michael (wrighty) on 22nd Apr 08 at 6:22pm
try changing:
c.colSpan='3';
to:
c.colSpan='5';

In the first code! {Smile}

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 22nd Apr 08 at 10:20pm
OK ty that works, but i have a small error with the code could you fix it for me?

http://deluxeanimeforum.virtualforums.co.uk/board/PhoenixEmerald/

for some reason the gradient code is clashing with the categories subboard codes, and its adding bards at the bottom/....

Re: Board Code Mod Merge - Posted By Michael (wrighty) on 23rd Apr 08 at 6:47am
can you post the category code that you're using please? {Cheesy}

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 23rd Apr 08 at 1:36pm
lol, ok

Board Head
Code:
 
  1. <div id="subboards"></div>
 


Board Foot
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Categorized Sub-Boards by Cr0w
  5. Copyright 2008
  6. Do not repost
  7. */
  8. var sp = []; var brds = new Array(); var cts = new Array(); //Do Not Edit This Line
  9.  
  10. // Categories
  11. cts[0] = "Information Boards";
  12. cts[1] = "Guilds";
  13. cts[2] = "Jobs";
  14. cts[3] = "Altheron (Roleplay Boards)";
  15.  
  16. // Board Organization
  17. sp[0] = ["Roleplayinfo2",0];
  18. sp[1] = ["Guilds",1];
  19. sp[2] = ["Jobs",2];
  20. sp[3] = ["PhoenixCave",3];
  21. sp[4] = ["Lunior",3];
  22. sp[5] = ["Shadowforest",3];
  23. sp[6] = ["RycoCity",3];
  24. sp[7] = ["LaconiumCity",3];
  25. sp[8] = ["Zuler",3];
  26. sp[9] = ["Falidor",3];
  27. sp[10] = ["Cirvil",3];
  28. sp[11] = ["Belveon",3];
  29. sp[12] = ["Zenreone",3];
  30. sp[13] = ["ShelbyMountains",3];
  31. sp[14] = ["AlfronCity",3];
  32.  
  33.  
  34. // No More Edits
  35. if(!location.href.match(/topic/)){
  36. var tr = get('tr','tag');
  37. var td = get('td','tag');
  38. var sb = get('subboards','id');
  39. var n = 0;
  40. var nt = "";
  41. var ntree = get('nav_tree','id');
  42.  
  43. for(t=0;t<tr.length;t++){
  44. if(tr[t].id.match(/^board_(.+?)$/i)){
  45. for(i=0;i<sp.length;i++){
  46. if(RegExp.$1==sp[i][0]){
  47. brds[n] = tr[t].cloneNode(true);
  48. n++;
  49. }
  50. }
  51. tr[t].style.display = "none";
  52. }
  53. }
  54. for(s=0;s<td.length;s++){
  55. if(td[s].width=="70%" && td[s].innerHTML.match(/Sub\-Board Name/) && td[s+1].width=="22%"){
  56. td[s].parentNode.parentNode.parentNode.parentNode.style.display = "none";
  57. }
  58. }
  59.  
  60. ntree.style.display = "none";
  61. nt = '<table align="center" width="' + vf_width + '"><tr><td id="nav_tree">' + ntree.innerHTML + '</td></tr></table>';
  62. for(x=0;x<cts.length;x++){
  63. nt += '<table align="center" class="border" cellpadding="2" cellspacing="1" width="' + vf_width + '">';
  64. nt += '<tr><td align="center" class="title1" colspan="5">' + cts[x] + '</td></tr>';
  65. for(q=0;q<brds.length;q++){
  66. if(sp[q][1]==x){
  67. nt += '<tr>' + brds[q].innerHTML + '</tr>';
  68. }
  69. }
  70. nt += '</table><br><br>';
  71. }
  72. sb.innerHTML = nt;
  73. }
  74. //-->
  75. </script>
 



Edit: also i hate to keep asking things, but could you make it so that the sub board category mod will show head/base image please?

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 27th Apr 08 at 6:31pm
bump

Re: Board Code Mod Merge - Posted By Michael (wrighty) on 27th Apr 08 at 6:42pm
try chaning this line:
brds[n] = tr[t].cloneNode(true);
n++
to:
brds[n] = tr[t].cloneNode(true);
brds[n+1] = tr[t+1].cloneNode(true);
n = parseInt(n+2);

That might work! {Smile}

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 27th Apr 08 at 6:48pm
like this?

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Categorized Sub-Boards by Cr0w
  5. Copyright 2008
  6. Do not repost
  7. */
  8. var sp = []; var brds = new Array(); var cts = new Array(); //Do Not Edit This Line
  9.  
  10. // Categories
  11. cts[0] = "Information Boards";
  12. cts[1] = "Guilds";
  13. cts[2] = "Jobs";
  14. cts[3] = "Altheron (Roleplay Boards)";
  15.  
  16. // Board Organization
  17. sp[0] = ["Roleplayinfo2",0];
  18. sp[1] = ["Guilds",1];
  19. sp[2] = ["Jobs",2];
  20. sp[3] = ["PhoenixCave",3];
  21. sp[4] = ["Lunior",3];
  22. sp[5] = ["Shadowforest",3];
  23. sp[6] = ["RycoCity",3];
  24. sp[7] = ["LaconiumCity",3];
  25. sp[8] = ["Zuler",3];
  26. sp[9] = ["Falidor",3];
  27. sp[10] = ["Cirvil",3];
  28. sp[11] = ["Belveon",3];
  29. sp[12] = ["Zenreone",3];
  30. sp[13] = ["ShelbyMountains",3];
  31. sp[14] = ["AlfronCity",3];
  32.  
  33.  
  34. // No More Edits
  35. if(!location.href.match(/topic/)){
  36. var tr = get('tr','tag');
  37. var td = get('td','tag');
  38. var sb = get('subboards','id');
  39. var n = 0;
  40. var nt = "";
  41. var ntree = get('nav_tree','id');
  42.  
  43. for(t=0;t<tr.length;t++){
  44. if(tr[t].id.match(/^board_(.+?)$/i)){
  45. for(i=0;i<sp.length;i++){
  46. if(RegExp.$1==sp[i][0]){
  47. brds[n] = tr[t].cloneNode(true);
  48. brds[n+1] = tr[t+1].cloneNode(true);
  49. n = parseInt(n+2);
  50. }
  51. }
  52. tr[t].style.display = "none";
  53. }
  54. }
  55. for(s=0;s<td.length;s++){
  56. if(td[s].width=="70%" && td[s].innerHTML.match(/Sub\-Board Name/) && td[s+1].width=="22%"){
  57. td[s].parentNode.parentNode.parentNode.parentNode.style.display = "none";
  58. }
  59. }
  60.  
  61. ntree.style.display = "none";
  62. nt = '<table align="center" width="' + vf_width + '"><tr><td id="nav_tree">' + ntree.innerHTML + '</td></tr></table>';
  63. for(x=0;x<cts.length;x++){
  64. nt += '<table align="center" class="border" cellpadding="2" cellspacing="1" width="' + vf_width + '">';
  65. nt += '<tr><td align="center" class="title1" colspan="5">' + cts[x] + '</td></tr>';
  66. for(q=0;q<brds.length;q++){
  67. if(sp[q][1]==x){
  68. nt += '<tr>' + brds[q].innerHTML + '</tr>';
  69. }
  70. }
  71. nt += '</table><br><br>';
  72. }
  73. sb.innerHTML = nt;
  74. }
  75. //-->
  76. </script>
 


if so, the code breaks and doesn't show my boards

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 2nd May 08 at 4:05am
bump

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 6th May 08 at 4:08am
bump

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 7th May 08 at 11:03pm
bump

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 12th May 08 at 2:31am
bump

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 17th May 08 at 2:12am
bump

Re: Board Code Mod Merge - Posted By Michael (wrighty) on 18th May 08 at 3:34pm
try this:

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Categorized Sub-Boards by Cr0w
  5. Copyright 2008
  6. Do not repost
  7. */
  8. var sp = []; var brds = new Array(); var cts = new Array(); //Do Not Edit This Line
  9.  
  10. // Categories
  11. cts[0] = "Information Boards";
  12. cts[1] = "Guilds";
  13. cts[2] = "Jobs";
  14. cts[3] = "Altheron (Roleplay Boards)";
  15.  
  16. // Board Organization
  17. sp[0] = ["Roleplayinfo2",0];
  18. sp[1] = ["Guilds",1];
  19. sp[2] = ["Jobs",2];
  20. sp[3] = ["PhoenixCave",3];
  21. sp[4] = ["Lunior",3];
  22. sp[5] = ["Shadowforest",3];
  23. sp[6] = ["RycoCity",3];
  24. sp[7] = ["LaconiumCity",3];
  25. sp[8] = ["Zuler",3];
  26. sp[9] = ["Falidor",3];
  27. sp[10] = ["Cirvil",3];
  28. sp[11] = ["Belveon",3];
  29. sp[12] = ["Zenreone",3];
  30. sp[13] = ["ShelbyMountains",3];
  31. sp[14] = ["AlfronCity",3];
  32.  
  33.  
  34.  
  35. // No More Edits
  36. if(!location.href.match(/topic/)){
  37. var tr = get('tr','tag');
  38. var td = get('td','tag');
  39. var sb = get('subboards','id');
  40. var n = 0;
  41. var nt = "";
  42. var ntree = get('nav_tree','id');
  43.  
  44. for(t=0;t<tr.length;t++){
  45. if(tr[t].id.match(/^board_(.+?)$/i)){
  46. for(i=0;i<sp.length;i++){
  47. if(RegExp.$1==sp[i][0]){
  48. brds[n] = tr[t].cloneNode(true);
  49. n++;
  50. }
  51. }
  52. tr[t].style.display = "none";
  53. }
  54. }
  55. for(s=0;s<td.length;s++){
  56. if(td[s].width=="70%" && td[s].innerHTML.match(/Sub\-Board Name/) && td[s+1].width=="22%"){
  57. td[s].parentNode.parentNode.parentNode.parentNode.style.display = "none";
  58. }
  59. }
  60.  
  61. ntree.style.display = "none";
  62. nt = '<table align="center" width="' + vf_width + '"><tr><td id="nav_tree">' + ntree.innerHTML + '</td></tr></table>';
  63. for(x=0;x<cts.length;x++){
  64. nt += '<table align="center" class="border" cellpadding="2" cellspacing="1" width="' + vf_width + '">';
  65. nt += '<tr><td align="center" class="title1" colspan="5">' + cts[x] + '</td></tr>';
  66. var num = 0;
  67. for(q=0;q<brds.length;q++){
  68. if(sp[q][1]==x){
  69. if(num >0){
  70. nt += '<tr><td colspan = "5" style="height: 10px; background-image: url(http://i25.photobucket.com/albums/c51/dog199200/Deluxeanime/galbule.png);"></td></tr>';
  71. }
  72. nt += '<tr>' + brds[q].innerHTML + '</tr>';
  73. num++
  74. }}
  75. nt += '</table><br><br>';
  76. }
  77. sb.innerHTML = nt;
  78. }
  79. //-->
  80. </script>
 


Replace the 2nd part of Marc's script with that! {Smile} (that's the footer part)

Re: Board Code Mod Merge - Posted By dog199200 (dog199200) on 18th May 08 at 4:49pm
ty, over all thsi request is done {Smile}