Former Member
inherit
guest@proboards.com
222576
0
May 19, 2024 6:11:47 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Mar 31, 2016 17:51:22 GMT -8
Hi I got this random facts code from someone, is it possible to make it do random avatar images ? Edit: thinking of it now i can just place the <img> in them manually but i would rather have it choose from the members avatars automatically. would this be possible with this code ? or am i way out ha !! <div id="random-facts"> <span>Fact One</span> <span>Fact Two</span> <span>Fact Three</span> <span>Etc.</span> </div> thank you to whoever
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Mar 31, 2016 18:45:55 GMT -8
You might want to ask Peter . I believe that's what he's done to his avatar if you look at it on the board. I know that Peter is very busy though, so be patient with a reply. He was last online May 14th, so it might take him a while to get back to this. Every time you refresh the page, his avatar changes. It's pretty darn cool.
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Mar 31, 2016 18:49:37 GMT -8
|
|
Former Member
inherit
guest@proboards.com
222576
0
May 19, 2024 6:11:47 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Mar 31, 2016 18:55:24 GMT -8
iv spoke to peter today, yea iv seen his avy ha ha !!! i was actually asking for a div i could place in my sidebar so it would play the whole sites random avatars in, but i'll see what he peter says thank you for all the help you can deal with me one at a time you know im easy like that.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Apr 1, 2016 1:58:19 GMT -8
My avatar is randomly picked from a folder on my server. I use a PHP script to pick one at random, I then set the header to be "image/png" and echo out the file contents. Very simple.
<?php
$dir = "images/"; $images = scandir($dir);
$i = rand(2, sizeof($images) - 1);
header("Content-Type: image/png");
echo readfile($dir . $images[$i]); exit();
?>
That's it.
Edit: Forgot to say, I also do some mod_rewrite in the .htaccess file...
RewriteEngine On RewriteRule ^avatar.png$ avatar.php
|
|
Former Member
inherit
guest@proboards.com
222576
0
May 19, 2024 6:11:47 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 1, 2016 4:17:33 GMT -8
My avatar is randomly picked from a folder on my server. I use a PHP script to pick one at random, I then set the header to be "image/png" and echo out the file contents. Very simple. <?php
$dir = "images/"; $images = scandir($dir);
$i = rand(2, sizeof($images) - 1);
header("Content-Type: image/png");
echo readfile($dir . $images[$i]); exit();
?> That's it. Edit: Forgot to say, I also do some mod_rewrite in the .htaccess file... RewriteEngine On RewriteRule ^avatar.png$ avatar.php im sorry peter i think we've got our wires crossed. its not what im looking for sorry. i was wanting an automatic box in my sidebar what pics up the members avartars randomly without me loading them in everytime. Is this possible with your code ? im very new to codes sorry.
|
|
inherit
58740
0
Jan 5, 2024 18:58:20 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Apr 1, 2016 8:12:22 GMT -8
im sorry peter i think we've got our wires crossed. its not what im looking for sorry. i was wanting an automatic box in my sidebar what pics up the members avartars randomly without me loading them in everytime. Is this possible with your code ? im very new to codes sorry. Hi @joecool111, that wouldn't be possible to pick up user's avatars automatically.
|
|
Former Member
inherit
guest@proboards.com
222576
0
May 19, 2024 6:11:47 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 1, 2016 8:36:13 GMT -8
im sorry peter i think we've got our wires crossed. its not what im looking for sorry. i was wanting an automatic box in my sidebar what pics up the members avartars randomly without me loading them in everytime. Is this possible with your code ? im very new to codes sorry. Hi @joecool111 , that wouldn't be possible to pick up user's avatars automatically. ok thats no problem. would this code work in my sidebar ?
|
|
inherit
58740
0
Jan 5, 2024 18:58:20 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Apr 1, 2016 8:39:31 GMT -8
Hi @joecool111 , that wouldn't be possible to pick up user's avatars automatically. ok thats no problem. would this code work in my sidebar ? I don't see why not?
|
|
Former Member
inherit
guest@proboards.com
222576
0
May 19, 2024 6:11:47 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 1, 2016 8:44:31 GMT -8
im sorry peter i think we've got our wires crossed. its not what im looking for sorry. i was wanting an automatic box in my sidebar what pics up the members avartars randomly without me loading them in everytime. Is this possible with your code ? im very new to codes sorry. Hi @joecool111 , that wouldn't be possible to pick up user's avatars automatically. <div id="random-facts"> <span>Fact One</span> <span>Fact Two</span> <span>Fact Three</span> <span>Etc.</span> </div> im meaning this one ? i dont understand peters.
|
|
inherit
58740
0
Jan 5, 2024 18:58:20 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Apr 1, 2016 9:09:01 GMT -8
Yeah, it SHOULD work.
|
|
Former Member
inherit
guest@proboards.com
222576
0
May 19, 2024 6:11:47 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 1, 2016 9:25:32 GMT -8
ok i'll have a play around with it thanks for the help richie
|
|