Example #1
0
function data_print($a)
{
    global ${"{$a}_array"};
    global ${"{$a}_rows"};
    global ${"{$a}_data"};
    global $stats_rows;
    global $board_rows;
    global $board_data;
    global $board_array;
    global $post_data;
    global $post_rows;
    global $total_data;
    global $GLOBAL;
    for ($i = 0; $i < ${"{$a}_rows"}; $i++, ${"{$a}_data"} = mysql_fetch_array(${"{$a}_array"})) {
        data_fetch("stats", "SELECT `id` FROM `board_" . ${"{$a}_data"}['id'] . "`");
        data_fetch("board", "SELECT `id`,`readby`,`date` FROM `boardnames` WHERE `forumid`='" . ${"{$a}_data"}['id'] . "'");
        data_fetch("post", "SELECT `date`,`poster` FROM `board_" . ${"{$a}_data"}['id'] . "` WHERE `id`=" . ${"{$a}_data"}['lastpost']);
        $post_new = 1;
        for ($j = 0; $j < $board_rows; $j++, $board_data = mysql_fetch_array($board_array)) {
            if ($board_data['date'] > $GLOBAL['user_info']['user_joined'] && !in_array($_COOKIE['ZeldaShrine'], split(":", $board_data['readby'])) && $_COOKIE['ZeldaShrine']) {
                unset($post_new);
            }
        }
        print "\r\n<div class=\"f_item\">\r\n  <div class=\"f_new_" . (isset($post_new) ? $i % 2 == 0 ? "l" : "d" : "red") . "\"></div>\r\n  <div style=\"background-image:url('http://" . $_SERVER['HTTP_HOST'] . "/images/main/Forum/chart." . (!isset($post_new) ? "new" : "old") . "." . ($i % 2 == 0 ? "l" : "d") . ".gif');\" class=\"f_check_" . ($i % 2 == 0 ? "l" : "d") . "\">\r\n  " . (!isset($post_new) ? "\r\n    <input name=\"post_mark_selected[" . ${"{$a}_data"}['id'] . "]\" type=\"checkbox\" value=\"" . ${"{$a}_data"}['id'] . "\" class=\"radio\">\r\n  " : "") . "</div>\r\n  <div class=\"f_thread\">\r\n    <div class=\"f_top_" . ($i % 2 == 0 ? "l" : "d") . "\">\r\n      <a href=\"?fid=" . ${"{$a}_data"}['id'] . "&amp;f_p=0#" . ${"{$a}_data"}['id'] . "\" name=\"" . ${"{$a}_data"}['id'] . "\" id=\"" . ${"{$a}_data"}['id'] . "\">" . ${"{$a}_data"}['name'] . "</a><br>\r\n      <small>\r\n        " . ${"{$a}_data"}['description'] . "<br>\r\n        " . ($_COOKIE['ZeldaShrine'] ? "<a href='http://" . $_SERVER['HTTP_HOST'] . "/Forum/thread.php?fid=" . ${"{$a}_data"}['id'] . "'>Make new thread</a>" : "Please log in to create a new thread.") . "\r\n      </small>\r\n    </div>";
        if ($_GET['fid'] == ${"{$a}_data"}['id']) {
            data_fetch("total", "SELECT COUNT(*) AS `rows` FROM `boardnames` WHERE `forumid`=" . $_GET['fid']);
            data_fetch("board", "SELECT `id`,`name`,`starter`,`date`,`lastpost`,`readby` FROM `boardnames` WHERE `forumid`='" . $_GET['fid'] . "' ORDER BY `lastpost` DESC LIMIT " . $_GET['f_p'] * 5 . ",5");
            print "\r\n  <!-- Running data_thread -->\r\n";
            data_thread("board", $i);
            print "\r\n    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"m_nav\">\r\n      <tr>\r\n        <td class=\"m_nav_left\">" . ($_GET['f_p'] > 0 ? "\r\n          <a href='?fid=" . $_GET['fid'] . "&amp;f_p=" . ($_GET['f_p'] - 1) . "#" . $_GET['fid'] . "'>Previous page of topics</a>" : "\r\n          &nbsp;") . "\r\n        </td>\r\n        <td class=\"m_nav_right\">" . ($total_data['rows'] - ($_GET['f_p'] + 1) * 5 > 0 ? "\r\n          <a href='?fid=" . $_GET['fid'] . "&amp;f_p=" . ($_GET['f_p'] + 1) . "#" . $_GET['fid'] . "'>Next page of topics</a>" : "\r\n          &nbsp;") . "\r\n        </td>\r\n      </tr>\r\n    </table>";
        }
        print "\r\n  </div>\r\n</div>";
    }
}
Example #2
0
<br />
          <?php 
if ($_COOKIE['ZeldaShrine']) {
    ?>
          <a href='http://<?php 
    print $_SERVER['HTTP_HOST'];
    ?>
/Forum/thread.php?fid=<?php 
    print $_GET['fid'];
    ?>
'>Make new thread</a>
          <?php 
}
?>
<br />
          Showing the ten most recent threads.</small><br />
          <br /><br /><div style='position:relative; left:30px;'>
          <?php 
data_fetch("board", "SELECT `id`,`name`,`starter`,`date`,`lastpost`,`readby` FROM `boardnames` WHERE `forumid`='" . $_GET['fid'] . "' ORDER BY `lastpost` DESC LIMIT 10");
data_thread("board");
?>
          </div>
      </div>
    </td>
    <td></td>
  </tr>
</table>
</fieldset>

<?php 
include $_SERVER['DOCUMENT_ROOT'] . "/includes/layout.bottom.php";