vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: (Please MArc) Arcade Code Help - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
(Please MArc) Arcade Code Help (16th Oct 08 at 10:56pm UTC)
OK I have been given permission to convert this arcade code to a vforums style as long as I am the one to host it, and thats call ok and stuff, but I have come across a problem. I have been working on converting ti almost all day and I think I have it almost finished, but I can't seen to figure out why it won't work. Can someone please tell me why it wont work and show me how to fix it?

Code:
 
  1. if (typeof(quickCreateElement) == "undefined")
  2. {
  3. function quickCreateElement(name, attr)
  4. {
  5. temp = document.createElement(name);
  6. if (attr !== "")
  7. {
  8. attr = attr.split(", ");
  9. for (var qce = 0; qce < attr.length; qce++)
  10. {
  11. attr[qce] = attr[qce].split('=');
  12. attr[qce] = new Array(attr[qce].shift(), attr[qce].join('='));
  13. if (attr[qce][0] == "innerHTML")
  14. temp.innerHTML = attr[qce][1];
  15. else
  16. {
  17. temp.setAttribute(attr[qce][0], attr[qce][1]);
  18. if (attr[qce][0] == "class")
  19. temp.setAttribute("className", attr[qce][1]);
  20. }
  21. }
  22. }
  23. return temp;
  24. }
  25. }
  26. var arcadeLink = quickCreateElement("a", "href=/action/arcade"),
  27. arcadePage = ((temp = location.href.match(/[\\/]page/(\d+)/)) ? Number(temp[1]) : 1),
  28. arcadeTitle = ((temp = decodeURI(location.href).match(/[\\/]title=([\w\':!\-\s]+)/)) ? temp[1] : "Arcade"),
  29. menu = document.getElementsByTagName("font")[3],
  30. offset = ((vf_username == "Guest") ? 2 : 3);
  31. var menuItems = menu.getElementsByTagName("a");
  32. arcadeLink.appendChild(quickCreateElement("img", "alt=[Arcade], border=0, src=http://proboards.gamingmedley.com/images/arcade.gif"));
  33. menu.insertBefore(arcadeLink, menuItems[menuItems.length - offset]);
  34. menu.insertBefore(document.createTextNode(" "), menuItems[menuItems.length - offset]);
  35. if (location.href.match("action/arcade"))
  36. {
  37. arcade = function(totalGames)
  38. {
  39. var gamesTBody = document.getElementById("arcadeGames").getElementsByTagName("tbody")[0];
  40. for (var a = 0; a < arcadeGames.length; a++)
  41. {
  42. if (a % 5 == 0)
  43. var arcadeTr = document.createElement("tr");
  44. arcadeGame = quickCreateElement("td", "align=center, class=window2, width=20%");
  45. arcadeGame.innerHTML = "<a href=\"/action/arcade&game/" + arcadeGames[a][1] + "&title/" + encodeURIComponent(arcadeGames[a][0]) + "\"><img alt=\"" + arcadeGames[a][0] + "\" border=\"0\" src=\"http://flash.games.gamingmedley.com/img/" + arcadeGames[a][1] + "." + arcadeGames[a][2] + "\" /><\/a><br /><a href=\"/action/arcade&game/" + arcadeGames[a][1] + "\">" + arcadeGames[a][0] + "<\/a>";
  46. arcadeTr.appendChild(arcadeGame);
  47. if ((a % 5 == 4) || (a == arcadeGames.length - 1))
  48. {
  49. arcadeTr.lastChild.setAttribute("colSpan", String(5 - (a % 5)));
  50. gamesTBody.appendChild(arcadeTr);
  51. }
  52. }
  53. var selectPages = "";
  54. for (a = 1; a <= Math.ceil(totalGames / 20); a++)
  55. selectPages += "<option value=\"" + a + "\"" + ((a == arcadePage) ? " selected=\"selected\"" : "") + ">Page " + a + "<\/option>";
  56. arcadeTr = document.createElement("tr");
  57. arcadeTr.appendChild(quickCreateElement("td", "align=center, class=window1, colSpan=5, innerHTML=<font size=\"1\"><div style=\"float : left; text-align : left; width : 10%;\"> " + ((arcadePage > 1) ? " <a href=\"/action/arcade&page=" + (arcadePage - 1) + "\">« Previous<\/a>" : "") + "<\/div><div style=\"float : right; text-align : right; width : 10%;\">" + ((totalGames > arcadePage * 20) ? "<a href=\"/action/arcade&page=" + (arcadePage + 1) + "\">Next »<\/a> " : "") + " <\/div><select onchange=\"location.href = '/action/arcade&page=' + this.options[this.selectedIndex].value;\">" + selectPages + "<\/select><\/font>, vAlign=middle"));
  58. gamesTBody.appendChild(arcadeTr);
  59. }
  60. document.title = document.title.replace(" - An Error Has Occurred", " - Arcade");
  61. document.getElementsByTagName("font")[1].innerHTML = "« " + arcadeTitle + " »";
  62. var t, tables = document.getElementsByTagName("table");
  63. for (t = 0; t < tables.length; t++)
  64. {
  65. if ((tables[t].innerHTML.match(" :: An Error Has Occurred")) && (!tables[t].getElementsByTagName("table")[3]))
  66. {
  67. tables[t].setAttribute("id", "arcade");
  68. tables[t + 2].setAttribute("id", "arcadeGames");
  69. var columns = tables[t].getElementsByTagName("td");
  70. columns[0].innerHTML = columns[0].innerHTML.replace(" :: An Error Has Occurred", " :: Arcade");
  71. columns[2].setAttribute("align", "center");
  72. columns[2].setAttribute("colSpan", "5");
  73. columns[4].innerHTML = "<div style=\"float : left; text-align : left; width : 50%;\"><font size=\"1\">Hosted by <a href=\"http://flash.games.gamingmedley.com\">Shining Ashes.com<\/a>.<\/font><\/div><div style=\"float : right; width : 49%;\">" + columns[4].innerHTML + "<\/div>";
  74. tables[t].getElementsByTagName("b")[0].innerHTML = arcadeTitle;
  75. tables[t].getElementsByTagName("table")[1].getElementsByTagName("tr")[1].style.display = "none";
  76. if (temp = location.href.match(/[\\/]game=([\w-]+)/))
  77. {
  78. var arcadeTr = document.createElement("tr");
  79. arcadeTr.appendChild(quickCreateElement("td", "align=center, class=window2, colSpan=5, innerHTML=<link href=\"http://flash.games.gamingmedley.com/css/" + temp[1] + ".css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" /><embed menu=\"false\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" quality=\"high\" src=\"http://flash.games.gamingmedley.com/swf/" + temp[1] + ".swf\" type=\"application/x-shockwave-flash\"><\/embed>"));
  80. tables[t + 2].getElementsByTagName("tbody")[0].appendChild(arcadeTr);
  81. arcadeTr = document.createElement("tr");
  82. arcadeTr.appendChild(quickCreateElement("td", "align=center, class=window1, colSpan=5, innerHTML=<a href=\"/action/arcade\">Back to the Arcade<\/a>"));
  83. tables[t + 2].getElementsByTagName("tbody")[0].appendChild(arcadeTr);
  84. }
  85. else
  86. document.getElementsByTagName("head")[0].appendChild(quickCreateElement("script", "id=arcadeIndex, src=http://flash.games.gamingmedley.com/index.js?page=" + arcadePage + ", type=text/javascript"));
  87. }
  88. }
  89. }
 
dog199200
Guest
Re: Arcade Code Help (19th Oct 08 at 8:41am UTC)
bump
dog199200
Guest
Re: Arcade Code Help (24th Oct 08 at 9:07pm UTC)
bump
dog199200
Guest
Re: Arcade Code Help (12th Nov 08 at 9:18am UTC)
wow I just remembered this, I still need help
Marc
vChat Developer
*****
I <3 Rossy

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

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Arcade Code Help (13th Nov 08 at 1:24am UTC)
I've only got a moment online right now so I can't fully look over it, but for starters you'll need to remove all the instances of "index.cgi" - vForums doesn't use the Common Gateway Interface, and also uses .htaccess modifications for cleaner URL's.

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Arcade Code Help (13th Nov 08 at 1:35am UTC)
all index.cgi's have been taken out and i dont know how to do .htaccess modifications yet.

~Code above updated~
dog199200
Guest
Re: Arcade Code Help (18th Nov 08 at 1:54am UTC)
bump
ashkir
Full Member
***

[Avatar]

Posts: 1,159
Status: Offline
Gender: Male
Location: Cali!
Age: 35
Joined:  
Reputation: 42%  


pmtwitterskypemsnyahoo
Re: Arcade Code Help (24th Nov 08 at 12:31pm UTC)
I am not good with JS but I can state that the classes could be fixed. I don't believe vF uses something like: windowbg2
dog199200
Guest
Re: Arcade Code Help (24th Nov 08 at 7:34pm UTC)
{Tongue Out} I thought I changed that, anyway changed and the code above is updated {Smile}
dog199200
Guest
Re: Arcade Code Help (30th Nov 08 at 12:56pm UTC)
bump
dog199200
Guest
Re: Arcade Code Help (11th Dec 08 at 2:14pm UTC)
bump
[.tR] ookie1
Full Member
***

[Avatar]
Is it choccy?

Posts: 167
Status: Offline
Joined:  
Reputation: 3%  


pm
Re: (Please MArc) Arcade Code Help (12th Dec 08 at 10:18pm UTC)
http://flash.games.gamingmedley.com/css/

That would be another Forum's CSS and not compatible with vF. {Smile}




Image

Hallelujah! 'tis done; I believe on the Son; I am saved by the blood of the Crucified One!
dog199200
Guest
Re: (Please MArc) Arcade Code Help (12th Dec 08 at 10:30pm UTC)
crap i didnt see taht at all until you just pointed it out, ok i'll fix it up soon.
Marc
vChat Developer
*****
I <3 Rossy

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

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: (Please MArc) Arcade Code Help (13th Dec 08 at 12:07am UTC)
The external JS file is attempting to run a function called arcade() and as far as I can see, no such function exists in your code. You'll have to have a look at the original code, and possibly contact Charles to see how to fix it as you seem to be missing required portions of the code.

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: (Please MArc) Arcade Code Help (13th Dec 08 at 3:00am UTC)
ok well i'm going to have to update the code then, because this is everything I got from him, but he has been doing a lot of work on the proboards version adding in a highscore system that he cant even get to work, so i would have a lot to remove and dont reallyt wnat to take the risk of removing something that was needed. But ok i'll get the code very good and convert what I can and post the code.
 Printable View

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