PHP - Updating The Timestamp Error
Hi, I have a php form that submits updated 'comments' onto specific records. I have now added a timestamp feature to record the time of submission automatically. I have only added the lines and sections containing 'sent' (which is the column that for the timestamp) but there is an error when I do this and the php file shows an error as a result. $hospitalnumber = $_POST['hospitalnumber']; $PIN = $_POST['PIN']; $comments = $_POST['comments']; $sent = date("Y-m-d H:i:s"); // mysql query to Update data $query = "UPDATE `greencard` SET `comments`= '$comments', 'sent' = '$sent' WHERE `hospitalnumber`= '$hospitalnumber' and `PIN`= '$PIN'"; I have tested the timestamp coding and it has worked on other php files I made so I am confused as to what is wrong. Also, the overall code works when I remove 'sent' = '$sent' and $sent = date("Y-m-d H:i:s"); (but obviously without updating the timestamp). Any help appreciated as always. Similar Tutorialswell here my page i tryed and tryed to get it working but it shows the data but it dont update it Code: [Select] [php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><?php include "../config.php"; $id = $_GET['id']; $con = database_connect(); $sql = "SELECT * FROM anime1 WHERE animeid ='$id'"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { $title = $row['title']; $type = $row['type']; $episode = $row['episode']; $year = $row['year']; $genre = $row['genre']; $status = $row['status']; $summary = $row['summary']; $pictures = $row['pictures']; }mysql_query($sql) or exit(mysql_error()); mysql_close($con); ?> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".flip").click(function(){ $(".panel").slideToggle("slow"); }); }); </script> <style type="text/css"> </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Transdmin Light</title> <!-- CSS --> <link href="style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" /> <!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" /><![endif]--> <!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" /><![endif]--> <!-- JavaScripts--> <script type="text/javascript" src="style/js/jquery.js"></script> <script type="text/javascript" src="style/js/jNice.js"></script> </head> <body> <div id="wrapper"> <!-- h1 tag stays for the logo, you can use the a tag for linking the index page --> <h1><a href="#"><span>Transdmin Light</span></a></h1> <!-- You can name the links with lowercase, they will be transformed to uppercase by CSS, we prefered to name them with uppercase to have the same effect with disabled stylesheet --> <ul id="mainNav"> <li><a href="#">DASHBOARD</a></li> <!-- Use the "active" class for the active menu item --> <li><a href="./anime.php" class="active">Anime</a></li> <li><a href="#">DESIGN</a></li> <li><a href="#">OPTION</a></li> <li class="logout"><a href="#">LOGOUT</a></li> </ul> <!-- // #end mainNav --> <div id="containerHolder"> <div id="container"> <div id="sidebar"> <ul class="sideNav"> <li><?php echo $lbox1 ?></li> <li><?php echo $lbox2 ?></li> <li><?php echo $lbox3 ?></li> <li><?php echo $lbox4 ?></li> <li> <?php echo $lbox5 ?></li> <li><?php echo $lbox6 ?></li> </ul> <!-- // .sideNav --> </div> <!-- // #sidebar --> <!-- h2 stays for breadcrumbs --> <h2><a href="#">Anime</a> » edit » <?php echo "$title"; ?></h2> <div id="main"> <form action="<?php echo $_SERVER['PHP_SELF']."?id=$id" ; ?>" method="post" class="jNice"> <h3>Editing <?php echo "$title"; ?>, when finished click submit</h3> <fieldset> <p> <label>Series Title -- (Put the Title of the Series you are adding into here)</label> <input name="title" type="text" class="text-long" id="title" value="<?php echo $title ?>" /> </p> <p> <label>Type -- (Put what type of anime is it?)</label> <select name="type" id="type"> <option selected="selected">Select one</option> <option>TV Series</option> <option>OVA</option> <option>TV Special</option> <option>Movie</option> <option>Web</option> <option>DVD Special</option> <option>Other</option> </select> </p> <p> <label>Episodes -- (How many Episode are there?)</label> <input name="episode" type="text" class="text-long" id="episode" value="<?php echo $episode ?>" /> </p> <p> <label>Year -- (What year was the anime release in?)</label> <input name="year" type="text" class="text-long" id="year" value="<?php echo $year ?>" /> </p> <p> <label>genre <a href="./genre">(click this for the list and FAQ for adding in genre)</a></label> <input name="genre" type="text" class="text-long" id="genre" value="<?php echo $genre ?>" /> </p> <p> <label>status -- (What Is the status of the anime, Completed, Ongoing or Stalled)</label> <select name="status" id="status"> <option selected="selected">Select one</option> <option>Complete</option> <option>Ongoing</option> <option>Stalled</option> </select> </p> <p> <label>Summary -- (Put in the Summary for the anime)</label> <textarea name="summary" cols="1" rows="1" id="summary"><?php echo $summary ?></textarea> </p> <p> <label>Pictures -- (link to the Anime Pictures you upladed)</label> <input name="pictures" type="text" class="text-long" id="pictures" value="<?php echo $pictures ?>" /> </p> <?php $con = database_connect(); $sql="UPDATE anime1 SET title='$title', type='$type', episode='$episode', year='$year', genre='$genre', status='$status', summary='$summary', pictures='$pictures' WHERE animeid = '$id'"; $con = database_connect(); $title = $_POST['title']; $type = $_POST['type']; $episode = $_POST['episode']; $year = $_POST['year']; $genre = $_POST['genre']; $status = $_POST['status']; $summary = $_POST['summary']; $pictures = $_POST['pictures']; $title = mysql_real_escape_string($title); $type = mysql_real_escape_string($type); $episode = mysql_real_escape_string($episode); $year = mysql_real_escape_string($year); $genre = mysql_real_escape_string($genre); $status = mysql_real_escape_string($status); $summary = mysql_real_escape_string($summary); $pictures = mysql_real_escape_string($pictures); error_reporting(-1); if (!mysql_query($sql,$con)) { die('Error adding anime database: ' . mysql_error()); } ?> <h3> </h3> <?php $con = database_connect(); $sql1 = "SELECT * FROM episodea WHERE animeid = '$id' UNION ALL SELECT * FROM episodeb WHERE animeid = '$id'"; $result1 = mysql_query($sql1); while ($row = mysql_fetch_assoc($result1)) { $ep = $row['ep']; $epname = $row['epname']; $animeid = $row['animeid']; $video = $row['video']; $video2 = $row['video2']; $video3 = $row['video3']; mysql_query($sql) or exit(mysql_error()); echo " <div class=\"panel\">\n"; echo "<p>\n"; echo " <label>Episodes -- (When this box says Anime episode finished, you have added in all the episodes)</label>\n"; echo " <input name=\"ep\" type=\"text\" class=\"text-long\" id=\"ep\" value=\" $ep\" readonly=\"readonly\" />\n"; echo " </p>\n"; echo " <p>\n"; echo " <label>Episodes Name-- (What is the name of the episode you are adding? --- If the episodes has no name enter episode number)</label>\n"; echo " <input name=\"epname\" type=\"text\" class=\"text-long\" id=\"epname\" value=\" $epname\" />\n"; echo " </p>\n"; echo " <p>\n"; echo " <label>Viewable -- (Is the episode your are adding in SUBBED or DUBBED or RAW?)</label>\n"; echo " <select name=\"viewable\" id=\"viewable\">\n"; echo " <option selected=\"selected\">Select one</option>\n"; echo " <option>SUBBED</option>\n"; echo " <option>DUBBED</option>\n"; echo " <option>RAW</option>\n"; echo " </select>\n"; echo " </p>\n"; echo " <p>\n"; echo " <label>Video 1 -- (enter the embed code for the episode you are adding in)</label>\n"; echo " <textarea name=\"video\" cols=\"1\" rows=\"1\" id=\"video\"> $video</textarea></p>\n"; echo " <p>\n"; echo " <label>Video 2 -- ( If you have a 2ed embed code </label>\n"; echo " <textarea name=\"video1\" cols=\"1\" rows=\"1\" id=\"video1\"> $video2</textarea>\n"; echo " </p>\n"; echo " <p>\n"; echo " <label>Video 3 --( If you have a 3ed embed code </label>\n"; echo " <textarea name=\"video4\" cols=\"1\" rows=\"1\" id=\"video4\"> $video3</textarea>\n"; echo "<h3>\n"; echo "<a href=\"#submit\">IF you finished editing ep, click me to go to submit button</a></h3>\n"; echo " </p>\n"; echo "</div>\n"; echo " \n"; echo " <br />"; echo "<br />"; echo "<p class=\"flip\">Click here to edit all Episodes For $title </p>\n"; echo " <br />"; echo "<br />"; } ?> <h3> remember to click submit before changing the page</h3> <h3> </h3> <h3> <a name="submit" id="submit"></a> <input type="submit" value="Submit Query" /> </h3> </fieldset> </form> </div> <!-- // #main --> <div class="clear"></div> </div> <!-- // #container --> </div> <!-- // #containerHolder --> <p id="footer">Feel free to use and customize it. <a href="http://www.perspectived.com">Credit is appreciated.</a></p> </div> <!-- // #wrapper --> </body> </html> [/php] I am getting this error when updating a record (through a form) Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/wormste1/public_html/tilburywebdesign/shop/FTPServers/barryottley/updates.php on line 62 This is updates.php <?php mysql_connect("localhost", "wormste1_barry", "barry") or die(mysql_error()); mysql_select_db("wormste1_barry") or die(mysql_error()); $carname = mysql_real_escape_string(trim($_POST['CarName'])); $cartitle = mysql_real_escape_string(trim($_POST['CarTitle'])); $carprice = mysql_real_escape_string(trim($_POST['CarPrice'])); $carmiles = mysql_real_escape_string(trim($_POST['CarMiles'])); $cardesc = mysql_real_escape_string(trim($_POST['CarDescription'])); mysql_query("UPDATE cars WHERE id='.intval ($_GET['id']).' LIMIT 1 (CarName, CarTitle, CarPrice, CarMiles, CarDescription, photo) VALUES('$carname', '$cartitle', '$carprice', '$carmiles', '$cardesc' ) ") or die(mysql_error()); echo "The vehicle data has been updated!"; ?> the updates.php actually processes the update. the form page is edit.php: <CENTER><B>Update a Vehicle</B></CENTER> <BR> <?php $what_id=$_GET['id']; $query="SELECT * FROM cars WHERE id = '$what_id'"; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { $carname = $row['CarName']; $cartitle = $row['CarTitle']; $carprice = $row['CarPrice']; $carmiles = $row['CarMiles']; $cardesc = $row['CarDescription']; } ?> <form action="updates.php" method="post"> <CENTER>Vehicle Name:</CENTER> <br><CENTER><input type="text" name="CarName" value="<?php echo $carname; ?>"></CENTER><br> <CENTER>Vehicle Type:</CENTER><br><CENTER><input type="text" name="CarTitle" value="<?php echo $cartitle; ?>"></CENTER><br> <CENTER>Vehicle Price:</CENTER><br><CENTER><input type="text" name="CarPrice" value="<?php echo $carprice; ?>"></CENTER><br> <CENTER>Vehicle Mileage:</CENTER><br><CENTER><input type="text" name="CarMiles" value="<?php echo $carmiles; ?>"></CENTER><br> <CENTER>Vehicle Description:</CENTER><br><CENTER><input type="text" name="CarDescription" value="<?php echo $cardesc; ?>"></CENTER><br> <CENTER>Vehicle Description:</CENTER><br> <CENTER><textarea name="CarDescription" rows="10" cols="30" value="<?php echo nl2br($cardesc); ?>"></textarea></CENTER><br> <CENTER><input type="Submit"></CENTER> </form> Any idea for the error. I think it could be because the UPDATE tag syntax is wrong. Help would be great!!!
I need help here. I am creating a system where the user will be able to update the product stock by uploading the stock of the products according to the id that has been assigned to the product.
I tried the code below but all i could not update my data into my database. And there's not error shown on my code. I do not know what is wrong with my codes. Please help me. <?php include 'conn.php'; if(isset($_POST["add_stock"])) { if($_FILES['product_file']['tmp_name']) { $filename = explode(".", $_FILES['product_file']['tmp_name']); if(end($filename) == "csv") { $handle = fopen($_FILES['product_file']['tmp_name'], "r"); while($data = fgetcsv($handle)) { $product_id = mysqli_real_escape_string($conn, $data[0]); $product_stock = mysqli_real_escape_string($conn, $data[1]); $product_status = 1 ; $query = "UPDATE products SET `product_stock` = '$product_stock', `product_status` = '$product_status' WHERE id = '$product_id'"; mysqli_query($conn, $query); } fclose($handle); header("location: upload-product.php?updation=1"); } else { echo '<script>alert("An error occur while uploading product. Please try again.") window.location.href = "upload-product.php"</script>'; } } else { echo '<script>alert("No file selected! ") window.location.href = "upload-product.php"</script>'; } } if(isset($_GET["updation"])) { echo '<script>alert("Product Stock Updated successfully!")</script>'; } ?> <div class="col-12"> <div class="card card-user"> <div class="card-header"> <h5 class="card-title">Update Product Stock</h5> <div class="card-body"> <div class="form-group"> <label for="file">Update Products stock File (.csv file)</label> <a href="assets/templates/product-template.xlsx" title="Download Sample File (Fill In Information and Export As CSV File)" class="mx-2"> <span class="iconify" data-icon="fa-solid:download" data-inline="false"> </a> </div> <form class = "form" action="" method="post" name="uploadCsv" enctype="multipart/form-data"> <div> <input type="file" name="product_file" accept=".csv"> <div class="row"> <div class="update ml-auto mr-auto"> <button type="submit" class="btn btn-primary btn-round" name="add_stock"> Import .cvs file</button> </div> </div> </div> </div> </form> </div> </div>
This is the template that i require user to key in and saved it in CSV format before uploading it. $epocTime = $math.newInt($math.divide("$today.getTime()", "1000"))) Hey there, Thanks for taking the time to read my thread. I've encountered a problem that I cannot figure out a way to solve. I need to calculate the remaining days until a specified unix timestamp. I haven't yet figured out how to get the amount of days until the timestamp. If anybody could tell me how to get the remaining days until a unix timestamp I would be grateful, thanks. I have this date in database I must convert it to Unix Timestamp How ? 2010-11-11 09:04:44 I try this echo mktime($mydate); but its not work its return wrong Timestamp becase if I convert back it I have wrong date 2011-02-16 21:01:33 Hi, I have in my DB a column with a timestamp as definition. Now I would like to have only the month and year of that column for further use in a form. How can I achieve that? Thanks! How do i correctly update a timestamp? Code: [Select] $date = date("Y-m-d H:i:s"); mysql_query("UPDATE mmembers set time=now() where email=$myusername"); What is the proper way to turn a date that is in "m/d/Y" format, into a correct timestamp. When I try strtotime, then try to change it back to a date, it shows up incorrectly (defaulting to the 1969 date that it does when it messes up. I just need to be able to turn $date = '10/15/2011'; to and from a timestamp correctly. Any advice? I have a update query that should be updating the timestamp when a "month" field is changed. I have the following code:
$month_update->bindParam(':timestamp', strtotime (date("Y-m-d H:i:s")), PDO::PARAM_INT);
The result that is returned is 1403198033. I need it to look like this 2014-03-26 07:09:06. I know I am missing something and I would greatly appreciate your help.
Thank you so much!
upon using PHP strtotime('2010-11-23 00:00:00') output a different values. Asia/Taipei int(1290441600) Europe/London int(1290470400) Expected : Same since I declare the date that need to convert as timestamp date_default_timezone_set('Asia/Taipei'); var_dump(strtotime('2010-11-23 00:00:00')); date_default_timezone_set('Europe/London'); var_dump(strtotime('2010-11-23 00:00:00')); Any explanation, Idea or alternative? Please help. Thanks Hi, I have a table field that has the full timestamp (date and time), I want to select records from DB but after checking the date part only from the timestamp. Example: 2020-3-10 10:15:00 ---- i want to check if current date is equal to the date part which in this case it is the same. Thanks. I have a column that is named date_created and has a value of DATETIME. How on this script can I insert only the time it was created. Is it NOW()) and if so how do I write it in the script? Code: [Select] // if residential if($_POST['type'] == ""){ mysql_select_db("", $con); $sql = "INSERT INTO apartments (username, title, county, town, type, description, phone, rooms, bath, square, rent, fees, service, imageurl1, imageurl2, imageurl3, imageurl4) VALUES ('".$myusername."', '".mysql_real_escape_string($_POST['title'])."', '".mysql_real_escape_string($_POST['county'])."', '".mysql_real_escape_string($_POST['town'])."', '".mysql_real_escape_string($_POST['type'])."', '".mysql_real_escape_string($_POST['description'])."', '".mysql_real_escape_string($_POST['phone'])."', '".$_POST[('rooms')]."', '".mysql_real_escape_string($_POST['bath'])."', '".mysql_real_escape_string($_POST['square'])."', '".mysql_real_escape_string($_POST['rent'])."', '".mysql_real_escape_string($_POST['fees'])."', '".mysql_real_escape_string($_POST['service'])."', '".mysql_real_escape_string($images[1])."', '".mysql_real_escape_string($images[2])."', '".mysql_real_escape_string($images[3])."', '".mysql_real_escape_string($images[4])."')"; $result = mysql_query($sql) or die(mysql_error()); How would I go about adding a timestamp to my image uploads so I don't erase image files with the same name? Also, what would be the correct use of the mysql_escape_string <?php require_once('storescripts/connect.php'); mysql_select_db($database_phpimage,$phpimage); $uploadDir = 'upload/'; if(isset($_POST['upload' . $config])) { foreach ($_FILES as $file) { $fileName = $file['name']; $tmpName = $file['tmp_name']; $fileSize = $file['size']; $fileType = $file['type']; if($fileName==""){ $filePath = 'upload/'; } else{ $filePath = $uploadDir . $fileName; } $filePath = str_replace(" ", "_", $filePath); $result = move_uploaded_file($tmpName, $filePath); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $fileinsert[]=$filePath; } } $mid = mysql_real_escape_string(trim($_POST['mid'])); $cat = mysql_real_escape_string(trim($_POST['cat'])); $item = mysql_real_escape_string(trim($_POST['item'])); $price = mysql_real_escape_string(trim($_POST['price'])); $about = mysql_real_escape_string(trim($_POST['about'])); $fields = array(); $values = array(); $updateVals = array(); for($i=1; $i<=4; $i++) { $fields[$i] = 'name'.$i; $values[$i] = mysql_real_escape_string(basename(trim($_FILES[$fields[$i]]['name']))); if($values[$i] != '') { $updateVals[] = "{$fields[$i]} = '{$values[$i]}'"; } } $updateNames = ''; if(count($updateVals)) { $updateNames = ", " . implode(', ', $updateVals); } $update = "INSERT INTO image (mid, cid, item, price, about, name1, name2, name3, name4) VALUES ('$mid', '$cat', '$item', '$price', '$about', '$values[1]', '$values[2]', '$values[3]', '$values[4]') ON DUPLICATE KEY UPDATE cid = '$cat', item = '$item', price = '$price', about = '$about' $updateNames"; $result = mysql_query($update) or die (mysql_error()); $id = mysql_insert_id(); ?> <p style="font-size:35px; font-family:Arial, Helvetica, sans-serif; color:#255E67; margin-left:25px;">Your Item Has Been Uploaded!</p> <script type="text/javascript"> setTimeout('ourRedirect()', 2000) function ourRedirect() { location.href='protator_php.php?mid=<?php echo $id ?>' } </script> I've been having problems displaying the correct time when extracting timestamp for a graph. Wasted a lot of time trying to adjust for timezone and then finding that it didn't help. Now trying to add 2 hours to the timestamp and not sure how. Here is the line that needs to be changed I believe.
$Date=substr(mysql_result($result,$i,"Date"),11,5); Can someone help me?
I'm using date_default_timezone_set("America/New_York"); to set the time, but the time isn't being displayed properly in mysql. The time is some other time zone. Do I have to set the time in mysql too? How do I do this? Hi. I have this code which input data to the database. Code: [Select] <?php include("connect.php"); echo $date = date("Y-m-d H:i:s"); echo "\n <br />"; echo $date2 = date('Y-m-d H:i:s', strtotime("+20 seconds")); mysql_query("UPDATE users2 SET date2 = '$date2'"); $query = mysql_query("SELECT date2 FROM users2"); $numrows = mysql_num_rows($query); if ($numrows != 0) { while ($row = $mysql_fetch_array($query)) { $date_final = $row['date2']; } } echo $date_final; ?> Variable date2 is stored as timestamp. Now i want to display this two variable on the web, but this code doesn't work. Why? Thank you. I need to set two variables for use within my pages, one containing a date as a string in format 'YYYY-MM-DD HH-MM-SS' and another containing the same date as a timestamp. The date and time stored will take on the value passed in the url if available, else will be for the current date. The time should always be midnight at the beginning of the date. eg. $datestr = '2010-09-08 00:00:00' and $datestamp = '1283904000' Where a date is passed in the url, it will be in the format 'YYYY-MM-DD'. The problem I am having is getting an accurate timestamp. I think the trouble is connected to the handling of daylight saving time as it it always an hour out. What I have at the present is as below: Code: [Select] <?php // ensure all date and time functions are relative to the correct timezone (UK) date_default_timezone_set('Europe/London'); // string holding selected / current date in format 'YYYY-MM-DD HH:MM:SS' $datestr = (isset($_GET['date']) ? $_GET['date']." 00:00:00" : gmdate("Y-m-d")." 00:00:00"); // int holding selected / current date as unix timestamp $datestamp = strtotime($datestr); ?> Can anybody give me a simple way of converting $datestr into $datestamp to ensure that this is always correct for my UK timezone, irrespective of whether we are in or out of daylight saving time? I have a timestamp field in my mySQL table and need to check if it's 14 day or older. What's the best way to do this? Any help will be appreciated Hi am trying to add date and timestamp of when a comment gets posted.Am not gr8t at php but still learning. If any one can help me on this would be reil gr8t. Sry for the long post. As for now i have this Code: [Select] $date = date("M j, y, g:i a"); and echo's out the date, time [/code]$date[/code] as in the current date and time which i dont want. Code: [Select] <?php $query = yasDB_select("SELECT * FROM newsblog"); if($query->num_rows == 0) { echo '<div id="newsblog_text">This news blog has no comments, become a member and be the first to add one!</div>'; } else { $query = yasDB_select("SELECT * FROM newsblog WHERE userid = '$id'"); while($row = $query->fetch_array(MYSQLI_ASSOC)) { $date = date("M j, y, g:i a"); $text = $row['comment']; $text = str_replace(':D','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/biggrin.gif" title="biggrin" alt="biggrin" />',$text); $text = str_replace(':?','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/confused.gif" title="confused" alt="confused" />',$text); $text = str_replace('8)','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/cool.gif" title="cool" alt="cool" />',$text); $text = str_replace(':cry:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/cry.gif" title="cry" alt="cry" />',$text); $text = str_replace(':shock:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/eek.gif" title="eek" alt="eek" />',$text); $text = str_replace(':evil:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/evil.gif" title="evil" alt="evil" />',$text); $text = str_replace(':lol:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/lol.gif" title="lol" alt="lol" />',$text); $text = str_replace(':x','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/mad.gif" title="mad" alt="mad" />',$text); $text = str_replace(':P','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/razz.gif" title="razz" alt="razz" />',$text); $text = str_replace(':oops:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/redface.gif" title="redface" alt="redface" />',$text); $text = str_replace(':roll:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/rolleyes.gif" title="rolleyes" alt="rolleyes" />',$text); $text = str_replace(':(','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/sad.gif" title="sad" alt="sad" />',$text); $text = str_replace(':)','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/smile.gif" title="smile" alt="smile" />',$text); $text = str_replace(':o','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/surprised.gif" title="surprised" alt="surprised" />',$text); $text = str_replace(':twisted:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/twisted.gif" title="twisted" alt="twisted" />',$text); $text = str_replace(':wink:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/wink.gif" title="wink" alt="wink" />',$text); echo '<div class="newsblog_box1"><div class="newsblog_name">' . $row['name'] . ' '.$date.'</div></div> <div class="newsblog_box2">' . $text . '</div>'; } }?> |