Is not that complicated, just copy code and replace the images link with your own. If you wanna add more images just enter a new array object; $files[next number] = "image link";. Then save the file as for example; "getImage.php", and upload it to a server. Make sure that server has PHP support. (thou I believe most do these days.) Then just point your signature address to that .php file and you're done.
I don't have any free server tips, last one I used was geocities.com and that was years ago.
Joined: Tue May 27, 2008 12:44 am Posts: 2839 Location: ~Deterioration of public morals, two half-naked in winter~
I've always wanted to do this, but I never found any sort of code for it. Just a bunch of websites that you have to sign up for that'll say they'll shuffle your images for you.
//This makes the current year a variable $year = date('Y', $date) ;
//Here we generate the first day of November $first_day = mktime(0,0,0,11, 1, $year) ;
//We determine what day of the week the first falls on $day_of_week = date('D', $first_day) ;
//Based upon this, we add the appropriate number of days to get to the forth Thursday of the month
switch($day_of_week) { case "Sun": $add = 25; break; case "Mon": $add = 24; break; case "Tue": $add = 23; break; case "Wed": $add = 22; break; case "Thu": $add = 21; break; case "Fri": $add = 27; break; case "Sat": $add = 26; break; }
$Thanks = 1 + $add;
return $Thanks; }
function getfreecomicbookday($year) { // First Saturday in May. $firstday = mktime(0, 0, 0, 5, 1, $year); $dayofweek = date('D', $firstday);
switch($dayofweek) { case "Sun": $day = 7; break; case "Mon": $day = 6; break; case "Tue": $day = 5; break; case "Wed": $day = 4; break; case "Thu": $day = 3; break; case "Fri": $day = 2; break; case "Sat": $day = 1; break; }
return $day; }
function isfullmoon($month, $day, $year) { // Based on an algorithm located here http://www.voidware.com/moon_phase.htm if ($month < 3) { $year = $year - 1; $month = $month + 12; }
function getindex() { $month = date(n); // Current month $day = date(j); // Current Day of the month $year = date(Y); // Current year $hour = date(G); // Current hour
// FILL THESE VALUES IN FOR YOUR BIRTHDAY (month is 1-12, day is 1-31, year is four digits) $bmonth = 7; // Month of your birthday $bday = 16; // Day of your birthday $byear = 1983; // Year you were born (has no use currently)
$tod = 0; // Originally meant for time of day, has been appropriated to help with special days too
// Special dates (will be the same image for the duration of these dates) // Add special dates with an else if statement after the else if thanksgiving statement block. // MAKE SURE YOU INCREMENT THE TOD VALUE! Otherwise, you're not allocating different signatures! // If you add another index, you need to adjust BOTH the avatar and signature init functions! if (($month == 12 && $day == 24) || ($month == 12 && $day == 25)) $tod = 12; // CHRISTMAS!
$file[0] = ""; // Midnight $file[1] = ""; // Noon $file[2] = ""; // Dawn $file[3] = ""; // Dusk $file[4] = ""; // Early Evening $file[5] = ""; // Early Morning $file[6] = ""; // Morning $file[7] = ""; // Late Morning $file[8] = ""; // Afternoon $file[9] = ""; // Late Afternoon $file[10] = ""; // Evening $file[11] = ""; // Night $file[12] = ""; // Christmas $file[13] = ""; // New Years $file[14] = ""; // Birthday $file[15] = ""; // Thanksgiving $file[16] = ""; // Fullmoon, and evening $file[17] = ""; // Free Comic Book Day
readfile($file[getindex()]); ?>
Now, I need to discuss some "features" of this. First of all (I haven't tried this yet, but it should work) you can use this for your avatar too. You just copy the above (sig.php) to another script file with the urls for your avatar images for each time/day.
The times of day are, sort of, obvious, so I'll skip them. There's also some holidays, such as Christmas and American Thanksgiving (feel free to change the Thanksgiving function in imagescript.php to find a different date), New Years, and Free comic book day.
I also added in a calculation of when the full moon is, it only outputs that index number if it's also between dusk and dawn. This is, of course, so you can have werewolf sigs and avatars.
Some areas to note, you need to alter the birthday values in getindex in the imagescript.php file ... unless you want to celebrate my birthday. I like video games, btw.
So ... if you want to add a new special date, this is what you need to do:
1. Go to imagescript.php where Thanksgiving, Christmas, and all that crap is assigning a value to $tod, you need to add in a new else if block. You should be able to use the surrounding else if blocks as a rubric to go off of.
2. When you assign a value to $tod, you need to make sure it's a NEW value. and it has to be an integer and positive. If you notice, the last value before the area of code that covers time of day, generally, will have the newest index value, so you just add one to that and use that as the new index.
3. Once you've done that you need to go to your sig.php file and add a new entry for that address, just copy the format of the other entries. And that's it.
When you add the urls to the sig.php file, if there's a time of day you don't want to utilize, you can use the same image as another entry. The alternative, is to go in and re-edit all my time of day operations ... I don't suggest doing that. It would take a lot more time.
You can also create multiple sets of sigs (in different files, or even in the sig.php file) to have sets of profiles for times of year, or something like that, if you wanted.
You can use the exact same format in another file for your avatar as well, as stated earlier ... anyway. Enjoy?
Joined: Tue May 27, 2008 12:17 am Posts: 3054 Location: Oregon, USA
I never even thought about it before, honestly, that it would appear like image code externally. So, thanks for pointing that out. Opens all sorts of neat possibilities, like, real-time stats from playing games online, for an example.
... and I want someone to use the werewolf functionality ... I think it's neat.
Joined: Fri Jun 27, 2008 3:18 am Posts: 1907 Location: Michigan
I am so totally going to use this!
Since it took so long for somebody to do my request here, I also had people do some on another forum I am a part of. However that forum doesn't have the php capabilities this one does, or at least I don't think so. I'd still like to see somebody take up my request, but for now this will be great.
Joined: Tue May 27, 2008 12:17 am Posts: 3054 Location: Oregon, USA
What are you talking about? You have to host the scripts somewhere (where they will run) ... the forums themselves don't know they're scripts (unless they explicitly check), all they get is an image file as a result of making this page request.
But it all hinges on you uploading it to a server that has PHP installed. No one can do that for you unless you work out a hosting deal.
Users browsing this forum: No registered users and 0 guests
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 post attachments in this forum