-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
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"); ?>
-
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
-
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?
-
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.
-
What HTML tags? What are your start and end points? Does this text not come from a database?
-
haha, good luck
-
if(!is_array($sql_data)) $sql_data = array(); foreach ($sql_data as $table => $update_ary) { }
-
Fix this first: PHP Notice: in file /includes/functions_posting.php on line 2514: Invalid argument supplied for foreach()
-
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);
-
$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
-
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.
-
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']
-
The button is in seat #(.*) Don't use * for everything. If a number is expected then use ([0-9]+)
-
/ 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.
-
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/
-
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 />"; } ?>
-
Is there such a thing as a URL_Exists function?
JonnoTheDev replied to usafrmajor's topic in HTML Help
what is the error -
Is there such a thing as a URL_Exists function?
JonnoTheDev replied to usafrmajor's topic in HTML Help
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 -
Half of text aligned left and other half aligned right.
JonnoTheDev replied to lynxus's topic in HTML Help
http://www.barelyfitz.com/screencast/html-training/css/positioning/ -
Half of text aligned left and other half aligned right.
JonnoTheDev replied to lynxus's topic in HTML Help
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> -
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(); ?>
-
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.
-
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']; }
-
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.