dzygners' forums
You have never visited, or are not logged in.
Not logged in [Login - Register]

Printable Version | Send to Friend
Subscribe | Add to Favorites
<<  1    2    3    4  >>
Author Subject: testing
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.22.2002 at 11:42 Reply With Quote
testing

Testing these avatars - they're just crappy little icons for testing, but should be random each page load.
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.22.2002 at 11:48 Reply With Quote
heh .. works.

Had to trick the message board, by renaming my PHP script .jpg and then using a .htaccess file to make my server process .jpg files as .php files.




-- no sig --
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 6.22.2002 at 11:51 Reply With Quote
ha, cool Dan




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
jimdrake
flash guru






385 Posts
Location . Bristol, UK
Status: Offline

posted on 6.22.2002 at 11:53 Reply With Quote
cool.

what does the php/jpg file look like then?





View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U jimdrake
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.22.2002 at 11:58 Reply With Quote
Not complex at all:

code:
<?  
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

$r = rand(1,4);
header("Content-type: image/gif");
$fn=fopen("./sig" . $r . ".gif","r");
fpassthru($fn);
?>


Now i'm going to do some experinting with randomly generated images.




-- no sig --
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
anders
Administrator






2013 Posts
Location . Taipei
Status: Offline

posted on 6.22.2002 at 11:59 Reply With Quote
dan, u r amazing...
i was just trying to find a script like that to use for my avatars and sigs too...lol.....

wanted to use a script that would show random sigs but without having to turn on html....

you are a genius...





"Life is not measured by the number of breaths we take, but the moments that take our breath away."
View User's Profile Visit User's Homepage View All Posts By User U2U anders
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.22.2002 at 12:09 Reply With Quote
Heh ... thx anders.

btw it's nothing special.

[Edited on 22.6.2002 by Dan]




-- no sig --
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.22.2002 at 14:07 Reply With Quote
My avatar now has random sentences... they don't make much sence and I could do with adding more words to it.

The code if anyone's interested:


code:
	function ImageStringWrap($image, $font, $x, $y, $text, $color, $maxwidth) {  
$fontwidth = ImageFontWidth($font);
$fontheight = ImageFontHeight($font);


if ($maxwidth != NULL) {
$maxcharsperline = floor($maxwidth / $fontwidth);
$text = wordwrap($text, $maxcharsperline, "\n", 1);
}

$lines = explode("\n", $text);
while (list($numl, $line) = each($lines)) {
ImageString($image, $font, $x, $y, $line, $color);
$y += $fontheight;
}
}





$Xart = array("the","a","another");
$Xv = array("throw","like","kiss","hit","love","hate","hug");
$Xn = array("car","dog","tree","bush","tennis ball","design", "website","man","woman");
$Xobj = array("anders","sher","alex","sergi","david","dan","simu","shane","janny","jmax","jooli","ttrenka","maik.l","hzr","claudia","webster","jay","chris","syedur","bobman","rem","jimdrake","pixelkitty","madis","abhi");
$Xadj = array("blue","black","dark","light","funny","cool","white","grey","badass","crap","furry","fast","slow","beautiful","ugly");

$Xaux = array("can","will","should");

$Xnp[0] = array(" ","Xart"," ","Xn");
$Xnp[1] = array(" ","Xart"," ","Xadj"," ","Xn");
$Xnp[2] = array(" ","Xobj");


$Xvp[0] = array(" ",'Xv','s','Xnp');
$Xvp[1] = array(" ",'Xaux'," ",'Xv','Xnp');
//$vp[2] = array('Xv');

$Xs[0] = array('Xnp','Xvp');


function process($item) {
global $Xart, $Xadj, $Xv, $Xn, $Xobj, $Xnp, $Xvp, $Xs, $Xaux;

$out = "";

if(is_array($item)) {
$i = rand(0,count($item)-1);
if(is_string($item[0])) $out = $item[$i];
else foreach($item[$i] as $sub)
if(is_array($$sub)) $out .= process($$sub);
else $out .= $sub;
} else $out = $item;

return $out;
}


$str = trim(process($Xs));

header("Content-type: image/gif");

$im = imagecreate(139,50);
$background_color = imagecolorallocate($im,230,230,230);
$text_color = imagecolorallocate($im,50,50,50);

ImageStringWrap($im, 2, 5, 0, "$str", $text_color, 129);
imagepng($im);





-- no sig --
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 6.22.2002 at 16:21 Reply With Quote
Very cool Dan




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
Sergi
backend messer






465 Posts
Location . Barcelona
Status: Offline

posted on 6.22.2002 at 16:57 Reply With Quote
hehe, found an error... and i provide the answer, all in one...


please add the following line just after the trim sentence:

$str=eregi_replace("sss","sses",$str);

Otherwise you endup with things like kisss

ciao




Sergi: [ meddle v2 ] || [ gen7es ] || [ e ]
View User's Profile Visit User's Homepage View All Posts By User U2U Sergi
Sergi
backend messer






465 Posts
Location . Barcelona
Status: Offline

posted on 6.22.2002 at 16:58 Reply With Quote
btw, brilliant signature and tool man, as usual




Sergi: [ meddle v2 ] || [ gen7es ] || [ e ]
View User's Profile Visit User's Homepage View All Posts By User U2U Sergi
Sergi
backend messer






465 Posts
Location . Barcelona
Status: Offline

posted on 6.22.2002 at 17:01 Reply With Quote
sh*t where is the edit button?




Sergi: [ meddle v2 ] || [ gen7es ] || [ e ]
View User's Profile Visit User's Homepage View All Posts By User U2U Sergi
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 6.22.2002 at 18:00 Reply With Quote
Hehe, it's far to the right because of Dan's code. Scroll and you will see the button.




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 6.22.2002 at 18:04 Reply With Quote
also noticed that it can be like "...a ugly..." when it should be "...an ugly..."

btw, got these:
"a light website hates pixelkitty" and
"a gray woman will throw dan" hehe

[Edited on 22.6.2002 by HZR]




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
whatisthematrix
Moderator






2337 Posts
Location . Sweden
Status: Offline

posted on 6.22.2002 at 18:19 Reply With Quote
very nice work dan!!
but my forum size flip out at this thread...




I'm whatever I want, you can like it or love it // [loading]
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U whatisthematrix
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 6.22.2002 at 18:22 Reply With Quote
It's because of the code lines, they don't have line breaks.

And Jooli, I will hug you:
"hzr will hug jooli"

[Edited on 22.6.2002 by HZR]




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
whatisthematrix
Moderator






2337 Posts
Location . Sweden
Status: Offline

posted on 6.22.2002 at 18:38 Reply With Quote
what...hug jooli??




I'm whatever I want, you can like it or love it // [loading]
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U whatisthematrix
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.22.2002 at 18:57 Reply With Quote
Thanks for the syntax fixes. Not done them as there are actually loads. Since it is only a simple vocabulary I thought I'd leave it as it is, to avoid spending untold hours making it do longer more sensicle sentences. Plus I don't want to delve in to deply into my "Natural Language Processing" notes, gives me nightmares

If your interested the 6 rules are:
Sentence = Noun Phrase + Verb Phrase
Noun Phrase = Article + Noun
Noun Phrase = Article + Adjective + Noun
Noun Phrase = Object
Verb Phrase = Verb + "s" + Noun Phrase
Verb Phrase = Verb + Auxilary + Noun Phrase




-- no sig --
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
Sergi
backend messer






465 Posts
Location . Barcelona
Status: Offline

posted on 6.22.2002 at 19:29 Reply With Quote
cool mate, very very clever. it rocks. ahhh, seen the button now, stup*d me...




Sergi: [ meddle v2 ] || [ gen7es ] || [ e ]
View User's Profile Visit User's Homepage View All Posts By User U2U Sergi
jimdrake
flash guru






385 Posts
Location . Bristol, UK
Status: Offline

posted on 6.23.2002 at 10:19 Reply With Quote
hmm, i got 'pixelkitty throws pixelkitty'







View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U jimdrake
rem_sr
Senior Member






481 Posts
Location . Sweden
Status: Offline

posted on 6.23.2002 at 15:21 Reply With Quote
really nice one dan... I really like it, I started to play with it, by refreshing and these is what I came up with...


  • a cool man should like abhi
  • a car hits another white tennis ball (every1 knows that tennisball should be yellow-colored)
  • another tree hits chris (watch out chris, don't go near trees, they are mad at you... )
  • jay should throw anders
  • anders hits the badass tennis ball
  • another funny woman hits a ugly website
  • another black tennis ball should kiss pixelkitty
  • the grey design throws janny (hmmm.. thought it was Janny that throws design/graphics etc. instead of reverse... )
  • a blue man likes jooli (a blue man?? who could that be? HZR are you blue?? )


it's been really fun...




s a m [ u e l ]
Dissatisfaction is the mother of development

View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U rem_sr
hzr
Moderator






1701 Posts
Location . localhost
Status: Offline

posted on 6.23.2002 at 15:30 Reply With Quote
No I'm not blue (but I like Jooli hehe (whoops, I was blue))
anders is green though (well, on his earlier avatar he was).

[Edited on 23.6.2002 by HZR]




hzr
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U hzr
Alex
Member






271 Posts
Status: Offline

posted on 6.23.2002 at 18:05 Reply With Quote
the woman can hug a design

nice job!

View User's Profile E-Mail User View All Posts By User U2U Alex
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.23.2002 at 18:26 Reply With Quote
Yeah, not many of them seem to make much sense.
Just got though:
"Pixelkitty should kiss the blue woman"




-- no sig --
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
Dan
Member






221 Posts
Location . Sheffield, UK
Status: Offline

posted on 6.23.2002 at 18:27 Reply With Quote
oh and:

"another black car hits the dog"

which is quite amusing




-- no sig --
View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Dan
<<  1    2    3    4  >>
Quick Reply [ Show All Smilies ] Not logged in [Login - Register]



© 2002 - 2005 dzygn.com
Powered by XMB v1.5 Beta :: Blue Moon
Processed in 0.5240450 seconds, 51 queries