vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Board Code Mod Merge - View Topic (Page 1 of 2)Page: 1 2
Topic Rating: *****
Printable View
dog199200
Guest
[F] Board Code Mod Merge (18th Apr 08 at 7:50pm UTC)
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
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Board Code Mod Merge (19th Apr 08 at 2:34am UTC)
Have you tried swapping their position? (Which is above the other I mean!)
dog199200
Guest
Re: Board Code Mod Merge (19th Apr 08 at 4:53am UTC)
there not in the same place, thats why they need to be combined to work.
dog199200
Guest
Re: Board Code Mod Merge (20th Apr 08 at 6:48pm UTC)
bump
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Board Code Mod Merge (21st Apr 08 at 2:48am UTC)
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}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Board Code Mod Merge (21st Apr 08 at 3:29am UTC)
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
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Board Code Mod Merge (21st Apr 08 at 4:09am UTC)
Which is in a skin and which isn't? {Smile}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Board Code Mod Merge (21st Apr 08 at 4:13am UTC)
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.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Board Code Mod Merge (22nd Apr 08 at 6:22pm UTC)
try changing:
c.colSpan='3';
to:
c.colSpan='5';

In the first code! {Smile}
dog199200
Guest
Re: Board Code Mod Merge (22nd Apr 08 at 10:20pm UTC)
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/....
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Board Code Mod Merge (23rd Apr 08 at 6:47am UTC)
can you post the category code that you're using please? {Cheesy}
dog199200
Guest
Re: Board Code Mod Merge (23rd Apr 08 at 1:36pm UTC)
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?
dog199200
Guest
Re: Board Code Mod Merge (27th Apr 08 at 6:31pm UTC)
bump
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Board Code Mod Merge (27th Apr 08 at 6:42pm UTC)
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}
dog199200
Guest
Re: Board Code Mod Merge (27th Apr 08 at 6:48pm UTC)
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
 Printable View
Page: 1 2

All times are GMT+0 :: The current time is 12:17am
Page generated in 1.4207 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums