Ejemplo n.º 1
0
         $last_reply_avatar = '<img class="img-centre img-rounded" src="https://cravatar.eu/avatar/' . htmlspecialchars($user->IdToMCName($sticky->topic_last_user)) . '/30.png" />';
     } else {
         $last_reply_avatar = '<img class="img-centre img-rounded" style="width:30px; height:30px;" src="' . $user->getAvatar($sticky->topic_last_user, "../") . '" />';
     }
     // Is there a label?
     if ($sticky->label != 0) {
         // yes
         // Get label
         $label = $queries->getWhere('forums_topic_labels', array('id', '=', $sticky->label));
         $label = '<span class="label label-' . htmlspecialchars($label[0]->label) . '">' . htmlspecialchars($label[0]->name) . '</span>';
     } else {
         // no
         $label = '';
     }
     // Add to array
     $sticky_array[] = array('topic_title' => htmlspecialchars($sticky->topic_title), 'topic_id' => $sticky->id, 'topic_created_rough' => $timeago->inWords(date('d M Y, H:i', $sticky->topic_date), $time_language), 'topic_created' => date('d M Y, H:i', $sticky->topic_date), 'topic_created_username' => htmlspecialchars($user->IdToName($sticky->topic_last_user)), 'topic_created_mcname' => htmlspecialchars($user->IdToMCName($sticky->topic_last_user)), 'views' => $sticky->topic_views, 'locked' => $sticky->locked, 'posts' => $replies, 'last_reply_avatar' => $last_reply_avatar, 'last_reply_rough' => $timeago->inWords(date('d M Y, H:i', $sticky->topic_reply_date), $time_language), 'last_reply' => date('d M Y, H:i', $sticky->topic_reply_date), 'last_reply_username' => htmlspecialchars($user->IdToName($sticky->topic_last_user)), 'last_reply_mcname' => htmlspecialchars($user->IdToMCName($sticky->topic_last_user)), 'label' => $label);
 }
 // Clear out variables
 $stickies = null;
 $sticky = null;
 // Latest discussions
 // PAGINATION
 // Set current page and number of records
 $pagination->setCurrent($p);
 $pagination->setTotal(count($topics));
 $pagination->alwaysShowPagination();
 // Get number of topics we should display on the page
 $paginate = PaginateArray($p);
 $n = $paginate[0];
 $f = $paginate[1];
 // Get the number we need to finish on ($d)
Ejemplo n.º 2
0
</td>
			    <td><?php 
        echo htmlspecialchars($infraction["reason"]);
        ?>
</td>
			    <?php 
        if ($inf_plugin != 'bu') {
            ?>
<td><?php 
            if (isset($infraction['issued'])) {
                ?>
<span rel="tooltip" data-placement="top" title="<?php 
                echo $infraction["issued_human"];
                ?>
"><?php 
                echo $timeago->inWords(date('d M Y, H:i', $infraction["issued"]), $time_language);
                ?>
</span><?php 
            } else {
                echo '-';
            }
            ?>
</td><?php 
        }
        ?>
			    <td><a class="btn btn-primary btn-sm" href="/infractions/?type=<?php 
        echo $infraction["type"];
        ?>
&amp;id=<?php 
        echo $infraction["id"];
        if (isset($infraction['past'])) {
Ejemplo n.º 3
0
         $last_reply_avatar = '<img class="img-centre img-rounded" src="https://cravatar.eu/avatar/' . $user->IdToMCName($discussions[$n]['topic_last_user']) . '/30.png" />';
     } else {
         $last_reply_avatar = '<img class="img-centre img-rounded" style="width:30px; height:30px;" src="' . $user->getAvatar($discussions[$n]['topic_last_user'], "../") . '" />';
     }
     // Is there a label?
     if ($discussions[$n]['label'] !== null && $discussions[$n]['label'] !== '') {
         // yes
         // Get label
         $label = $queries->getWhere('forums_topic_labels', array('id', '=', $discussions[$n]['label']));
         $label = '<span class="label label-' . htmlspecialchars($label[0]->label) . '">' . htmlspecialchars($label[0]->name) . '</span>';
     } else {
         // no
         $label = '';
     }
     // Add to array
     $template_array[] = array('topic_title' => htmlspecialchars($discussions[$n]['topic_title']), 'topic_id' => $discussions[$n]['id'], 'topic_created_rough' => $timeago->inWords(date('d M Y, H:i', $discussions[$n]['topic_date']), $time_language), 'topic_created' => date('d M Y, H:i', $discussions[$n]['topic_date']), 'topic_created_username' => htmlspecialchars($user->IdToName($discussions[$n]['topic_last_user'])), 'topic_created_mcname' => htmlspecialchars($user->IdToMCName($discussions[$n]['topic_last_user'])), 'locked' => $discussions[$n]['locked'], 'forum_name' => $forum_name, 'forum_id' => $discussions[$n]['forum_id'], 'views' => $discussions[$n]['topic_views'], 'posts' => $posts, 'last_reply_avatar' => $last_reply_avatar, 'last_reply_rough' => $timeago->inWords(date('d M Y, H:i', $discussions[$n]['topic_reply_date']), $time_language), 'last_reply' => date('d M Y, H:i', $discussions[$n]['topic_reply_date']), 'last_reply_username' => htmlspecialchars($user->IdToName($discussions[$n]['topic_last_user'])), 'last_reply_mcname' => htmlspecialchars($user->IdToMCName($discussions[$n]['topic_last_user'])), 'label' => $label);
     $n++;
 }
 // Assign to Smarty variable
 $smarty->assign('LATEST_DISCUSSIONS', $template_array);
 // Assign language variables
 $smarty->assign('FORUMS', $forum_language['forums']);
 $smarty->assign('DISCUSSION', $forum_language['discussion']);
 $smarty->assign('STATS', $forum_language['stats']);
 $smarty->assign('LAST_REPLY', $forum_language['last_reply']);
 $smarty->assign('AGO', '');
 // to be removed
 $smarty->assign('BY', $forum_language['by']);
 $smarty->assign('IN', $forum_language['in']);
 $smarty->assign('VIEWS', $forum_language['views']);
 $smarty->assign('POSTS', $forum_language['posts']);
Ejemplo n.º 4
0
			  <div class="col-md-2"><a href="<?php 
                echo $alert->url;
                ?>
"><?php 
                echo htmlspecialchars($alert->type);
                ?>
</a></div>
			  <div class="col-md-5"><?php 
                echo $alert->content;
                ?>
</div>
			  <div class="col-md-3"><span rel="tooltip" data-trigger="hover" data-original-title="<?php 
                echo date('d M Y, H:i', $alert->created);
                ?>
"><?php 
                echo $timeago->inWords(date('d M Y, H:i', $alert->created), $time_language);
                ?>
</span></div>
			  <div class="col-md-2"><a href="/user/alerts/?action=read&amp;aid=<?php 
                echo $alert->id;
                ?>
"><span class="label label-success">Mark as Read</span></a></div>
			</div>
			<br />
					<?php 
            }
        } else {
            echo $user_language['no_unread_alerts'];
        }
    } else {
        if (isset($_GET['view']) && $_GET['view'] == 'read') {
Ejemplo n.º 5
0
            $post_reputation .= '
						  <tr>
							<td style="width:40px"><a href="/profile/' . htmlspecialchars($user->IdToMCName($rep->user_given)) . '"><img class="img-rounded" src="https://cravatar.eu/avatar/' . htmlspecialchars($user->IdToMCName($rep->user_given)) . '/30.png" /></a></td>
							<td style="width:100px"><a href="/profile/' . htmlspecialchars($user->IdToMCName($rep->user_given)) . '">' . htmlspecialchars($user->IdToName($rep->user_given)) . '</a></td>
						  </tr>';
        }
        $post_reputation .= '</table>';
    } else {
        $post_reputation .= $forum_language['no_reputation'];
    }
    $post_reputation .= '
				</div>
			  </div>
			</div>
		  </div>';
    $replies[] = array('heading' => $heading, 'post_id' => 'post-' . $posts[$n]->id, 'avatar' => $avatar, 'username' => htmlspecialchars($post_user[0]->username), 'mcname' => htmlspecialchars($post_user[0]->mcname), 'user_group' => $purifier->purify($user_group), 'user_posts_count' => count($queries->getWhere('posts', array('post_creator', '=', $posts[$n]->post_creator))), 'user_reputation' => $post_user[0]->reputation, 'post_date_rough' => $timeago->inWords($posts[$n]->post_date, $time_language), 'post_date' => date('d M Y, H:i', strtotime($posts[$n]->post_date)), 'buttons' => $buttons, 'content' => $purifier->purify(htmlspecialchars_decode($posts[$n]->post_content)), 'reputation' => $post_reputation, 'signature' => $purifier->purify(htmlspecialchars_decode($signature)));
    $n++;
}
$smarty->assign('REPLIES', $replies);
// Quick reply
if ($user->isLoggedIn() && $can_reply) {
    if ($topic->locked != 1) {
        $quick_reply = '
		    <h3>' . $forum_language['new_reply'] . '</h3>
		    <form action="" method="post">
			  <textarea name="content" id="quickreply" rows="3">' . htmlspecialchars(Input::get('content')) . '</textarea>
			  <br /><input type="hidden" name="token" value="' . $token . '">
			  <button type="submit" class="btn btn-primary">' . $general_language['submit'] . '</button>
		    </form>';
        $smarty->assign('QUICK_REPLY', $quick_reply);
    } else {
Ejemplo n.º 6
0
</small>
				</blockquote>
  	      	</div>

  	      	<div class="col-md-9">
  	      	  By <a href="/profile/<?php 
    echo htmlspecialchars($post_user[0]->mcname);
    ?>
"><?php 
    echo htmlspecialchars($post_user[0]->username);
    ?>
</a> &raquo; <span rel="tooltip" data-trigger="hover" data-original-title="<?php 
    echo date('d M Y, H:i', strtotime($posts[$n]->post_date));
    ?>
"><?php 
    echo $timeago->inWords($posts[$n]->post_date);
    ?>
 ago</span>
  	      	  <?php 
    if ($user->isLoggedIn()) {
        ?>
  	      	  <span class="pull-right">
  	      	    <?php 
        // Edit button
        if ($user->data()->group_id == 2 || $user->data()->group_id == 3) {
            ?>
  	      	    <a rel="tooltip" title="Edit post" href="/forum/edit_post/?pid=<?php 
            echo $posts[$n]->id;
            ?>
&amp;tid=<?php 
            echo $tid;
Ejemplo n.º 7
0
        $posts = count($posts);
        ?>
			<tr>
			  <td>
			    <a href="/forum/view_topic/?tid=<?php 
        echo $discussions[$n]['id'];
        ?>
"><?php 
        echo htmlspecialchars($discussions[$n]['topic_title']);
        ?>
</a>
				<br /><small><span rel="tooltip" data-trigger="hover" data-original-title="<?php 
        echo date('d M Y, H:i', $discussions[$n]['topic_date']);
        ?>
"><?php 
        echo $timeago->inWords(date('d M Y, H:i', $discussions[$n]['topic_date']));
        ?>
 ago</span> by <a href="/profile/<?php 
        echo $user->IdToMCName($discussions[$n]['topic_creator']);
        ?>
"><?php 
        echo $user->IdToName($discussions[$n]['topic_creator']);
        ?>
</a> in <a href="/forum/view_forum/?fid=<?php 
        echo $discussions[$n]['forum_id'];
        ?>
"><?php 
        echo $forum_name;
        ?>
</a></small>
			  </td>
Ejemplo n.º 8
0
            $replies = count($replies);
            ?>
			<tr>
			  <td>
			    <span class="glyphicon glyphicon-pushpin"></span> <a href="/forum/view_topic/?tid=<?php 
            echo $sticky->id;
            ?>
"><?php 
            echo htmlspecialchars($sticky->topic_title);
            ?>
</a>
				<br /><small><span rel="tooltip" data-trigger="hover" data-original-title="<?php 
            echo date('d M Y, H:i', $sticky->topic_date);
            ?>
"><?php 
            echo $timeago->inWords(date('d M Y, H:i', $sticky->topic_date));
            ?>
 ago</span> by <a href="/profile/<?php 
            echo htmlspecialchars($user->idToMCName($sticky->topic_creator));
            ?>
"><?php 
            echo htmlspecialchars($user->idToName($sticky->topic_creator));
            ?>
</a></small>
			  </td>
			  <td>
				<b><?php 
            echo $sticky->topic_views;
            ?>
</b> views<br />
				<b><?php