vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Lottery System v1 - View Topic (Page 1 of 2)Page: 1 2
Topic Rating: *****
Printable View
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
Lottery System v1 (24th Jan 08 at 1:41am UTC)
This code is admin editable. It adds a link to your admin area. Click on the link, and it takes you to a page with instructions. Click on one of the links, and you will have your Lottery system up and running.

Every member sees the exact same numbers, and they do not change after every new page load. Only those with access to the admin area can enable/disable the lottery system.

The Code - Edit the footer. {Smile}


Part 1: Main Header
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Lottery System v1 by Cr0w
  5. Copyright 2008
  6. Do not repost
  7. MAIN HEADER
  8. */
  9.  
  10. xxOn="yes"
  11. xx="26"
  12. xx1="10"
  13. xx2="66"
  14. xx3="53"
  15. LotteryNumbers = "";
  16.  
  17. if(xxOn=="yes"){
  18. LotteryNumbers += '<table width="250px" cellpadding="4" cellspacing="1" align="center" class="border" id="LottoTable">';
  19. LotteryNumbers += '<tr>';
  20. LotteryNumbers += '<td class="title1" width="100%" colspan="2" align="center">';
  21. LotteryNumbers += '<font size=2><b>Winning Lotto Numbers</B></font>';
  22. LotteryNumbers += '</td>';
  23. LotteryNumbers += '</tr>';
  24. LotteryNumbers += '<tr>';
  25. LotteryNumbers += '<td width="100%" class="window2" align="center" id="LotteryTable" style="height: 30px">';
  26. LotteryNumbers += '</td>';
  27. LotteryNumbers += '</tr>';
  28. LotteryNumbers += '</table>';
  29. }
  30. document.write(LotteryNumbers);
  31. //-->
  32. </script>
 



Part 2: Main Footer
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Lottery System by Cr0w
  5. Copyright 2008
  6. Do not repost
  7. MAIN FOOTER
  8. */
  9.  
  10. var HighNum="99" //Edit this to the highest number the lottery can go up to
  11.  
  12. if(location.href.match(/system\/lottery/)){
  13. document.title = document.title.replace('Modify Headers and Footers','Lottery Settings');
  14. Table = document.getElementsByTagName('Table');
  15. for(t=4;t<Table.length;t++){
  16. Table.item(t).style.display = 'none'
  17. }
  18. var x=Math.round(Math.random()*HighNum)
  19. var x1=Math.round(Math.random()*HighNum)
  20. var x2=Math.round(Math.random()*HighNum)
  21. var x3=Math.round(Math.random()*HighNum)
  22. LottoBody = '<div style="display: none">';
  23. LottoBody += '<input type="text" value="'+x+'" id="Lottonum">';
  24. LottoBody += '<input type="text" value="'+x1+'" id="Lottonum1">';
  25. LottoBody += '<input type="text" value="'+x2+'" id="Lottonum2">';
  26. LottoBody += '<input type="text" value="'+x3+'" id="Lottonum3">';
  27. LottoBody += '</div>';
  28. LottoBody += '<table border="0" cellpadding="4" cellspacing="1" class="border" width="92%" align="center">';
  29. LottoBody += '<tr>';
  30. LottoBody += '<td class="title1"><b>Lottery Settings</b></td></tr>';
  31. LottoBody += '<tr><td class="window1">Click the "Activate Lottery" button to enable the lottery system. Once you click the button, the lottery table will be displayed, along with 4 randomly selected numbers. These numbers will remain the same to everyone on your forum.<br /><br /> Once you click the "De-activate Lottery" button, the table will disappear, and will once again be displayed when you click on "Activate Lottery" again.';
  32. LottoBody += '</td></tr><tr>';
  33. LottoBody += '<td class="window1">';
  34. LottoBody += '<center><input type="button" value="Activate Lottery" onclick="LottoSave()"> <input type="button" value="De-activate Lottery" onclick="LottoOff()"></center>';
  35. LottoBody += '</td></tr></table>';
  36. document.write(LottoBody);
  37. function LottoSave(){
  38. var xxxOn= document.getElementById('LottoOn');
  39. var xxx= document.getElementById('Lottonum');
  40. var xxx1= document.getElementById('Lottonum1');
  41. var xxx2= document.getElementById('Lottonum2');
  42. var xxx3= document.getElementById('Lottonum3');
  43.  
  44. header = document.getElementsByName('header').item(0);
  45. header.value = header.value.replace(new RegExp('xxOn="'+xxOn+'"',"i"),'xxOn="yes"');
  46. header.value = header.value.replace(new RegExp('xx="'+xx+'"',"i"),'xx="'+xxx.value+'"');
  47. header.value = header.value.replace(new RegExp('xx1="'+xx1+'"',"i"),'xx1="'+xxx1.value+'"');
  48. header.value = header.value.replace(new RegExp('xx2="'+xx2+'"',"i"),'xx2="'+xxx2.value+'"');
  49. header.value = header.value.replace(new RegExp('xx3="'+xx3+'"',"i"),'xx3="'+xxx3.value+'"');
  50. document.forms.item(0).submit(true);
  51. }
  52. function LottoOff(){
  53. header = document.getElementsByName('header').item(0);
  54. header.value = header.value.replace(new RegExp('xxOn="'+xxOn+'"',"i"),'xxOn="no"');
  55. document.forms.item(0).submit(true);
  56. }
  57. }
  58. document.getElementById("LotteryTable").innerHTML = +xx+', '+xx1+', '+xx2+', '+xx3;
  59.  
  60. var div = document.getElementsByTagName('ul');
  61. for(q=0;q<div.length;q++){
  62. if(div[q].innerHTML.match(/Recycle\sBin/i)){
  63. div[q].innerHTML+='<li><a href="/action/admin/page/headers_footers/header_footer_id/-/system/lottery">Lottery System</a></li>';
  64. }}
  65. //-->
  66. </script>
 

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

[Avatar]

Posts: 64
Status: Offline
Gender: Male
Location: Northern Ireland
Age: 35
Joined:  
Reputation: 10%  


pmvForum
Re: Lottery System v1 (24th Jan 08 at 1:50am UTC)
I cant find the link in the admin panel =/

Maybe im just blind and tired... but I dont think its there.
Got a good idea on how this code can be used too {Cheesy}

Image
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: Lottery System v1 (24th Jan 08 at 1:51am UTC)
At the bottom of "General Settings" {Wink}

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

[Avatar]

Posts: 64
Status: Offline
Gender: Male
Location: Northern Ireland
Age: 35
Joined:  
Reputation: 10%  


pmvForum
Re: Lottery System v1 (24th Jan 08 at 1:52am UTC)
Ah that would be why...

Was going to try to add it to one board only.

Image
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: Lottery System v1 (24th Jan 08 at 1:53am UTC)
 
Ah that would be why...

Was going to try to add it to one board only.


Ahh, I'll keep that in mind for v2. {Smile} [I made this code back in 2006; I think it's time for an update. {Tongue Out} ]

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Lottery System v1 (24th Jan 08 at 5:13am UTC)
so umm i suggested this like back when it was made..umm again..can you please make it so members can be inserted again if so this would be an awesome code for deciding the member of the month.
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: Lottery System v1 (24th Jan 08 at 5:41pm UTC)
Yep, that's also in the works for v2. {Smile}

Just post here if you have any other suggestions for it. {Wink}

rroll.to— Shorten a link, rickroll your friends.
MiNiCliP™
New Member
*

[Avatar]
And Im Back.....

Posts: 9
Status: Offline
Gender: Male
Joined:  
Reputation: 0%  


pm
Re: Lottery System v1 (20th Apr 08 at 4:58am UTC)
Oh Never Mind I Misplaced The code on The Global H/F's

So It's Resolved {Cheesy}

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: Lottery System v1 (20th Apr 08 at 4:59am UTC)
Alright, glad you got it working. {Smile}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Lottery System v1 (17th Oct 08 at 8:20am UTC)
Still planning on making an update for it Marc?
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: Lottery System v1 (20th Oct 08 at 9:47pm UTC)
v2's sitting on one of my test boards about half complete; I might toss together some loose ends and release a v1.5 sometime soon if I've got time. {Smile}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Lottery System v1 (20th Oct 08 at 10:05pm UTC)
ah ok I see, well i hope it comes together nicely
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Lottery System v1 (23rd May 10 at 6:57am UTC)
Over a year and still no v2?

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
dog199200
Guest
Re: Lottery System v1 (24th May 10 at 3:45am UTC)
Nope, but we are talking about Marc here, the one who openly admits to procrastination {Tongue Out}
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: Lottery System v1 (24th May 10 at 8:54pm UTC)
Posted By dog199200 on 24th May 10 at 3:45am
 
Nope, but we are talking about Marc here, the one who openly admits to procrastination {Tongue Out}


Don't forget laziness; procrastination and laziness...one dangerous combination. {Tongue Out}

But yeah, in a few weeks (when my Co-op is done and my summer officially starts) I plan to go through all of my old codes and revamp them, as well as hopefully get a few more up. {Smile}

rroll.to— Shorten a link, rickroll your friends.
 Printable View
Page: 1 2

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