Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. <div class="widget topics" style="border-bottom: 1px solid #5a4b49;margin-top:-2px;box-shadow: 0px 0px 26px 6px rgba(0,0,0,0.75);">
  2.     <div class="topics-up-section">
  3.         <div class="topics-up-image">
  4.             <img src="layout/img/icons/topics-icon.png">
  5.         </div>
  6.         <div class="topics-up-text">
  7.           Changelog
  8.         </div>
  9.         <div style="clear: both;"></div>
  10.     </div>
  11.     <?php
  12.     $posts = mysql_select_multi("
  13.        ( SELECT `t`.`title` AS `thread_title`,
  14.          `t`.`id` AS `thread_id`,
  15.          `p`.`id` AS `post_id`,
  16.          IFNULL(`p`.`created`, `t`.`created`) AS `created`,
  17.          IFNULL(`p`.`player_name`, `t`.`player_name`) AS `player_name`,
  18.          IFNULL(`p`.`player_id`, `t`.`player_id`) AS `player_id`
  19.          FROM `znote_forum_threads` AS `t`
  20.          LEFT JOIN `znote_forum_posts` AS `p` ON `t`.`id` = `p`.`thread_id`
  21.        ) union all (
  22.          SELECT `t`.`title` AS `thread_title`,
  23.          `t`.`id` AS `thread_id`,
  24.          `p`.`id` AS `post_id`,
  25.          IFNULL(`p`.`created`, `t`.`created`) AS `created`,
  26.          IFNULL(`p`.`player_name`, `t`.`player_name`) AS `player_name`,
  27.          IFNULL(`p`.`player_id`, `t`.`player_id`) AS `player_id`
  28.          FROM `znote_forum_threads` AS `t`
  29.          RIGHT JOIN `znote_forum_posts` AS `p` ON `t`.`id` = `p`.`thread_id`
  30.          WHERE `p`.`id` = NULL
  31.        ) ORDER BY `created` DESC LIMIT 5;
  32.    ");
  33.     //data_dump($posts, false, "POSTS");
  34.     if ($posts !== false): foreach ($posts as $post):
  35.         ?>
  36.         <a href="changelog">
  37.         <div class="new-topic">
  38.             <div class="topic-title">
  39.                 <?php echo $post['thread_title']; ?>
  40.             </div>
  41.             <div class="topic-info">
  42.                 <time><?php echo getClock($post['created'], true); ?></time>
  43.                 <span><?php echo $post['player_name']; ?></span>
  44.             </div>
  45.         </div>
  46.         </a>
  47.     <?php endforeach; endif; ?>
  48. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement