getOfficialSymbol(); $lowsymbol = strtolower($symbol); $base = 'BTC'; $market = trim($marketName); if (strpos($marketName, ' ')) { $parts = explode(' ',$marketName); $market = $parts[0]; $base = $parts[1]; if (empty($base)) { debuglog("warning: invalid market name '$marketName'"); $base = dboscalar( "SELECT base_coin FROM markets WHERE coinid=:id AND name=:name", array( ':id'=>$coin->id, ':name'=>$marketName, )); } } $lowbase = strtolower($base); if($market == 'alcurex') $url = "https://alcurex.org/index.php/crypto/market?pair={$lowsymbol}_{$lowbase}"; else if($market == 'bittrex') $url = "https://bittrex.com/Market/Index?MarketName={$base}-{$symbol}"; else if($market == 'poloniex') $url = "https://poloniex.com/exchange#{$lowbase}_{$lowsymbol}"; else if($market == 'bleutrade') $url = "https://bleutrade.com/exchange/{$symbol}/{$base}"; else if($market == 'bter') $url = "https://bter.com/trade/{$lowsymbol}_{$lowbase}"; else if($market == 'coinexchange') $url = "https://www.coinexchange.io/market/{$symbol}/{$base}"; else if($market == 'coinsmarkets') $url = " https://coinsmarkets.com/trade-{$base}-{$symbol}.htm"; else if($market == 'cryptopia') $url = "https://www.cryptopia.co.nz/Exchange?market={$symbol}_{$base}"; else if($market == 'c-cex') $url = "https://c-cex.com/?p={$lowsymbol}-{$lowbase}"; else if($market == 'empoex') $url = "http://www.empoex.com/trade/{$symbol}-{$base}"; else if($market == 'jubi') $url = "http://jubi.com/coin/{$lowsymbol}"; else if($market == 'hitbtc') $url = "https://hitbtc.com/exchange/{$symbol}-to-{$base}"; else if($market == 'livecoin') $url = "https://www.livecoin.net/trade/?currencyPair={$symbol}%2F{$base}"; else if($market == 'nova') $url = "https://novaexchange.com/market/{$base}_{$symbol}/"; else if($market == 'yobit') $url = "https://yobit.net/en/trade/{$symbol}/{$base}"; else $url = ""; return $url; } // $market can be a db_markets or a string (symbol) function exchange_update_market($exchange, $market) { $fn_update = str_replace('-','',$exchange.'_update_market'); if (function_exists($fn_update)) { return $fn_update($market); } else { debuglog(__FUNCTION__.': '.$fn_update.'() not implemented'); user()->setFlash('error', $fn_update.'() not yet implemented'); return false; } } // used to manually update one market price function exchange_update_market_by_id($idmarket) { $market = getdbo('db_markets', $idmarket); if (!$market) return false; return exchange_update_market($market->name, $market); }