• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

IlluminaCMS Vault Script

Status
Not open for further replies.
Junior Spellweaver
Joined
Nov 27, 2011
Messages
176
Reaction score
74
Hello,

I am currently developing with IlluminaCMS and I decided I would release my code for a vault.

Features:
- Enable / Disable
- One win per user
- Customizable prize (in credits)
- Change Vault Code in Config

Add these lines of codes to Misc Settings in lightcms.php
Code:
public $vault_enabled = true;
public $vault_code = "1234";
public $vault_prize = "10000"; // Must be a number (Prize is in credits)

Create a new file in templates called vault.tpl and paste this code into there:
Code:
<div class="habblet-container ">		
	<div class="cbb clearfix blue "> 
		<h2 class="title">Vault</h2> 
		<div style="padding:5px">
			<img src="{$www}/images/lock.gif" align="right">
			Can you crack the vault? Put your skills to the test to earn this weeks prize, <strong>{$vault_prize} credits!</strong><br><br><hr>
			<br>
			<form method="post" id="vault">
			<table width="80%" align="center">
				<tbody>
					<tr>
						<td width="20%"><select name="vault1"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></td>
						<td width="20%"><select name="vault2"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></td>
						<td width="20%"><select name="vault3"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></td>
						<td width="20%"><select name="vault4"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></td>
					</tr>
				</tbody>
			</table>
			<center>
				<div class="settings-buttons">
			        <input type="submit" style="width: 80%" value="Crack the Vault" name="crackvault" class="submit">
			    </div>									
			</center>
			</form>
		</div>
	</div>
</div>

Now open me.php and insert these lines below if(!$users->isLogged()) { :
Code:
if(isset($_POST['crackvault'])) {
		$userCombination = $_POST['vault1'].$_POST['vault2'].$_POST['vault3'].$_POST['vault4'];
		if($userCombination == $light->vault_code && $users->userVar(USERNAME, 'vault_won') == 0) {
			$db->real_query("UPDATE users SET credits = credits + '" . $light->vault_prize . "', vault_won = '1' WHERE id = '" . USER_ID . "'");
		}
	}

Sticking to me.php add these lines below $tpl->draw('hotcampaigns');
Code:
if($light->vault_enabled == true) {
		$tpl->draw('vault');
	}

Add this code to class_tpl.php:
Code:
$this->assign('vault_prize', $light->vault_prize);

Next run this SQL query so users can't win more than once!
Code:
ALTER TABLE `users` ADD COLUMN `vault_won`  int(11) NOT NULL DEFAULT 0;

Place this image in the images folder with the name of lock.gif
lock - IlluminaCMS Vault Script - RaGEZONE Forums

End result:
iRaged - IlluminaCMS Vault Script - RaGEZONE Forums
 
The real deal.
Joined
Jun 1, 2011
Messages
592
Reaction score
247
I like how you can edit the vault with the config file. This is a very nice release, thank you.
 
Experienced Elementalist
Joined
Sep 19, 2011
Messages
240
Reaction score
35
Gah same vault thing for every cms.. anyone remember flex hotel? They created somthing via flash for their vault?
 
Zephyr Studios
Loyal Member
Joined
Feb 18, 2012
Messages
1,877
Reaction score
724
It's nice iRaged, thanks for the script and image! :)
iRaged - IlluminaCMS Vault Script - RaGEZONE Forums
 
Junior Spellweaver
Joined
Feb 7, 2013
Messages
187
Reaction score
19
Was going to use, but relised what if someone got the code then gave it away? or ... made clones and stacked up.

Could someone edit this and make only 1 win per code?
 
Junior Spellweaver
Joined
Jun 1, 2010
Messages
152
Reaction score
27
Would be good if it was using the database instead of the lightcms file, you could also make it so if someone cracked it, a new code comes into place, automatically.
 
Junior Spellweaver
Joined
Nov 27, 2011
Messages
176
Reaction score
74
Was going to use, but relised what if someone got the code then gave it away? or ... made clones and stacked up.

Could someone edit this and make only 1 win per code?

You could select the number of rows from the database that have won the vault, and if it's won once then others can't win until you reset the system. Just a suggestion. When I release my full CMS edit, the code will randomly change after a winner.
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
You could make a table in the database to store possible numbers to win (use a script to insert like 200 random numbers) and then when one of those numbers is won you can delete it from the table and it can't be used again.
 
Experienced Elementalist
Joined
Nov 25, 2012
Messages
270
Reaction score
17
It all looks fine but it doesn't seem to be registering that I've put the code in, when i go to the users table it doesn't say I've won nor rewarded me with credits. Any fix?
 
Junior Spellweaver
Joined
Nov 27, 2011
Messages
176
Reaction score
74
It all looks fine but it doesn't seem to be registering that I've put the code in, when i go to the users table it doesn't say I've won nor rewarded me with credits. Any fix?
Please clarify more.. Also make sure you have included all of the code from the thread.
 
Status
Not open for further replies.
Back
Top