[Release] WebShop Exchange Resets For Credits

ivowe3

Wiki
Joined
Apr 1, 2009
Messages
1,220
Reaction score
1,281
1. Правите 1 файл cfr.php в който пишете:
PHP:
<?php
iseedeadpeople();
switch (1) {
	default: 
	if ($webshop['credits']['cfr']<1) {
		print phrase_blocked_module;
		break;
	}
	if (($_POST['character']) && ($_POST['reset'])) {
		$query	= mssql_query("select [Resets] from [Character] where [Name]='".secure($_POST['character'])."' and [AccountID]='".$GLOBALS['mu_user']."'");
		$res	= mssql_fetch_row($query);
		$newresets= $res[0]-$_POST['reset'];
		$newcredits= $_POST['reset']*$webshop['credits']['cfr'];
		require 'inc/function.checkstatus.php';
		switch (2) {
			case checkstatus($_POST['character']) :
				$legtitle	= "Error";
				$content	= phrase_offline_rq;
				break;
			case (mssql_num_rows($query)!=1):
				$legtitle	= "Error";
				$content	= phrase_nosuch_char;
				break;
			case $newresets<0:
				$legtitle	= "Error";
				$content	= "You dont have enought Resets";
				break;
			case $_POST['reset']<0:
				$legtitle	= "Error";
				$content	= "Resets Cant be negative value!";
				break;
			default :
			shoplog("Character: ".$_POST['character']." , exchange ".$_POST['reset']." for ".$newcredits." credits");
			mssql_query("exec XCredits '".$GLOBALS['mu_user']."', ".($newcredits*1));
			mssql_query("update [Character] set [Resets]='".$newresets."' where [Name]='".secure($_POST['character'])."';") or die("Failed to excahnge your resets");
			$legtitle	= "Success";
			$content	= "You have successfully exchange Resets";
		}
		print '<fieldset style="width: 300px"><legend class="mu_style2" style="padding: 0px;font-weight:bold;">'.$legtitle.'</legend><div>'.$content.'</div>
</fieldset><br><br>';
	}
	$query	= mssql_query("select [Name],[Resets] from [Character] where [AccountID]='".$GLOBALS['mu_user']."'");
	$i	= 0;
	$mychars= '';
	while($i<mssql_num_rows($query)) {
		$char	= mssql_fetch_array($query);
		$i++;
		$mychars.="<option class=\"clchg\" value=\"".htmlspecialchars($char['Name'])."\">".$char['Name']."</option>";
	}
print "
<script type=\"text/javascript\">
function amisure() {
	if (".$mycreds."<".$webshop['credits']['cfr'].") {
		alert('".phrase_lack_credits."');
		return false;
	}
	return webshop_confirm_action('Are you sure you want to exchange '+document.getElementById('character').value+'\'s Resets?');
}
</script>
";
print'
<fieldset style="width: 300px">
<legend class="mu_style2" style="padding: 0px;font-weight:bold;">Exchange your Resets for credits</legend>
<form method="post" action="'.$_SERVER['SCRIPT_NAME'].'?sy=cfr">
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr><td align="center">
<select style="color: #000000;" id="character" name="character">
<optgroup label="Select a character">
'.$mychars.'
</select></td><td align="center">
<span id="sybrack" name="sybrack">
 <input type="text" name="reset" size="10" placeholder="Resets" />
</span>
</td></tr><tr><td colspan="2" height=15></td></tr><tr>
<td colspan="2" align="center" style="padding-top: 10px;border-top: 1px dashed #DDDDDD"><input value="Exchange Resets" type="submit"><br>Exchange '.number_format($webshop['credits']['cfr']).' Credits for Reset</td></tr></table>
</form>
</fieldset>
';
}
?>

2. след това добавяте в wshmodules.php:
PHP:
define('cfr',        moddir.'/cfr.php');        // by ivowe3

3. cлед това добавяте в wshconf.php:
PHP:
$webshop['credits']['cfr'] = 500; //Kolko Kredita za 1 reset

4. в \lang\english.php
PHP:
#CFR
define('phrase_menu_cfr',       "Exchange Resets");

5. За да искарате в меню-то опцията трябва да добавите в Menu_Config.inc следния код:
PHP:
// CFR
if ($webshop['credits']['cfr']) 	$menu -> item(phrase_menu_cfr, 'index.php?sy=cfr');
 
Last edited:
кредити за ресове :)
 
Малко тъпо го написах на английски.

За ресове да зимаш кредити. трябваше да пише Exchange Resets for Credits.

Примерно пишеш 10 кредита за 1 ресет. и като дадеш 5 реса получаваш 50 кредита и ти зима 5 ресета.
 
Go testing

When i make it it was tested(2012). What is wrong with your setup IDK.

This is not buy reset this is exchange resets for credits...

For support skype: ivowe3
 
Last edited:
иска да каже сигурно, че като въведе -9999... в полето ресетс се случва нещо, което е логично при положение, че няма никаква филтрация там и сметката ще стане

$newresets= $res[0]- (-$_POST['reset']);

в крайна сметка без пари толкова :D
 
  • Like
Reactions: ivowe3
Update:

PHP:
			case $_POST['reset']<0:
				$legtitle	= "Error";
				$content	= "Resets Cant be negative value!";
				break;

Must work now :D
 
hi and nice release but how good is this ? have bug or hole etc ? work for webshop 97d ? ;):

guys why have this problems with this script WebShop Exchange Resets For Credits:

no work for webshop 97d ?

Untitled.png
 
Last edited:
hi and nice release but how good is this ? have bug or hole etc ? work for webshop 97d ? ;):

guys why have this problems with this script WebShop Exchange Resets For Credits:

no work for webshop 97d ?

Its tested for 97d probably. Maybe missing define in file wshmodules.php?
PHP:
define('cfr',        moddir.'/cfr.php');        // by ivowe3

You can find me on skype: ivowe3 if still didn't work
 
  • Like
Reactions: DemonuMu