Subversion Repositories SmartDukaan

Rev

Rev 10620 | Rev 10631 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10620 Rev 10621
Line 90... Line 90...
90
 
90
 
91
		$current_dir = @opendir($img_path);
91
		$current_dir = @opendir($img_path);
92
 
92
 
93
		while ($filename = @readdir($current_dir))
93
		while ($filename = @readdir($current_dir))
94
		{
94
		{
95
			if ($filename != "." and $filename != ".svn" and $filename != ".." and $filename != "index.html")
95
			if ($filename != "." and $filename != ".." and $filename != "index.html")
96
			{
96
			{
97
				$name = str_replace(".jpg", "", $filename);
97
				$name = str_replace(".jpg", "", $filename);
98
 
98
 
99
				if (($name + $expiration) < $now)
99
				if (($name + $expiration) < $now)
100
				{
100
				{
Line 149... Line 149...
149
		//  Assign colors
149
		//  Assign colors
150
		// -----------------------------------
150
		// -----------------------------------
151
 
151
 
152
		$bg_color		= imagecolorallocate ($im, 255, 255, 255);
152
		$bg_color		= imagecolorallocate ($im, 255, 255, 255);
153
		$border_color	= imagecolorallocate ($im, 153, 102, 102);
153
		$border_color	= imagecolorallocate ($im, 153, 102, 102);
154
		$text_color		= imagecolorallocate ($im, 204, 153, 153);
154
		$text_color		= imagecolorallocate ($im, 0, 0, 0);
155
		$grid_color		= imagecolorallocate($im, 255, 182, 182);
155
		$grid_color		= imagecolorallocate($im, 255, 182, 182);
156
		$shadow_color	= imagecolorallocate($im, 255, 240, 240);
156
		$shadow_color	= imagecolorallocate($im, 255, 240, 240);
157
 
157
 
158
		// -----------------------------------
158
		// -----------------------------------
159
		//  Create the rectangle
159
		//  Create the rectangle
160
		// -----------------------------------
160
		// -----------------------------------
161
 
161
 
162
		imagefilledrectangle($im, 0, 0, $img_width, $img_height, $bg_color);
162
		ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $bg_color);
163
 
163
 
164
		// -----------------------------------
164
		// -----------------------------------
165
		//  Create the spiral pattern
165
		//  Create the spiral pattern
166
		// -----------------------------------
166
		// -----------------------------------
167
 
167
 
Line 190... Line 190...
190
		// -----------------------------------
190
		// -----------------------------------
191
 
191
 
192
		$use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE;
192
		$use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE;
193
 
193
 
194
		if ($use_font == FALSE)
194
		if ($use_font == FALSE)
195
		{
195
		{	echo 'inside font';
196
			$font_size = 5;
196
			$font_size = 26;
197
			$x = rand(0, $img_width/($length/3));
197
			$x = rand(0, $img_width/($length/3));
198
			$y = 0;
198
			$y = 0;
199
		}
199
		}
200
		else
200
		else
201
		{
201
		{
202
			$font_size	= 16;
202
			$font_size	= 26;
203
			$x = rand(0, $img_width/($length/1.5));
203
			$x = rand(0, $img_width/($length/1.5));
204
			$y = $font_size+2;
204
			$y = $font_size+2;
205
		}
205
		}
206
 
206
 
207
		for ($i = 0; $i < strlen($word); $i++)
207
		for ($i = 0; $i < strlen($word); $i++)
Line 229... Line 229...
229
 
229
 
230
		// -----------------------------------
230
		// -----------------------------------
231
		//  Generate the image
231
		//  Generate the image
232
		// -----------------------------------
232
		// -----------------------------------
233
 
233
 
234
		$img_name = $now.'.png';
234
		$img_name = $now.'.jpg';
-
 
235
 
235
		imagepng($im, $img_path.$img_name);
236
		ImageJPEG($im, $img_path.$img_name);
236
 
237
 
237
		$img = "<img src=\"$img_url$img_name\" width=\"$img_width\" height=\"$img_height\" style=\"border:0;\" alt=\" \" />";
238
		$img = "<img src=\"$img_url$img_name\" width=\"$img_width\" height=\"$img_height\" style=\"border:0;\" alt=\" \" />";
-
 
239
 
238
		imagedestroy($im);
240
		ImageDestroy($im);
239
 
241
 
240
		return array('word' => $word, 'time' => $now, 'image' => $img, 'name' => $img_name);
242
		return array('word' => $word, 'time' => $now, 'image' => $img, 'name' => $img_name);
241
	}
243
	}
242
}
244
}
243
 
245
 
244
// ------------------------------------------------------------------------
246
// ------------------------------------------------------------------------
245
 
247
 
246
/* End of file captcha_helper.php */
248
/* End of file captcha_helper.php */
247
/* Location: ./system/heleprs/captcha_helper.php */
249
/* Location: ./system/heleprs/captcha_helper.php */
248
250