vForums Support :: Programming & Coding :: Code Requests & Support :: (Please MArc) Arcade Code Help - View Topic
| |
| 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: - if (typeof(quickCreateElement) == "undefined")
- {
- function quickCreateElement(name, attr)
- {
- temp = document.createElement(name);
- if (attr !== "")
- {
- attr = attr.split(", ");
- for (var qce = 0; qce < attr.length; qce++)
- {
- attr[qce] = attr[qce].split('=');
- attr[qce] = new Array(attr[qce].shift(), attr[qce].join('='));
- if (attr[qce][0] == "innerHTML")
- temp.innerHTML = attr[qce][1];
- else
- {
- temp.setAttribute(attr[qce][0], attr[qce][1]);
- if (attr[qce][0] == "class")
- temp.setAttribute("className", attr[qce][1]);
- }
- }
- }
- return temp;
- }
- }
- var arcadeLink = quickCreateElement("a", "href=/action/arcade"),
- arcadePage = ((temp = location.href.match(/[\\/]page/(\d+)/)) ? Number(temp[1]) : 1),
- arcadeTitle = ((temp = decodeURI(location.href).match(/[\\/]title=([\w\':!\-\s]+)/)) ? temp[1] : "Arcade"),
- menu = document.getElementsByTagName("font")[3],
- offset = ((vf_username == "Guest") ? 2 : 3);
- var menuItems = menu.getElementsByTagName("a");
- arcadeLink.appendChild(quickCreateElement("img", "alt=[Arcade], border=0, src=http://proboards.gamingmedley.com/images/arcade.gif"));
- menu.insertBefore(arcadeLink, menuItems[menuItems.length - offset]);
- menu.insertBefore(document.createTextNode(" "), menuItems[menuItems.length - offset]);
- if (location.href.match("action/arcade"))
- {
- arcade = function(totalGames)
- {
- var gamesTBody = document.getElementById("arcadeGames").getElementsByTagName("tbody")[0];
- for (var a = 0; a < arcadeGames.length; a++)
- {
- if (a % 5 == 0)
- var arcadeTr = document.createElement("tr");
- arcadeGame = quickCreateElement("td", "align=center, class=window2, width=20%");
- 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>";
- arcadeTr.appendChild(arcadeGame);
- if ((a % 5 == 4) || (a == arcadeGames.length - 1))
- {
- arcadeTr.lastChild.setAttribute("colSpan", String(5 - (a % 5)));
- gamesTBody.appendChild(arcadeTr);
- }
- }
- var selectPages = "";
- for (a = 1; a <= Math.ceil(totalGames / 20); a++)
- selectPages += "<option value=\"" + a + "\"" + ((a == arcadePage) ? " selected=\"selected\"" : "") + ">Page " + a + "<\/option>";
- arcadeTr = document.createElement("tr");
- 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"));
- gamesTBody.appendChild(arcadeTr);
- }
- document.title = document.title.replace(" - An Error Has Occurred", " - Arcade");
- document.getElementsByTagName("font")[1].innerHTML = "« " + arcadeTitle + " »";
- var t, tables = document.getElementsByTagName("table");
- for (t = 0; t < tables.length; t++)
- {
- if ((tables[t].innerHTML.match(" :: An Error Has Occurred")) && (!tables[t].getElementsByTagName("table")[3]))
- {
- tables[t].setAttribute("id", "arcade");
- tables[t + 2].setAttribute("id", "arcadeGames");
- var columns = tables[t].getElementsByTagName("td");
- columns[0].innerHTML = columns[0].innerHTML.replace(" :: An Error Has Occurred", " :: Arcade");
- columns[2].setAttribute("align", "center");
- columns[2].setAttribute("colSpan", "5");
- 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>";
- tables[t].getElementsByTagName("b")[0].innerHTML = arcadeTitle;
- tables[t].getElementsByTagName("table")[1].getElementsByTagName("tr")[1].style.display = "none";
- if (temp = location.href.match(/[\\/]game=([\w-]+)/))
- {
- var arcadeTr = document.createElement("tr");
- 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>"));
- tables[t + 2].getElementsByTagName("tbody")[0].appendChild(arcadeTr);
- arcadeTr = document.createElement("tr");
- arcadeTr.appendChild(quickCreateElement("td", "align=center, class=window1, colSpan=5, innerHTML=<a href=\"/action/arcade\">Back to the Arcade<\/a>"));
- tables[t + 2].getElementsByTagName("tbody")[0].appendChild(arcadeTr);
- }
- else
- document.getElementsByTagName("head")[0].appendChild(quickCreateElement("script", "id=arcadeIndex, src=http://flash.games.gamingmedley.com/index.js?page=" + arcadePage + ", type=text/javascript"));
- }
- }
- }
| |
| 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
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
Posts: 1,159 Status: Offline Gender: Male Location: Cali! Age: 35 Joined:
pmskypemsnyahoo | 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) | | I thought I changed that, anyway changed and the code above is updated | |
| 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
Is it choccy? Posts: 167 Status: Offline Joined:
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. | |
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
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. | |
| |
| |
|