mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
Google Authenticator
This commit is contained in:
@@ -2476,7 +2476,7 @@ else {
|
||||
<?php if (get_user_class() >= UC_SYSOP) { ?> [<a href="settings.php"><?php echo $lang_functions['text_site_settings'] ?></a>]<?php } ?>
|
||||
[<a href="torrents.php?inclbookmarked=1&allsec=1&incldead=0"><?php echo $lang_functions['text_bookmarks'] ?></a>]
|
||||
<font class = 'color_bonus'><?php echo $lang_functions['text_bonus'] ?></font>[<a href="mybonus.php"><?php echo $lang_functions['text_use'] ?></a>]: <?php echo number_format($CURUSER['seedbonus'], 1)?>
|
||||
<?php if($attendance){ printf(' '.$lang_functions['text_attended'], $attendance['points']); }else{ printf(' <a href="attendance.php" class="faqlink">%s</a>', $lang_functions['text_attendance']);}?>
|
||||
<?php if($attendance){ printf(' '.$lang_functions['text_attended'], $attendance['total_points']); }else{ printf(' <a href="attendance.php" class="faqlink">%s</a>', $lang_functions['text_attendance']);}?>
|
||||
<font class = 'color_invite'><?php echo $lang_functions['text_invite'] ?></font>[<a href="invite.php?id=<?php echo $CURUSER['id']?>"><?php echo $lang_functions['text_send'] ?></a>]: <?php echo $CURUSER['invites']?><br />
|
||||
<font class="color_ratio"><?php echo $lang_functions['text_ratio'] ?></font> <?php echo $ratio?>
|
||||
<font class='color_uploaded'><?php echo $lang_functions['text_uploaded'] ?></font> <?php echo mksize($CURUSER['uploaded'])?>
|
||||
|
||||
@@ -544,16 +544,33 @@ function fail(...$args)
|
||||
|
||||
function last_query($all = false)
|
||||
{
|
||||
if (IN_NEXUS) {
|
||||
$queries = \Illuminate\Database\Capsule\Manager::connection(\Nexus\Database\NexusDB::ELOQUENT_CONNECTION_NAME)->getQueryLog();
|
||||
} else {
|
||||
$queries = \Illuminate\Support\Facades\DB::connection(config('database.default'))->getQueryLog();
|
||||
static $connection, $pdo;
|
||||
if (is_null($connection)) {
|
||||
if (IN_NEXUS) {
|
||||
$connection = \Illuminate\Database\Capsule\Manager::connection(\Nexus\Database\NexusDB::ELOQUENT_CONNECTION_NAME);
|
||||
} else {
|
||||
$connection = \Illuminate\Support\Facades\DB::connection(config('database.default'));
|
||||
}
|
||||
$pdo = $connection->getPdo();
|
||||
}
|
||||
$queries = $connection->getQueryLog();
|
||||
if (!$all) {
|
||||
$queries = [last($queries)];
|
||||
}
|
||||
$queryFormatted = [];
|
||||
foreach ($queries as $query) {
|
||||
$sqlWithPlaceholders = str_replace(['%', '?'], ['%%', '%s'], $query['query']);
|
||||
$bindings = $query['bindings'];
|
||||
$realSql = $sqlWithPlaceholders;
|
||||
if (count($bindings) > 0) {
|
||||
$realSql = vsprintf($sqlWithPlaceholders, array_map([$pdo, 'quote'], $bindings));
|
||||
}
|
||||
$queryFormatted[] = $realSql;
|
||||
}
|
||||
if ($all) {
|
||||
return nexus_json_encode($queries);
|
||||
return nexus_json_encode($queryFormatted);
|
||||
}
|
||||
$query = last($queries);
|
||||
return nexus_json_encode($query);
|
||||
return $queryFormatted[0];
|
||||
}
|
||||
|
||||
function format_datetime($datetime, $format = 'Y-m-d H:i')
|
||||
|
||||
Reference in New Issue
Block a user