0) { $content = mysql_result($result, 0, "page_Text"); $content=str_replace("`", "'", $content); $content_title = mysql_result($result, 0, "page_title"); $content_desc = mysql_result($result, 0, "page_desc"); $content_keyword = mysql_result($result, 0, "page_keywords"); } $userid=$_SESSION['KC_memberId']; //***********ADD TOPIC************* if (isset($_POST['hl'])){ $hl=addslashes(trim($_POST['hl'])); $msg=addslashes(trim($_POST['msg'])); $useridtemp=$_POST['useridtemp']; $section=$_POST['section1']; $date=gmdate("Y-m-d H:i:s"); $forumUrl = str_replace("-", "", $hl); $forumUrl = str_replace("–", "", $forumUrl); $forumUrl = str_replace(",", "", $forumUrl); $forumUrl = str_replace(" ", " ", $forumUrl); $forumUrl = preg_replace('/[^a-zA-Z0-9 ]/s', '', $forumUrl); $forumUrl= trim($forumUrl); $forumUrl = str_replace(" ", "_", strtolower($forumUrl)); $forumUrl = str_replace("___", "-", strtolower($forumUrl)); $forumUrl = str_replace("_", "_", strtolower($forumUrl)); if($_FILES['Filedata']['name']!="") { $filename = $_FILES['Filedata']['name']; $temporary_name = $_FILES['Filedata']['tmp_name']; $lastOccurence = strrpos(stripslashes($filename),"."); $fileExtension = strtoupper(substr(stripslashes($filename),($lastOccurence+1))); if (!file_exists("../photos/forum/".$userid)){ mkdir("../photos/forum/".$userid); chmod ("../photos/forum/".$userid, 0777); } switch($fileExtension) { case "JPEG": $i = imagecreatefromjpeg($temporary_name); break; case "JPG": $i = imagecreatefromjpeg($temporary_name); break; case "GIF": $i = imagecreatefromgif($temporary_name); break; case "PNG": $i = imagecreatefrompng($temporary_name); break; } $imageName="photo_".date('d-m-y')."_".rand(); //echo "
img:".$imageName; /**saving large image **/ $mainDest_x=508; if (imagesx($i) > $mainDest_x) { $main_x = $mainDest_x; $main_y = imagesy($i)*($mainDest_x/imagesx($i)); } else { $main_x = imagesx($i); $main_y = imagesy($i); } $main = imagecreatetruecolor($main_x,$main_y); imagecopyresampled($main, $i ,0, 0, 0, 0, $main_x, $main_y, imagesx($i), imagesy($i)); imagejpeg($main, "../photos/forum/".$userid."/".$imageName.".jpg", 80); $largeurl="photos/forum/".$userid."/".$imageName.".jpg"; } else { $largeurl = ""; } //$msg = "Butterflies cannot hear, but they can feel vibration and they have an excellent sense of smell. Butterflies can smell or taste with the tiny receptors they have"; mysql_query("INSERT INTO forum (posted_by,section,hl,msg,date,level,threadurl,image) VALUES ('$useridtemp','$section','$hl','$msg','$date',0,'$forumUrl','$largeurl')", $db); //echo "INSERT INTO forum (posted_by,section,hl,msg,date,level,threadurl,image) VALUES ('$useridtemp','$section','$hl','$msg','$date',0,'$forumUrl','$largeurl')"; //$iddetectQ=mysql_query("SELECT * FROM forum WHERE hl='$hl' AND msg='$msg' AND posted_by='$useridtemp'", $db); //$idFetch=mysql_fetch_assoc($iddetectQ); //$threadid=$idFetch['threadid']; $threadid=mysql_insert_id(); mysql_query("INSERT INTO sitelog (userid,activity,id,date,pending) VALUES ('$useridtemp','new thread','$threadid','$date','n')", $db); $_SESSION['success']="Topic has successfully been posted."; //CHECK FOR ADMIN NOTIFICATION $adminInfoQ=mysql_query("SELECT * FROM userinfo WHERE userid='admin'", $db); $adminInfo=mysql_fetch_assoc($adminInfoQ); if ($adminInfo['noti_start_thread']=='y'){ $email="andrew@bombasticlife.com"; $headers = "From:". $email . "\r\nContent-type:text/html"; $to=$adminInfo['email_noti']; $subject=$userid." added a new topic in BBB"; $msgBody="To see the topic, go to http://". $_SERVER['HTTP_HOST']."/forum/".$section."/".$forumUrl.".html

"; $msgBody.="To turn the notification off, go to http://". $_SERVER['HTTP_HOST']."/admin/setting_admin.php

"; //mail($to, $subject, $msgBody, "From: BBB"); mail($to, $subject, $msgBody, $headers); } } ?>

Add New Topic

Click here to go back to My Posts page

".$_SESSION['error']."

"; unset($_SESSION['error']); } if (isset($_SESSION['success'])){ echo "

".$_SESSION['success']."

"; unset($_SESSION['success']); } ?>

Title

Image to Upload:

Description