 |
16-06-2008, 06:09 PM
|
#1 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Avtar
There is another topic for it but I didn't found it for three pages so I created it. I wanted to ask that I got a news about the avtars being changed everytime you refresh your page. It has a bit of coding. So what is it? Is it right that the avtars do change on their own?
|
|
|
|
Advertisements. Register and be a member of the community to get rid of them.
|
|
Advertisement
|
|
16-06-2008, 06:15 PM
|
#2 (permalink)
|
|
left this forum longback
Join Date: Sep 2005
Location: -
Posts: 7,536
|
Re: Avtar
did u meant GIF?
__________________
left this forum long back.Admin Can Delete this Account and posts Permanantly.Thank You
Get GNU/Linux - http://getgnulinux.org
|
|
|
16-06-2008, 06:19 PM
|
#3 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Re: Avtar
Of course not It is only a bit of Image Ready. I am saying about coding. It is I think to be some special coding. I hope i didn't misread.
|
|
|
16-06-2008, 06:23 PM
|
#4 (permalink)
|
|
"Aal Izz Well"
Join Date: Apr 2008
Location: Inside ur BRaIN..!!
Posts: 1,832
|
Re: Avtar
do u mean for Animation ?
Write clearly.
__________________
http://webchat.freenode.net/?channels=krow
http://twitter.com/krazzywarrior
|
|
|
16-06-2008, 06:25 PM
|
#5 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: Avtar
A random image choosing PHP script?
http://ma.tt has a small implementation.
__________________
Harsh J
www.harshj.com
|
|
|
16-06-2008, 06:33 PM
|
#6 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Re: Avtar
Quote:
Originally Posted by QwertyManiac
A random image choosing PHP script?
http://ma.tt has a small implementation.
|
Yes,it must be a PHP script. as for the link it doesn't open forme. I don't know the reason.
|
|
|
16-06-2008, 06:33 PM
|
#7 (permalink)
|
|
हॉर्न ओके प्लीज़
Join Date: Sep 2007
Posts: 1,493
|
Re: Avtar
^But you can't do it on this forum because the avatar manager downloads the remote image to the server and serves the avatar from there!
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति
गीक होना माँगता
|
|
|
16-06-2008, 06:35 PM
|
#8 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Re: Avtar
OMG, it is really a problem forme then. But stil the coding would help me a lot.
|
|
|
16-06-2008, 06:37 PM
|
#9 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: Avtar
PHP Code:
<?php
/*
By Matt Mullenweg > http://photomatt.net
Inspired by Dan Benjamin > http://hiveware.com/imagerotator.php
Latest version always at:
http://photomatt.net/scripts/randomimage
*/// Make this the relative path to the images, like "../img" or "random/images/".
// If the images are in the same directory, leave it blank.
$folder = '';
// Space seperated list of extensions, you probably won't have to change this.
$exts = 'jpg jpeg png gif';
$files = array(); $i = -1; // Initialize some variables
if ('' == $folder) $folder = './';
$handle = opendir($folder);
$exts = explode(' ', $exts);
while (false !== ($file = readdir($handle))) {
foreach($exts as $ext) { // for each extension check the extension
if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
$files[] = $file; // it’s good
++$i;
}
}
}
closedir($handle); // We’re not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
$rand = mt_rand(0, $i); // $i was incremented as we went along
header('Location: '.$folder.$files[$rand]); // Voila!
?>
Usage:
Quote:
For the simplest possible installation, just drop this code in a directory with the images you want to rotate, and call it like you would a normal image, for example:
<img src="/dropbox/2003/rotate/rotate.php" alt="A Random Image" />
|
__________________
Harsh J
www.harshj.com
|
|
|
16-06-2008, 06:44 PM
|
#10 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Re: Avtar
But how would I load it as AVTAR on to my account? <_>
|
|
|
16-06-2008, 06:48 PM
|
#11 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: Avtar
I do not know, look into your forum's avatar mechanisms probably and modify them as you wish.
__________________
Harsh J
www.harshj.com
|
|
|
16-06-2008, 06:52 PM
|
#12 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Re: Avtar
|
|
|
16-06-2008, 07:01 PM
|
#13 (permalink)
|
|
Legen-wait for it-dary!
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
|
Re: Avtar
I want to ask about a similar thing... check this out...
the link is http://chandras.com.au/x0r/randomimage.png, ends in a png extention. how about that?
ps: reload the image to get different images
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
|
|
|
16-06-2008, 07:06 PM
|
#14 (permalink)
|
|
हॉर्न ओके प्लीज़
Join Date: Sep 2007
Posts: 1,493
|
Re: Avtar
^Its the same thing as CAPTCHA except for the background!
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति
गीक होना माँगता
|
|
|
16-06-2008, 08:34 PM
|
#15 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: Avtar
Yes it serves a random image every request I suppose.
__________________
Harsh J
www.harshj.com
|
|
|
16-06-2008, 09:03 PM
|
#16 (permalink)
|
|
Legen-wait for it-dary!
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
|
Re: Avtar
Ok, so is it possible to do it in a wordpress blog? Any script to randomize images every request?
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
|
|
|
17-06-2008, 09:35 PM
|
#17 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Re: Avtar
It only changes the color but doesn't like the one JOHN BEAK has done.
|
|
|
17-06-2008, 09:37 PM
|
#18 (permalink)
|
|
हॉर्न ओके प्लीज़
Join Date: Sep 2007
Posts: 1,493
|
Re: Avtar
Quote:
Originally Posted by dheeraj_kumar
Ok, so is it possible to do it in a wordpress blog? Any script to randomize images every request?
|
yes, its possibe
(did I us the wrong smiley above  )
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति
गीक होना माँगता
|
|
|
17-06-2008, 10:21 PM
|
#19 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: Avtar
And also a wrong spelling.
__________________
Harsh J
www.harshj.com
|
|
|
17-06-2008, 10:42 PM
|
#20 (permalink)
|
|
Wahahaha~!
Join Date: Dec 2006
Location: Pune/there
Posts: 7,673
|
Re: Avtar
^^ZOMG
nitpicking
Quote:
Originally Posted by dheeraj_kumar
|
isn't it just a mapping ?
like we do in JSP
Last edited by Faun; 17-06-2008 at 10:43 PM.
Reason: Automerged Doublepost
|
|
|
18-06-2008, 05:47 PM
|
#21 (permalink)
|
|
Legen-wait for it-dary!
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
|
Re: Avtar
Rohan, can you tell us how to do it in wordpress blog?
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
|
|
|
18-06-2008, 06:27 PM
|
#22 (permalink)
|
|
हॉर्न ओके प्लीज़
Join Date: Sep 2007
Posts: 1,493
|
Re: Avtar
There is actually no need to modify any WP files for that. You can do that with javascript too, but I will discuss here how its done with PHP:
There is actually no need to modify any WP files for that. You can do that with javascript too, but I will discuss here how its done with PHP:
PHP Code:
//put names of all images you want to rotate randomly $image_set=array("img1.jpg","img2.jpg","img3.jpg","img4.jpg");
//now select any one random image $randomly_selected_image=$image_set[array_rand($image_set,1)];
//now fetch the image and store it in a string $image=file_get_contents("images/$randomly_selected_image");
//send a header to the browser telling it that we are now sending an image header("Content-type: image/jpg");
//now send the image. echo $image;
/* Because we informed the browser earlier that we are sending an image, it could parse that string as an image. Else it gets confused and parses it as plain text which looks horrible(with all question marks and rhombuses and weird characters-like the one when fonts are missing!) */
Now you can save this file as randomimage.php on yourserver. The HTML markup for your posts would be
Code:
<img src="randomimage.php" alt="random image" title="This image has been generated randomly and will change on refreshing">
Thats how simple it is!
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति
गीक होना माँगता
Last edited by victor_rambo; 18-06-2008 at 06:42 PM.
Reason: Automerged Doublepost
|
|
|
19-06-2008, 11:34 AM
|
#23 (permalink)
|
|
The Boy Who Lived
Join Date: Apr 2008
Location: Kharagpur, Rajasthan, Godric's Hollow
Posts: 409
|
Re: Avtar
Yeah! it is ismple for those who know something about PHP script not me.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|