diff --git a/Templates/Plus/1.tpl b/Templates/Plus/1.tpl index 6d092791..7c667162 100644 --- a/Templates/Plus/1.tpl +++ b/Templates/Plus/1.tpl @@ -1,228 +1,46 @@ - 110, 'key' => 'A', 'img' => 'Travian_paket_a.jpg', 'gold' => defined('PLUS_PACKAGE_A_GOLD') ? PLUS_PACKAGE_A_GOLD : 60, 'price' => defined('PLUS_PACKAGE_A_PRICE') ? PLUS_PACKAGE_A_PRICE : '1,99'], + ['id' => 111, 'key' => 'B', 'img' => 'Travian_paket_b.jpg', 'gold' => defined('PLUS_PACKAGE_B_GOLD') ? PLUS_PACKAGE_B_GOLD : 120, 'price' => defined('PLUS_PACKAGE_B_PRICE') ? PLUS_PACKAGE_B_PRICE : '4,99'], + ['id' => 112, 'key' => 'C', 'img' => 'Travian_paket_c.jpg', 'gold' => defined('PLUS_PACKAGE_C_GOLD') ? PLUS_PACKAGE_C_GOLD : 360, 'price' => defined('PLUS_PACKAGE_C_PRICE') ? PLUS_PACKAGE_C_PRICE : '9,99'], + ['id' => 113, 'key' => 'D', 'img' => 'Travian_paket_d.jpg', 'gold' => defined('PLUS_PACKAGE_D_GOLD') ? PLUS_PACKAGE_D_GOLD : 1000, 'price' => defined('PLUS_PACKAGE_D_PRICE') ? PLUS_PACKAGE_D_PRICE : '19,99'], + ['id' => 3110, 'key' => 'E', 'img' => 'Travian_paket_e.jpg', 'gold' => defined('PLUS_PACKAGE_E_GOLD') ? PLUS_PACKAGE_E_GOLD : 2000, 'price' => defined('PLUS_PACKAGE_E_PRICE') ? PLUS_PACKAGE_E_PRICE : '49,99'], +]; + +$currency = defined('PAYPAL_CURRENCY') ? PAYPAL_CURRENCY : 'EUR'; +$payEmail = defined('PAYPAL_EMAIL') ? PAYPAL_EMAIL : 'novgorodschi@icloud.com'; ?> - - - - - - - - + - + - + Basically, we reserve the ordered amount of gold immediately after the payment. If there are any problems, please send an email to our + payment account.

+ Username
Payment Method
Ordered Package
Date and time


+ We strive to ensure speedy processing! +
Gold Shop
Gold Shop
Package A - -
Gold Shop
-
Gold Shop
Gold Shop
- Basically, we reserve the ordered amount of gold immediately after the payment. If there are any problems, please send an email to our - payment account.

Username
Payment Method
Ordered Package
- Date and time


We strive to ensure speedy processing!
- -
+
- - - - - - - - - - - - - - - - - - - - - - - -
Package A
- Package A
 Gold
» buy
- - - - - - - - - - - - - - - - - - - - - - - -
Package B
- Package B
 Gold
» buy
- - - - - - - - - - - - - - - - - - - - - - - -
Package C
- Package C
 Gold
» buy
- - - - - - - - - - - - - - - - - - - - - - - -
Package D
- Package D
 Gold
» buy
- - - - - - - - - - - - - - - - - - - - - - - -
Package E
- Package E
 Gold
» buy
- - - - - + + + + + + + + + +
Package
Package <?= $p['key'] ?>
 Gold
 
» buy
+
-
None of the packages are refundable!
- -
- +
None of the packages are refundable!
+ \ No newline at end of file diff --git a/Templates/Plus/10.tpl b/Templates/Plus/10.tpl index 42528183..4cf51161 100644 --- a/Templates/Plus/10.tpl +++ b/Templates/Plus/10.tpl @@ -1,28 +1,43 @@ gold >= 5){ - $MyGold = mysqli_query($database->dblink,"SELECT gold, b2 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); - if($session->sit == 0) { - if (mysqli_num_rows($MyGold) == 1) { - if($golds['gold'] >= 5) { - if($golds['b2'] < time()) { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } else { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } - $done1 = "+25% Production: Clay"; - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Clay')") or die(mysqli_error($database->dblink)); - } else { - $done1 = "You need more gold"; - } - } else { - $done1 = "Failed clay attempt"; - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Clay')") or die(mysqli_error($database->dblink)); - } - } - header("Location: plus.php?id=3"); - exit; + +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Project: TravianZ (Refactor incremental) ## +## File: 8.tpl ## +## Description: Clay Plus ## +## Made by: alq0rsan ## +## Improved by: evader ## +## Refactor by: Shadow ## +## ## +################################################################################# + +if($session->sit == 0) { + $uid = (int)$session->uid; + $now = time(); + $cost = 5; + + // UPDATE atomic: scade gold doar dacă ai, și prelungește b2 + $sql = "UPDATE ".TB_PREFIX."users + SET gold = gold - $cost, + b2 = IF(b2 > $now, b2 + ".PLUS_PRODUCTION.", $now + ".PLUS_PRODUCTION.") + WHERE id = '$uid' AND gold >= $cost"; + + mysqli_query($database->dblink, $sql) or die(mysqli_error($database->dblink)); + + if(mysqli_affected_rows($database->dblink) == 1) { + // succes - update instant în sesiune + $session->gold -= $cost; + + // log + mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Clay')") or die(mysqli_error($database->dblink)); + + // iinvalidează cache v9 + if(method_exists($database, 'clearUserCache')) { + $database->clearUserCache($uid); + } + } } - ?> \ No newline at end of file +header("Location: plus.php?id=3"); +exit; +?> \ No newline at end of file diff --git a/Templates/Plus/11.tpl b/Templates/Plus/11.tpl index a66df829..d2c23cef 100644 --- a/Templates/Plus/11.tpl +++ b/Templates/Plus/11.tpl @@ -1,28 +1,43 @@ gold >= 5){ - $MyGold = mysqli_query($database->dblink,"SELECT gold, b3 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); - if($session->sit == 0) { - if (mysqli_num_rows($MyGold)) { - if($golds['gold'] >= 5) { - if($golds['b3'] < time()) { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } else { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } - $done1 = "+25% Production: Iron"; - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Iron')") or die(mysqli_error($database->dblink)); - } else { - $done1 = "You need more gold"; - } - } else { - $done1 = "Failed iron attempt"; - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Iron')") or die(mysqli_error($database->dblink)); - } - } - header("Location: plus.php?id=3"); - exit; + +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Project: TravianZ (Refactor incremental) ## +## File: 8.tpl ## +## Description: Iron Plus ## +## Made by: alq0rsan ## +## Improved by: evader ## +## Refactor by: Shadow ## +## ## +################################################################################# + +if($session->sit == 0) { + $uid = (int)$session->uid; + $now = time(); + $cost = 5; + + // UPDATE atomic: scade gold doar dacă ai, și prelungește b3 + $sql = "UPDATE ".TB_PREFIX."users + SET gold = gold - $cost, + b3 = IF(b3 > $now, b3 + ".PLUS_PRODUCTION.", $now + ".PLUS_PRODUCTION.") + WHERE id = '$uid' AND gold >= $cost"; + + mysqli_query($database->dblink, $sql) or die(mysqli_error($database->dblink)); + + if(mysqli_affected_rows($database->dblink) == 1) { + // succes - update instant în sesiune + $session->gold -= $cost; + + // log + mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Iron')") or die(mysqli_error($database->dblink)); + + // invalidează cache v9 + if(method_exists($database, 'clearUserCache')) { + $database->clearUserCache($uid); + } + } } - ?> \ No newline at end of file +header("Location: plus.php?id=3"); +exit; +?> \ No newline at end of file diff --git a/Templates/Plus/110.tpl b/Templates/Plus/110.tpl index 0b0474af..1d93d318 100644 --- a/Templates/Plus/110.tpl +++ b/Templates/Plus/110.tpl @@ -1,147 +1,41 @@ uid; -//echo"
Benutzer-Id : $name
"; -//$free = $session->uid; -//echo"
Veriable free : ?account=56387&project=trvnx&theme=default&gfx=x-surfer&bgcolor=ffffff&title=travianix-30+Gold&amount=150&free=$free
"; + +$pkg = [ + 'gold' => defined('PLUS_PACKAGE_A_GOLD') ? PLUS_PACKAGE_A_GOLD : 60, + 'price' => defined('PLUS_PACKAGE_A_PRICE') ? PLUS_PACKAGE_A_PRICE : '1,99', +]; +$price = str_replace(',', '.', $pkg['price']); +$currency = defined('PAYPAL_CURRENCY') ? PAYPAL_CURRENCY : 'EUR'; +$email = defined('PAYPAL_EMAIL') ? PAYPAL_EMAIL : 'novgorodschi@icloud.com'; ?> - - + + + + + + +
More info: PayPal + + + - - - - - - - - - - - - - - -
2. Handy2Pay
Paket A - -
Gold : 60
Cost : 1,99 Euro
Wait: Instant
-
- Pay with SMS
- - - handy2pay - -
- More Info about micropayment can be found here:
More Info
-
- - - - - - - - - - - - - - -
3. Ebank2Pay
Paket A - -
Gold : 60
Cost : 1,99 Euro
Wait: Sofort
-
- Pay by online banktransfer
- - - ebank2pay - -
- More Info about micropayment can be found here:
More Info
-
---> - - - - - - - - - - - - - -
Paypal
- Package A - -
- Gold : -
- Cost : -
- Wait: 24 hours -
-
- Initiate Payment by Paypal -

-
- - - - - - - - - - "> - - - - - - -
- -
- More Info about PayPal can be found here:
- More Info -
-
-





- - - + \ No newline at end of file diff --git a/Templates/Plus/111.tpl b/Templates/Plus/111.tpl index 1decf107..82e39ed1 100644 --- a/Templates/Plus/111.tpl +++ b/Templates/Plus/111.tpl @@ -1,220 +1,48 @@ uid; + +$uid = (int)$session->uid; +$gold = defined('PLUS_PACKAGE_B_GOLD')? PLUS_PACKAGE_B_GOLD : 120; +$price = defined('PLUS_PACKAGE_B_PRICE')? str_replace(',', '.', PLUS_PACKAGE_B_PRICE) : '4.99'; +$currency = defined('PAYPAL_CURRENCY')? PAYPAL_CURRENCY : 'EUR'; +$paypal = defined('PAYPAL_EMAIL')? PAYPAL_EMAIL : 'novgorodschi@icloud.com'; + +// link-uri pentru IPN +$notify = rtrim(HOMEPAGE,'/'). '/paypal_ipn.php'; +$return = rtrim(HOMEPAGE,'/'). '/plus.php?id=1&paid=1'; +$cancel = rtrim(HOMEPAGE,'/'). '/plus.php?id=1&cancel=1'; ?> - - + + + + + -
Gold : 120
Cost : 4,99 Euro
Wait: Instant
- - - Pay by phone
- - - call2pay - -
- More information about micropayent can be found here:
More Info
- - - - + + +
After payment you will be credited automatically. + + + - - - - - - - - - - - - - - -
2. Handy2Pay
Paket A - -
Gold : 120
Cost : 4,99 Euro
Wait: Instant
-
- Pay with SMS
- - - handy2pay - -
- More information about micropayent can be found here:
More Info
-
- - - - - - - - - - - - - - -
3. Ebank2Pay
Paket A - -
Gold : 120
Cost : 4,99 Euro
Wait: Instant
-
- Pay with online banktransfer
- - - ebank2pay - -
- More information about micropayent can be found here:
More Info
-
---> - - - - - - - - - - - - - -
Paypal
- Package B - -
- Gold : -
- Cost : -
- Wait: 24 hours -
-
- Initiate Payment by Paypal -

-
- - - - - - - - - - "> - - - - - - -
- -
- More Info about PayPal can be found here:
- More Info -
-
- -





- - - + \ No newline at end of file diff --git a/Templates/Plus/112.tpl b/Templates/Plus/112.tpl index b4f7c1da..1d9bf5e5 100644 --- a/Templates/Plus/112.tpl +++ b/Templates/Plus/112.tpl @@ -1,220 +1,43 @@ uid; + +$uid = (int)$session->uid; +$gold = defined('PLUS_PACKAGE_C_GOLD') ? PLUS_PACKAGE_C_GOLD : 360; +$price = defined('PLUS_PACKAGE_C_PRICE') ? str_replace(',', '.', PLUS_PACKAGE_C_PRICE) : '9.99'; +$currency = defined('PAYPAL_CURRENCY') ? PAYPAL_CURRENCY : 'EUR'; +$paypal = defined('PAYPAL_EMAIL') ? PAYPAL_EMAIL : 'novgorodschi@icloud.com'; + +$base = rtrim(HOMEPAGE,'/'); ?> - - + + + + + - - handy2pay - -
- More information about micropayent can be found here:
More Info
- - - - + + + + + - - - - - - - - - - - - - - -
3. Ebank2Pay
Paket A - -
Gold : 360
Cost : 9,99 Euro
Wait: Instant
-
- Pay by online banktranfer
- - - ebank2pay - -
- More information about micropayent can be found here:
More Info
-
---> - - - - - - - - - - - - - -
Paypal
- Package C - -
- Gold : -
- Cost : -
- Wait: 24 hours -
-
- Initiate Payment by Paypal -

-
- - - - - - - - - - "> - - - - - - -
- -
- More Info about PayPal can be found here:
- More Info -
-
- -





- - - - + \ No newline at end of file diff --git a/Templates/Plus/113.tpl b/Templates/Plus/113.tpl index cd71db7f..55e0c92d 100644 --- a/Templates/Plus/113.tpl +++ b/Templates/Plus/113.tpl @@ -1,193 +1,39 @@ uid; + +$uid = (int)$session->uid; +$gold = defined('PLUS_PACKAGE_D_GOLD') ? PLUS_PACKAGE_D_GOLD : 1000; +$price = defined('PLUS_PACKAGE_D_PRICE') ? str_replace(',', '.', PLUS_PACKAGE_D_PRICE) : '19.99'; +$currency = defined('PAYPAL_CURRENCY') ? PAYPAL_CURRENCY : 'EUR'; +$paypal = defined('PAYPAL_EMAIL') ? PAYPAL_EMAIL : 'novgorodschi@icloud.com'; +$base = rtrim(HOMEPAGE,'/'); ?> - - - - - - - - - - - - - - - -
Paypal
- Package D - -
- Gold : -
- Cost : -
- Wait: 24 hours -
-
- Initiate Payment by Paypal -

-
- - - - - - - - - - "> - - - - - - -
- -
- More Info about PayPal can be found here:
- More Info -
-
- -





- - - - + \ No newline at end of file diff --git a/Templates/Plus/12.tpl b/Templates/Plus/12.tpl index 2ea41910..19dff784 100644 --- a/Templates/Plus/12.tpl +++ b/Templates/Plus/12.tpl @@ -1,28 +1,43 @@ gold >= 5){ - $MyGold = mysqli_query($database->dblink,"SELECT gold, b4 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); - if($session->sit == 0) { - if (mysqli_num_rows($MyGold)) { - if($golds['gold'] >= 5) { - if($golds['b4'] < time()) { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } else { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } - $done1 = "+25% Production: Crop"; - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Crop')") or die(mysqli_error($database->dblink)); - } else { - $done1 = "You need more gold"; - } - } else { - $done1 = "Failed crop attempt"; - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Crop')") or die(mysqli_error($database->dblink)); - } - } - header("Location: plus.php?id=3"); - exit; + +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Project: TravianZ (Refactor incremental) ## +## File: 8.tpl ## +## Description: Crop Plus ## +## Made by: alq0rsan ## +## Improved by: evader ## +## Refactor by: Shadow ## +## ## +################################################################################# + +if($session->sit == 0) { + $uid = (int)$session->uid; + $now = time(); + $cost = 5; + + // UPDATE atomic: scade gold doar dacă ai, și prelungește b4 + $sql = "UPDATE ".TB_PREFIX."users + SET gold = gold - $cost, + b4 = IF(b4 > $now, b4 + ".PLUS_PRODUCTION.", $now + ".PLUS_PRODUCTION.") + WHERE id = '$uid' AND gold >= $cost"; + + mysqli_query($database->dblink, $sql) or die(mysqli_error($database->dblink)); + + if(mysqli_affected_rows($database->dblink) == 1) { + // succes - update instant în sesiune + $session->gold -= $cost; + + // log + mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Crop')") or die(mysqli_error($database->dblink)); + + // invalidează cache v9 + if(method_exists($database, 'clearUserCache')) { + $database->clearUserCache($uid); + } + } } - ?> \ No newline at end of file +header("Location: plus.php?id=3"); +exit; +?> \ No newline at end of file diff --git a/Templates/Plus/13.tpl b/Templates/Plus/13.tpl deleted file mode 100644 index 86bbd17b..00000000 --- a/Templates/Plus/13.tpl +++ /dev/null @@ -1,48 +0,0 @@ - \ No newline at end of file diff --git a/Templates/Plus/14.tpl b/Templates/Plus/14.tpl deleted file mode 100644 index b2dafa54..00000000 --- a/Templates/Plus/14.tpl +++ /dev/null @@ -1,29 +0,0 @@ -dblink,"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error($database->dblink)); - $uuVilid = mysqli_fetch_array($MyVilId); - - $totalT = ($T1+$T2+$T3+$T4); - $totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']); - - $goldlog = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."gold_fin_log"), MYSQLI_ASSOC) or die(mysqli_error($database->dblink)); - -if($totalT <= $totalR) { -mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink)); -mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink)); -mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink)); -mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink)); - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'trade 1:1')") or die(mysqli_error($database->dblink)); -echo "done"; -} else { -echo "failed"; - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysqli_error($database->dblink)); - -} - -header("Location: plus.php?id=3"); -exit; - - ?> \ No newline at end of file diff --git a/Templates/Plus/15.tpl b/Templates/Plus/15.tpl index 01e27972..7aa1e42f 100644 --- a/Templates/Plus/15.tpl +++ b/Templates/Plus/15.tpl @@ -1,8 +1,36 @@ gold >= 100 && $session->sit == 0 && $session->goldclub == 0) { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'"); +// Gold Club activation – 100 gold, atomic +$uid = (int)$session->uid; + +if($session->sit != 0) { + header("Location: plus.php?id=3"); exit; } + +// un singur query care face tot +mysqli_query($database->dblink, + "UPDATE ".TB_PREFIX."users + SET goldclub = 1, gold = gold - 100 + WHERE id = $uid AND gold >= 100 AND goldclub = 0" +); + +if(mysqli_affected_rows($database->dblink) == 1) { + // succes – update sesiunea + $session->gold -= 100; + $session->goldclub = 1; + $_SESSION['gold'] = $session->gold; + $_SESSION['goldclub'] = 1; + + if(isset($database->cache)) { + $database->cache->delete('user:'.$uid); + } + + // log + mysqli_query($database->dblink, + "INSERT INTO ".TB_PREFIX."gold_fin_log (wid, action, time) + VALUES (0, 'Gold Club activated', ".time().")" + ); +} + header("Location: plus.php?id=3"); exit; ?> \ No newline at end of file diff --git a/Templates/Plus/2.tpl b/Templates/Plus/2.tpl index 90f30a97..822de94f 100644 --- a/Templates/Plus/2.tpl +++ b/Templates/Plus/2.tpl @@ -1,207 +1,54 @@ 'Waiting loop for constructions', 'img'=>'p1', 'text'=>'The waiting loop enables you to give your builders another order to raise or extend a second building. After completing their first task and a short break (60s), they will start to take care of this second job.'], + ['title'=>'Larger map', 'img'=>'xxl_map', 'text'=>'You can enlarge the map to get a better overview. Instead of 7x7 fields you can have a map of 13x13 fields. Other alliances which are allied or have a non-aggression pact (NAP) with you are shown in special colours.'], + ['title'=>'Archive function for reports and messages', 'img'=>'p5', 'text'=>'Important reports and messages can be archived and thereby be looked up faster. Additionally, you can choose several messages or reports and archive or delete them at once.'], + ['title'=>'Sorting function for reports and messages', 'img'=>'sort', 'text'=>'By clicking the table heading "Sent" you can reverse the sorting of reports and messages. If you get many messages a day and need to look up older ones you are able to do so very fast with this function. It can also be used in the archives.'], + ['title'=>'Sorting function for the marketplace', 'img'=>'p6', 'text'=>'To use the marketplace more efficiently, you can filter the offers for certain resources only. Additionally you can use a ratio filter to only see 1:1 offers.'], + ['title'=>'Auto-completion', 'img'=>'autovv', 'text'=>'By using the auto-completion you can easily "write" a whole village name by using very few figures. Depending on your preferences you can use this function in any combination for own villages, villages of alliance members or villages of your surroundings.'], + ['title'=>'Report filter', 'img'=>'bfilter', 'text'=>'Thanks to the report filter unwanted reports concerning marketplace transactions are a problem of the past. Depending on your personal preferences you can easily switch off reports concerning trades from/to other villages or between your own villages.'], + ['title'=>'Freely definable direct links', 'img'=>'p7', 'text'=>'Thanks to these links, you can reach every page you want with just one click. Just create a link to every destination you want and get directly to your alliance\'s overview, to your barracks or to the tempting 1:1 biddings at the marketplace.'], + ['title'=>'Graphical statistics', 'img'=>'st1', 'text'=>'These statistics show you the chronological development of your account, e.g. the ranking, your army\'s strength or your population\'s development.'], + ['title'=>'Central account overview', 'img'=>'dorf3', 'text'=>'Anyone who reigns over several villages might easily miss something going on within his realm: where are those troops I built, are all my workers at work or are some of them lazy, do I lose resources because one of my warehouses isn\'t big enough? Just take a look at your central village overview and you can check out all your villages at once.'], + ['title'=>'Notepad', 'img'=>'p8', 'text'=>'Paper and pencil aren\'t always at hand. In order to make you don\'t forget important things or if you simply want to make a few notes, use your notebook.'], +]; + +$goldFeatures = [ + ['title'=>'Production bonus for lumber', 'img'=>'p1_25', 'text'=>'With this Gold advantage all your villages\' lumber production will be increased by 25%.

The bonus will not be added to the single resource fields but to the sum of the production.'], + ['title'=>'Production bonus for clay', 'img'=>'p2_25', 'text'=>'With this Gold advantage all your villages\' clay production will be increased by 25%.

The bonus will not be added to the single resource fields but to the sum of the production.'], + ['title'=>'Production bonus for iron', 'img'=>'p3_25', 'text'=>'With this Gold advantage all your villages\' iron production will be increased by 25%.

The bonus will not be added to the single resource fields but to the sum of the production.'], + ['title'=>'Production bonus for crop', 'img'=>'p4_25', 'text'=>'With this Gold advantage all your villages\' crop production will be increased by 25%.

The bonus will not be added to the single resource fields but to the sum of the production.'], + ['title'=>'Complete construction orders & research immediately.', 'img'=>'bau0', 'text'=>'In the current village all construction orders and research in the academy as well as the blacksmith and armoury will be completed immediately.

However, the buildings Residence and Palace and villages with a wonder of the world inside them are excluded.'], + ['title'=>'NPC Merchant', 'img'=>'npc', 'text'=>'The NPC Merchant will exchange any desired amount of resources in a village with other resources at a ratio of 1:1.'], +]; ?> - - + + + + + + + + + + + +
Features of Travian Plus
Features of Travian Plus
<?= $f['title'] ?>
- - - - - Waiting loop for constructions - - - Waiting loop for constructions - The waiting loop enables you to give your builders another order to raise or extend a second building. After completing their first task and a short break (60s), they will start to take care of this second job. - - - - - - Larger map - - - Larger map - - You can enlarge the map to get a better overview. Instead of 7x7 fields you can have a map of 13x13 fields. Other alliances which are allied or have a non-aggression pact (NAP) with you are shown in special colours. - - - - - Archive function for reports and messages - - - - Archive function for reports and messages - Important reports and messages can be archived and thereby be looked up faster. Additionally, you can choose several messages or reports and archive or delete them at once. - - - - - Sorting function for reports and messages - - - - Sorting function for reports and messages - By clicking the table heading "Sent" you can reverse the sorting of reports and messages. If you get many messages a day and need to look up older ones you are able to do so very fast with this function. It can also be used in the archives. - - - - - - Sorting function for the marketplace - - - Sorting function for the marketplace - To use the marketplace more efficiently, you can filter the offers for certain resources only. Additionally you can use a ratio filter to only see 1:1 offers. - - - - - - Auto-completion - - - Auto-completion - By using the auto-completion you can easily "write" a whole village name by using very few figures. Depending on your preferences you can use this function in any combination for own villages, villages of alliance members or villages of your surroundings. - - - - - - Report filter - - - Report filter - Thanks to the report filter unwanted reports concerning marketplace transactions are a problem of the past. Depending on your personal preferences you can easily switch off reports concerning trades from/to other villages or between your own villages. - - - - - - Freely definable direct links - - - Freely definable direct links - Thanks to these links, you can reach every page you want with just one click. Just create a link to every destination you want and get directly to your alliance's overview, to your barracks or to the tempting 1:1 biddings at the marketplace. - - - - - - Graphical statistics - - - Graphical statistics - - These statistics show you the chronological development of your account, e.g. the ranking, your army's strength or your population's development. - - - - - Central account overview - - - - Central account overview - Anyone who reigns over several villages might easily miss something going on within his realm: where are those troops I built, are all my workers at work or are some of them lazy, do I lose resources because one of my warehouses isn't big enough? Just take a look at your central village overview and you can check out all your villages at once. If you own more than one village you can reach the central village overview by clicking "Villages" directly above the list of your villages. - - - - - Notepad - - - - Notepad - Paper and pencil aren't always at hand. In order to make you don't forget important things or if you simply want to make a few notes, use your notebook. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Features of Travian Gold
Production bonus for lumber
Production bonus for lumberWith this Gold advantage all your villages' lumber production will be increased by 25%. -

-The bonus will not be added to the single resource fields but to the sum of the production. -

-This feature is NOT included in the gold club!

Production bonus for clay
Production bonus for clayWith this Gold advantage all your villages' clay production will be increased by 25%. -

-The bonus will not be added to the single resource fields but to the sum of the production. -

-This feature is NOT included in the gold club!

Production bonus for iron
Production bonus for ironWith this Gold advantage all your villages' iron production will be increased by 25%. -

-The bonus will not be added to the single resource fields but to the sum of the production. - -

-This feature is NOT included in the gold club!

Production bonus for crop
Production bonus for cropWith this Gold advantage all your villages' crop production will be increased by 25%. -

-The bonus will not be added to the single resource fields but to the sum of the production. -

-This feature is NOT included in the gold club!

Complete construction orders & research immediately.
Complete construction orders & research immediately.In the current village all construction orders and research in the academy as well as the blacksmith and armoury will be completed immediately. -

-However, the buildings Residence and Palace and villages with a wonder of the world inside them are excluded. - -

-This feature is NOT included in the gold club!

NPC Merchant
NPC MerchantThe NPC Merchant will exchange any desired amount of resources in a village with other resources at a ratio of 1:1. -

-This feature is NOT included in the gold club!

+ + + + + + + + + + + + +
Features of Travian Gold
<?= $f['title'] ?>

This feature is NOT included in the gold club!
+ \ No newline at end of file diff --git a/Templates/Plus/3.tpl b/Templates/Plus/3.tpl index e14ae579..3b7ba3c0 100644 --- a/Templates/Plus/3.tpl +++ b/Templates/Plus/3.tpl @@ -1,454 +1,184 @@ dblink, "SELECT * FROM " . TB_PREFIX . "users WHERE `id`='" . $session->uid . "'") or die(mysqli_error($database->dblink)); -$golds = mysqli_fetch_array($MyGold); +// TODO: Reduce this file by a lot, by using arrays +$MyGold = mysqli_query($database->dblink, "SELECT * FROM " . TB_PREFIX . "users WHERE id='".$session->uid."'") or die(mysqli_error($database->dblink)); +$golds = mysqli_fetch_assoc($MyGold); include ("Templates/Plus/pmenu.tpl"); -$MyGold = mysqli_query($database->dblink, "SELECT * FROM " . TB_PREFIX . "users WHERE `id`='" . $session->uid . "'") or die(mysqli_error($database->dblink)); -$golds = mysqli_fetch_array($MyGold); +$date2 = time(); -$today = date("mdHi"); - -if (mysqli_num_rows($MyGold)) { - if ($session->gold == 0) +if ($golds) { + if ($golds['gold'] == 0) echo "

You currently don't own gold.

"; else - echo "

You currently have $session->gold gold

"; + echo "

You currently have ".$golds['gold']." gold

"; } -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '; - } - } -} else { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b2 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $tl_b2 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold'; - } - } -} -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Plus function
DescriptionDurationGoldAction
Plus Account
-'.$days.' days '.$hours.' hours '.$mins.' mins '.$secs.' secs (until '.date('H:i:s', (int)$endTimestamp).')'; } - -if ($datetimep == 0) echo "get PLUS
"; -else -{ - if ($datetimep <= $date2) { - print "Your PLUS advantage has ended.
"; - mysqli_query($database->dblink, "UPDATE " . TB_PREFIX . "users set plus = '0' where `id`='" . $session->uid . "'") or die(mysqli_error($database->dblink)); - } else { - echo "" . formatRemainingTime($datetimep, $date2) . ""; - } -} - ?> -
= 86400) { - echo '' . (PLUS_TIME / 86400) . ' Days'; - } else if (PLUS_TIME < 86400) { - echo '' . (PLUS_TIME / 3600) . ' Hours'; - } - ?> - Gold10 - -dblink, "SELECT * FROM " . TB_PREFIX . "users WHERE `id`='" . $session->uid . "'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); - - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 9 && $datetimep < $date2) { - echo ' - Activate'; - } elseif ($golds['gold'] > 9 && $datetimep > $date2) { - echo ' - Extend'; - } else { - echo 'too little gold'; - } - } ?> - -
+25% Lumber Production: Lumber
-= $date2) { - echo "" . formatRemainingTime($tl_b1, $date2) . " "; -} -?> -  - -
= 86400) { - echo '' . (PLUS_PRODUCTION / 86400) . ' Days'; -} else if (PLUS_PRODUCTION < 86400) { - echo '' . (PLUS_PRODUCTION / 3600) . ' Hours'; -} -?>Gold5 - -access != BANNED) { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b1 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $datetime1 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold'; - } - } -} else { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b1 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $datetime1 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold'; - } - } -} -?> -
+25% Clay Production: Clay
-= $date2) { - echo "" . formatRemainingTime($tl_b2, $date2) . ""; -} -?> -  -
= 86400) { - echo '' . (PLUS_PRODUCTION / 86400) . ' Days'; -} else if (PLUS_PRODUCTION < 86400) { - echo '' . (PLUS_PRODUCTION / 3600) . ' Hours'; -} -?>Gold5 - -access != BANNED) { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b2 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $tl_b2 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold
+25% Iron Production: Iron
-= $date2) { - echo "" . formatRemainingTime($tl_b3, $date2) . ""; -} -?> -  -
= 86400) { - echo '' . (PLUS_PRODUCTION / 86400) . ' Days'; -} else if (PLUS_PRODUCTION < 86400) { - echo '' . (PLUS_PRODUCTION / 3600) . ' Hours'; -} -?>Gold5 - -access != BANNED) { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b3 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $tl_b3 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold'; - } - } -} else { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b3 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $tl_b3 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold'; - } - } -} -?> - 
+25% Crop Production: Crop
-= $date2) { - echo "" . formatRemainingTime($tl_b4, $date2) . ""; -} -?> -  -
= 86400) { - echo '' . (PLUS_PRODUCTION / 86400) . ' Days'; -} else if (PLUS_PRODUCTION < 86400) { - echo '' . (PLUS_PRODUCTION / 3600) . ' Hours'; -} -?>Gold5 -access != BANNED) { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b4 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $tl_b4 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold'; - } - } -} else { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 4 && $tl_b4 < $date2) { - echo 'Activate'; - } elseif ($golds['gold'] > 4 && $tl_b4 > $date2) { - echo ' Extend'; - } else { - echo 'too little gold'; - } - } -} -?> -
Complete construction orders and researches in this - village now (does not work for Palace and Residence).nowGold2 - -access != BANNED) { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 1) { - echo ' - On'; - } else { - echo 'too little gold'; - } - } -} else { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 1) { - echo ' - On'; - } else { - echo 'too little gold'; - } - } -} -?> -
1:1 Trade with the NPC merchantnowGold3 - -access != BANNED) { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 2) { - echo ' NPC'; - } else { - echo 'too little gold'; - } - } -} else { - if (mysqli_num_rows($MyGold)) { - if ($golds['gold'] > 2) { - echo ' NPC'; - } else { - echo 'too little gold'; - } - } -} -?> -
- - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + -dblink, "SELECT * FROM " . TB_PREFIX . "users WHERE `id`='" . $session->uid . "'") or die(mysqli_error($database->dblink)); -$golds = mysqli_fetch_array($MyGold); - -if (mysqli_num_rows($MyGold)) { - if ($golds['goldclub'] == 0) { - if ($golds['gold'] > 99) { - echo ' - Activate'; - } else { - echo ' - too little gold'; - } - } else { - echo 'On'; - } -} -?> - - + + + + + +
Travian Gold Club
DescriptionDurationGoldAction
Plus function
DescriptionDurationGoldAction
Plus Account
+ "; + else { + if ($datetimep <= $date2) { + echo "Your PLUS advantage has ended.
"; + mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."users SET plus='0' WHERE id='".$session->uid."'"); + } else { + echo "".formatRemainingTime($datetimep, $date2).""; + } + } + ?>
= 86400) ? (PLUS_TIME/86400).' Days' : (PLUS_TIME/3600).' Hours'; ?>10 9 && $datetimep < $date2) { + echo 'Activate'; + } elseif ($golds['gold'] > 9 && $datetimep > $date2) { + echo 'Extend'; + } else { + echo 'too little gold'; + } + ?>
+25% Production: Lumber
+ =$date2) echo "".formatRemainingTime($tl_b1,$date2).""; ?>
=86400)?(PLUS_PRODUCTION/86400).' Days':(PLUS_PRODUCTION/3600).' Hours'; ?>5access!=BANNED){ + if($golds['gold']>4 && $tl_b1<$date2){ + echo 'Activate'; + } elseif($golds['gold']>4 && $datetime1>$date2){ + echo 'Extend'; + } else echo 'too little gold'; + } else { + echo 'too little gold'; + } + ?>
+25% Production: Clay
+ =$date2) echo "".formatRemainingTime($tl_b2,$date2).""; ?>
=86400)?(PLUS_PRODUCTION/86400).' Days':(PLUS_PRODUCTION/3600).' Hours'; ?>5access!=BANNED){ + if($golds['gold']>4 && $tl_b2<$date2){ + echo 'Activate'; + } elseif($golds['gold']>4 && $tl_b2>$date2){ + echo 'Extend'; + } else echo 'too little gold'; + } else echo 'too little gold'; + ?>
+25% Production: Iron
+ =$date2) echo "".formatRemainingTime($tl_b3,$date2).""; ?>
=86400)?(PLUS_PRODUCTION/86400).' Days':(PLUS_PRODUCTION/3600).' Hours'; ?>5access!=BANNED){ + if($golds['gold']>4 && $tl_b3<$date2){ + echo 'Activate'; + } elseif($golds['gold']>4 && $tl_b3>$date2){ + echo 'Extend'; + } else echo 'too little gold'; + } else echo 'too little gold'; + ?>
+25% Production: Crop
+ =$date2) echo "".formatRemainingTime($tl_b4,$date2).""; ?>
=86400)?(PLUS_PRODUCTION/86400).' Days':(PLUS_PRODUCTION/3600).' Hours'; ?>5access!=BANNED){ + if($golds['gold']>4 && $tl_b4<$date2){ + echo 'Activate'; + } elseif($golds['gold']>4 && $tl_b4>$date2){ + echo 'Extend'; + } else echo 'too little gold'; + } else echo 'too little gold'; + ?>
Gold Club
Whole game roundGold100 + Complete construction orders and researches in this village nownow21) ? 'On' : 'too little gold'; + ?>
1:1 Trade with the NPC merchantnow32) ? 'NPC' : 'too little gold'; + ?>
- + + + + + + + + + + + + + +
Travian Gold Club
DescriptionDurationGoldAction
Gold ClubWhole game round10099){ + echo 'Activate'; + } else echo 'too little gold'; + } else echo 'On'; + ?>
+ \ No newline at end of file diff --git a/Templates/Plus/3110.tpl b/Templates/Plus/3110.tpl index 0e96c9d8..a8fd4c46 100644 --- a/Templates/Plus/3110.tpl +++ b/Templates/Plus/3110.tpl @@ -1,165 +1,39 @@ uid; + +$uid = (int)$session->uid; +$gold = defined('PLUS_PACKAGE_E_GOLD') ? PLUS_PACKAGE_E_GOLD : 2000; +$price = defined('PLUS_PACKAGE_E_PRICE') ? str_replace(',', '.', PLUS_PACKAGE_E_PRICE) : '49.99'; +$currency = defined('PAYPAL_CURRENCY') ? PAYPAL_CURRENCY : 'EUR'; +$paypal = defined('PAYPAL_EMAIL') ? PAYPAL_EMAIL : 'novgorodschi@icloud.com'; +$base = rtrim(HOMEPAGE,'/'); ?> - - - - - - - - - - - - - - -
Paypal
- Package E - -
- Gold : -
- Cost : -
- Wait: 24 hours -
-
- Initiate Payment by Paypal -

-
- - - - - - - - - - "> - - - - - - -
- -
- More Info about PayPal can be found here:
- More Info -
-
- -





- - - - + \ No newline at end of file diff --git a/Templates/Plus/4.tpl b/Templates/Plus/4.tpl index 2bb78479..7f5186ea 100644 --- a/Templates/Plus/4.tpl +++ b/Templates/Plus/4.tpl @@ -2,18 +2,14 @@ include("Templates/Plus/pmenu.tpl"); ?>

How do I get Gold?

-

Ask owner of the site

- +

Buy it in the Gold Shop or ask the server owner.

Why can't I finish some buildings with Gold?

+

Residence, Palace and World Wonder villages are excluded for gameplay reasons.

-

Due to game play reasons the buildings Residence and Palace are excluded from this function. The same applies to villages in which the wonders of the world can be constructed.

- -

I activated the Plus account, however, my resource production did not increase.

-

The production did not increase because Plus is separated from these additional features.

- -

Do I need to activate Plus before I can use any other function?

-

No, you can use every single gold feature as long as you have enough gold.

- - +

I activated Plus, but production did not increase.

+

Plus does not include production bonuses. You must buy +25% for each resource separately in Plus functions.

+

Do I need Plus to use other features?

+

No. Every gold feature works standalone as long as you have enough gold.

+ \ No newline at end of file diff --git a/Templates/Plus/5.tpl b/Templates/Plus/5.tpl index ee48f569..ea511083 100644 --- a/Templates/Plus/5.tpl +++ b/Templates/Plus/5.tpl @@ -1,68 +1,46 @@ uid; +$invited = $database->getInvitedUser($session->uid); ?> +

Invite friends and receive free Gold

+

If you get new players to open an account and settle a second village, you will receive 50 gold. You can use this gold for Plus or any gold advantage.

+To bring in new players, invite them by e-mail or share your REF link.

-

Invite friends and receive free Gold

+

How is it done?

+

1) Invite your friends via Email

+

» Invite by e-mail

-

If you get new players to open an account and settle a second village with Travian you will receive gold. You can use this gold to purchase a plus account or plus advantages. -
-
- To bring in new players, you can invite them by e-mail or have them click on your REF link.

+

2) Copy your personal REF-Link and share it!

+Your personal REF Link:
+ -

How is it done?

+

Progress of your invited friends

+

As soon as a player you invited founds his 2nd village, you will be credited with 50 gold.

-

1) Invite your friends via Email

-

» Invite by e-mail

-

2) Copy your personal REF-Link and share it!

Your personal REF Link: -
- anmelden.php?uid=ref_uid; ?> - -

Progress of your invited friends

- -

As soon as a player you invited has found his 2 village, you will be credited with 50 gold.

- - - - - - - - - - - - - - - - - - getInvitedUser($session->uid); - if(count($invite) > 0){ - foreach($invite as $invited) { - $varray = $database->getProfileVillages($invited['id']); - $totalpop = 0; - foreach($varray as $vil) { - $totalpop += $vil['pop']; - } - ?> - - - - - - - - - - +
Players brought in
UIDMember sinceInhabitantsVillages
+ + + + + + + getProfileVillages($inv['id']); + $totalPop = array_sum(array_column($villages, 'pop')); + $vilCount = count($villages); + ?> - + + + + - - -
Players brought in
UIDMember sinceInhabitantsVillages
You have not brought in any new players yet. = 2 ? '' : '' ?>
- + + + You have not brought in any new players yet. + + + + \ No newline at end of file diff --git a/Templates/Plus/7.tpl b/Templates/Plus/7.tpl index df055223..1d06821a 100644 --- a/Templates/Plus/7.tpl +++ b/Templates/Plus/7.tpl @@ -1,4 +1,17 @@ finishAll('plus.php?id=3'); exit; ?> diff --git a/Templates/Plus/8.tpl b/Templates/Plus/8.tpl index acd0674c..b7686ae0 100644 --- a/Templates/Plus/8.tpl +++ b/Templates/Plus/8.tpl @@ -1,28 +1,43 @@ gold >= 10){ - $MyGold = mysqli_query($database->dblink,"SELECT gold, plus FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); - if($session->sit == 0) { - if (mysqli_num_rows($MyGold) == 1) { - if($golds['gold'] >= 10) { - if($golds['plus'] == 0) { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+".PLUS_TIME." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } else { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = '".($golds['plus']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } - $done1 = "  Plus Account"; - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-10)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Plus Account')") or die(mysqli_error($database->dblink)); - } else { - $done1 = "  You need more gold"; - } - } else { - $done1 = "Failed plus attempt"; - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed Plus Account')") or die(mysqli_error($database->dblink)); - } - } - header("Location: plus.php?id=3"); - exit; + +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Project: TravianZ (Refactor incremental) ## +## File: 8.tpl ## +## Description: Plus Account ## +## Made by: alq0rsan ## +## Improved by: evader ## +## Refactor by: Shadow ## +## ## +################################################################################# + +if($session->sit == 0) { + $now = time(); + $uid = (int)$session->uid; + $cost = 10; + + // un singur UPDATE: scade gold DOAR dacă ai destul, și prelungește plus-ul + $sql = "UPDATE ".TB_PREFIX."users + SET gold = gold - $cost, + plus = IF(plus > $now, plus + ".PLUS_TIME.", $now + ".PLUS_TIME.") + WHERE id = '$uid' AND gold >= $cost"; + + mysqli_query($database->dblink, $sql) or die(mysqli_error($database->dblink)); + + if(mysqli_affected_rows($database->dblink) == 1) { + // a reușit - actualizează sesiunea instant + $session->gold -= $cost; + + // log (opțional) + mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Plus Account')") or die(mysqli_error($database->dblink)); + + // invalidează cache v9 + if(method_exists($database, 'clearUserCache')) { + $database->clearUserCache($uid); + } + } } - ?> \ No newline at end of file +header("Location: plus.php?id=3"); +exit; +?> \ No newline at end of file diff --git a/Templates/Plus/9.tpl b/Templates/Plus/9.tpl index 71826d30..064af74a 100644 --- a/Templates/Plus/9.tpl +++ b/Templates/Plus/9.tpl @@ -1,28 +1,43 @@ gold >= 5){ - $MyGold = mysqli_query($database->dblink,"SELECT gold, b1 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $golds = mysqli_fetch_array($MyGold); - if($session->sit == 0) { - if (mysqli_num_rows($MyGold) == 1) { - if($golds['gold'] >= 5) { - if($golds['b1'] < time()) { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } else { - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - } - $done1 = "+25% Production: Lumber"; - mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Lumber')") or die(mysqli_error($database->dblink)); - } else { - $done1 = "You need more gold"; - } - } else { - $done1 = "Failed lumber attempt"; - mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Lumber')") or die(mysqli_error($database->dblink)); - } - } - header("Location: plus.php?id=3"); - exit; + +################################################################################# +## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## +## --------------------------------------------------------------------------- ## +## Project: TravianZ (Refactor incremental) ## +## File: 8.tpl ## +## Description: Wood Plus ## +## Made by: alq0rsan ## +## Improved by: evader ## +## Refactor by: Shadow ## +## ## +################################################################################# + +if($session->sit == 0) { + $uid = (int)$session->uid; + $now = time(); + $cost = 5; + + // UPDATE atomic: scade gold DOAR dacă ai, și prelungește b1 într-o singură operație + $sql = "UPDATE ".TB_PREFIX."users + SET gold = gold - $cost, + b1 = IF(b1 > $now, b1 + ".PLUS_PRODUCTION.", $now + ".PLUS_PRODUCTION.") + WHERE id = '$uid' AND gold >= $cost"; + + mysqli_query($database->dblink, $sql) or die(mysqli_error($database->dblink)); + + if(mysqli_affected_rows($database->dblink) == 1) { + // succes - actualizează sesiunea instant (nu mai aștepți cache-ul de 10 sec) + $session->gold -= $cost; + + // log + mysqli_query($database->dblink, "INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Lumber')") or die(mysqli_error($database->dblink)); + + // invalidează cache v9 + if(method_exists($database, 'clearUserCache')) { + $database->clearUserCache($uid); + } + } } +header("Location: plus.php?id=3"); +exit; ?> \ No newline at end of file diff --git a/Templates/Plus/getplus.tpl b/Templates/Plus/getplus.tpl index f2c95a91..e1360145 100644 --- a/Templates/Plus/getplus.tpl +++ b/Templates/Plus/getplus.tpl @@ -1,122 +1,82 @@ uid; +$plusTime = 604800; // 7 zile - echo "

Get Plus

"; - echo "
To enter you login then select the plus site.
You will be redirected to the plus site."; - echo "
The plus system will be monitored. Account name, site plus on ip,
and points given are logged,
if caught cheating account will be banned.


"; +echo '

Get Plus

'; +echo 'Exchange gold for Plus features. All actions are logged.

'; -if(!$_POST['plus']){ -echo <<
- - - +
$session->username
Select Reward: -

-
+ +
username ?> – Gold: gold ?>
Select Reward: +

+ +
-

- -EOT; -}else{ - - $account = mysqli_real_escape_string($database->dblink,$_POST['username']); - $reward = mysqli_real_escape_string($database->dblink,$_POST['reward']); - $valid=TRUE; - - - if($reward == ""){ - echo "ERROR:
"; - echo "Please select a reward."; - echo "

"; - $valid=FALSE; - } - - if(!$valid) break; - $valid=TRUE; -///////////////////////////////////////////////////////// - $plusTime = 604800; // 7 days - $time = time(); - $giveplus = ($time + $plustime); - $accountCheck = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'"), MYSQLI_ASSOC) or die(mysqli_error($database->dblink)); - if($accountCheck['Total'] <= 0){ - echo "ERROR:
"; - echo "The account name you entered does not exist."; - echo "

"; - $valid=FALSE; - } - if(!$valid) break; - $valid=TRUE; - - $plusCheck = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - $pluss = mysqli_fetch_array($plusCheck); - - switch($reward){ - case 'p_plus': - $key='plus'; - $gldz='10'; - $url='URL=./plus.php?id=3'; - break; - case 'p_b1': - $key ='b1'; - $gldz='5'; - $url='URL=./plus.php?id=3'; - break; - case 'p_b2': - $key ='b2'; - $gldz='5'; - $url='URL=./plus.php?id=3'; - break; - case 'p_b3': - $key ='b3'; - $gldz='5'; - $url='URL=./plus.php?id=3'; - break; - case 'p_b4': - $key ='b4'; - $gldz='5'; - $url='URL=./plus.php?id=3'; - break; - - default: -echo' Please select the option you wish to activate or extend.
'; - $valid=FALSE; - break; - } - if(!$valid) break; - $valid=TRUE; + 0){ - if($time > $pluss[$key] ){ - $editplus = mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` + ('".$time."'+'".$plusTime."'), `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - echo "

Your Status has been updated!
"; - }else - if($time < $pluss[$key]){ - $editplus = mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` +'".$plusTime."', `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink)); - echo "

Your Status has been updated!
"; - - } + // whitelist + $map = [ + 'plus' => ['field'=>'plus','cost'=>10], + 'b1' => ['field'=>'b1','cost'=>5], + 'b2' => ['field'=>'b2','cost'=>5], + 'b3' => ['field'=>'b3','cost'=>5], + 'b4' => ['field'=>'b4','cost'=>5], + ]; + + if(!isset($map[$reward])) { + die('ERROR: Invalid reward. '); } -else{ - $insertplus = mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."users (`username`,`{$key}`, `gold`) VALUES ('".$session->username."', ('".$time."'+'".$plusTime."'),`gold` - {$gldz})") or die(mysqli_error($database->dblink)); - echo "

Your Status has been updated!
"; - } + + $field = $map[$reward]['field']; + $cost = $map[$reward]['cost']; + $now = time(); + + // 1. scade gold ATOMIC – doar dacă ai suficient + $goldUpd = mysqli_query($database->dblink, + "UPDATE ".TB_PREFIX."users SET gold = gold - $cost + WHERE id = $uid AND gold >= $cost" + ); + + if(mysqli_affected_rows($database->dblink) != 1) { + die('
Not enough gold!
'); + } + + // 2. adaugă timpul la feature + // dacă a expirat, setează de acum, altfel adaugă + mysqli_query($database->dblink, + "UPDATE ".TB_PREFIX."users + SET `$field` = IF(`$field` < $now, $now + $plusTime, `$field` + $plusTime) + WHERE id = $uid" + ); + + // 3. update sesiune + $session->gold -= $cost; + $_SESSION['gold'] = $session->gold; + $session->$field = max($session->$field, $now) + $plusTime; + + // 4. log + mysqli_query($database->dblink, + "INSERT INTO ".TB_PREFIX."gold_fin_log (wid, action, time) + VALUES (0, 'Bought $field for $cost gold', $now)" + ); + + echo ''; + echo '
Your status has been updated!
'; } - - ?> \ No newline at end of file diff --git a/Templates/Plus/invite.tpl b/Templates/Plus/invite.tpl index cef79d28..1f8559ba 100644 --- a/Templates/Plus/invite.tpl +++ b/Templates/Plus/invite.tpl @@ -1,79 +1,58 @@ uid; +$invite = $database->getInvitedUser($session->uid); ?> +

Invite friends and receive free Gold

+

If you get new players to open an account and settle a second village, you will receive 50 gold. Use it for Plus or any advantage.

+Invite by e-mail or share your REF link.

-

Invite friends and receive free Gold

+

How is it done?

-

If you get new players to open an account and settle a second village with Travian you will receive gold. You can use this gold to purchase a plus account or plus advantages. -
-
- To bring in new players, you can invite them by e-mail or have them click on your REF link.

+

1) Invite your friends via Email

+
+

+

Own text:

+

-
-

2) Copy your personal REF-Link and share it!

Your personal REF Link: -
- anmelden.php?uid=ref_uid; ?> +See you in game!

+

+ -

Progress of your invited friends

+

2) Copy your personal REF-Link and share it!

+Your personal REF Link:
+ -

As soon as a player you invited has found his 2. village, you will be credited with 50 gold.

+

Progress of your invited friends

+

As soon as a player you invited founds his 2nd village, you get 50 gold.

- - - - - - - - - - - - - - - - - - - - - - getInvitedUser($session->uid); - if(count($invite) > 0){ - foreach($invite as $invited) { - $varray = $database->getProfileVillages($invited['id']); - $totalpop = 0; - foreach($varray as $vil) { - $totalpop += $vil['pop']; - } - ?> - - - - - - - - - - - - +
Players brought in
WorldUIDMember sinceInhabitantsVillages
You have not brought in any new players yet.
+ + + + + + + getProfileVillages($inv['id']); + $totalPop = array_sum(array_column($villages, 'pop')); + $vilCount = count($villages); + $rewarded = $vilCount >= 2 ? 'style="background:#dfd"' : ''; + ?> + > + + + + - -
Players brought in
UIDMember sinceInhabitantsVillages
= 2 ? ' ✓' : '' ?>
- + + + You have not brought in any new players yet. + + + + \ No newline at end of file diff --git a/Templates/Plus/pmenu.tpl b/Templates/Plus/pmenu.tpl index bd2706ec..3205db1f 100644 --- a/Templates/Plus/pmenu.tpl +++ b/Templates/Plus/pmenu.tpl @@ -1,62 +1,16 @@ -
-

Travian Plus

+