Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. If you get a blank screen you need to turn error reporting on. Add this at the top of your script. ini_set('display_errors', 'on'); Looks like you have a few lines of image echos. Add the extra part to all of them or simply just add a random bit of text after the <img src tag to see if it prints out. Also other bit of code should be <?php echo("<img class=\"thumb_active\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"> \n<br />\n".$splitname[0]."_thumb.jpg"); ?>
  2. echo("<img class=\"thumb_active\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"> \n<br />\n".$splitname[0]_thumb.jpg); Add to all lines where an image is printed
  3. You have many </p> tags so this cannot be an end point. As I said does this information come from a database? If so does it already contain the HTML tags or is this simply static html on your page?
  4. The filename is obviously used in the <img src= attribute. Find this and echo it under your picture. I dont know your script but as an example: // loop through database table of image files while($row = $db->nrecord()) { print "<img src='images/".$row->filename."' />"; // print the filename under image print "<br />".$row->filename; } Don't take this code and look for it in your script as it will be different. Just find the part that prints out the images.
  5. What HTML tags? What are your start and end points? Does this text not come from a database?
  6. if(!is_array($sql_data)) $sql_data = array(); foreach ($sql_data as $table => $update_ary) { }
  7. Fix this first: PHP Notice: in file /includes/functions_posting.php on line 2514: Invalid argument supplied for foreach()
  8. Again close off your arrays $sql_data[topicS_TABLE]['sql'] = array( 'topic_first_post_id' => $data['post_id'], 'topic_last_post_id' => $data['post_id'], 'topic_last_post_time' => $current_time, 'topic_last_poster_id' => (int) $user->data['user_id'], 'topic_last_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), 'topic_last_poster_colour' => $user->data['user_colour'], 'topic_last_post_subject' => (string) $subject);
  9. $data = array( 'topic_first_post_id' => $post_data['topic_first_post_id'], 'topic_last_post_id' => $post_data['topic_last_post_id'], 'topic_replies_real' => $post_data['topic_replies_real'], 'topic_approved' => $post_data['topic_approved'], 'topic_type' => $post_data['topic_type'], 'post_approved' => $post_data['post_approved'], 'post_reported' => $post_data['post_reported'], 'post_time' => $post_data['post_time'], 'poster_id' => $post_data['poster_id'], // Start Ultimate Points 'points_received' => $post_data['points_received'], //End Ultimate Points 'post_postcount' => $post_data['post_postcount']); done
  10. No the string is broken if the values are empty. As the above post states post lines of code prior to the sql string. Expecting a syntax error.
  11. There is no sytax error with the above string. However check that the constant and variables have values: USERS_TABLE $post_data['points_received'] $post_data['poster_id']
  12. The button is in seat #(.*) Don't use * for everything. If a number is expected then use ([0-9]+)
  13. / is an indicator that there is a regular expression between both start and end / \\ are escape characters (same as escaping quotes in strings) for escaping special characters .* matches any character except a line break () create a back reference to capture the portion of the string in the returned array Try your expressions out. This is why I highly recommend Regexbuddy as you can test them out on your string rather than modifying them in your source code if incorrect.
  14. Ok, it is all done using regular expression pattern matching preg_match_all('/Seat ([0-9]+):\\ (.*)\\ \\(/' Everything you see within () is known as a backreference i.e. ([0-9]+) (.*) and captures that piece of data. My advice is get a copy of regexbuddy. This will allow you to build and test regular expressions before putting into your code. It is an essential tool for programmers. http://www.regexbuddy.com/
  15. Add the following under your $convert string <?php preg_match_all('/Seat ([0-9]+):\\ (.*)\\ \\(/', $convert, $result, PREG_PATTERN_ORDER); $seats = $result[1]; $players = $result[2]; for($x = 0; $x < count($result[0]); $x++) { print "Seat ".$seats[$x].": ".$players[$x]."<br />"; } ?>
  16. Have you saved as a php file i.e test.php http://www.yourdomain.com/test.php and yes, you should have posted this in PHP help not HTML
  17. http://www.barelyfitz.com/screencast/html-training/css/positioning/
  18. Really you should use CSS but if you have a table cell then nest another table within i.e <tr> <td> <table> <tr> <td>left</td> <td>right</td> </tr> </table> </td> </tr>
  19. http://uk.php.net/manual/en/function.htmlspecialchars-decode.php
  20. It depends entirely on your spec however you should checkout fopen() fwrite(), etc within the php manual php.net to learn how to read and write to files. The fist thing you will need is to have a file that is included within all your php pages i.e. application.inc.php. Here you can add you function to write the data to file i.e. function write_user_data() { $fp = fopen(); // etc....... } I would say use sessions to hold the name of the file written to for each user otherwise you will keep opening and writing to new files on each page request i.e. <?php // the user does not have a log file - set one if(!strlen($_SESSION['filename'])) { $_SESSION['filename'] = time().".txt"; } function write_user_data() { $fp = fopen("whosonline/".$_SESSION['filename'] // etc....... } write_user_data(); ?>
  21. Of course, however a database server is the most efficient method. Your other option is to create a logging function that will write information to file.
  22. Because you are using the isset() function which will return 1 when true. I don't know where you got this code from. It is effectively stripping slashes from either a 1 or 0. I'm not sure why you are even using the stripslashes() function. isset() is not the best function to use when testing that a variable contains a value. $name = stripslashes(isset($_POST['txtName'])); Corrected if(strlen(trim($_POST['txtName']))) { $name = $_POST['txtName']; }
  23. If the article date is a unix timestamp then look at the FROM_UNIXTIME() function in mysql. You may also want to look at the MONTH() and YEAR() functions. This should help you get the articles for a given month / year.
×
×
  • 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.