vForums Support > Programming & Coding :: Code Requests & Support :: > Simple Guild List code

Simple Guild List code - Posted By Aiken (ionfortuna) on 24th Feb 10 at 4:57pm
Code:
 
  1. <script>
  2.  
  3. function GuildListing(Page){
  4.  
  5. GuildPages = Math.ceil((GuildList.length + 1)/10);
  6.  
  7. var GuildStart = (GuildPage * 10) - 10
  8. var GuildEnd = GuildStart + 10
  9.  
  10. var Guildpost = '<table class="border" width="100%">\n<tr height="20">\n<td class="title1" colspan="2">Guild List - Page ' + Page + '</td>\n</tr>\n';
  11.  
  12. for(i=GuildStart;i<=GuildEnd;i++){
  13.  
  14. if(i%2 == 0){
  15.  
  16. GuildPost += '<tr height="30">\n';
  17.  
  18. }
  19.  
  20. if(GuildList[i]){
  21.  
  22. GuildPost += '<td class="window1" width="50%">' + GuildList[i][0] + '</td>\n';
  23.  
  24. } else {
  25.  
  26. GuildPost += '<td class="window2" width="50%"> </td>\n';
  27.  
  28. }
  29.  
  30. if(i%2 == 1){
  31.  
  32. GuildPost += '</tr>\n';
  33.  
  34. }
  35.  
  36. }
  37.  
  38. GuildPost += '<tr height="20">\n<td class="title2" colspan="2">Close Window</td>\n</tr>\n</table>\n';
  39.  
  40. return GuildPost;
  41.  
  42. }
  43.  
  44. </script>
  45.  
 


There is a variable called GuildList which is a multidimensional array

Re: Simple Guild List code - Posted By Michael (wrighty) on 27th Feb 10 at 7:57am
Is it not working or something? You've simply posted a code and not stated what you want us to do! {Unsure}

Re: Simple Guild List code - Posted By Aiken (ionfortuna) on 27th Feb 10 at 10:00am
I used document.write(GuildListing(1)); but nothing shows up

Re: Simple Guild List code - Posted By Michael (wrighty) on 27th Feb 10 at 10:21am
Just from reading it ...

GuildList - Not defined anywhere


That's all I can see that would be the problem! {Smile}

Re: Simple Guild List code - Posted By Aiken (ionfortuna) on 27th Feb 10 at 10:41am
It is defined, I just didn't post it

Re: Simple Guild List code - Posted By Michael (wrighty) on 27th Feb 10 at 11:10am
Have you got somewhere where this whole code is in use?