From a1909ed63628f08d1fc1e6a8213152348c631f71 Mon Sep 17 00:00:00 2001
From: Tanguy Pruvot
Date: Sun, 19 Jul 2015 19:10:32 +0200
Subject: [PATCH] remove hard coded site urls
---
web/yaamp/core/functions/yaamp.php | 4 ++--
web/yaamp/modules/api/ApiController.php | 2 +-
web/yaamp/modules/common/yaamp.php | 2 +-
web/yaamp/modules/site/diff.php | 2 +-
web/yaamp/modules/site/index.php | 22 ++++++++++++----------
web/yaamp/ui/main.php | 6 +++---
6 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php
index d961c3b..81aa685 100755
--- a/web/yaamp/core/functions/yaamp.php
+++ b/web/yaamp/core/functions/yaamp.php
@@ -198,7 +198,7 @@ function yaamp_profitability($coin)
function yaamp_convert_amount_user($coin, $amount, $user)
{
$refcoin = getdbo('db_coins', $user->coinid);
- if(!$refcoin) $refcoin = getdbosql('db_coins', "symbol='BTC'");
+ if(!$refcoin && YAAMP_ALLOW_EXCHANGE) $refcoin = getdbosql('db_coins', "symbol='BTC'");
if(!$refcoin || $refcoin->price2<=0) return 0;
$value = $amount * $coin->price2 / $refcoin->price2;
@@ -208,7 +208,7 @@ function yaamp_convert_amount_user($coin, $amount, $user)
function yaamp_convert_earnings_user($user, $status)
{
$refcoin = getdbo('db_coins', $user->coinid);
- if(!$refcoin) $refcoin = getdbosql('db_coins', "symbol='BTC'");
+ if(!$refcoin && YAAMP_ALLOW_EXCHANGE) $refcoin = getdbosql('db_coins', "symbol='BTC'");
if(!$refcoin || $refcoin->price2<=0) return 0;
$value = dboscalar("select sum(amount*price) from earnings where $status and userid=$user->id");
diff --git a/web/yaamp/modules/api/ApiController.php b/web/yaamp/modules/api/ApiController.php
index 6f8fd01..6ffb19f 100644
--- a/web/yaamp/modules/api/ApiController.php
+++ b/web/yaamp/modules/api/ApiController.php
@@ -313,7 +313,7 @@ class ApiController extends CommonController
// $uptime = system('uptime');
// $name = system('hostname');
-// fetch_url("http://yiimp.ccminer.org/api/nodereport?name=$name&uptime=$uptime");
+// fetch_url("http://".YAAMP_SITE_URL."/api/nodereport?name=$name&uptime=$uptime");
// }
diff --git a/web/yaamp/modules/common/yaamp.php b/web/yaamp/modules/common/yaamp.php
index 4fb4fc2..acb4123 100644
--- a/web/yaamp/modules/common/yaamp.php
+++ b/web/yaamp/modules/common/yaamp.php
@@ -7,7 +7,7 @@
-GOTO YIIMP
+GOTO YIIMP
diff --git a/web/yaamp/modules/site/diff.php b/web/yaamp/modules/site/diff.php
index e8bb9e6..d5157ee 100644
--- a/web/yaamp/modules/site/diff.php
+++ b/web/yaamp/modules/site/diff.php
@@ -11,7 +11,7 @@ you have from 5 to 15 submits per minute. It's a good trade off between bandwidt
if you want to set the difficulty to 64, you would use:
--o stratum+tcp://yiimp.ccminer.org:3433 -u wallet_adress -p d=64
+-o stratum+tcp://= YAAMP_SITE_URL ?>:3433 -u wallet_adress -p d=64
Here are the accepted values for the custom diff:
diff --git a/web/yaamp/modules/site/index.php b/web/yaamp/modules/site/index.php
index f241bcd..d5e191d 100644
--- a/web/yaamp/modules/site/index.php
+++ b/web/yaamp/modules/site/index.php
@@ -11,7 +11,7 @@ JavascriptFile('/yaamp/ui/js/auto_refresh.js');
$height = '240px';
-echo <<
";
echo "";