Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Oct 29, 2003 8:06 am Reply with quote

Tired of the same, dreary old security code? Well, try this code. You can modify it to your heart's content! If you create something really neat, nice, pretty, etc., please post it back! Note that it needs no images and it is using JPG, but can easily be modified to PNG or any other format.
Code:
function gfx($random_num) {

   global $prefix, $db;
   require("config.php");
   $datekey = date("F j");
   $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
   $code = substr($rcode, 2, 6);

   $circles=5;
   $width=100;
   $height=40;
   $font=5;

   $fontwidth = ImageFontWidth($font) * strlen($string);
   $fontheight = ImageFontHeight($font);

   $im = @imagecreate ($width,$height);
   $background_color = imagecolorallocate ($im, 255, 255, 255);
   $text_color = imagecolorallocate ($im, rand(0,100), rand(0,100),rand(0,100)); // Random Text

   for ($i=1;$i<=$circles;$i++) {
      $randomcolor = imagecolorallocate ($im , rand(100,255),rand(100,255),rand(100,255));
      imagefilledellipse($im,rand(0,$width-10),rand(0,$height-3),rand(20,70),rand(20,70),$randomcolor);
   }

   imagerectangle($im,0,0,$width-1,$height-1,$text_color);
   imagestring ($im, $font, 12, 12,$code,$text_color);
   header ("Content-type: image/jpeg");
   imagejpeg ($im,'',80);
   ImageDestroy($im);
   die();
}


Last edited by Raven on Fri Oct 31, 2003 8:50 am; edited 1 time in total 
View user's profile Send private message
scottr
PHP-Portal Project



Joined: Jan 21, 2003
Posts: 41
Location: Southern California

PostPosted: Wed Oct 29, 2003 8:39 am Reply with quote

cool, can we see it in action Smile
 
View user's profile Send private message Visit poster's website Yahoo Messenger
Raven







PostPosted: Wed Oct 29, 2003 8:44 am Reply with quote

Sure. Just replace your gfx() function in modules/Your_Account/index.php Smile and/or admin.php. You think I'm going to do EVERYTHING for you people? Laughing
 
scottr







PostPosted: Wed Oct 29, 2003 8:49 am Reply with quote

Don't you already ? hehe. Laughing
I don't have GD loaded at home and i got everything working
and don't want to risk breaking things.
Actually i would like GD loaded here.
 
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Wed Oct 29, 2003 9:00 am Reply with quote

Great!! Thanks Raven!! Now I have something else to tweak... such fun!
 
View user's profile Send private message Visit poster's website
Raven







PostPosted: Wed Oct 29, 2003 9:01 am Reply with quote

scottr wrote:
Don't you already ? hehe. Laughing
I don't have GD loaded at home and i got everything working
and don't want to risk breaking things.
Actually i would like GD loaded here.


http://www.ravenphpscripts.com/gfx.php

So many excuses .... Laughing
 
scottr







PostPosted: Wed Oct 29, 2003 9:24 am Reply with quote

hey that's neat, i hit refresh on that page and see different background designs everytime Cool
 
Raven







PostPosted: Wed Oct 29, 2003 9:27 am Reply with quote

Ah the wonderful world of randomization functions Laughing
 
Frogger
Worker
Worker



Joined: Oct 06, 2003
Posts: 108

PostPosted: Thu Oct 30, 2003 9:10 am Reply with quote

What would be causing this. It isn't a major issue, just wondering if I can remedy the problem.

Code:
PHP Warning:  imagedestroy(): supplied argument is not a valid Image resource in /home/froggerz/public_html/admin.php on line 149



Code:
Line 149    ImageDestroy($image); 

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger ICQ Number
Raven







PostPosted: Thu Oct 30, 2003 9:14 am Reply with quote

Did you remember to change your JPG to PNG logic? I think you would change
Code:
   header ("Content-type: image/jpeg"); 

   imagejpeg ($im,'',80);
to
Code:
   header ("Content-type: image/png"); 

   imagepng ($im,'',80);
 
TheosEleos
Life Cycles Becoming CPU Cycles



Joined: Sep 18, 2003
Posts: 960
Location: Missouri

PostPosted: Thu Oct 30, 2003 2:16 pm Reply with quote

This should work with 6.9 right?

(getting tired of being high maintnance but my admin is broke now and I can't log in)

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website AIM Address ICQ Number
msimonds
Regular
Regular



Joined: Jul 15, 2003
Posts: 56
Location: Dallas

PostPosted: Thu Oct 30, 2003 8:41 pm Reply with quote

how do you control the size of the image if I have it set on my default theme to a certain size
 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Raven







PostPosted: Thu Oct 30, 2003 8:50 pm Reply with quote

TheosEleos wrote:
This should work with 6.9 right?

(getting tired of being high maintnance but my admin is broke now and I can't log in)
Well, it works with my 6.9
 
TheosEleos







PostPosted: Thu Oct 30, 2003 9:32 pm Reply with quote

I give up, on all of this. I'll cut loose so you can have a break from me. See you in a couple of weeks. Sad
 
Frogger







PostPosted: Thu Oct 30, 2003 10:46 pm Reply with quote

Works for me in 6.8, 6.9 and 7.0 beta
 
Frogger







PostPosted: Fri Oct 31, 2003 7:52 am Reply with quote

Anyone know what is causing this:

Code:
PHP Warning:  imagedestroy(): supplied argument is not a valid Image resource in /home/WWW/public_html/admin.php on line 149
 
Raven







PostPosted: Fri Oct 31, 2003 8:50 am Reply with quote

I think this line
Code:
ImageDestroy($image);
should be
Code:
ImageDestroy($im);
I corrected my original post - SORRY!
 
Frogger







PostPosted: Fri Oct 31, 2003 9:12 am Reply with quote

Not a fo-pah? Laughing

Thanks, will update it.
 
paranor
Worker
Worker



Joined: Aug 28, 2003
Posts: 227

PostPosted: Thu Nov 13, 2003 3:50 pm Reply with quote

got around to installing it.

very cool. yo.
 
View user's profile Send private message
BigDaddyEBK
New Member
New Member



Joined: Nov 21, 2003
Posts: 5
Location: La Mesa, CA(suburb of San Diego)

PostPosted: Sat Nov 22, 2003 12:39 am Reply with quote

THANKS for this code hack info "Raven"!! I've been trying to figure this one out for a while!

Would you happen to know a way to make it look similar to the one found on the
Only registered users can see links on this board! Get registered or login!? Or at least, something close to that random Only registered users can see links on this board! Get registered or login! image they have on that page Question

It TOTALLY works like a charm on my website!!!

_________________
"Unix" for Longevity
"AS/400" for Nostalgia
"Linux" for Productivity
"MAC" for Multimedia
"Windows" for Solitaire Twisted Evil

Hello tech support? I broke the cup-holder on my PC!! 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
paranor







PostPosted: Sat Nov 22, 2003 6:36 am Reply with quote

Why would you ant it soo hard to read? That's one of the things I hate about ordering tickets on ticketmaster - some of their images aren't readable.
 
BigDaddyEBK







PostPosted: Sat Nov 22, 2003 9:28 pm Reply with quote

paranor wrote:
Why would you ant it soo hard to read? That's one of the things I hate about ordering tickets on ticketmaster - some of their images aren't readable.


Well, I have to take extra security precautions since I co-locate my server at work (I happen to work at a local ISP) & I'm getting free unlimited bandwidth. I just can't abuse that now can I? Wink
 
Raven







PostPosted: Sat Nov 22, 2003 10:19 pm Reply with quote

BigDaddyEBK wrote:
THANKS for this code hack info "Raven"!! I've been trying to figure this one out for a while!

Would you happen to know a way to make it look similar to the one found on the
Only registered users can see links on this board! Get registered or login!? Or at least, something close to that random Only registered users can see links on this board! Get registered or login! image they have on that page Question

It TOTALLY works like a charm on my website!!!
So you just want the checkerboard background? If so, why not just use the one that comes with nuke?
 
BigDaddyEBK







PostPosted: Sat Nov 22, 2003 11:55 pm Reply with quote

Raven wrote:
So you just want the checkerboard background? If so, why not just use the one that comes with nuke?


NOPE.....I wanted something different than the plain security code that comes with nuke!! Like the code you posted earlier in this topic, but I was also wondering if there's a code hack to make it look similar the one on the Only registered users can see links on this board! Get registered or login! page Question

Their's has randomly generated background images & words (it can be seen if you refresh the page a couple of times)!! Confused
 
BigDaddyEBK







PostPosted: Thu Dec 04, 2003 1:03 am Reply with quote

Hey....I've found another way to customize the security code, in addition to Raven's suggestions!! Razz

This info was given to me by Only registered users can see links on this board! Get registered or login! on the NukeCops site.

Written by Only registered users can see links on this board! Get registered or login!:
yeah i made something similiar for 6.7 (should work on 6.8 but will break 6.9& up security code on/off switch)
Only registered users can see links on this board! Get registered or login!
(refresh a few times)

Turn on/off security images for user login, user registration, and admin panel
specify the length of the code (3-10)
use "Enhanced" security codes similiar to those found on major sites like
yahoo!
aol IM
Hotmail

Create you own security code graphics
Only registered users can see links on this board! Get registered or login!
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©