vForums Support :: Programming & Coding :: Code Requests & Support :: [ASAP Please :P] Code Fix - View Topic
| |
| dog199200 Guest | [ASAP Please :P] Code Fix (2nd Nov 08 at 7:18am UTC) Resolved | | Can someone please help me fix this code, for some reason the get variables ain't working after I switched the code's design to an array.
Code: - <script type="text/javascript">
- <!--
- /*
- Guest Friendly Message by Dwight
- Copyright© 2008 Infinity Codes
- http://icodes.vforums.co.uk
- Do not Repost
- */
-
- //Edit Below
-
- var wtp = 2; //0 = above banner, 1 = above menu buttons, 2 = below menu buttons
-
- var message = ['We hope you enjoy your visit.<br /><br /><br />You re currently viewing the our forum as a guest. This mean you are limited to certain areas of the board and there are some features you can not use. If you join our community, you ll be able to access the member-only sections, and use many member-only features such as customizing your profile, sending private messages, and voting in polls. Registration is simple, fast, and completely free.<br /><br /><br /><font color="#FF6600">Join our community! <a href=/action/register>Register Now!</a></font><br /><br /><br />If you are already a member please login to your account to access all the features:']; // Do not use 's, they will cause the code to break.
-
- var form = ['<form action=javascript:void;(0); onsubmit=login();>Username: <input type="text" id="un" size="20"> Password: <input type="password" id="pw" size="20"> <input type="submit" value="Login"></form>'];
-
- //Edit Above
-
- function build(){
- var wt = document.getElementByI00;("welcome_table");
- var nRow=wt.insertRow(wtp);
- var nCell=nRow.insertCell(0);
- nCell.className="window1";
- nCell.innerHTML = message + "<br />" + form;
- }
- function login(){
- get('username','name')[0].value = get('un','id').value;<span><wbr /></span>
- get('password','name')[0].value = get('pw','id').value;<span><wbr /></span>
- get('loginForm','name').submit();
- }
- if(location.href.match(/.co.uk($|\/$)/) && vf_username == 'guest'){
- build();
- }
- //-->
- </script>
| |
| 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: [ASAP Please :P] Code Fix (7th Nov 08 at 8:07pm UTC) | | I see numerous <span><wbr /></span> tags in the code you posted. Were those placed into the code by you, or is that something that happened when you posted the code here? | |
rroll.to— Shorten a link, rickroll your friends. |
| dog199200 Guest | Re: [ASAP Please :P] Code Fix (9th Nov 08 at 4:10am UTC) | | I didnt add them in
Edit: but I went ahead and removed them | |
| 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: [ASAP Please :P] Code Fix (9th Nov 08 at 6:17pm UTC) | | Since you're using an array, to add the message and form anywhere, you need to tell it which index in the array to grab. You would need to use message[0] and form[0] to access it.
However, I see no reason for you to be using arrays; they are completely useless in this situation and only add to the amount of time & processing power needed for the code to run. | |
rroll.to— Shorten a link, rickroll your friends. |
| dog199200 Guest | Re: [ASAP Please :P] Code Fix (10th Nov 08 at 12:28am UTC) | | i was using arrays to make the code easier to edit instead of one big code area to edit, by using an array I have it so the information is split up and easier to edit, at least in my own opinion.
And ok i'll add those in when i get home and see what happeneds | |
| dog199200 Guest | Re: [ASAP Please :P] Code Fix (10th Nov 08 at 3:31am UTC) | | Edit: OK Ross Pm'd me what was wrong, I forgot to add a [0] to the submit function. | |
| |
| |
|