mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-05 05:15:17 +00:00
will use a more friendly format if the coin is visible bitcoins txs will be linked to an external site, and if the site explorer is disabled, hyperlinks should be disabled (text only) + some other changes related to the explorer...
88 lines
2.1 KiB
PHP
88 lines
2.1 KiB
PHP
<?php
|
|
|
|
class db_coins extends CActiveRecord
|
|
{
|
|
public static function model($className=__CLASS__)
|
|
{
|
|
return parent::model($className);
|
|
}
|
|
|
|
public function tableName()
|
|
{
|
|
return 'coins';
|
|
}
|
|
|
|
public function rules()
|
|
{
|
|
return array(
|
|
array('name', 'required'),
|
|
array('symbol', 'required'),
|
|
array('symbol', 'unique'),
|
|
);
|
|
}
|
|
|
|
public function relations()
|
|
{
|
|
return array(
|
|
);
|
|
}
|
|
|
|
public function attributeLabels()
|
|
{
|
|
return array(
|
|
'symbol2' => 'Official Symbol',
|
|
'auxpow' => 'AUX PoW',
|
|
'dontsell' => 'Don\'t sell',
|
|
'sellonbid' => 'Sell on Bid',
|
|
'txfee' => 'Tx Fee',
|
|
'program' => 'Process name',
|
|
'conf_folder' => 'Conf. folder',
|
|
'rpchost' => 'RPC Host',
|
|
'rpcport' => 'RPC Port',
|
|
'rpcuser' => 'RPC User',
|
|
'rpcpasswd' => 'RPC Password',
|
|
'rpccurl' => 'RPC via curl',
|
|
'rpcssl' => 'RPC SSL',
|
|
'rpccert' => 'RPC Certificate',
|
|
'serveruser' => 'Server user',
|
|
'hassubmitblock'=> 'Has submitblock',
|
|
'hasmasternodes'=> 'Masternodes',
|
|
'market' => 'Preferred market',
|
|
'rpcencoding' => 'RPC Type',
|
|
'specifications'=> 'Notes'
|
|
);
|
|
}
|
|
|
|
public function getSymbol_show()
|
|
{
|
|
if(!empty($this->symbol2))
|
|
return $this->symbol2;
|
|
else
|
|
return $this->symbol;
|
|
}
|
|
|
|
/**
|
|
* Link for txs
|
|
* @param string $label link content
|
|
* @param array $params 'height'=>123 or 'hash'=>'xxx' or 'txid'=>'xxx'
|
|
* @param array $htmlOptions target/title ...
|
|
*/
|
|
public function createExplorerLink($label, $params=array(), $htmlOptions=array(), $force=false)
|
|
{
|
|
if($this->id == 6 && isset($params['txid'])) {
|
|
// BTC txid
|
|
$url = 'https://blockchain.info/tx/'.$params['txid'];
|
|
$htmlOpts = array_merge(array('target'=>'_blank'), $htmlOptions);
|
|
return CHtml::link($label, $url, $htmlOpts);
|
|
}
|
|
else if (YIIMP_PUBLIC_EXPLORER || $force || user()->getState('yaamp_admin')) {
|
|
$urlParams = array_merge(array('id'=>$this->id), $params);
|
|
Yii::import('application.modules.explorer.ExplorerController');
|
|
$url = ExplorerController::createUrl('/explorer', $urlParams);
|
|
return CHtml::link($label, trim($url,'?'), $htmlOptions);
|
|
}
|
|
return $label;
|
|
}
|
|
|
|
}
|
|
|