Power Up Store.....

  • Konbuyu başlatan Konbuyu başlatan _WurucU_
  • Başlangıç tarihi Başlangıç tarihi
Konu Yazar

_WurucU_

New Member
Kalemi Kırıldı!
Haz
2,455
75
Mrb arkadaşlar suana kadar cok kez pus (power up store) paylasıldı ama kımsenın kı calısmadı hepsınınkınde de sorun wardı adam gıbı alıntı yapmadan kullandıhını yada kendı yazdıhını nasıl yapıldıhını anlatarak paylaşabılırmı suan gercekten cok ihtiyacım war (kopanel ıcın olanı ) sımdılık.... lutfen yardımlarınızı esırgemeyın.. ;)
 
Cevap: Power Up Store.....

gercekten su anda benim de ihtiyacım var ama bulamadım bi türlü
 
Cevap: Power Up Store.....

elınde olanda paylasmıorkı :(
 
Cevap: Power Up Store.....

offf paylaşcak yokmuuu lutfen cok acıll...
 
Cevap: Power Up Store.....

Hmm Kopanel icinWar 2-3 tane bnde ama Calismiyor :(
istiyorsan verem bi dne belki yaparsin
 
Cevap: Power Up Store.....

wawlla onun programını yapıp launcher ekliodum ama kodlar yalan oldu :D
 
Cevap: Power Up Store.....

calismadi diyorsun ama beceremedim de diyemiyorsun calismayan seyi ne diye atsınlar siteye calistıramıyorsundur ben kendim orjinal power up store ekledim bütün bilgilerini verdim calistiramadıysan soyle yardimci olalim
 
Cevap: Power Up Store.....

calismadi diyorsun ama beceremedim de diyemiyorsun calismayan seyi ne diye atsınlar siteye calistıramıyorsundur ben kendim orjinal power up store ekledim bütün bilgilerini verdim calistiramadıysan soyle yardimci olalim

tekrar paylaşabılırmısın çalısanı ?
 
Cevap: Power Up Store.....

Pus.php

Kod:
<?php

	$conn = odbc_connect("$dbname","$dbuser","$dbpass");

	/* CONFIGURATION */
	$community = "IceTeaKO's";
	$table = "PUS_STORE";
	$items_per_row = 5;
	$filename = "pus";
	$images = "pus_images";

	/* Logs 
	 1 = on
	 0 = off

	 Requires the PUS_STORE_LOGS table
	*/
	$logs = 0;

	/* Knight Cash */
	# Get from TB_USER
	#$_WHERE = "TB_USER";
	#$kc_col = "KC";
	
	# Get from USERDATA [ jifen ]
	# This is for most people.
	$_WHERE = "TB_USER";
	$kc_col = "kc";

	/*
		Categories
	*/
	$cats = array(
		1 => "Weapons", 
		2 => "Armour", 
		3 => "Scrolls", 
		4 => "Jewellery"
	);


	/* END OF CONFIGURATION */

	$kc = 0;

 	if (empty($_SESSION['sesuser']))
 		{
			
			parth1tr();
			parth1('100%',1,'center');
			echo "Error";
			parth2();
			parth2tr();

			part1tr();
			part1('100%',1,'center', 1);
			echo "You are not logged in!";
			part2();
			part2tr();
		}
	else
		{
			if ($_WHERE == "TB_USER")
				{
					$results = odbc_exec($conn, "SELECT $kc_col FROM $_WHERE WHERE strAccountID='{$_SESSION['sesuser']}'");
					$kc = intval(odbc_result($results, 1));
				}
			else
				{
					$results = odbc_exec($conn, "SELECT strCharID1, strCharID2, strCharID3 FROM ACCOUNT_CHAR WHERE strAccountID='{$_SESSION['sesuser']}'");
					while (odbc_fetch_row($results))
						{
							$x = 1;
							while ($x <= 3)
								{
									$char = odbc_result($results, $x);
									if (!empty($char))
										{	
											$results2 = odbc_exec($conn, "SELECT $kc_col FROM $_WHERE WHERE strUserID='{$char}'");
											$_CHAR[$x] = $char;
											$_KC[$x] = intval(odbc_result($results2, 1));
											$kc = $kc + $_KC[$x];
										}
									$x++;
								}
						}
				}	
			parth1tr();
			parth1('100%',$items_per_row,'center');
			echo "Power-Up Store";
			parth2();
			parth2tr();
		
			$cat = trim(intval($_GET['cat']));
			if (!$cat)
				$cat = 1;
			
			$dwID = trim(intval($_POST['item']));
			if ($dwID == 0)
				{
					part1tr();
					part1('100%',$items_per_row,'center', 1);
					echo "<div align=\"right\"><b>You have {$kc} Knight Cash</b></div>";
					echo "Welcome to $community Power-Up Store <br /><center><font size=\"+1\">{$cats[$cat]}</font></center>";
					part2();
					part2tr();
					
					$results = odbc_exec($conn, "SELECT * FROM $table WHERE category=$cat ORDER BY price DESC");
					$x = 1;
					$y = 0;
					echo "<table align=\"center\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">";
					while ($row = odbc_fetch_array($results))
						{
							$y++;
							if ($x == 1)
								{
									if ($y > 1)
										echo "<tr><td colspan='{$items_per_row}'><br /><hr><br /></td></tr>";
									# Main row
									echo "<tr>";
								}

							$dwID2  = substr($row['dwID'], 0, -2) . "00";

							$img_res = odbc_exec($conn, "SELECT dwIDicon FROM ITEM WHERE Num = '{$dwID2}'");
							$img_id  = odbc_result($img_res, 1);

							$image = "{$img_id}.gif";

							if (!file_exists("./{$images}/" . $image))
								$image = "noimage.gif";
							
							$image = "./image.php?link=" . substr($image, 0, -4);

							echo "
											<td>
												<table>
													<tr>
														<td align='center'><b>{$row['szName']}</b></td>
													</tr>
													<tr>
														<td align='center'><img src='{$image}' border='0' /></td>
													</tr>
													<tr>
														<td align='center'><i>{$row['szDescript']}</i></td>									
													</tr>
													<tr>
														<td align='center'><b>{$row['price']}</b> KC</td>									
													</tr>
													<tr>
														<td valign='bottom' align='center'>
																<form action=\"./?act={$filename}&selected=1\" method=\"POST\">
																	<input type=\"submit\" value=\"Buy!\" />
																	<input type=\"hidden\" name=\"item\" value=\"{$row['dwID']}\" />
																</form>
															</div>
														</td>									
													</tr>
												</table>
											</td>";
							if ($x == $items_per_row)
								{
									echo "
										</tr>";
									$x = 0;
								}
							$x++;
						}
					if ($y == 0)
						{
									echo "<tr><td colspan='{$items_per_row}'><center>There are no items in this category!</center></td></tr>";
						}
					echo "<tr>
						  <td class=\"thead\" width=\"100%\" colspan=\"{$items_per_row}\" align=\"center\" height=\"{$items_per_row}\">
						  <div align=\"right\">
						  	<form action='./' method='GET' name='dd'>
							<input type=\"hidden\" name=\"act\" value=\"{$filename}\"/>
							<select id=\"cat\" name=\"cat\" onChange=\"elem = document.getElementById('cat').value; if (elem != 'dontpickme') { document.dd.submit(); } \">
								<option value=\"dontpickme\">Select category</option>";
								foreach ($cats as $key => $value) {
									echo "<option value=\"{$key}\">{$value}</option>";								
								}					
						    echo "</select></td></tr>";
			}
		else
			{
					$results = odbc_exec($conn, "SELECT szName, price, max_stack FROM $table WHERE dwID={$dwID}");
					$item = odbc_result($results, 1);	
					$_item = $item;
					$price = odbc_result($results, 2);
					$max_stack = odbc_result($results, 3);

					if ($max_stack > 1)
						$stackable = "is [adding stacked items is not working: all stacked items will be added as non-stacked]";
					else
						$stackable = "is not"; 

					part1tr();
					part1('100%',$items_per_row,'center', 1);					
					echo "Welcome to $community Power-Up Store <br /><center><font size=\"+1\">Purchase <b>{$item}</b></font></center>";
					part2();
					part2tr();
					parth1tr();
					parth1('100%',$items_per_row,'center');
					echo "&nbsp;";
					parth2();
					parth2tr();
					part1tr();
					part1('100%',$items_per_row,'center', 1);					
					if ($kc >= $price)
						{
							if ($_GET['selected'] == 1)				
								{
									echo "<div align=\"right\"><b>You have $kc Knight Cash</b></div>";
									echo "How many do you wish to purchase?<br />
										  Note: This item $stackable stackable.<br />
										  <br />
										  <form action='./?act={$filename}&selected=2' method='POST'>
											<input type='hidden' name='item' value='{$dwID}' />
										  	Amount: <input type='text' name='amount' /><input type='submit' value='Okay!' />
										  </form>";
								}
							else
								{
									$amount = intval($_POST['amount']);
									$x = 1;
									while ($x <= 9998 && !$max_purchase)
										{
											$p = $price * $x;

											if ($kc < $p)
												$max_purchase = ($x - 1);

											$x++;
										}
									if ($amount <= $max_purchase)
										{
											$price = $price * $amount;
											if ($kc >= $price)
												{
													if (substr($item, -1) != "s" && $amount > 1)
														$item = $item . "s";
													elseif (substr($item, -1) == "s" && $amount == 1)
														$item = substr($item, 0, -1);

													if ($_GET['selected'] == 2)
														{
															echo "<div align=\"right\"><b>You have $kc Knight Cash</b></div>";
															echo "Are you sure you wish to purchase <b>{$amount} {$item}?</b><br /><br />
															  <form action='./?act={$filename}&selected=3' method='POST'>
																<input type='hidden' name='item' value='{$dwID}' />
																<input type='hidden' name='amount' value='{$amount}' />
															  	<input type='button' value='No' onClick='window.location=\"./?act={$filename}\"' /><input type='submit' value='Yes!' />
															  </form>";
														}
													elseif ($_GET['selected'] == 3)
														{
															if (/*$stackable == "is not" && */ $amount > 1)
																{
																	$x = 1;
																	while ($x <= $amount)
																		{
																			odbc_exec($conn, "EXEC InsertItem '{$_SESSION['sesuser']}', 2, {$dwID}, {$x}");
																			$x++;
																		}
																}
															else
																{
																	odbc_exec($conn, "EXEC InsertItem '{$_SESSION['sesuser']}', 2, {$dwID}, 1");
																}

																$_price = $price;
																if ($_WHERE == "USERDATA")
																	{
																		if ($_KC[1] >= $price)
																			{
																				$_KC[1] -= $price;																		
																			}
																		else
																			{
																				$takeKC = $_KC[1];
																				$price -= $takeKC;
																				$_KC[1] -= $takeKC;
			
																				if ($_KC[2] >= $price)
																					{
																						$_KC[2] -= $price;
																					}
																				else
																					{
																						$takeKC = $_KC[2];
																						$price -= $takeKC;
																						$_KC[2] -= $takeKC;
																						if ($_KC[3] >= $price)
																							{
																								$_KC[3] -= $price;
																							}
																					}
																				}
																				$x = 1;
																				while ($x <= 3)
																					{
																						if (!empty($_CHAR[$x]))
																							@odbc_exec($conn, "UPDATE $_WHERE SET {$kc_column}='{$_KC[$x]}' WHERE strUserID='{$_CHAR[$x]}'");
							
																						$x++;
																					}													
																	}
																else
																	{
																		$kc -= $price;
																		@odbc_exec($conn, "UPDATE $_WHERE SET $kc_col = $kc WHERE strAccountID='{$_SESSION['sesuser']}'");
																	}
																	if ($_WHERE == "TB_USER")
																		{
																			$results = odbc_exec($conn, "SELECT $kc_col FROM $_WHERE WHERE strAccountID='{$_SESSION['sesuser']}'");
																			$kc = intval(odbc_result($results, 1));
																		}
																	else
																		{
																			$kc = 0;
																			$results = odbc_exec($conn, "SELECT strCharID1, strCharID2, strCharID3 FROM ACCOUNT_CHAR WHERE strAccountID='{$_SESSION['sesuser']}'");
																			while (odbc_fetch_row($results))
																				{
																					$x = 1;
																					while ($x <= 3)
																						{
																							$char = odbc_result($results, $x);
																							if (!empty($char))
																								{	
																									$results2 = odbc_exec($conn, "SELECT $kc_col FROM $_WHERE WHERE strUserID='{$char}'");
																									$_CHAR[$x] = $char;
																									$_KC[$x] = intval(odbc_result($results2, 1));
																									$kc = $kc + $_KC[$x];
																								}
																							$x++;
																						}
																				}
																		}
					
					
																		$ip = (getenv(HTTP_X_FORWARDED_FOR)) ?  getenv(HTTP_X_FORWARDED_FOR) :  getenv(REMOTE_ADDR);
					
																		if ($logs)
																			odbc_exec($conn, "INSERT INTO PUS_STORE_LOGS (strAccountID, item, amount, price, kc_left, ip, timestamp) VALUES('{$_SESSION['sesuser']}', '{$_item}', '{$amount}', '{$_price}', '{$kc}', '{$ip}', getdate())");
					
																		echo "<div align=\"right\"><b>You have {$_kc} Knight Cash</b></div><br />";
																		echo "Thankyou for your purchase!<br /><br />
																			  For future reference and in case of any fraud purchases, this order has been recorded.<br /><br />
																			  You purchased $amount {$item}, bringing the total price to <b>{$_price}</b>
																			  <br /><br />
																			  Enjoy your purchase!";
																	
																}

												}
											else
												{
													echo "<div align=\"right\"><b>You have {$kc} Knight Cash</b></div><br />";
													echo "How many do you wish to purchase?<br />
													  Note: This item $stackable stackable.<br /><br />
													  You cannot purchase $amount of the item <b>{$item}</b>! You don't have enough Knight Cash to afford it.<br />
													  The maximum number of the item <b>{$item}</b> that you can purchase is {$max_purchase}!
													  <br /><br />
													  <form action='./?act={$filename}&selected=2' method='POST'>
														<input type='hidden' name='item' value='{$dwID}' />
													  	Amount: <input type='text' name='amount' /><input type='submit' value='Okay!' />
													  </form>";
												}
										
										}							
									else
										{
											echo "<div align=\"right\"><b>You have {$kc} Knight Cash</b></div><br />";
											echo "How many do you wish to purchase?<br />
											  Note: This item $stackable stackable.<br /><br />
											  You cannot have more than $max_stack of the item <b>{$item}</b>.
											  <br /><br />
											  <form action='./?act={$filename}&selected=2' method='POST'>
												<input type='hidden' name='item' value='{$dwID}' />
											  	Amount: <input type='text' name='amount' /><input type='submit' value='Okay!' />
											  </form>";
										}
								}	
						}
					else
						{
							echo "<div align=\"right\"><b>You have {$kc} Knight Cash</b></div><br />";
							echo "The <b>{$item}</b> costs <b>{$price}</b> Knight Cash, but you only have <b>{$kc}</b> Knight Cash!<br />
								  You must purchase more Knight Cash to be able to afford this!<br /><br />
								  <a href='javascript: history.go(-1);'><< Go back</a>";
						}
					part2();
			
			}
			
	echo '	
		<tr>
			<td align="center" height="35" valign="middle" colspan="' . $items_per_row . '" background="./skins/default/cat_top_mid.gif"><center><strong>Copyright to twostars &copy;, 2021.</strong></center></td>
		</tr>';

		}
?>

InsertItem Prosedürü

Kod:
--All credits go to the original writer of this script. Modified by Emil to work with v1299.
CREATE PROCEDURE [dbo].[InsertItem]
@StrUserID varchar(30),
@NEWNum int,
@StackSize int
AS
DECLARE
@length int,
@row int,
@i int,
@Num int,
@pos int,
@dur int,
@dur1 int,
@ext int,
@StackSize1 int,
@strName varchar(30),
@strExtName varchar(30),
@CNum varbinary(4),
@cdur varchar(2),
@cstack varchar(2)
BEGIN TRAN
If (@StackSize > 9999) or (@StackSize < 1)
begin
select @StrUserID, 0, 0, 0, 'Invalid StackSize', 'Stack size 1 > 9999'
ROLLBACK TRAN
RETURN
end

Begin
set @i = 1
set @length =1601
Select @row = count(*) From Warehouse Where strAccountID like @StrUserID

If @row = 0 or @row > 1
Begin
Select @StrUserID, 0, 0, 0, 'Invalid ID', 'Please check the name against the datasource'
ROLLBACK TRAN
RETURN
End
Select @row = count(*) From Warehouse Where (strAccountID like @StrUserID) and (WarehouseData is NULL)
If @row > 0
Begin
Select @StrUserID, 0, 0, 0, 'No Data', 'Warehouse is NULL'
ROLLBACK TRAN
RETURN
End
End

WHILE @i < @length
Begin

Select @Num=cast(cast(substring(cast(substring(WareHouseData, @i,4) as varbinary(4)), 4, 1)+substring(cast(substring(WareHouseData, @i,4) as varbinary(4)), 3, 1)+substring(cast(substring(WareHouseData, @i,4) as varbinary(4)), 2, 1)+substring(cast(substring(WareHouseData, @i,4) as varbinary(4)), 1, 1) as varbinary(4)) as int),
@dur = cast(cast(cast( substring(WareHouseData, @i+5, 1) as varbinary(1))+cast(substring(WareHouseData, @i+4, 1) as varbinary(1)) as varbinary(2)) as smallint),
@StackSize1 = cast(cast(cast( substring(WareHouseData, @i+7, 1) as varbinary(1))+cast(substring(WareHouseData, @i+6, 1) as varbinary(1)) as varbinary(2)) as smallint),
@StrUserID = strAccountID
From Warehouse
Where strAccountID = @StrUserID
If @Num = 0
begin
If @dur = 0
Begin
If @StackSize1 = 0
Begin
select @dur1 = Duration from ITEM where Num = @NEWNum
Set @dur = -1


Set @dur = @dur + @dur1
--Set @StackSize = 1
If @StackSize > 1
Set @dur = 1
Set @CNum = Substring(cast(@NEWNum as varbinary(4)), 4, 1) + Substring(cast(@NEWNum as varbinary(4)), 3, 1) + Substring(cast(@NEWNum as varbinary(4)), 2, 1) + Substring(cast(@NEWNum as varbinary(4)), 1, 1)
Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as varchar(2))
Set @Cstack = cast(Substring(cast(@StackSize as varbinary(2)), 2, 1)+Substring(cast(@StackSize as varbinary(2)), 1, 1) as varchar(2))

Begin
--select cast(warehousedata as varbinary(1600)) from warehouse where strAccountID = @strUserID
--select cast( substring(WareHouseData, 1, @i-1) + cast(cast(@CNum as varchar(4)) + @Cdur + @Cstack as varchar(8)) + substring(WareHouseData, @i+8, 1601-@i) as binary(1600)) from warehouse where strAccountID = @strUserID
update WareHouse set WareHouseData = cast( substring(WareHouseData, 1, @i-1) + cast(cast(@CNum as varchar(4)) + @Cdur + @Cstack as varchar(8)) + substring(WareHouseData, @i+8, 1601-@i) as binary(1600)) where strAccountID = @strUserID
COMMIT TRAN
RETURN
End
End
End
End
set @i = @i + 8
End

GO

Vinthian KO Panel V3'de çalışmaktadır. Session ve table ayarlarını yaparsanız diğer panellerede ekleyebilirsiniz.

Not. Şuan kendi serverimde sorunsuz olarak çalışmaktadır. Takıldığınız yer olursa yardımcı olmaya çalışırım.

Gerekli Tableler

Table: TB_USER
Coloumn: KC
Veritipi: INT
Uzunluk: 4

Table: USERDATA
Coloumn: Jifen
Veritipi: INT
Uzunluk: 4

dwID falanda varda, onlar için resimlerin falan değişmesi gerekiyor, şimdilik bu kadarı yeterli.
 
Son düzenleme:
Geri
Üst Alt