Jump to content

3raser

Members
  • Posts

    815
  • Joined

  • Last visited

Everything posted by 3raser

  1. Here is a picture of what I'm working with: http://puu.sh/1nlwf Any idea why it sorts decently, but when it gets down to the seconds - it doesn't seem to be right. It is an array and each key is a timestamp (time()[/time]). I then call: //now sort them krsort($list, SORT_NUMERIC); On my array (list). Any ideas?
  2. I'm creating a list that shows all of a user's recent posts and threads. I want to have all the threads/posts mixed together in one list, all descending by their dates (decided to go with dates and not IDs). E.g: Newest [THREAD] Oct/11/12 Oct/10/12 Oct/8/12 ..and so on [THREAD] [THREAD] Latest
  3. It's hard to explain. I want the results combined, then ordered. I don't want a "segregated" list.
  4. Each table has the field id. Is there any way to do something below (code provided doesn't work): SELECT threads.id,threads.title,posts.id,posts.thread FROM threads, posts WHERE threads.username = ? AND posts.username = ? ORDER BY `id` DESC
  5. I have several units (days, weeks, years) I'd like to add to the current date in MySQL. How would I go about doing this? I tried: ADDDATE(CURRENT_DATE(), INTERVAL {$length[0]} YEAR INTERVAL {$length[1]} MONTH INTERVAL {$length[2]} WEEK INTERVAL {$length[3]} DAY) But doesn't work. Can you even add multiple intervals?
  6. I have index.php: http://paste2.org/p/2394784 And then I have a file called post.php - Is there any way to get the file from the input field in index.php to go through the AJAX request? I attempt something like so: when the file is selected in the html field, set the var file equal to it image.change(function(){ extension = image.val().split('.')[1]; if(extension != 'png' && extension != 'jpeg' && extension != 'bmp' && extension != 'gif'){ image.val(''); displayError('#image', 'That file extension is not allowed.'); }else{ file = this; } }); Then when the user is done, and they click submit - send the file through POST: $.ajax({ type: "POST", url: "post.php", data: { t: title.val(), c: content.val(), image: file} }).done(function(msg) { alert(msg); if(msg != "success"){ split = msg.split(','); displayError(split[0], split[1]); }else{ alert(msg); } });
  7. Ah, thanks. Fixed that. I've also gotten everything to work: however, it still doesn't seem to support multiple lines. Any ideas?
  8. I've checked all variables, and they are set correctly. However, no matter what - I can't seem to get the following line of code to actually replace the [donator][/donator] pattern with the contents within it. input [donator] this is a test[/donator] //show content within [donator] tags only to donators $content = preg_replace('#\[donator\](.+?)\[\/donator\]#im', (($user->isDonator($user->getUsername($_COOKIE['user'], 2)) || $rank > 1) ? '<div class="donator_only">$1</div>' : null), $content);
  9. \w(.+?)@\w(.+?)\.\w(.+?) Is my RegEx to verify someone has their email in the correct format. It always leaves off the last letter, however. Any idea? Example: input: test@gmail.com matched: test@gmail.com (notice m is not matched)
  10. Sorry about that <?php class server{ protected $database; function __construct(){ self::$database = loadClass($database); } public static function loadClass($class){ if(self::$class == null){ if(file_exists($class.'.php')){ include($class.'.php'); self::$class = new $class(); }else{ self::throwError('class '. $class.' does not exist'); } }else{ self::throwError($class. 'already loaded.'); } } public static function dropClass($class){ self::$class = null; } public static function runMethod($class, $method, array $params = array()){ if(self::isLoaded($class)){ if(count($params) != 0){ $par = ''; $i = 1; foreach($params as $key => $value){ $par .= ($i == count($params)) ? $method : $method.','; $i++; } } self::$class->$method(($par != null) ? $par : null); }else{ self::throwError($class .' is not loaded.'); } } protected static function isLoaded($class){ return (self::$class == null) ? false : true; } protected static function throwError($error){ die('<link rel="stylesheet" href="css/error.css" media="all" /><div class="error"><img src="img/error.png" width="45" height="40"><br/><h4>Error!</h4><div class="err_msg">'. $error .'</div></div>'); } } ?>
  11. The below function worked just fine when it was in a non-static format. However, whenever I put it into static format and called the function this error was generated: Fatal error: Access to undeclared static property: server::$class in C:\wamp\www\rsplaypages\structure\server.php on line 11 Any idea whay self::$class isn't working? public static function loadClass($class){ if(self::$class == null){ if(file_exists($class.'.php')){ include($class.'.php'); self::$class = new $class(); }else{ self::throwError('class '. $class.' does not exist'); } }else{ self::throwError($class. 'already loaded.'); } } Thanks.
  12. I'm going for the most efficient setup I can get for my MySQL structure. Would you recommend making the field type of "lastlogin" (the last login for a user) a timestamp or date? Thanks.
  13. It would probably make it easier if you gave us the modified code. ;P
  14. Well, you can make a small modification to the $path variable: $path = trim($_GET['file']); Then, you'd simply link to it: <a href="download.php?file=picture.gif">This is a link. Download the image.</a> And of course download.php would be changed to whatever you named the PHP file I provided to you.
  15. Well it seems the error is within connect.php - Are you sure it's not returning anything that may cause the header error?
  16. I'm not too sure if this could be the cause, but is there an accidental whitespace after/before your PHP tags in connect.php file that my be causing the header error?
  17. $path should be the path to the image you want the viewer to download. <?php //path to the picture you're wanting the viewer to download $path = 'picture.gif'; if(file_exists($path)){ //split the extension and name from eachother $e = explode('.', $path); //get the name of the file $file_name = $e[0]; //image extension $extension = $e[1]; // Send a header saying we'll be displaying a picture header('Content-type: image/'. $extension); // Name the file header('Content-Disposition: attachment; filename="'. $file_name .'.'. $extension .'"'); // Path to the picture you're wanting the user/viewer to download readfile($file_name .'.'. $extension); }else{ echo 'The requested image does not exist.'; } ?>
  18. Hmmm, I have been converting most of my code above the HTML and echoing out results with a variable. But it makes the code so much uglier. As you can see, with the original code I posted - it now looks 10x uglier. <?php require('../structure/base.php'); require('../includes/config.php'); require('../structure/database.php'); require('../structure/forum.php'); require('../structure/forum.thread.php'); require('../structure/user.php'); $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $user = new user($database); $forum = new forum($database); $thread_obj = new thread($database); //make sure the user is logged in and the required data is set if(!$user->isLoggedIn() || !ctype_digit($_REQUEST['forum']) || !ctype_digit($_REQUEST['id'])) $base->redirect('index.php'); //set some variables that are used a lot throughout the page $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $f = $_REQUEST['forum']; $thread = $_REQUEST['id']; //make sure they are posting in a forum where they have permission if($user->checkMute($username) || !$thread_obj->canView($thread, $username, $rank) || !$thread_obj->canReply($thread, $rank)) $base->redirect('index.php'); //floodlimit time $flood_limit = $database->processQuery("SELECT `floodlimit` FROM `config` LIMIT 1", array(), true); //get the user's last post (time) $last_post = $database->processQuery("SELECT `lastpost` FROM `users` WHERE `username` = ? LIMIT 1", array($username), true); //make sure the user doesn't have an existing mute if(isset($_POST['message'])) { //if they clicked cancel instead of "reply" if(isset($_POST['cancel'])) $base->redirect('viewthread.php?forum='. $f.'&id='. $thread); //make sure the title and message meet the standards if(strlen($_POST['message']) > 2000 && $rank < 3) { $content = '<div class="frame e">Your post can\'t be larger than 2000 characters.</div>'; } elseif((time()-$last_post[0]['lastpost']) < $flood_limit[0]['floodlimit'] && $rank < 4) { $content = '<div class="frame e">You\'re attempting to post too soon.</div>'; } else { //auto-hiding? $data = $database->processQuery("SELECT `autohiding` FROM `threads` WHERE `id` = ?", array($thread), true); $status = ($data[0]['autohiding'] == 1) ? 1 : 0; //insert post $database->processQuery("INSERT INTO `posts` VALUES (null, ?, ?, ?, NOW(), ?, '', ?, ?)", array($username, nl2br($_POST['message']), $thread, $status, $_SERVER['REMOTE_ADDR'], time()), false); $creation_id = $database->getInsertId(); //update thread $database->processQuery("UPDATE `threads` SET `lastposter` = ?, `lastpost` = NOW() WHERE `id` = ?", array($username, $thread), false); //update their last post field $database->processQuery("UPDATE `users` SET `lastpost` = ?", array(time()), false); //send them to the thread they posted on $base->redirect('viewthread.php?forum='. $f .'&id='. $thread.'&goto='. $creation_id); } } else { $chars = ($rank > 2) ? $chars = null : $chars = 2000; if(isset($_GET['quote']) && isset($_GET['qt']) && $rank > 3) { $quote = ($_GET['qt'] == 1) ? $database->processQuery("SELECT `content`,`username` FROM `posts` WHERE `id` = ?", array($_GET['quote']), true) : $database->processQuery("SELECT `content`,`username` FROM `threads` WHERE `id` = ?", array($_GET['quote']), true); $text = $base->remBr('[quote='. $quote[0]['username'] .']'. $quote[0]['content'] .'[/quote]'); } $content = ' <div id="nocontrols" class="phold"></div> <div id="command"> <form method="post" action="reply.php"> <input type="hidden" name="id" value="'. $thread .'"> <input type="hidden" name="forum" value="'. $f .'"> <table> <tr> <td class="commandtwo" colspan="2">You have <span id="charlimit_count_b">30</span> characters <span id="charlimit_info_b" style="display: none">remaining</span> for your title.</td> </tr> <tr> <td class="commandtwo" colspan="2"> <textarea id="charlimit_text_a" name="message" rows="20" cols="60">'. $text .'</textarea><br /> You have <span id="charlimit_count_a">'. $chars .'</span> characters <span id="charlimit_info_a" style="display: none">remaining</span> for your message.</td> </tr> <tr> <td class="commandtwo" colspan="2"><br /> <input type="submit" name="add" value="Add reply" /> <!--<input type="submit" name="preview" value="Preview" /> --> <input type="submit" name="cancel" value="Cancel" /> </td> </tr> </table> </form> </div> <div id="smileylegend"> <span class="title">Smileys: </span><br> <span id="smilytxt" style="display: hidden;">Click to add a smiley to your message (will overwrite selected text).</span><br /> <span onclick="addsmiley(\'\')"><IMG class=sm0 alt="" title="" src="../img/forum/smileys/smile.gif"> </span> <span onclick="addsmiley(\'\')"><IMG class=sm1 alt="" title="" src="../img/forum/smileys/wink.gif"> </span> <span onclick="addsmiley(\'\')"><IMG class=sm2 alt="" title="" src="../img/forum/smileys/tongue.gif"> </span> <span onclick="addsmiley(\'\')"><IMG class=sm3 alt="" title="" src="../img/forum/smileys/sad.gif"> </span> <span onclick="addsmiley(\':|\')"><IMG class=sm4 alt=":|" title=":|" src="../img/forum/smileys/nosmile.gif"> :|</span> <span onclick="addsmiley(\'O_o\')"><IMG class=sm5 alt="O_o" title="O_o" src="../img/forum/smileys/o.O.gif"> O_o</span> <span onclick="addsmiley(\'\')"><IMG class=sm6 alt="" title="" src="../img/forum/smileys/bigsmile.gif"> </span> <span onclick="addsmiley(\'^^\')"><IMG class=sm7 alt="^^" title="^^" src="../img/forum/smileys/^^.gif"> ^^</span> <span onclick="addsmiley(\'\')"><IMG class=sm8 alt="" title="" src="../img/forum/smileys/shocked.gif"> </span> <span onclick="addsmiley(\':@\')"><IMG class=sm9 alt=":@" title=":@" src="../img/forum/smileys/angry.gif"> :@</span> </div>'; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:IE> <head> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta name="MSSmartTagsPreventParsing" content="TRUE"> <title><?php echo $data['wb_title']; ?></title> <link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all" /> <link href="../css/forum-3.css" rel="stylesheet" type="text/css" media="all" /> <link href="../css/forummsg-1.css" rel="stylesheet" type="text/css" media="all" /> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="../css/forummsg-ie-1.css" /> <![endif]--> <script src="../js/v_thread_1.js"></script> <script src="../js/v_thread_2.js"></script> <?php include('../includes/google_analytics.html'); ?> </head> <body> <div id="body"> <?php $forum->getNavBar($username, $rank); ?> <br /><br /> <div style="text-align: center; background: none;"> <div id="infopane"> <div class="about"> <ul class="flat"> <li><a href="viewthread.php?forum=<?php echo $f; ?>&id=<?php echo $thread; ?>">Return to thread</a></li> </ul> </div> </div> <?php echo $content; ?> <br /> <div class="tandc"><?php echo $data['wb_foot']; ?></div> </div> </div> </body> And how bad would the page be slowed down with ob_start();
  19. I'm sorry for the absurd title, but I'm very ticked off right now. I spent the last few weeks rewriting my software. All development took place on localhost which doesn't seem to report header errors and works just fine. But I will now have to, after moving the stuff to a live version, change ALL of my work. But can someone PLEASE tell me there is an easier way than changing all of my work. This is one example. As you can see, after successfully creating the reply - it attempts to redirect the user but of course a header error is outputted instead. <?php require('../structure/base.php'); require('../includes/config.php'); require('../structure/database.php'); require('../structure/forum.php'); require('../structure/forum.thread.php'); require('../structure/user.php'); $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $user = new user($database); $forum = new forum($database); $thread_obj = new thread($database); //make sure the user is logged in and the required data is set if(!$user->isLoggedIn() || !ctype_digit($_REQUEST['forum']) || !ctype_digit($_REQUEST['id'])) $base->redirect('index.php'); //set some variables that are used a lot throughout the page $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $f = $_REQUEST['forum']; $thread = $_REQUEST['id']; //make sure they are posting in a forum where they have permission if($user->checkMute($username) || !$thread_obj->canView($thread, $username, $rank) || !$thread_obj->canReply($thread, $rank)) $base->redirect('index.php'); //floodlimit time $flood_limit = $database->processQuery("SELECT `floodlimit` FROM `config` LIMIT 1", array(), true); //get the user's last post (time) $last_post = $database->processQuery("SELECT `lastpost` FROM `users` WHERE `username` = ? LIMIT 1", array($username), true); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:IE> <head> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta name="MSSmartTagsPreventParsing" content="TRUE"> <title><?php echo $data['wb_title']; ?></title> <link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all" /> <link href="../css/forum-3.css" rel="stylesheet" type="text/css" media="all" /> <link href="../css/forummsg-1.css" rel="stylesheet" type="text/css" media="all" /> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="../css/forummsg-ie-1.css" /> <![endif]--> <script src="../js/v_thread_1.js"></script> <script src="../js/v_thread_2.js"></script> <?php include('../includes/google_analytics.html'); ?> </head> <body> <div id="body"> <?php $forum->getNavBar($username, $rank); ?> <br /><br /> <div style="text-align: center; background: none;"> <div id="infopane"> <div class="about"> <ul class="flat"> <li><a href="viewthread.php?forum=<?php echo $f; ?>&id=<?php echo $thread; ?>">Return to thread</a></li> </ul> </div> </div> <?php //make sure the user doesn't have an existing mute if(isset($_POST['message'])) { //if they clicked cancel instead of "reply" if(isset($_POST['cancel'])) $base->redirect('viewthread.php?forum='. $f.'&id='. $thread); //make sure the title and message meet the standards if(strlen($_POST['message']) > 2000 && $rank < 3) { echo '<div class="frame e">Your post can\'t be larger than 2000 characters.</div>'; } elseif((time()-$last_post[0]['lastpost']) < $flood_limit[0]['floodlimit'] && $rank < 4) { echo '<div class="frame e">You\'re attempting to post too soon.</div>'; } else { //auto-hiding? $data = $database->processQuery("SELECT `autohiding` FROM `threads` WHERE `id` = ?", array($thread), true); $status = ($data[0]['autohiding'] == 1) ? 1 : 0; //insert post $database->processQuery("INSERT INTO `posts` VALUES (null, ?, ?, ?, NOW(), ?, '', ?, ?)", array($username, nl2br($_POST['message']), $thread, $status, $_SERVER['REMOTE_ADDR'], time()), false); $creation_id = $database->getInsertId(); //update thread $database->processQuery("UPDATE `threads` SET `lastposter` = ?, `lastpost` = NOW() WHERE `id` = ?", array($username, $thread), false); //update their last post field $database->processQuery("UPDATE `users` SET `lastpost` = ?", array(time()), false); //send them to the thread they posted on $base->redirect('viewthread.php?forum='. $f .'&id='. $thread.'&goto='. $creation_id); } } else { $chars = ($rank > 2) ? $chars = null : $chars = 2000; if(isset($_GET['quote']) && isset($_GET['qt']) && $rank > 3) { $quote = ($_GET['qt'] == 1) ? $database->processQuery("SELECT `content`,`username` FROM `posts` WHERE `id` = ?", array($_GET['quote']), true) : $database->processQuery("SELECT `content`,`username` FROM `threads` WHERE `id` = ?", array($_GET['quote']), true); $text = $base->remBr('[quote='. $quote[0]['username'] .']'. $quote[0]['content'] .'[/quote]'); } ?> <div id="nocontrols" class="phold"></div> <div id="command"> <form method="post" action="reply.php"> <input type="hidden" name="id" value="<?php echo $thread; ?>"> <input type="hidden" name="forum" value="<?php echo $f; ?>"> <table> <tr> <td class="commandtwo" colspan="2">You have <span id="charlimit_count_b">30</span> characters <span id="charlimit_info_b" style="display: none">remaining</span> for your title.</td> </tr> <tr> <td class="commandtwo" colspan="2"> <textarea id="charlimit_text_a" name="message" rows="20" cols="60"><?php echo $text; ?></textarea><br /> You have <span id="charlimit_count_a"><?php echo $chars; ?></span> characters <span id="charlimit_info_a" style="display: none">remaining</span> for your message.</td> </tr> <tr> <td class="commandtwo" colspan="2"><br /> <input type="submit" name="add" value="Add reply" /> <!--<input type="submit" name="preview" value="Preview" /> --> <input type="submit" name="cancel" value="Cancel" /> </td> </tr> </table> </form> </div> <div id="smileylegend"> <span class="title">Smileys: </span><br> <span id="smilytxt" style="display: hidden;">Click to add a smiley to your message (will overwrite selected text).</span><br /> <span onclick="addsmiley('')"><IMG class=sm0 alt="" title="" src="../img/forum/smileys/smile.gif"> </span> <span onclick="addsmiley('')"><IMG class=sm1 alt="" title="" src="../img/forum/smileys/wink.gif"> </span> <span onclick="addsmiley('')"><IMG class=sm2 alt="" title="" src="../img/forum/smileys/tongue.gif"> </span> <span onclick="addsmiley('')"><IMG class=sm3 alt="" title="" src="../img/forum/smileys/sad.gif"> </span> <span onclick="addsmiley(':|')"><IMG class=sm4 alt=":|" title=":|" src="../img/forum/smileys/nosmile.gif"> :|</span> <span onclick="addsmiley('O_o')"><IMG class=sm5 alt="O_o" title="O_o" src="../img/forum/smileys/o.O.gif"> O_o</span> <span onclick="addsmiley('')"><IMG class=sm6 alt="" title="" src="../img/forum/smileys/bigsmile.gif"> </span> <span onclick="addsmiley('^^')"><IMG class=sm7 alt="^^" title="^^" src="../img/forum/smileys/^^.gif"> ^^</span> <span onclick="addsmiley('')"><IMG class=sm8 alt="" title="" src="../img/forum/smileys/shocked.gif"> </span> <span onclick="addsmiley(':@')"><IMG class=sm9 alt=":@" title=":@" src="../img/forum/smileys/angry.gif"> :@</span> </div> <?php } ?> <br /> <div class="tandc"><?php echo $data['wb_foot']; ?></div> </div> </div> </body> Please tell me there is a way around this besides moving all the code to the top and making the file sloppy.
  20. Edit: Never mind, it was a simple mistake on my behalf.
  21. I don't have too much experience with PDO, but I want to remove all inactive users from online_users WHERE time() - time (table) > 480 $this->database->processQuery("DELETE FROM `online_users` WHERE ". time() ." - `time` > 480", array(), false); I receive this error statement: Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in C:\wamp\www\OSREMAKE\structure\database.php on line 55 So which part requires the token?
  22. Welcome, dude. Nope. Better to keep the separate functionality separate. Alrighty, here's the updated version: <?php require('../includes/config.php'); require('../structure/base.php'); require('../structure/forum.php'); require('../structure/forum.thread.php'); require('../structure/forum.post.php'); require('../structure/database.php'); require('../structure/user.php'); $database = new database($db_host, $db_name, $db_user, $db_password); $base = new base($database); $user = new user($database); $forum = new forum($database); $thread = new thread($database); $post = new post($database); //set some variables that are used a lot throughout the page $username = $user->getUsername($_COOKIE['user'], 2); $rank = $user->getRank($username); $f = $_GET['forum']; $i = $_GET['id']; //preform basic checks if(!$thread->checkExistence($i) || !$thread->canView($i, $username, $rank)) $base->redirect('index.php'); //if a moderator chooses to hide the thread, lets make it happen if((isset($_GET['hide']) && !isset($_GET['pid'])) && $rank > 2) $thread->hideThread($i, $rank); //if the GOTO field is set, let's skip to the selected post if(ctype_digit($_GET['goto'])) { $getPageNum = $thread->getPageNum($_GET['goto'], $i); if($getPageNum) $base->redirect('viewthread.php?forum='. $f.'&id='.$i.'&page='.$getPageNum.'&highlight='. $_GET['goto'] .'#'.$_GET['goto']); } //extract thread details $detail_query = $database->processQuery("SELECT `id`,`lock`,`sticky`,`title`,`username`,`status`,`content`,`date`,`lastedit`,`qfc` FROM `threads` WHERE `id` = ? LIMIT 1", array($i), true); //assign data to details[] array $details[] = $detail_query[0]['lock']; $details[] = $detail_query[0]['sticky']; $details[] = htmlentities($detail_query[0]['title'], ENT_NOQUOTES); $details[] = $detail_query[0]['username']; $details[] = $detail_query[0]['status']; $details[] = $detail_query[0]['content']; $details[] = $detail_query[0]['date']; $details[] = $detail_query[0]['lastedit']; $details[] = $detail_query[0]['qfc']; //get any extra icons if($details[1] == 1) $extra .= '<img src="../img/forum/sticky.gif"> '; if($details[0] == 1) $extra .= ' <img src="../img/forum/locked.gif">'; //check if the POST has been edited, then adjust the $date variable accordingly if(empty($details[7])) { $date = $details[6]; } else { //get USERNAME:DATE/TIME $edit_details = explode('@', $details[7]); $date = $details[6].'<br/>Last edit on '. $edit_details[1] .' by '. $edit_details[0]; } //get forum details $forum_details = $database->processQuery("SELECT `title` FROM `forums` WHERE `id` = ?", array($f), true); //pagination $per_page = 10; //get # of pages $database->processQuery("SELECT * FROM `posts` WHERE `thread` = ?", array($i), false); $pages = ($database->getRowCount() == 0) ? 1 : ceil($database->getRowCount() / $per_page); //get current page (!ctype_digit($_GET['page']) || $_GET['page'] > $pages) ? $page = 1 : $page = $_GET['page']; //get next link ($page < $pages) ? $next = $page+1 : $next = $page; //get prev link (($page-1) >= 1) ? $prev = ($page-1) : $prev = $page; //start $start = ($page-1)*$per_page; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:IE> <head> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta name="MSSmartTagsPreventParsing" content="TRUE"> <title><?php echo $data['wb_title']; ?></title> <link href="../css/basic-3.css" rel="stylesheet" type="text/css" media="all" /> <link href="../css/forum-3.css" rel="stylesheet" type="text/css" media="all" /> <link href="../css/forummsg-1.css" rel="stylesheet" type="text/css" media="all" /> <script src="../js/v_thread_2.js"></script> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="../css/forummsg-ie-1.css" /> <![endif]--> </head> <body> <div id="body"> <?php $forum->getNavBar($username, $rank); ?> <br /><br /> <div id="picker"> <form method="post" action="jump.php"> <ul class="flat"> <!--<li><a href=""><img src="../img/forums/search_threads.gif"> Search threads</a></li>--> <li>Jump to Thread: <input size="8" name="qfc" maxlength="14" /></li> <li><input class="b" name="jump" value="Go" type="submit" /></li> </ul> </form> </div> <div id="infopane"> <span class="title"><?php echo $extra.' '.$details[2]; ?></span> <div class="about"> <ul class="flat"> <!--<li><a href="#"><img src="../img/forum/code_of_conduct.gif" /> Code of Conduct</a></li>--> </ul> </div> </div> <!--<div id="nocontrols" class="phold"></div>--> <br> <div id="breadcrumb"> <a href="../index.php">Home</a> > <a href="index.php"><?php echo $data['wb_name']; ?></a> > <a href="viewforum.php?forum=<?php echo $f; ?>"><?php echo $forum_details[0]['title']; ?></a> > <a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>"><?php echo $details[2]; ?></a> </div> <div class="actions" id="top"> <table> <tbody> <tr> <td class="nav"> <form action="viewthread.php" method="get" style="display: inline;"> <input type="hidden" name="id" value="<?php echo $i; ?>" /> <input type="hidden" name="forum" value="<?php echo $f; ?>" /> <ul class="flat"> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>"><< first</a></li> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>&page=<?php echo $prev; ?>">< prev</a></li> <li>Page <input type="text" class="textinput" id="page" name="page" value="<?php echo $page; ?>" size="2" maxlength="3" /> of <?php echo $pages; ?></li> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>&page=<?php echo $next; ?>">next ></a></li> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>&page=<?php echo $pages; ?>">last >></a></li> </ul> </form> </td> <td class="commands"> <ul class="flat"> <?php if($thread->canReply($i, $rank) && !$user->checkMute($username)) echo '<li><a href="reply.php?forum='. $f .'&id='. $i .'"><img src="../img/forum/new_thread.gif" alt="T" /> Reply</a></li>'; ?> <li><a href=""><img src="../img/forum/refresh.gif" alt=""> Refresh</a></li> </ul> </td> </tr> </tbody> </table> </div> <!--<form action="javascript://" method="post">--> <div id="contentmsg"> <a name="188090"></a> <?php //set the action bar $action_bar = (($rank < 3 && $details[4] == 0 && $details[0] == 0) || $rank > 2) ? $thread->getActionBar($rank, $i, $f) : null; //only display thread on page 1 if($page == 1) { if($details[4] == 1 && $rank < 3) { ?> <table class="<?php echo $thread->getPostType($details[4], $details[3]); ?>"> <tbody> <tr> <td class="leftpanel"> <div class="msgcreator uname"> </div> <div class="modtype"> </div> <div class="msgcommands"> </div> </td> <td class="rightpanel"> <div class="msgtime"><br/></div> <div class="msgcontents"> <i>The contents of this message is hidden</i> </div> <span style="float:right; margin-right: 5px; margin-bottom: 5px; margin-top: -20px;"><?php if($rank > 2) echo $action_bar; ?></span> </td> </tr> </tbody> </table> <?php } else { ?> <table class="<?php echo $thread->getPostType($details[4], $details[3], ($_GET['goto'] == 'start') ? true : false); ?>"> <tbody> <tr> <td class="leftpanel"> <div class="msgcreator uname"><?php echo $user->dName($details[3]); ?></div> <div class="modtype"><?php echo $forum->getPostTitle($details[3]); ?> <div class="msgcommands"></div> </td> <td class="rightpanel"> <div class="msgtime"><?php echo $date; ?></div> <div class="msgcontents"> <?php echo $base->br2nl($thread->formatPost($details[5], $details[3])); ?> </div> <span style="float:right; margin-right: 5px; margin-bottom: 5px; margin-top: -20px;"><?php echo ($details[3] == $username && $rank < 3 && $details[4] == 0 && $details[0] == 0) ? '<a href="edit.php?forum='. $f .'&id='. $i .'&type=2">Edit</a> | '.$action_bar : $action_bar; ?></span> </td> </tr> </tbody> </table> <?php } } //display posts $replies = $database->processQuery("SELECT `id`,`username`,`content`,`lastedit`,`date`,`status` FROM `posts` WHERE `thread` = ? ORDER BY `id` ASC LIMIT $start,$per_page", array($i), true); foreach($replies as $reply) { //set the user's action bar $action_bar = (($rank < 3 && $details[4] == 0 && $details[0] == 0) || $rank > 2) ? $post->getActionBar($rank, $reply['id'], $i, $f) : null; //check if the POST has been edited, then adjust the $date variable accordingly if(empty($reply['lastedit'])) { $date = $reply['date']; } else { //get USERNAME:DATE/TIME $edit_details = explode('@', $details[7]); $date = $reply['date'].'<br/>Last edit on '. $edit_details[1] .' by '. $edit_details[0]; } if($reply['status'] == 1 && $rank < 3) { ?> <a name="<?php echo $reply['id']; ?>"></a> <table class="<?php echo $thread->getPostType($reply['status'], $reply['username']); ?>"> <tbody> <tr> <td class="leftpanel"> <div class="msgcreator uname"> </div> <div class="modtype"> </div> <div class="msgcommands"> </div> </td> <td class="rightpanel"> <div class="msgtime"><br/></div> <div class="msgcontents"> <i>The contents of this message is hidden</i> </div> <span style="float:right; margin-right: 5px; margin-bottom: 5px; margin-top: -20px;"><?php if($rank > 2) echo $action_bar; ?></span> </td> </tr> </tbody> </table> <?php } else { ?> <a name="<?php echo $reply['id']; ?>"></a> <table class="<?php echo $thread->getPostType($reply['status'], $reply['username'], ($_GET['highlight'] == $reply['id']) ? true : false); ?>"> <tbody> <tr> <td class="leftpanel"> <div class="msgcreator uname"><?php echo $user->dName($reply['username']).' ['. $reply['id'] .']'; ?></div> <div class="modtype"><?php echo $forum->getPostTitle($reply['username']); ?></div> <div class="msgcommands"></div> </td> <td class="rightpanel"> <div class="msgtime"><?php echo $date; ?></div> <div class="msgcontents"> <?php echo $base->br2nl($thread->formatPost($reply['content'], $reply['username'])); ?> </div> <span style="float:right; margin-right: 5px; margin-bottom: 5px; margin-top: -20px;"><?php echo ($reply['username'] == $username && $rank < 3 && $details[4] == 0 && $details[0] == 0) ? '<a href="edit.php?forum='. $f .'&id='. $i .'&type=1&pid='. $reply['id'] .'">Edit</a> | '.$action_bar : $action_bar; ?></span> </td> </tr> </tbody> </table> <?php } } ?> </div> <!-- --> <div id="breadcrumb"> <a href="../index.php">Home</a> > <a href="index.php"><?php echo $data['wb_name']; ?></a> > <a href="viewforum.php?forum=<?php echo $f; ?>"><?php echo $forum_details[0]['title']; ?></a> > <a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>"><?php echo $details[2]; ?></a> </div> <div class="actions" id="top"> <table> <tbody> <tr> <td class="nav"> <form action="viewthread.php" method="get" style="display: inline;"> <input type="hidden" name="id" value="<?php echo $i; ?>" /> <input type="hidden" name="forum" value="<?php echo $f; ?>" /> <ul class="flat"> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>"><< first</a></li> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>&page=<?php echo $prev; ?>">< prev</a></li> <li>Page <input type="text" class="textinput" id="page" name="page" value="<?php echo $page; ?>" size="2" maxlength="3" /> of <?php echo $pages; ?></li> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>&page=<?php echo $next; ?>">next ></a></li> <li><a href="viewthread.php?forum=<?php echo $f.'&id='.$i; ?>&page=<?php echo $pages; ?>">last >></a></li> </ul> </form> </td> <td class="commands"> <ul class="flat"> <?php if($thread->canReply($i, $rank) && !$user->checkMute($username)) echo '<li><a href="reply.php?forum='. $f .'&id='. $i .'"><img src="../img/forum/new_thread.gif" alt="T" /> Reply</a></li>'; ?> <li><a href=""><img src="../img/forum/refresh.gif" alt=""> Refresh</a></li> </ul> </td> </tr> </tbody> </table> </div> <div id="uid">Quick find code: <?php echo $details[8]; ?></div> <br> <div class="tandc"><?php echo $data['wb_foot']; ?></div> </div> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.