Skip to content

Commit 4286136

Browse files
committed
Pajax - changed form serialization
Updated exchange links
1 parent 6cafac4 commit 4286136

6 files changed

Lines changed: 36 additions & 22 deletions

File tree

include/class/Pajax.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static function processAjax()
2929
{
3030
if (isset($_SERVER['HTTP_P_AJAX'])) {
3131
$pAjax = json_decode(base64_decode($_SERVER['HTTP_P_AJAX']), true);
32-
$viewData = json_decode(base64_decode($pAjax['viewData']), true);
32+
$viewData = unserialize(base64_decode($pAjax['viewData']));
3333
$class = $pAjax['class'];
3434
self::$options = json_decode(base64_decode($pAjax['options']), true);
3535
$action = $pAjax['action'];
@@ -42,14 +42,14 @@ static function processAjax()
4242
}
4343
}
4444
self::$ajax = true;
45-
self::$class = new $class();
46-
if(is_array($viewData)) {
47-
foreach($viewData as $k => $v) {
48-
if(property_exists(self::$class, $k)) {
49-
self::$class->$k = $v;
50-
}
51-
}
52-
}
45+
self::$class = $viewData;
46+
// if(is_array($viewData)) {
47+
// foreach($viewData as $k => $v) {
48+
// if(property_exists(self::$class, $k)) {
49+
// self::$class->$k = $v;
50+
// }
51+
// }
52+
// }
5353
foreach($_POST as $k => $v) {
5454
if(property_exists(self::$class, $k)) {
5555
self::$class->$k = $v;
@@ -71,7 +71,7 @@ static function processAjax()
7171
self::render();
7272
$content = ob_get_contents();
7373
if(self::$class) {
74-
$data = base64_encode(json_encode(self::$class));
74+
$data = base64_encode(serialize(self::$class));
7575
} else {
7676
$data = base64_encode(json_encode(self::$data));
7777
}
@@ -157,7 +157,7 @@ static function render()
157157
?>
158158
<div id="<?= $view ?>" data-p-view="<?= $view ?>" data-p-class="<?= get_class(self::$class) ?>"
159159
data-p-options="<?= base64_encode(json_encode(self::$options)) ?>"
160-
data-p-view-data="<?= base64_encode(json_encode(self::getData())) ?>" class="<?= self::$options['class'] ?? '' ?>">
160+
data-p-view-data="<?= base64_encode(serialize(self::getData())) ?>" class="<?= self::$options['class'] ?? '' ?>">
161161
<?php echo $body ?>
162162
</div>
163163
<?php

include/functions.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ function pem2hex($data)
141141
function hex2pem($data, $is_private_key = false)
142142
{
143143
$data = hex2bin($data);
144+
$data = base58_encode($data);
144145
$data = base64_encode($data);
145146
if ($is_private_key) {
146147
return "-----BEGIN EC PRIVATE KEY-----\n".$data."\n-----END EC PRIVATE KEY-----";

web/apps/common/include/bottom.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<?php if ($updateAvb) { ?>
1919
<span class="badge rounded-pill bg-success">Update available!</span>
2020
<?php } ?>
21+
|
22+
Trade on <a href="https://klingex.io/trade/PHP-USDT?ref=3436CA42" target="_blank">KlingEx</a>
2123
</div>
2224
<div class="col-sm-6">
2325
<div class="text-center text-md-end d-flex justify-content-center justify-content-sm-end align-items-center mb-2 mb-sm-0">

web/apps/common/include/top.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,11 @@ function gtag(){dataLayer.push(arguments);}
229229
<i class="fas fa-faucet me-2"></i><span data-key="t-dashboards">Faucet</span>
230230
</a>
231231
</li>
232-
233-
<li class="nav-item dropdown">
234-
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-pages" role="button">
235-
<i class="fas fa-network-wired me-2"></i><span data-key="t-peers">Peers</span> <div class="arrow-down"></div>
232+
<li class="nav-item">
233+
<a class="nav-link dropdown-toggle arrow-none" href="https://trade.phpcoin.net" id="topnav-p2p" role="button" target="_blank">
234+
<i class="fas fa-chart-line me-2"></i><span data-key="t-p2p">P2P Trade</span>
235+
<span class="badge bg-success">New</span>
236236
</a>
237-
<div class="dropdown-menu" aria-labelledby="topnav-pages" id="peers-menu">
238-
<?php foreach($menuPeers as $peer) { ?>
239-
<a href="<?php echo $peer['hostname'] . $_SERVER['REQUEST_URI'] ?>" class="dropdown-item <?php if ($peer['ip'] == $_SERVER['SERVER_ADDR']) { ?>active<?php } ?>" data-key="t-calendar"><?php echo $peer['hostname'] ?></a>
240-
<?php } ?>
241-
</div>
242237
</li>
243238
</ul>
244239
<ul class="navbar-nav d-flex">

web/apps/explorer/index.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@
253253
<div class="card card-h-100">
254254
<div class="card-body p-3">
255255
<div class="row align-items-center">
256-
<div class="col-12">
256+
<div class="col-9">
257257
<i class="fas fa-dollar-sign me-1 h4"></i>
258258
<span class="text-muted mb-3 lh-1 text-truncate h4">
259-
<a href="https://xeggex.com/market/PHP_USDT" target="_blank">Price</a>
259+
<a href="https://klingex.io/trade/PHP-USDT?ref=3436CA42" target="_blank">Price</a>
260260
</span>
261261
<h2 class="my-2">
262262
<?php echo empty(floatval($btcPrice)) ? "-" : $btcPrice ?>
@@ -265,6 +265,13 @@
265265
<span class="text-muted font-size-13"><?php echo empty(floatval($usdPrice)) ? "-" : $usdPrice ?> $</span>
266266
</div>
267267
</div>
268+
<div class="col-3">
269+
Trade on
270+
<a href="https://klingex.io/trade/PHP-USDT?ref=3436CA42" target="_blank">
271+
<img src="https://klingex.io/symbol.svg" style="width:50px;height:50px"/>
272+
</a>
273+
KlingEx
274+
</div>
268275
</div>
269276
</div>
270277
</div>

web/index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@
144144
</div>
145145
</div>
146146
<?php } ?>
147+
<div class="col-sm-6 col-md-4 col-lg-3 col-12 col-xl-2 my-3">
148+
<div class="d-grid gap-2" data-bs-toggle="tooltip" title="Exchange">
149+
<a class="btn btn-lg btn-primary btn-block text-white-50 waves-effect waves-light"
150+
href="https://klingex.io/trade/PHP-USDT?ref=3436CA42" target="_blank">
151+
<h5 class="mb-3 text-white">Exchange</h5>
152+
<img src="https://klingex.io/symbol.svg" style="width:38px;height:38px" class="p-1 bg-white rounded-2"/>
153+
</a>
154+
</div>
155+
</div>
147156
</div>
148157
</div>
149158

0 commit comments

Comments
 (0)