modernmafia Posted June 12, 2011 Posted June 12, 2011 i have a site ( mafia rpg ), before my hosters upgraded to the following specification MySQL will be upgraded to version 5.1 due to MySQL 5.0 reaching EOL (End of life) We'll also be disabling PHP4 support and upgrading all servers to PHP 5.3. If you notice any software/scripts problems within your website, please ensure you have updated the software. If the software/script doesn't support 5.3, you should seriously consider the continued use of said script/software. Further to this, we will be totally disabling password authentication to all accounts to SSH. In the event you have a jailed SSH account, you will need to connect via SSH keys which can be generated within your cPanel. Contact support for assistance with that. my scriptcheck/script_check (php) worked fine but no they have upgraded it wont work any suggestions on what i need to do to make it work can provide information on request Quote
mixmaster Posted June 12, 2011 Posted June 12, 2011 you will need to find a new script due to the script not been php 5 , Quote
modernmafia Posted June 12, 2011 Author Posted June 12, 2011 is there a easyer way then going through every page Quote
modernmafia Posted June 12, 2011 Author Posted June 12, 2011 (edited) trying to do bb codes Edited June 12, 2011 by modernmafia Quote
Danny696 Posted June 12, 2011 Posted June 12, 2011 use php bbcode tags please. I only asked how many files, not too post them. I'd update the pages for $1 per file. Quote
Danny696 Posted June 12, 2011 Posted June 12, 2011 Hmm, lets see if Vb has the nobbc tag... nope Do this, [ php]Code Here[/php] (Remove te space though) Quote
modernmafia Posted June 12, 2011 Author Posted June 12, 2011 <?php /* Script Check */ class ScriptCheck { var $image_dir = './scriptcheck/'; var $extensions = array(); var $images = array(); var $_instance; var $watermark = 'watermark.png'; var $watermark_size = null; var $tempimagesdir = './scriptcheck/temp'; var $types = array ('nature', 'technology'); var $max_correct_percent = 0.6; function ScriptCheck($image_dir = null, $extensions = null, $padding = null) { session_start(); $this->image_dir = $image_dir ? $image_dir : dirname(__FILE__); $this->image_dir = rtrim($this->image_dir, '/'); $this->watermark = $this->image_dir.'/'.$this->watermark; $this->extensions = $extensions ? $extensions : array ('jpg'); $this->padding = $padding ? (int) $padding : 5; $this->scanDirForImages(); $this->watermark_size = getimagesize($this->watermark); } function scanDirForImages() { if(!file_exists($this->image_dir) || !is_dir($this->image_dir)) { return false; } elseif(is_readable($this->image_dir)) { $directory_list = opendir($this->image_dir); while (false !== ($file = readdir($directory_list))) { if($file != '.' && $file != '..') { $path = $this->image_dir.'/'.$file; if(is_readable($path)) { $subdirectories = explode('/', $path); if(is_file($path)) { $ext = explode('.', end($subdirectories)); $extension = end($ext); if(in_array($extension, $this->extensions) && in_array($ext[1], $this->types)) { $this->images[$ext[1]][] = $path; } } } } } closedir($directory_list); foreach ($this->types as $key => $type) { if (!is_array($this->images[$type]) || count($this->images[$type]) < 1) { unset($this->images[$type]); unset($this->types[$key]); } } return true; }else{ return false; } } function deleteImages($files) { foreach ($files as $file => $temp) { @unlink($this->tempimagesdir.'/'.$file.'.png'); } } function showImages() { if (is_array($_SESSION['scrpt_images'])) { return $this->outputHTML(); } $images = $this->images; $types = $this->types; $selected = array(); $total = 8; $total_types = count($types); $correct_type = mt_rand(0, $total_types-1); $correct_total = count($images[$types[$correct_type]]); $correct_amount = mt_rand(1, round($total*$this->max_correct_percent)-1); $_SESSION['correct_type'] = $types[$correct_type]; $_SESSION['correct_amount'] = $correct_amount; for ($i=0;$i<$correct_amount;$i++) { $img = mt_rand(0, $correct_total-1); $image = $images[$types[$correct_type]][$img]; $selected[] = $this->processImage($image, true); $correct_total--; unset($images[$types[$correct_type]][$img]); $images[$types[$correct_type]] = @array_values($images[$types[$correct_type]]); } unset($images[$types[$correct_type]]); unset($types[$correct_type]); $types = array_values($types); $total_types--; for ($i=0;$i<($total-$correct_amount);$i++) { $type = mt_rand(0, $total_types-1); $img = mt_rand(0, count($images[$types[$type]])-1); $selected[] = $this->processImage($images[$types[$type]][$img], false); unset($images[$types[$type]][$img]); $images[$types[$type]] = @array_values($images[$types[$type]]); } $_SESSION['scrpt_images'] = $this->shuffleImages($_SESSION['scrpt_images']); return $this->outputHTML(); } function outputHTML() { include($this->image_dir.'/show.php'); } function shuffleImages ($array) { while (count($array) > 0) { $val = array_rand($array); $new_arr[$val] = $array[$val]; unset($array[$val]); } return $new_arr; } function processImage($image_path, $add = true) { $type = getimagesize($image_path); $open = null; switch ($type[2]) { case IMAGETYPE_GIF: $open = imagecreatefromgif($image_path); break; case IMAGETYPE_JPEG: $open = imagecreatefromjpeg($image_path); break; case IMAGETYPE_PNG: $open = imagecreatefrompng($image_path); break; default: return false; break; } $size = getimagesize($image_path); $max_x = $size[0] - $this->watermark_size[0] - 5; $max_y = $size[1] - $this->watermark_size[1] - 5; $min_x = 5; $min_y = 5; $x = mt_rand($min_x, $max_x); $y = mt_rand($min_y, $max_y); $water = imagecreatefrompng($this->watermark); imageAlphaBlending($water, false); imageSaveAlpha($water, true); imagecopy($open, $water, $x, $y, 0, 0, $this->watermark_size[0], $this->watermark_size[1]); imagedestroy($water); $name = md5(microtime()); imagepng($open, $this->tempimagesdir.'/'.$name.'.png'); if ($add) { $_SESSION['scrpt_images'][$name] = 1; } else { $_SESSION['scrpt_images'][$name] = 0; } imagedestroy($open); return $name; } function testImages($images) { $match = true; if (!$_SESSION['scrpt_images']) { return false; } foreach ($images as $image => $key) { if ($_SESSION['scrpt_images'][$image] != (int)$key) { $match = false; } } $this->deleteImages($_SESSION['scrpt_images']); unset($_SESSION['scrpt_images']); return $match; } /*static function getInstance($image_dir = null, $extensions = null, $padding = null) { if (null === self::$_instance) { self::$_instance = new self($image_dir, $extensions, $padding); } return self::$_instance; }*/ } ob_end_clean(); if ($_POST['images']) { $scriptcheck = new ScriptCheck('./scriptcheck/'); $check = $scriptcheck->testImages($_POST['images']); if ($check) { $newtime = time() + (60 * 10); mysql_query("UPDATE user_info SET last_script='$newtime' WHERE username='$username'"); // echo "<div class='error'>Well done!</div>"; echo "<script>document.location=document.location</script>"; } else { echo "<div class='error'>Wrong!</div>"; } // echo ($check?'Well Done!':'Nuhuh'); // $scriptcheck->showImages(); } else { $scriptcheck = new ScriptCheck('./scriptcheck/'); $scriptcheck->showImages(); } ?> Quote
modernmafia Posted June 12, 2011 Author Posted June 12, 2011 (edited) that just scriptcheck.php there is another one script_check and probe and functions Edited June 12, 2011 by modernmafia Quote
modernmafia Posted June 12, 2011 Author Posted June 12, 2011 i have a working demo, still need work looking for a coding partner to redegn it and add new features Quote
modernmafia Posted June 16, 2011 Author Posted June 16, 2011 Danny said he'd do it for $1 a file.... i dont know how manay files need doing so i need a bull part figure Quote
bineye Posted June 16, 2011 Posted June 16, 2011 If you are paying up front, like you said a few comments up, perhaps it would be in your interest to count what needs doing. Quote
modernmafia Posted August 14, 2011 Author Posted August 14, 2011 10 files still need help also need a quote on a unqie layout Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.