0 && !strpos($comment_texti, "[") && !strpos($comment_efni, "<") && !strpos($comment_nafn, "[") && !strpos($comment_nafn, "<") && !strpos($comment_nafn, "http") && !strpos($comment_netfang, "http") && !strpos($comment_texti, "<") && !strpos($comment_texti, "||") && $comment_efni != "Unknown") { $query = "INSERT INTO comments_t (blog_id, comment_dags, comment_time, comment_nafn, comment_netfang, comment_veffang, comment_efni, comment_texti) VALUES ($blog_id, '$comment_dags', '$comment_time', '$comment_nafn', '$comment_netfang', '$comment_veffang', '$comment_efni', '$comment_texti')"; $result = mysql_query($query); if(!$result){ return mysql_error(); echo mysql_error(); } else { $query2 = "SELECT page_id, page_title, page_date FROM pages WHERE page_id=$blog_id"; $result2 = mysql_query($query2); $thetitle = mysql_result($result2,0,"page_title"); $thedate = mysql_result($result2,0,"page_date"); if ($thetitle == "") { $thetitle = "enginn titill"; } list($a, $b, $c) = explode("-", $thedate); $thepath = "http://rakel.betra.is/sida.php?id=$blog_id#comments"; mail("rakel@betra.is","Rakel - Orð í belg","$comment_nafn lagði orð í belg:\n\n$comment_efni\n$comment_texti\n\nNetfang:$comment_netfang\nVeffang:$comment_veffang\n\nÞetta var við færsluna \"$thetitle\"\n$thepath","From: vefur@betra.is"); return 1; } } } /*******************************************/ function get_comments ($blog_id, $explode) { $query = "SELECT * FROM comments_t where blog_id='$blog_id' ORDER BY comment_dags ASC, comment_time ASC"; $result = mysql_query($query); echo "
Leggja orð í belg
"; if ($row = mysql_fetch_array($result)) { $fjoldi = mysql_num_rows($result); if ($fjoldi == 1) { echo "$fjoldi hefur"; } else { echo "$fjoldi hafa"; } if ($explode != "yes") { echo " lagt orð í belg"; echo "
"; } else { echo " lagt orð í belg
"; } if ($explode == "yes") { do { echo "
"; $dags = $row["comment_dags"]; $timi = $row["comment_time"]; $nafn = $row["comment_nafn"]; $netfang= $row["comment_netfang"]; $veffang = $row["comment_veffang"]; $efni = $row["comment_efni"]; $texti = $row["comment_texti"]; $dags = new_date($dags); echo "$dags $timi
"; // TITILL EF EINHVER if (strlen($efni) > 0) { echo "$efni
"; } $texti = nl2br($texti); echo "$texti"; echo "
Þetta lagði "; // NAFN OG NETFANG if ($veffang != "" && $veffang != "http://") { echo ""; } echo "$nafn"; if ($veffang != "" && $veffang != "http://") { echo ""; } echo " í belginn
"; echo "
"; } while($row = mysql_fetch_array($result)); } } else { echo "Enginn hefur lagt orð í belg!"; echo ""; } mysql_free_result($result); } /*#################*/ function add_comment ($id) { /* echo "

Leggðu orð í belg

"; echo "
Nafn
Netfang (birtist ekki á vef)
Veffang
Fyrirsögn
Orð í belg:
"; */ } /*#################*/ ?>