<?
if (session_status() == PHP_SESSION_NONE) { session_start(); }
require_once '../site.php';
$db->connect();
site_header();
// Seed Bonus - Reworked - Sep 19, 2020
// Updated/optimized + social/UI additions - Mar 21, 2021
if (!$account->sessionLogin()) {
header(sprintf('Location: %s/siginin/', $CONFIG['base_url']));
die;
}
$errors = array();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$data = array();
$keys = array('id', 'userid', 'torrentid');
foreach ($keys as $key) {
if (!array_key_exists($key, $_POST)) {
$errors []= sprintf('Seed bonus item ID %s not valid.', $key);
}
$data[$key] = $_POST[$key];
}
$res = $db->query_params('SELECT users.seedbonus, users.perk_avatar, users.username, users.slots, users.last_exchange, users.class, users.user_id, bonus.cost, bonus.descr, bonus.type, bonus.value, bonus.id FROM users, bonus WHERE users.user_id = :user_id AND bonus.id = :post_id', array('user_id' => $account->getId(), 'post_id' => $data['id'])) or die('db error');
if (!($row = $res->fetch())) {
if ($row['seedbonus'] < $row['cost'])
$errors []= 'Demand not valid.';
}
if (array_key_exists('id', $data) && $data['id'] == $row['id']) {
if ($row['type'] == 'invite') {
$query = $db->query_params("UPDATE users SET invites = invites + :value WHERE user_id = :user_id", array('value' => $row['value'], 'user_id' => $account->getid()));
printf('Your account has been <b>credited</b> for <b>%s</b> Extra Invites!', $row['value']);
}
if ($row['type'] == 'traffic') {
$query = $db->query_params('UPDATE users SET uploaded = uploaded + :value, last_exchange = :bonus WHERE user_id = :user_id', array('bonus' => $row['value'], 'value' => $row['value'], 'user_id' => $account->getid()));
printf('Your account has been <b>credited</b> for <b>%s</b> bonus Upload Data!', format_size($row['value']));
}
if ($row['type'] == 'slots' && $data['id'] == $row['id']) {
$query = $db->query_params('UPDATE users SET slots = :slots WHERE user_id = :user_id', array('slots' => $data_row['value'], 'user_id' => $account->getid()));
printf('Your account has been <b>credited</b> for <b>%s</b> Extra Download Slots!', $row['value']);
}
if ($row['type'] == 'feature' && $data['id'] == $row['id']) {
$query = $db->query_params("UPDATE users SET perk_avatar = 'yes' WHERE user_id = :user_id", array('user_id' => $account->getid()));
printf('<span>Your site comments will be <b>featured</b> with a %s', '<img src="/themes/default/images/super_star.png" style="height: 50px; padding: 0;margin-bottom: -10px;position: relative;transform: rotate(-15deg);margin-left: -3px;margin-right: -30px;" /></span>');
}
if ($row['type'] == 'restore') {
$query = $db->query_params("UPDATE users SET limited = 'no' WHERE user_id = :user_id", array('user_id' => $account->getid()));
$db->query_params("DELETE FROM warnings WHERE userid = :user_id", array('user_id' => $account->getid()));
printf('<span>Your account has been <b>restored</b>, and all warnings removed.</span>');
}
if ($query) {
$db->query_params("UPDATE users SET seedbonus = seedbonus - :cost WHERE user_id = :user_id", array('cost' => $row['cost'], 'user_id' => $account->getid()));
$db->query_params("INSERT INTO bonus_users (user_id, added, type) VALUES (:user_id, NOW(), :type)", array('user_id' => $account->getId(), 'type' => $row['type']));
}
}
}
// Get exchange item list
$res = $db->query_params('SELECT * FROM bonus ORDER BY type');
$bonusid = $res->fetch();
$rowid = $bonusid['id'];
// Get users seed bonus points - Sep 2, 2020
$points = $db->query_params('SELECT seedbonus, user_id FROM users WHERE user_id = :user_id', array('user_id' => $account->getId()));
$userpoints = $points->fetch();
?>
<h1 itemprop="name">
<i class="material-icons" style="color:#7FB335;font-size:45px;vertical-align:bottom;padding-right:10px">eco</i> Seed Bonus
<?=(!empty($userpoints['seedbonus']))
? "<span style=\"font-size:27px;font-weight:400;padding:5px;border-radius:7px;background:#ED2324;text-align:center;color:#FFF;box-shadow: inset 1px 5px 7px -6px #000000;float:right\">" . $userpoints['seedbonus'] . "</span>"
: "<span style=\"font-size:27px;font-weight:400;padding:5px;border-radius:7px;background:#ED2324;text-align:center;color:#FFF;box-shadow: inset 1px 5px 7px -6px #000000;margin-right:15px\">0</span>";
?>
</h1>
<div itemprop="description">Explore options that you can redeem from accumulated <b>points</b> against depending on the share of torrents.</div>
<center>
<div class="card-action ng-scope">
<!-- Rundown -->
<?
$retrieve = $db->query_params("SELECT (SELECT COUNT(torrent_id) FROM peers WHERE user_id = p.user_id AND seeder = 'yes') AS total, GROUP_CONCAT(p.torrent_id) AS torrent_id FROM peers p WHERE p.user_id = :user_id GROUP BY p.torrent_id DESC LIMIT 12", array('user_id' => $account->getId()));
$seeding = $retrieve->fetchAll();
?>
<div itemprop="description">You are seeding:</div>
<div style="padding:10px 0 10px 0">
<?
// Currently seeding torrents - Mar 21, 2021
if ($seeding) {
foreach ($seeding as $row) {
$query = $db->query_params("SELECT name, cover1, torrent_id FROM torrents WHERE torrent_id IN ($row[torrent_id])");
$data['avatars'] = $query->fetchAll();
foreach ($data['avatars'] as $title) {
print("<a id=\"tips\" title=\"$title[name]\" href=\"/details/$title[torrent_id]/\"><img itemprop=\"image\" class=\"responsive-img\" src=\"/images/covers/$title[cover1]\" alt=\"$title[name]\" style=\"width: 107px; height: 176px; margin-left: 10px\" border=\"0\" /></a>");
}
}
}else{
print("<div style=\"margin-bottom:4px;padding:5px;background:#D2D2D2;text-align:center;color:#242424;font-size:20px;max-width:300px;border-radius:7px\">No (0 found)</div>");
}
?>
<div style="padding-top:7px">You receive <b><?=$CONFIG['bonuspertime']?></b> points per <b>every 10 minutes</b> the system registers you as a seeder by torrent.</div></div>
</center>
<? while ($row = $res->fetch()): ?>
<article itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Article" class="card">
<form method="post" class="cd-form floating-labels" action="/mybonus.php">
<input type="hidden" name="id" value="<?=intval($row['id'])?>" />
<div class="card-action ng-scope" style="font-size:22px">
<!-- Seeder exchange -->
<span style="font-size:27px;font-weight:400;padding: 7px 5px 5px 10px;border-radius:7px;background:#EC2324;text-align:center;color:#FFF;box-shadow: inset 1px 5px 7px -6px #000000;margin-right:15px">
<?=str_replace('Uploaded', '', html_escape($row['title']))?>
</span>
<?=$row['descr']?>
<span style="float:right;margin-right:-125px">
<button class="btn btn-danger" onclick="this.form.submit();" style="font-size:15px" <?=($userpoints['seedbonus'] < $row['cost'] ? 'disabled' : null)?>>
<?=($userpoints['seedbonus'] < $row['cost']) ? 'Not Enough' : 'Exchange'?>
</button>
</span>
</div>
<div class="card-action ng-scope" style="font-size:18px;width:700px">
<?
// Get item's recent users - Mar 21, 2021 - Query rewritten to support accurate claims per row/type, June 10, 2021
$claimed = $db->query_params("SELECT b.title, b.type, bu.user_id, u.username, u.avatar, bu.added FROM bonus_users bu LEFT JOIN users u ON u.user_id = bu.user_id LEFT JOIN bonus b ON b.type = b.type WHERE b.id = :bonus_id AND b.value = u.last_exchange ORDER BY bu.added DESC LIMIT 11", array(
'bonus_id' => $row['id']
));
foreach ($claimed as $bonususer) {
if (!file_exists($bonususer['avatar'])) {
$avatar = 'images/noavatar.png';
}else{
$avatar = $bonususer['avatar'];
}
printf('<div style="float:left;font-size:22px;font-weight:400;padding:5px 5px 5px 7px;border-radius:7px;background:#D2D2D2;text-align:center;color:#FFF;_box-shadow: inset 1px 5px 7px -6px #000000;margin-right:7px;margin-bottom:15px;margin-top:0px"><a href="/user/?id=%s"><img src="/%s" style="height:29px;width:29px;vertical-align:middle;border-radius:7px" /></a>%s</div>', $bonususer['user_id'], $avatar, str_replace('Uploaded', '', $bonususer['title']));
}
?>
</div>
</form>
</article>
<? endwhile; ?>
<article itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Article" class="card">
<div class="card-action ng-scope">
<!-- Rundown -->
<span>
To get bonus points you need to have the complete torrent which includes all txt/nfo documents, samples, and subtitles. Keep the torrent open in your torrent client and your bonus points will start to increase.
<br><br>
It means, when you download a torrent 100% (completely), share back and every hour you will earn bonus points, (up to a maximum of 15 torrents) you keep sharing back. Just download the torrent 100% and don't close your torrent client, keep sharing with others. Even if no one downloads from you, you will still get bonus points for them.
<br><br>Once you accumulate loads of points you can use them on any of the options listed above. You get points even if there are no leechers on the torrent and you can seed as many torrents as you want. Yet another way to help out your ratio!
<br><br>
Keep Seeding! Plus Enjoy Being with us!
</span>
</div>
</article>
<div>You receive <?=$CONFIG['bonuspertime']?> points per <?=floor($CONFIG['autoclean_interval'] / 10)?> minutes the system registers you as a seeder by torrent.</div>
<?
$db->query_params("UPDATE users SET page = 'Seed Bonus', last_access = NOW() WHERE user_id = :user_id", array('user_id' => $account->getId()));
site_footer();
<?
if (session_status() == PHP_SESSION_NONE) { session_start(); }
require_once '../site.php';
$db->connect();
site_header();
// Account Profiles - New - June 7, 2021
if (isset($_GET['id'])) {
// Get user data
$profile_data = $db->query_params('SELECT * FROM users WHERE user_id = :user_id', array(
'user_id' => isset($_GET['id']) ? intval($_GET['id']) : 0
));
// Check & insert/update views
$checkrow = $db->query_params('SELECT userid FROM profileviews WHERE userid = :user_id', array(
'user_id' => isset($_GET['id']) ? intval($_GET['id']) : 0
));
/*
$db->query_params('INSERT INTO profileviews (userid, userviewed, viewed, times) VALUES (:user_id_cur, :user_id, NOW(), 1)', array(
'user_id_cur' => $account->getId(),
'user_id' => intval($_GET['id'])
));
*/
if (!$profile_data) {
echo 'Invalid User ID';
}
} else {
echo 'Invalid request';
}
if ($profile_data) {
foreach ($profile_data as $row):
// User country flag
$country_flag = $db->query_params('SELECT name, flagpic FROM countries WHERE id = :country', array(
'country' => intval($row['country'])
));
// User level
$groups = $db->query_params('SELECT g.level FROM users u LEFT JOIN groups g ON g.group_id = u.class WHERE u.user_id = :user_id', array(
'user_id' => intval($row['user_id'])
));
$ulevel = '';
if ($level = $groups->fetch()) {
$ulevel = strval($level['level']);
}
// Get user views
$profile_views = $db->query_params('SELECT p.userid, p.userviewed, p.times, u.user_id, u.avatar_thumb AS avatar FROM users u LEFT JOIN profileviews p ON p.userviewed = u.user_id WHERE p.userid = :user_id ORDER BY p.viewed DESC', array(
'user_id' => intval($row['user_id'])
));
// Get friends
$friends = $db->query_params('SELECT (SELECT COUNT(*) FROM friends WHERE userid = f.userid) AS total, u.user_id, u.avatar_thumb AS avatar, f.userid FROM friends f LEFT JOIN users u ON u.user_id = f.friendid WHERE f.userid = :user_id', array(
'user_id' => isset($_GET['id']) ? intval($_GET['id']) : 0
));
// Get users recent downloads
$recentdl = $db->query_params("SELECT (SELECT COUNT(torrentid) FROM users_downloaded WHERE userid = u.user_id) AS total, ud.userid, u.avatar_thumb AS avatar, t.torrent_id, t.cover1, t.name FROM users u LEFT JOIN users_downloaded ud ON ud.userid = u.user_id LEFT JOIN torrents t ON t.torrent_id = ud.torrentid WHERE ud.userid = :user_id AND torrent_id != 'NULL'", array(
'user_id' => $row['user_id']
));
// Get user ratio
$ratio = 0;
if ($row['downloaded'] > 0) {
$ratio = number_format($row['uploaded'] / $row['downloaded'], 2);
}
// Check blocked
if ($account->sessionLogin()) {
$blocked = $db->query_params('SELECT id FROM blocked WHERE userid = :user_id AND blockid = :user_id_cur', array(
'user_id' => $row['user_id'],
'user_id_cur' => $account->getId()
));
if ($blocked->fetchAll()) {
echo 'You are blocked by this user.';
}
}
// Get moods
$res = $db->query_params('SELECT name, moodspic FROM moods WHERE id = :user_mood LIMIT 1', array(
'user_mood' => $row['moods']
));
if ($arr = $res->fetch()) {
$moods = '';
}
?>
<!-- Profile buttons -->
<div style="display:inline;float:left;padding-top:17px">
<?
if ($account->sessionlogin()): ?>
<button type='button' class='btn btn-danger' onclick="location.href='/message/?compose&id=<?=intval($row['user_id'])?>'">Message</button>
<? endif;
if ($account->getId() !== $row['user_id']) {
$f = $db->query_params('SELECT id, userid FROM friends WHERE userid = :user_id_cur AND friendid = :friend_id', array(
'user_id_cur' => $account->getId(),
'friend_id' => $row['user_id']
));
$b = $db->query_params('SELECT id, userid FROM blocked WHERE userid = :user_id_cur AND blockid = :block_id', array(
'user_id_cur' => $account->getId(),
'block_id' => $row['user_id']
));
if ($friend = $f->fetch()) {
echo "<button type=\"button\" style=\"margin-right:5px\" class='btn btn-danger' onclick=\"location.href='/friends.php?action=delete&type=friend&targetid=$friend[userid]'\">Unfriend</button>";
}
if ($block = $b->fetch()) {
echo "<button type=\"button\" class='btn btn-danger' onclick=\"location.href='/friends.php?action=delete&type=block&targetid=$block[userid]'\">Unblock</button>";
} else {
echo "<button type=\"button\" style=\"margin-right:5px\" class=\"btn btn-danger\" onclick=\"location.href='/friends.php?action=add&type=friend&targetid=$row[user_id]'\">+ Friend</button>";
echo "<button type=\"button\" class=\"btn btn-danger\" onclick=\"location.href='/friends.php?action=add&type=block&targetid=$row[user_id]'\">Block</button>";
}
}
?>
<!-- Left side content -->
<div style="display:inline;float:left">
<h1 itemprop="name">
@<?=html_escape($row['username'])?>
</h1>
<div>
<!-- Left column -->
<article itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Article" class="card" style="max-width:300px">
<div class="card-action ng-scope" ng-if="item.comment_count">
<!-- Profile picture --><span itemprop="interactionCount" class="comments">
<span style="text-align:center;padding-bottom:23px">
<center><img class="responsive-img" src="/<?=$row['avatar_thumb']?>" style="border-radius:100%;width:150px;height:150px;border:5px solid #ECECEC" /></center>
</span></span>
<!-- Profile views -->
<div style="text-align:center;padding-top:15px;padding-bottom:20px;border-bottom:1px solid #ECECEC">
<div style="color:#D2D2D2;padding-bottom:7px">Profile Views:</div>
<?
$n = 0;
foreach ($profile_views as $vuser) {
$n++;
echo (!empty($vuser['avatar']) && file_exists($vuser['avatar']))
? printf('<a href="/user/?id=%s"><img src="/%s" style="width:23px;height:23px;border-radius:100px" /></a>', $vuser['user_id'], $vuser['avatar'])
: printf('<a href="/user/?id=%s"><img src="/images/noavatar.png" style="width:23px;height:23px;border-radius:100px" /></a>', $vuser['user_id'], $vuser['avatar']);
$total = count($row);
if ($n === 24) break;
}
?>
</div>
<div style="color:#242424;float:right;font-size:15px;padding-top:12px"><b><?=intval($n)?></b> out of <b><?=(isset($total) ? $total : 0)?></b> total visitors</div>
<div style="clear:both"></div>
<!-- User info -->
<div style="text-align:center;padding-top:15px;padding-bottom:20px;border-bottom:1px solid #ECECEC">
<div style="font-size:22px"><?=html_escape($row['username'])?>, <?=html_escape($row['gender'])?>
<?
if ($flag = $country_flag->fetch()) {
printf('<img title="%s" src="/images/countries/%s" style="width:20px;height:20px;vertical-align:middle" />', $flag['name'], $flag['flagpic']);
}
?>
</div>
<div style="color:#C0C0C0">Joined <?=time_ago($row['added'])?></div>
<div style="color:#C0C0C0">Last online: <?=time_ago($row['last_access'])?></div>
<div style="color:#242424;padding-top:7px">Total Ratio: <b><?=$ratio?></b></div>
<div style="background:#D2D2D2;padding:4px;text-align:center;color:#242424;border-radius:7px;margin-top:13px">Account: <?=$ulevel?></div>
</div>
</div>
</article>
</div>
</div>
<!-- Friends list -->
<div style="display:inline;float:left;padding-left:20px;padding-top:70px">
<h1 itemprop="name">
Friends (<?=($total = $friends->fetch()) ? $total['total'] : 0 ?>)
</h1>
<article itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Article" class="_card" style="max-width:300px">
<div class="card-action ng-scope" ng-if="item.comment_count">
<!-- Friends -->
<div style="padding-top:15px;padding-bottom:20px;border-bottom:1px solid #ECECEC">
<?
$position = 'left';
$count = 0;
foreach ($friends as $fuser) {
$count++;
echo (!empty($fuser['avatar']) && file_exists($fuser['avatar']))
? printf('<a href="/user/?id=%s"><img src="/%s" style="border:2px solid #E3E3E3;margin:2px;width:45px;height:45px;border-radius:100px;float:%s" /></a>', $fuser['user_id'], $fuser['avatar'], $position, $fuser['user_id'])
: printf('<a href="/user/?id=%s"><img src="/images/noavatar.png" style="border:2px solid #E3E3E3;margin:2px;width:45px;height:45px;border-radius:100px;float:%s" /></a>', $fuser['user_id'], $position, $fuser['user_id']);
if ($count === 40) break;
}
if ($count === 0) printf('No recent friends.');
?>
</div>
</div>
</article>
<!-- BEGIN recents -->
<div style="display:inline;float:left;_padding-top:70px">
<h1 itemprop="name">
Recent's (<?=($title = $recentdl->fetch()) ? intval($title['total']) - 1 : 0 ?>)
</h1>
<article itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Article" class="_card" style="max-width:450px">
<div class="card-action ng-scope" ng-if="item.comment_count">
<!-- Titles -->
<div style="padding-top:15px;padding-bottom:20px;border-bottom:1px solid #ECECEC">
<?
// Get item's recent downloads - June 10, 2021
$n=0;
foreach ($recentdl as $item) {
$n++;
printf('<a href="/details/%s/" title="%s"><img src="/%s" style="width:80px;height:120px;margin-right:10px" /></a>', $item['torrent_id'], html_escape($item['name']), file_exists('images/covers/'.$item['cover1']) ? 'images/covers/'.$item['cover1'] : 'images/switch_cover_none.png');
if ($n === 10) break;
$total = $item['total'];
}
if ($total > 0) {
printf('<span style="float:right;padding-right:10px"><a href="#">Browse all</a> - Showing %s of <b>%s</b></span>', $n, $total - 1);
} else {
printf('<span style="float:right;padding-right:10px">No recent titles.');
}
?>
</div>
</div>
</article>
</div>
<!-- END recents -->
</div>
<div style="clear:both"></div>
<!-- Profile bio -->
<div>
<h1 itemprop="name">
about me
</h1>
<article itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Article" class="card">
<div class="card-action ng-scope" ng-if="item.comment_count">
<p><?=(!empty($row['profile_bio'])) ? html_escape($row['profile_bio']) : 'No info has been added yet :(';?></p>
</div>
</article>
</div>
<!-- Uploads -->
<div>
<h1 itemprop="name">
uploads
</h1>
<article itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Article">
<div class="card-action ng-scope" ng-if="item.comment_count">
<p>Coming soon.</p>
</div>
</article>
</div>
<?
endforeach;
}
if ($account->sessionLogin()){
$db->query_params("UPDATE users SET page = 'Browsing User Profile', last_access = NOW() WHERE user_id = :user_id", array('user_id' => $account->getId()));
}
site_footer();
echo preg_replace('/\[img\](.+?)\[\/img\]/', '', $row['descr']);
<?
$forumid = 11; // foRUM id
// Get forum name
$res = DB::run("SELECT name, minclassread, guest_read FROM forum_forums WHERE id = $forumid");
// Get forum topics
$gettopicres = DB::run("SELECT * FROM forum_topics WHERE forumid=$forumid ORDER BY sticky, lastpost DESC");
$topicres = $gettopicres->fetchAll();
$array = ['title' => 'Forums', 'forumname' => ($arr = $res->fetch()) ? $arr['name'] : 0, 'forumid' => $forumid, 'pagerbottom' => ''];
foreach ($topicres as $topicarr)
{
$data['level'] = ($_SESSION['edit_forum'] == 'yes' || $_SESSION['delete_forum'] == 'yes') ? 'Moderator' : 'Member';
$data['topicid'] = $topicarr['id'];
$data['topic_userid'] = $topicarr['userid'];
$data['locked'] = $topicarr['locked'] ?? 'yes'; // PHP 7 - Null Coalescing Operator
$data['moved'] = $topicarr['moved'] ?? 'yes'; // PHP 7 - Null Coalescing Operator
$data['sticky'] = $topicarr['sticky'] ?? 'yes'; // PHP 7 - Null Coalescing Operator
$replies = DB::run("SELECT COUNT(*) as total FROM forum_posts WHERE topicid=$topicarr[id]");
$data['replies'] = max(0, ($arr = $replies->fetchAll() ? count($arr) - 1 : 0));
$forumposts = DB::run("SELECT * FROM forum_posts WHERE topicid = $topicarr[id] ORDER BY id DESC LIMIT 1");
if ($arr = $forumposts->fetchAll())
{
$data['lppostid'] = intval($arr['id']);
$data['lpuserid'] = intval($arr['userid']);
$data['lpadded'] = $arr['added'];
if (intval($arr['userid']) > 0)
{
$users = DB::run("SELECT * FROM users WHERE user_id = $arr[userid]");
$data['lpusername'] = ($arr = $res->fetchAll()) ? "<a href='/profile?id=$arr[userid]'>$arr[username]</a>" : "Deluser";
if ($topicarr['id'] > 0)
{
$data['lpauthor'] = ($arr = $users->fetchAll()) ? "<a href='/profile?id=$topicarr[userid]'>$arr[username]</a>" : null;
}
}
array_push($data, $arr);
}
$viewsq = DB::run("SELECT views FROM forum_topics WHERE id = $topicarr[id]");
$data['views'] = ($v = $viewsq->fetch()) ? intval($v['views']) : 0;
$r = DB::run("SELECT lastpostread FROM forum_readposts WHERE userid = 1 AND topicid = $topicarr[id]");
isset($_SESSION) ? ($a = $r->fetch()) : false;
$data['topicpic'] = ($locked ? ((!$a || intval($arr['id']) > $a['lastpostread']) ? "folder_locked_new" : "folder_locked") : ((!$a || intval($arr['id']) > $a['lastpostread']) ? "folder_new" : "folder"));
$data['subject'] = ($data['sticky'] ? "<b>FORUMS_STICKY</b>" : "") . "<a href='/topic?topicid=$topicarr[id]'><b>" . trim($topicarr["subject"]) . "</b></a>";
// Push array
array_push($data, $array);
}
$this->view('forum/viewforum', $data, 'user');
<?
forumheader($data['forumname']);
if ($_SESSION['loggedin'] == true): ?>
<table class='table table-striped'><tr><td>
<div align='right'><a href='<?=URLROOT?>/forums/newtopic&forumid=<?=$data['forumid']?>'>
<button type='submit' class='btn btn-sm btn-warning'>New Post</button></a></div>
</td></tr></table>
<? endif; if ($data['topicsres'] > 0): ?>
<div class="row">
<div class="col-lg-12">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row card-header">
<div class="col-md-1">
Read
</div>
<div class="col-md-4">
Topic
</div>
<div class="col-md-1 d-none d-sm-block">
Replies
</div>
<div class="col-md-1 d-none d-sm-block">
Views
</div>
<div class="col-md-1 d-none d-sm-block">
Author
</div>
<div class="col-md-2 d-none d-sm-block">
Last Post
</div>
<?=($data['level'] == 'Moderator') ? '<div class="col-md-2 d-none d-sm-block">Moderate</div>' : ''?>
</div>
<div class="row border border-primary">
<div class="col-md-1 d-none d-sm-block">
<img src='<?=URLROOT?>/assets/images/forum/<?=$data['topicpic']?>.png' alt='' />
</div>
<div class="col-md-4">
<?=$data['subject']?>
</div>
<div class="col-md-1 d-none d-sm-block">
<?=$data['replies']?>
</div>
<div class="col-md-1 d-none d-sm-block">
<?=$data['views']?>
</div>
<div class="col-md-1 d-none d-sm-block">
<?=$data['lpauthor']?>
</div>
<div class="col-md-2">
<span class='small'>by <?=$data['lpusername']?><br /><span style='white-space: nowrap'><?=$data['lpadded']?></span></span>
</div>
<?
if ($_SESSION["edit_forum"] == "yes" || $_SESSION["delete_forum"] == "yes") {
print("<div class='col-md-2 d-none d-sm-block'>");
if ($locked) {
print("<a href='" . URLROOT . "/forums/unlocktopic&forumid=$data[forumid]&topicid=$topicid&page=$page' title='Unlock'><img src='" . URLROOT . "/assets/images/forum/topic_unlock.png' alt='UnLock Topic' /></a>\n");
} else {
print("<a href='" . URLROOT . "/forums/locktopic&forumid=$data[forumid]&topicid=$topicid&page=$page' title='Lock'><img src='" . URLROOT . "/assets/images/forum/topic_lock.png' alt='Lock Topic' /></a>\n");
}
print("<a href='" . URLROOT . "/forums/deletetopic&topicid=$topicid&sure=0' title='Delete'><img src='" . URLROOT . "/assets/images/forum/topic_delete.png' alt='Delete Topic' /></a>\n");
if ($sticky) {
print("<a href='" . URLROOT . "/forums/unsetsticky&forumid=$data[forumid]&topicid=$topicid&page=$page' title='UnStick'><img src='" . URLROOT . "/assets/images/forum/older_sticky_new.png' alt='Unstick Topic' /></a>\n");
} else {
print("<a href='" . URLROOT . "/forums/setsticky&forumid=$data[forumid]&topicid=$topicid&page=$page' title='Stick'><img src='" . URLROOT . "/assets/images/forum/folder_sticky.png' alt='Stick Topic' /></a>\n");
}
print("</div>");
}
print("</div>");
}
print("</div></div></div>");
print ($data['pagerbottom']);
else:
print("<p align='center'>No topics found</p>\n");
endif;
print_r($data['topicsres'])
<?
$myarray1 = [];
foreach ($data['topicsres'] as $topicarr) {
$data['topicid'] = $topicarr["id"];
$data['topic_userid'] = $topicarr["userid"];
$data['locked'] = $topicarr["locked"] == "yes";
array_push($myarray1, $data);
}
print_r($myarray1);
if (empty($row['xyz']))$var = !empty($row['xyz']) ? $row['xyz'] : 'Column looks empty!'
if (is_array($row)) {
if (password_verify($passwd, $row['password'])) {
/* Check if password needs rehashing, if so then continue */
if (password_needs_rehash(sha1($row['password']), PASSWORD_DEFAULT)) {
/* Rehash existing password algorithm to BCRYPT and update */
$newhash = password_hash($passwd, PASSWORD_BCRYPT);
try {
$stmt = $pdo->prepare("UPDATE users SET password = ?, last_access = NOW(), last_login = NOW() WHERE user_id = ?");
$stmt->execute([$newhash, $row['user_id']]);
}
catch (PDOException $e) {
/* If there is a PDO exception, throw a STAccountsException exception. */
$STe = new STAccountsException($e);
$STe->setVarData(['query' => 'UPDATE users SET password = ?, last_access = NOW(), last_login = NOW() WHERE user_id = ?', 'values' => [$newhash, $row['user_id']]]);
throw $STe;
}
}
}