Coin: Clear up the code

This commit is contained in:
veselcraft 2022-05-23 15:36:19 +03:00
parent fd9107749d
commit fb6c9d3963
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E
6 changed files with 13 additions and 12 deletions

View file

@ -46,8 +46,8 @@ class FetchToncoinTransactions extends Command
return Command::FAILURE;
}
$testnet_subdomain = OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["testnet"] ? "testnet." : "";
$url = "https://" . $testnet_subdomain . "toncenter.com/api/v2/getTransactions?";
$testnetSubdomain = OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["testnet"] ? "testnet." : "";
$url = "https://" . $testnetSubdomain . "toncenter.com/api/v2/getTransactions?";
$opts = [
"http" => [
@ -57,14 +57,14 @@ class FetchToncoinTransactions extends Command
];
$selection = $this->transactions->select('hash, lt')->order("id DESC")->limit(1)->fetch();
$tr_hash = $selection->hash ?? NULL;
$tr_lt = $selection->lt ?? NULL;
$trHash = $selection->hash ?? NULL;
$trLt = $selection->lt ?? NULL;
$data = http_build_query([
"address" => OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["address"],
"limit" => 100,
"hash" => $tr_hash,
"to_lt" => $tr_lt
"hash" => $trHash,
"to_lt" => $trLt
]);
$response = file_get_contents($url . $data, false, stream_context_create($opts));
@ -75,7 +75,7 @@ class FetchToncoinTransactions extends Command
$output_array;
preg_match('/' . OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["regex"] . '/', $transfer["in_msg"]["message"], $output_array);
$userid = ctype_digit($output_array[1]) ? intval($output_array[1]) : NULL;
if($userid === NULL) {
if(is_null($userid)) {
$header->writeln("Well, that's a donation. Thanks! XD");
} else {
$user = (new Users)->get($userid);

View file

@ -273,6 +273,7 @@ final class WallPresenter extends OpenVKPresenter
try {
$post = new Post;
$post->setOwner($this->user->id);
$post->setWall($wall);
$post->setCreated(time());

View file

@ -399,13 +399,13 @@
function convertCurrency(coin) {
var currencyTON = {php echo OPENVK_ROOT_CONF['openvk']['preferences']['ton']['rate']};
u('.coins_dialog_conv').nodes[0].innerHTML = tr("transfer_ton_currency_per_ton", coin * currencyTON);
u(".coins_dialog_conv").nodes[0].innerHTML = tr("transfer_ton_currency_per_ton", coin * currencyTON);
}
function showCoinsTopUpTroughTon() {
MessageBox(tr("transfer_trough_ton"), `
<div class="messagebox-content-header">
${ tr("transfer_ton_contents") }
${tr("transfer_ton_contents")}
</div>
<div style="margin-top: 30px">` +
{tr("transfer_ton_address", OPENVK_ROOT_CONF['openvk']['preferences']['ton']['address'], str_replace("$1", $thisUser->getId(), OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["hint"]))} +

View file

@ -7,7 +7,7 @@
<table border="0" style="font-size: 11px;" n:class="post, !$compact ? post-divider, $post->isExplicit() ? post-nsfw">
<tbody>
<tr>
<td width="54" style="{ifset $compact}display: block;{/ifset}" valign="top">
<td width="54" valign="top">
<a href="{$author->getURL()}">
<img src="{$author->getAvatarURL('miniscule')}" width="{ifset $compact}25{else}50{/ifset}" {ifset $compact}class="cCompactAvatars"{/ifset} />
<span n:if="!$post->isPostedOnBehalfOfGroup() && !$compact && $author->isOnline()" class="post-online">{_online}</span>

View file

@ -629,7 +629,7 @@ h4 {
}
.post-content .attachments_b {
margin-top: 8px;
margin-top: 8px;
}
.attachment .post {

View file

@ -100,7 +100,7 @@ function setupWallPostInputHandlers(id) {
if(e.clipboardData.files.length === 1) {
var input = u("#post-buttons" + id + " input[name=_pic_attachment]").nodes[0];
input.files = e.clipboardData.files;
u(input).trigger("change");
}
});