"; OpenTable(); if (is_user($user) || ($MemberRequired == 0)) { if (is_user($user)) { $submitter = "".$cookie[1].""; $submitteruid = $cookie[0]; $jmladsposted = AdsPostedByUser($submitteruid,0,0,0); if ($jmladsposted >= $MaxAllowedAds) { $NotAllowedByJml = 1; } else { $NotAllowedByJml = 0; } } else { $submitter = $anonymous." [ "._NUKECNEWUSER." ]"; $submitteruid = 1; } if ($NotAllowedByJml) { printnotallowlimitreached(); } else { echo "
"._NUKECPOSTNEWADS."
" .""._NUKECMAIN."/"._NUKECPOSTNEWADS."

\n"; echo "
\n"; echo ""; echo "* -> "._NUKECREQUIRED.""; echo "\n"; echo "\n"; echo "" ."\n"; echo "\n" ."\n"; echo "\n"; echo "\n" ."\n"; echo "\n"; echo "\n"; echo "\n"; if ($UploadImg) { echo "\n" ."\n"; } else { echo ""; } if ($multilingual) { echo ""; } else { echo "\n"; } echo ""; echo ""; echo ""; echo "
"._NUKECYOURNAME.":"; echo "$submitter
"._NUKECADSTITLE." (".$AdsTitleLength." "._NUKECADSMAXCHARS.")*:
"._NUKECADSDESC ." * \n" ."
(".$AdsContentLength." "._NUKECADSMAXCHARS.")
:
"._NUKECADSCATG." :\n" ."\n" ."
"._NUKECADSPRICE.":" ."" ." "._NUKECCURRSAMPLE."
"._NUKECADSURL." : "._NUKECEGURL."
"._NUKECADSEMAIL.": "._NUKECEGEMAIL."
"._NUKEADSPOSTFOR." :\n" ."
"._NUKECADSUPLOAD.":
"._NUKECLANGUAGE.":"; echo "
"; } } else { echo "
"._NUKECPOSTNEWADS."

\n"; printnotallowforanonymouse(); } CloseTable(); @include("footer.php"); } function SubmitAds($submitteruid,$title, $cdesc, $catgforprocess, $AdsCurr, $price, $website, $email, $postfor, $fileupload, $adslanguage, $fileupload, $fileupload_name, $fileupload_type, $fileupload_size) { global $prefix,$db,$folder_name, $module_name, $multilingual, $currentlang, $AdsTitleLength, $AdsContentLength, $MemberRequired, $PostInMainCatg, $cookie, $user, $UploadImg,$Waiting, $anonymous, $UploadPath,$cookie,$user,$DescLength,$UploadImg, $MaxImgSize, $MaxImgHeight, $MaxImgWidth,$MaxAllowedAds; if ($submitteruid != 1) { $jmladsposted = AdsPostedByUser($submitteruid,0,0,0); if ($jmladsposted >= $MaxAllowedAds) { $NotAllowedByJml = 1; } else { $NotAllowedByJml = 0; } if ($NotAllowedByJml == 1) { header("Location:modules.php?name=".$module_name."&file=postads&id_catg=$catgforprocess"); die(); } } if (is_user($user) || ($MemberRequired == 0)) { if ((!$title) || ($title == "") || (strlen($title) > $AdsTitleLength)) $errorTitle = 1; if ((!$cdesc) || ($cdesc == "") || (strlen($cdesc) > $AdsContentLength)) $errorCdesc = 1; if ($submitteruid == 1) { if ($email == "") { $erroremailanony = 1; } } if ($email != ""){ if (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$",$email)) $errorEmail = 1; } if ($UploadImg && ($fileupload != "") && ($fileupload != "none")) { $imageadstype = basename($fileupload_type); $UploadImageType = getImgType(); if (!in_array($imageadstype,$UploadImageType)) $errorImageType = 1; if (($imageadstype != "jpeg") && ($imageadstype != "jpg") && ($imageadstype != "pjpeg")) { $ImageUkuran = @getimagesize($fileupload); if ($ImageUkuran) { if ($ImageUkuran[0] > $MaxImgWidth) { $ErrorUkuranImage = 1; $ErrorUkuranImageWidth = 1; } if ($ImageUkuran[1] > $MaxImgHeight) { $ErrorUkuranImage = 1; $ErrorUkuranImageHeight = 1; } } else { $ErrorUkuranImage = 1; } } } if ($ErrorUkuranImage || $errorTitle || $errorCdesc || $errorPrice || $erroremailanony || $errorEmail || $errorImageSize || $errorImageDimension || $errorImageType) { @include("header.php"); MenuNukeC(1); echo "
"; OpenTable(); echo "
"._NUKECSUBMITERROR."

"; echo "
"; if ($errorTitle) { if ($title == "") { echo "
"._NUKECERRORTITLE."
"; } if (($title != "") && (strlen($title) > $TitleLength)) { echo "
"._NUKECERRORCTITLEMAX." $TitleLength "._NUKECCHARS."
"; } } if ($errorCdesc) { if ($cdesc == "") { echo "
"._NUKECERRORCDESCEMPTY."
"; } if (($cdesc != "") && (strlen($cdesc) > $DescLength)) { echo "
"._NUKECERRORCDESCMAX." $DescLength "._NUKECCHARS."
"; } } if ($erroremailanony) { echo "
"._NUKECANONYEMAILREQ."
"; } if ($errorEmail) { echo "
"._NUKECERROREMAIL."
"; } if ($errorImageSize) { echo "
"._NUKECERRORMAXSIZEALLOWED." $UploadImageSize "._NUKECKB."
"; } if ($ErrorUkuranImage) { echo "
"._NUKECERRORMAXDIMENSION." $MaxImgHeight x $MaxImgWidth "._NUKECPIXEL."
"; } if ($errorImageType) { echo "
$imageadstype"._NUKECALLOWEDFILETYPE.": "; for ($i = 0;$i<= sizeof($UploadImageType)-1;$i++) { echo "'.".$UploadImageType[$i]."'"; if ($j != sizeof($UploadImageType)-1) { echo ", "; } $j++; } echo "
"; } echo "

"._NUKECPLEASEGOBACK.""; echo "
<< "._NUKECGOBACK.""; echo "
"; CloseTable(); @include("footer.php"); } else { $ads_title = FixQuotes(filter_text($title, "nohtml")); $ads_content = FixQuotes(nl2br(filter_text($cdesc))); $nowdate = date("H i s m d Y"); $datearray = explode(" ",$nowdate); $currhour = $datearray[0]; $currminute = $datearray[1]; $currsecond = $datearray[2]; $currmonth = $datearray[3]; $currday = $datearray[4]; $curryear = $datearray[5]; $posted_on = GetTimeUnix($currhour, $currminute, $currsecond, $currmonth, $currday, $curryear, $chgmonth=0, $chgday=0 , $chgyear=0); if ($postfor == 0) { $validuntil = 0; } else { $validuntil = GetTimeUnix($currhour, $currminute, $currsecond, $currmonth, $currday, $curryear, $chgmonth=0, $chgday+$postfor , $chgyear=0); } $price = FixQuotes(filter_text($price, "nohtml")); $resultnextidads = $db->sql_query("select max(id_ads) as maxnumber from ".$prefix."_nukec_ads_ads"); list ($nextidads) = $db->sql_fetchrow($resultnextidads); $nextidads++; if ($fileupload != "") { $type = basename($fileupload_type); if (($type == "jpeg") || ($type == "jpg") || ($type == "pjpeg")) { $type= "jpeg"; } if ($type == "x-png") { $type = "png"; } $filename = $UploadPath."$nextidads.".$type; $filename_thumb = $UploadPath.$nextidads."_thumb.".$type; copy ($fileupload, $filename); copy ($fileupload, $filename_thumb); $imguploadname = $nextidads.".".$type; $imgsize = @getimagesize($fileupload); $imgwidth = $imgsize[0]; $imgheight = $imgsize[1]; @include("modules/".$module_name."/resize.php"); global $ThumbToHeight,$ThumbToWidth,$ThumbHeight,$ThumbWidth,$MaxImgHeight,$MaxImgWidth; if ($ThumbToHeight) { if ($imgheight <= $ThumbHeight) { $HeightToThumb = $imgheight; $LargeHeight = $imgheight; copy($imageupload, $filenamecopy_thumb); } else { $HeightToThumb = $ThumbHeight; if ($imgheight <= $MaxImgHeight) { $LargeHeight = $imgheight; } else { $LargeHeight = $MaxImgHeight; $thumb2 = new thumbnail($filename); $thumb2 -> size_height($MaxImgHeight); $thumb2->jpeg_quality(75); $thumb2->save($filename); } $thumb = new thumbnail($filename_thumb); $thumb->size_height($HeightToThumb); $thumb->jpeg_quality(75); $thumb->save($filename_thumb); } } else { if ($imgwidth <= $ThumbWidth) { $WidthToThumb = $imgwidth; $LargeWidth = $imqwidth; copy($imageupload, $filename_thumb); } else { $WidthToThumb = $ThumbWidth; if ($imgwidth <= $MaxImgWidth) { $LargeWidth = $imgwidth; } else { $LargeWidth = $MaxImgWidth; $thumb2 = new thumbnail($filename); $thumb2 -> size_width($LargeWidth); $thumb2->jpeg_quality(75); $thumb2->save($filename); } $thumb = new thumbnail($filename_thumb); $thumb->size_width($WidthToThumb); $thumb->jpeg_quality(75); $thumb->save($filename_thumb); } } } else { $imguploadname = ""; } if ($website != "") { $website = str_replace("http://","",$website); } if ($Waiting) { $active = 0; } else { $active = 1; } echo $sql = "insert into ".$prefix."_nukec_ads_ads values" ."('','$catgforprocess','$ads_title','$ads_content','$imguploadname','$AdsCurr','$price','$submitteruid','$email','$website','$posted_on','$validuntil','0','$adslanguage','$active')"; $res = $db->sql_query($sql); header("Location:modules.php?name=".$module_name."&file=postads&op=Done&id_catg=$catgforprocess"); } } else { @include("header.php"); MenuNukeC(1); echo "
"; OpenTable(); echo "
"._NUKECPOSTNEWADS."

\n"; printnotallowforanonymouse(); CloseTable(); @include("footer.php"); } } function Done($id_catg) { global $Waiting,$module_name,$prefix,$db; @include("header.php"); MenuNukeC(1); echo "
"; OpenTable(); echo "
"; if ($Waiting == 1) { echo _NUKECADSWAITINGRECEIVED.""; } else { echo _NUKECADSPOSTED; } echo "
\n"; echo "
"._NUKECADSTHX.""; echo "

"; if ($Waiting == 1) { $res = $db->sql_query("select count(*) as ttl from ".$prefix."_nukec_ads_ads where active = 0"); list ($jmlwaiting) = $db->sql_fetchrow($res); echo _NUKECADSWAITINGMSG."
"._NUKECADSWAITINGMSG1." $jmlwaiting "._NUKECADSWAITINGMSG2; } else { echo ""._NUKECADSCLICKHERE.""; } echo "
"; CloseTable(); @include("footer.php"); } switch($op) { case "Done":Done($id_catg);break; case "SubmitAds": SubmitAds($submitteruid, $title, $cdesc, $catgforprocess, $AdsCurr, $price, $website, $email, $postfor, $fileupload, $adslanguage, $fileupload, $fileupload_name, $fileupload_type, $fileupload_size);break; default : Index($id_catg); break; } ?>