vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Code Index v2 Help - View Topic
Topic Rating: *****
Printable View
This topic was locked 30th Mar 08 at 9:10pm by Marc
LEG7930
Junior Member
**

[Avatar]
RPG Forum Coming Soon!

Posts: 51
Status: Offline
Gender: Female
Location: USA
Age: 33
Joined:  
Reputation: 0%  


pmwwwmsnyahooaim
[F] Code Index v2 Help (30th Mar 08 at 8:58pm UTC)
Names are Reversing
This Code

Brief Discription of what I am Doing: I am using this as a resource database (if Marc has any objections to this, I will remove it imediately). So I changed All Coders (#4 in Other) to All Contributers. So basically when it says Codes it is Tutorials, and Coders to Contributers.

Problem: When I go to All Contributers (All Coders) it shows 2 names (Because that is all there are so far). Then I click on Name #1 so view their Coder Profile (Contributer Profile). When I go there it shows all the Tutorial (codes) the other person submitted. And when I go to Name #2 it shows the tutorials Name #1 submitted. On all the other pages it is fine, and has them correct.

Here are some Images:
http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/Correct1.gif
http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/correct2.gif
http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/correct3.gif
http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/correct4.gif
http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/correct5.gif
http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/correct6.gif
-- http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/Incorrect1.gif
-- http://i224.photobucket.com/albums/dd223/nfl_board_talk_leg/Incorrect2.gif

Code:
Code:
 
  1. <div id="code_database"></div>
 

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Code Index v2 by Cr0w
  5. Copyright 2008
  6. Do not repost
  7. */
  8.  
  9. //Last Update
  10. var lastup = "Sunday March 30th, 2008 1:24PM"; // Most recent update
  11.  
  12. //Database Options
  13. var dbshow = 1; // 0 = Show index in board, 1 = Show index in thread
  14. var dbthread = 33; // The thread where your index will be [if dbshow = 1]
  15. var dbforum = "Tutorials"; // The board id where your index is in
  16. var dbwin = 0; // 0 = Open codes on same page, 1 = Open in new window
  17.  
  18. //Sections
  19. var sections = [];
  20. sections[0]=["Signature Tutorials","sig"];
  21. sections[1]=["Other Tutorials","other"];
  22.  
  23. //Creators
  24. var creators = [];
  25. creators[0] = ["Talkir","admin"]; // ID = 0
  26. creators[1] = ["Lauren","leg7930"]; // ID = 1
  27.  
  28. //Codes
  29. var codes = []; var _cd = 0;
  30. codes[_cd++] = ["Gunman Tutorial","11","0","sig"];
  31. codes[_cd++] = ["Sprite Tag Tutorial","12","0","sig"];
  32. codes[_cd++] = ["Kakashi Tutorial","13","0","sig"];
  33. codes[_cd++] = ["Sprite Girl Tutorial","14","0","sig"];
  34. codes[_cd++] = ["Smilie Tutorial","15","0","other"];
  35. codes[_cd++] = ["C4d Splash Tutorial ","16","0","sig"];
  36. codes[_cd++] = ["Clipping Mask Tutorial","17","0","other"];
  37. codes[_cd++] = ["Shh Tutorial","18","0","sig"];
  38. codes[_cd++] = ["[CS-SLD] Brushes Tutorial","30","0","other"];
  39. codes[_cd++] = ["Dane Cook Sig Tutorial","31","1","sig"];
  40. codes[_cd++] = ["Rendering Tutorial","32","1","other"];
  41.  
  42.  
  43. //Do not edit below
  44.  
  45. function showdb(){
  46. var td=document.getElementsByTagName("td");
  47. if(dbshow==1){
  48. for(t=6;t<td.length;t++){
  49. td[t].style.display="none";
  50. }
  51. }
  52.  
  53. document.getElementById('code_database').innerHTML='<table cellspacing="1" cellpadding="4" class="border" width="'+vf_width+'" align="center" id="codedb"><tr><td class="title1" colspan="2" align="center">Tutorial Database</td></tr><tr><td class="title2" width="20%" align="center">Navigation</td><td class="title2" width="80%" align="center">Main</td></tr><tr><td class="window1" width="20%" valign="top"><div id="navhere"></div><div id="searchit"></div></td><td class="window1" width="80%" valign="top"><div id="dbmain"></div></td></tr></table><br />';
  54. var nav=document.getElementById("navhere");
  55. var main=document.getElementById("dbmain");
  56. var search=document.getElementById("searchit");
  57. /* Categories */
  58. nav.innerHTML="";
  59. nav.innerHTML+="<b>Categories</b><br />";
  60. for(l=0;l<sections.length;l++){
  61. var catnum=l+1;
  62. nav.innerHTML+=catnum+". <a href='javascript:void(0)' onclick=\"catchange('"+sections[l][1]+"')\">"+sections[l][0]+"</a><br />";
  63. }
  64. nav.innerHTML+="<br />";
  65. nav.innerHTML+="<b>Other</b><br />";
  66. nav.innerHTML+="1. <a href='javascript:void(0)' onclick='location.reload()'>Recent Tutorials</a><br />";
  67. nav.innerHTML+="2. <a href='javascript:void(0)' onclick='showfulldb()'>All Tutorials</a><br />";
  68. nav.innerHTML+="3. <a href='javascript:void(0)' onclick='showcreators()'>All Contributers</a><br />";
  69. nav.innerHTML+="4. <a href='javascript:void(0)' onclick='aboutdb()'>About</a><br /><br />";
  70.  
  71. /* Main DB Page */
  72. main.innerHTML="";
  73. main.innerHTML+="<u><b>Database Info</b></u>";
  74. main.innerHTML+="<br />";
  75. main.innerHTML+="<b>Total Tutorials:</b> <a href='javascript:void(0)' onclick='showfulldb()'>"+codes.length+"</a><br />";
  76. main.innerHTML+="<b>Total Contributers:</b> <a href='javascript:void(0)' onclick='showcreators()'>"+creators.length+"</a><br />";
  77. main.innerHTML+="<b>Last Updated:</b> "+lastup+"<br /><br />";
  78. main.innerHTML+="<b><u>Last 5 Tutorials</u></b><br /><br />";
  79. var FiveNew="";
  80. var num=1;
  81. for(t=codes.length-1;t>codes.length-6;t--){
  82. FiveNew+=num+". <a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[t][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+codes[t][0]+"</a> by <a href = '/action/view_profile/user/"+creators[codes[t][2]][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+creators[codes[t][2]][0]+"</a><br />";
  83. num=num+1;
  84. }
  85. main.innerHTML+=FiveNew;
  86.  
  87. /* Search DB */
  88. search.innerHTML="";
  89. search.innerHTML+="<b>Search:</b><br />";
  90. search.innerHTML+="<input type='text' id='lookfor' style='width: 60%' /> ";
  91. search.innerHTML+="<input type='submit' onclick='searchdb()' value='Go' />";
  92. }
  93.  
  94. function searchdb(){
  95. codes.sort();
  96. sections.sort();
  97. var main=document.getElementById("dbmain");
  98. var searchthis=document.getElementById('lookfor');
  99. main.innerHTML="<b><u>Search Results</u></b><br /><br />";
  100. for(i=0;i<codes.length;i++){
  101. if(codes[i][0].match(new RegExp(searchthis.value, 'gi'))){
  102. main.innerHTML+="<b>-</b> <a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[i][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+codes[i][0]+"</a> by <a href = '/action/view_profile/user/"+creators[codes[i][2]][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+creators[codes[i][2]][0]+"</a><br />";
  103. }
  104. }
  105. }
  106. function catchange(tothis){
  107. codes.sort();
  108. sections.sort();
  109. var main=document.getElementById("dbmain");
  110. main.innerHTML="";
  111. var num=1;
  112. for(q=0;q<codes.length;q++){
  113. if(codes[q][3]==tothis){
  114. main.innerHTML+=num+". <a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[q][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+codes[q][0]+"</a> by <a href = '/action/view_profile/user/"+creators[codes[q][2]][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+creators[codes[q][2]][0]+"</a><br />";
  115. num=num+1;
  116. }
  117. }
  118. }
  119. function aboutdb(){
  120. codes.sort();
  121. sections.sort();
  122. var main=document.getElementById("dbmain");
  123. main.innerHTML="";
  124. main.innerHTML+="<b><u><font size='+1'>";
  125. main.innerHTML+="This code database is coded by Cr0w. It is available for use by any forum, as long as it is not reposted without written permission from its creator.<br /><br />If you encounter any errors with this code, or find anyone who has reposted/ripped this code, please email Cr0w at <a href='mailto:admin@cr0wonline.com'>admin@cr0wonline.com</a>. Thank you.";
  126. main.innerHTML+="</font></u></b>";
  127. }
  128. function showfulldb(){
  129. codes.sort();
  130. sections.sort();
  131. var main=document.getElementById("dbmain");
  132. main.innerHTML="";
  133. for(t=0;t<codes.length;t++){
  134. var t2=t+1;
  135. main.innerHTML+=t2+". <a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[t][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+codes[t][0]+"</a> by <a href = '/action/view_profile/user/"+creators[codes[t][2]][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+creators[codes[t][2]][0]+"</a><br />";
  136. }
  137. }
  138. function showcreators(){
  139. creators.sort();
  140. var main=document.getElementById("dbmain");
  141. main.innerHTML="";
  142. for(t=0;t<creators.length;t++){
  143. main.innerHTML+="<a href = 'javascript: void();' onclick='showcodes("+t+")'>"+creators[t][0]+"</a><br />";
  144. }
  145. }
  146. function showcodes(cdr){
  147. codes.sort();
  148. var main=document.getElementById("dbmain");
  149. main.innerHTML="<b>Contributer Profile: </b><a href = '/action/view_profile/user/"+creators[cdr][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+creators[cdr][0]+"</a><br /><br />";
  150. for(t=0;t<codes.length;t++){
  151. if(codes[t][2]==cdr){
  152. main.innerHTML+="<a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[t][1]+"/'"+((dbwin==1) ? " target='_blank'" : '')+">"+codes[t][0]+"</a><br />";
  153. }
  154. }
  155. }
  156. if(dbshow==1 && location.href.match("topic/"+dbthread) || dbshow==0 && !location.href.match("topic/")){
  157. showdb();
  158. }
  159. //-->
  160. </script>
 


So I hope you understand this, sorry it is confusing me even lol.


Image
.L.E.G.7.9.3.0.
Talkir
Junior Member
**

[Avatar]

Posts: 41
Status: Offline
Gender: Male
Age: 33
Joined:  
Reputation: 0%  


pm
Re: Code Index v2 Help (30th Mar 08 at 9:02pm UTC)
I reordered the people and numbers and fixed it.

Go me! {Tongue Out}

Image


Gifts:
LEG Firestorm
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: Code Index v2 Help (30th Mar 08 at 9:05pm UTC)
Could I get a link to where you're using this code, please?

rroll.to— Shorten a link, rickroll your friends.
Talkir
Junior Member
**

[Avatar]

Posts: 41
Status: Offline
Gender: Male
Age: 33
Joined:  
Reputation: 0%  


pm
Re: Code Index v2 Help (30th Mar 08 at 9:09pm UTC)
www.taresources.vforums.co.uk

Image


Gifts:
LEG Firestorm
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Code Index v2 Help (30th Mar 08 at 9:09pm UTC)
Can you tell us which board? {Tongue Out}
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: Code Index v2 Help (30th Mar 08 at 9:10pm UTC)
Well, I'm glad to hear it's working now. {Smile}

rroll.to— Shorten a link, rickroll your friends.
 Printable View

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