• 0

Randomizing sig pictures?


Question

Recommended Posts

  • 0

yeah...i don't get it either.

ah well...what i got works for my needs...

On another note...anyone got an idea where i can pick a sig based on the time, not on a random number?

I'd like to take the current time and throw it through a hash function with the output being a number 1 through x...

Basically, how do I set a PHP variable equal to the current time as a number, not a string?? Is that possible?

  • 0

Ok, well I got it now. I wrote a script that increments my sig once every 5 minutes. This way I can coordinate my avatars with my sigs so they always match :D

Here's the code for anyone who may be interested in something similar:

<?php 

Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); 
Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); 
Header("Pragma: no-cache"); 
Header("Content-Type: image/gif");

//Get current time (seconds since 01/01/1970 12:00am) and divide by 300 (convert from seconds to '5-minute' increments
$seed = time()/300;

//Take the seed and get the remainder from dividing it by 14 (the number of sigs I have) and then add 1 to get 1-14 instead of 0-13
$n = ($seed%14) + 1;

//This part is pretty specific to where your sigs are and how you named them. ?It's best if you name them using numbers...that's the easiest way.
if($n < 10) {
header("Location: http://eecs.cwru.edu/~jwa4/design/Assets/Images/Banners/b0".$n.".gif");
}
else header("Location: http://eecs.cwru.edu/~jwa4/design/Assets/Images/Banners/b".$n.".gif");

?>

So this code will simply increment $n from 1-14 and then back to 1 every 300 seconds, or 5 minutes.

the interval can be changed to anything you want...from 1 second to a year if you want....and as long as you name your sigs with numbers, than you can make this work for any number of sigs (or avatars) you want.:DD

Edited by Jack31081
  • 0

I've used this plain jane one clicky by white rabbit.

Hey Jack..instead of a timed one, I have always wanted one that could synchronize the sig and av so I could have rotating "sets"..that would be cool.

heheh I know..so would a self refilling bottle of beer :)

btw: Silly..did yah ever get that upload script workin?

  • 0

Blaise, that's exactly what I have.

I have one script that picks my sig, and one that picks my avatar. my sigs are named b01.gif - b14.gif and my avatars are a01.gif - a14.gif. a01 goes with b01 and so on. The two scripts are the same so my sig and avatar are always paired up...and each changes every 5 minutes.

:yes:

  • 0
Blaise, that's exactly what I have.

I have one script that picks my sig, and one that picks my avatar. my sigs are named b01.gif - b14.gif and my avatars are a01.gif - a14.gif. a01 goes with b01 and so on. The two scripts are the same so my sig and avatar are always paired up...and each changes every 5 minutes.

:yes:

I like yours, do you mind if I give it a try?

  • 0
Yes, thank you. I just don't know how to prevent people from overwriting pics already uploaded, so I haven't released the URL.

:o

oh cr@p! I forgot about that, I've been using that simple one, since the one that allows users to make their own accounts is buggy (keeps asking them to authenticate over & over).

/me puts notice for folks to tag files with their username

Thanks cuz :)

Oh..Jack..thanks for the info and for sharin, I have load of old neobits/bytes sig avs I want to use

but didn't since I couldn't synch em (Y)

  • 0
Yes, thank you. I just don't know how to prevent people from overwriting pics already uploaded, so I haven't released the URL.

Looks like you're writing/have written a script that allows people to upload images to a server of yours?

If you're trying to keep each user's images separate so people don't go overwriting existing images, let me know...I may be able to help you out on that front, assuming that you're using a MySQL database to store image info. That's the only way I could think of to keep user's images separate from one another...

  • 0
Looks like you're writing/have written a script that allows people to upload images to a server of yours?

If you're trying to keep each user's images separate so people don't go overwriting existing images, let me know...I may be able to help you out on that front, assuming that you're using a MySQL database to store image info. That's the only way I could think of to keep user's images separate from one another...

I got the script from Blaise, who got it from somewhere else. :D

See script:

<html>

<head>

<title>Upload Status</title>

<body text="#000000" link="#000000" vlink="#000000" alink="#000000" leftmargin="0"

topmargin="0" marginwidth="0" marginheight="0">

<?

/*

+--------------------------------------------------------------------------

| SIGUP.COM UPLOADER SCRIPT

| ========================================

| by Marc Perkel (extreme)

| © 2002,2003,extreme design group

| http://www.sigup.com

| ========================================

| Web: http://www.sigup.com

| Email: [email protected]

+---------------------------------------------------------------------------

|

| > Uploader script

| > Script written by Marc Perkel

| > Date started: 2nd of December 2002

|

+--------------------------------------------------------------------------

*/

if ($superdat_name != "") {

copy("$superdat", "/usr/local/www/data/members/crissabl/silly_walk/sigup/images/$superdat_name") or

die("There has been an error while trying to upload, contact the webmaster");

} else {

    die("You did not select an image.");

}

mail("[email protected]", "Somone uploaded an image",

"$email sent $superdat_name, a $superdat_size byte file with a MIME type of $superdat_type");

?>

<!--Header/Logo-->

<p align="center"><font face="Verdana">Image Preview:</font></p>

<p align=center><a href="http://www.securenet.net/members/crissabl/silly_walk/sigup/images/<? echo "$superdat_name"; ?>"<font face="Verdana"><img SRC="http://www.securenet.net/members/crissabl/silly_walk/sigup/images/<? echo "$superdat_name"; ?>" ALT="Uploaded Image"></font></a></p>

<p align=center><font face="Verdana">Image URL: <a href="http://www.securenet.net/members/crissabl/silly_walk/sigup/images/<? echo "$superdat_name"; ?>">http://www.securenet.net/members/crissabl/silly_walk/sigup/images/<? echo "$superdat_name"; ?></a>.</font></p>

<p align="center">

<br>

<p> 

<table width="100%" border="1" cellspacing="0" cellpadding="1" bgcolor="#FFFFFF"

bordercolor="#333333" valign="bottom">

<tr>

<td><b><font face="Verdana" size="1" color="#CCCCCC"><p align="center"><a

href="http://sigup.com" target="_blank">Upload Script Copyright 2003 Extreme Design

Group. All rights reserved.</font></b> </a></td>

</td>

</tr>

</table>

</body>

</html>

Problem is, you have to CHMOD the directory to full access, and anyone can use the same filename and overwrite an older image.

  • 0

well the first thing that comes to mind is to have each person that wants to use this system log in w/ a user/pass (registration is free of course). The whenever a user uploads a file, have the script append the user's username to the front of the filename, if that's possible.

Of course, you'd need to have mysql installed on the server for this to work, but that shouldn't be that tough to do.

**EDIT** Or only give them access to a subfolder with there username in it...then they can only access and overwrite their own files.

it's an idea.

  • 0

Well, off the top of my head...

the time() function in PHP returns the number of seconds since mindnight, 01/01/1970. If you knew the number of seconds from then to the point you want to countdown to, then all you have to do is subtract time() from that amount...as you get closer to that time, time() returns a larger and larger number and your result gets smaller and smaller, hitting zero at the time you specified.

Once you have a variable with the number of seconds between now and the time you're counting down to, it's a simple matter to split that up into days, hours, minutes and use each of those values to either display directly to the screen...

However, I don't know how Bxboy does it with a picture. You'd have to ask him.

  • 0

Jack,

This is the one I wanted to use, I set up the mysql and tables etc..all seemed to work ..for me.

but in IE it keeps asking you to select an image type, even after you already have.

Also some people would be asked over and over to supply there creds..after successfully creating an account. Tis why I dropped the link to it and use the simple one.

Here's the url: http://blaise.us/pogouploader/uploader.php

Try to create an account, you'll see what I'm talkin about :cry:

I attached the php, the code is way too long to post.

uploader.php

uploader.php

  • 0

Ok. Well the first thing I see, which may explain why users keep getting asked for their creds, is a lack of cookies or sessions. How are you keeping the user's info stored from page load to page load?

Other than that, it worked fine for me.

Lot's o' PHP...I'll keep looking through it.

  • 0
Ok.  Well the first thing I see, which may explain why users keep getting asked for their creds, is a lack of cookies or sessions.  How are you keeping the user's info stored from page load to page load?

lol...oops!

I did not even think that through, just, setup the mysql ran the install.php and gave no thought whatever to cookies.

/me eyes copy of php bible warily and guiltily, laying underneath an unopened mysql manual :blush:

I attached the complete package that came with the script incl the readme.

Thanks for your input so far man, its appreciated (Y)

full.zip

full.zip

  • 0

I just wanted everyone to know that I've put my version of both a random signature generator and a time-interval based signature 'cycler' on my website (click my sig, go to 'web.design.stuff').

So if anyone wants to use it, that's where it is.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Are you going to do performance benchmarks comparing all states? I'd be interested in seeing that in the next "part".
    • My father still uses a programme written in dbase3. Still manages to work with a little help from dosbox. 
    • Microsoft hides these secret Windows 11 performance boost settings available on every PC by Sayan Sen Windows enthusiasts often look for ways to extract as much performance out of their systems as possible, and it's often the case that they try and do so while trying to minimize the heat and power consumption. This is especially relevant in the case of mobile Windows PCs since laptops and notebooks tend to get hot and management of that heat and power is harder in such a form factor. As such users often turn to techniques like under-volting which can be used to squeeze out the maximum capabilities of a chip while also maintaining lowered power levels. There are official apps from AMD and Intel with the likes of Ryzen Master and XTU (Extreme Tuning Utility). While these are quite handy, most enthusiasts probably prefer to dig into the BIOS and play around with settings there like Curve Optimizer on Ryzen, which lets users set various frequency-voltage scaling values. These are essentially called P-States. If you are not familiar with them, Processor Power Management is done through Advanced Configuration and Power Interface (ACPI) P-states and C-states. While P-states or performance pwoer states handle CPU voltage-frequency scaling, C-states deal with CPU sleep states so that some of the CPU functions, which are not necessary at that moment, can be disabled. The P-states and C-states work together to make the processor run more efficiently. It helps the OS and apps determine which cores can be parked and which should be boosted. Of course not every user is an enthusiast or knows the technicalities and integrities of how things like overclocking or undervolting work. Thankfully for them Windows itself offers something pretty cool, though it is hidden by default on all systems. By default, Windows only has two P-States, "Minimum Processor State" and "Maximum Processor State." However, this can be changed with a Registry trick to expand the options under a secret "Processor performance boost mode" dropdown. This essentially enables the HWP or hardware P-States available on a device, and these are not controlled just by the OS itself as the underlying hardware gets involved too. In total there are five Processor Performance Boost Mode profiles that control how Windows requests and allows CPU turbo/boost behavior under the different power policies. They are: Disabled: In this mode, processor boosting is effectively turned off. The CPU will avoid entering turbo or boost frequencies and instead operate closer to its base frequency ceiling. This can significantly reduce power consumption and heat output, but at the cost of reduced burst performance and responsiveness in short workloads. Enabled: This is the standard behavior where boost functionality is allowed under normal conditions. The processor can opportunistically increase frequency when workload demands it, balancing performance gains with power and thermal constraints as managed by the system. Aggressive: Aggressive mode favors performance more heavily, allowing the CPU to enter higher boost states more readily and sustain them longer. This should in theory improve responsiveness under bursty or heavy workloads but increases power draw and thermal output compared to the default enabled behavior. Efficient Enabled: This mode still allows boosting, but with a stronger bias toward energy efficiency. The system attempts to use boost more selectively, avoiding unnecessary frequency spikes when the performance gain is marginal. Efficient Aggressive: This is a hybrid approach where boost is still performance-responsive, but the system continuously weighs efficiency more heavily than in Aggressive mode. It aims to deliver noticeable performance improvements while reducing wasted power in less demanding scenarios. Here's how to enable the Processor performance boost mode: Open Registry Editor: Press Win+R, type regedit, and click OK. Go to: HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\be337238-0d82-4146-a960-4f3749d470c7 (where HKLM stands for HKEY_LOCAL_MACHINE_) Modify the value of Attributes from 1 to 2 (you can find modify option by right-clicking) After that, exit Registry, you should now be able to see the new "Processor performance boost mode" dropdown menu: As you can see there are now five new P-States or CPPC states or power profile available that help define the boost mode processor setting on your PC. Wrapping it up here's a quick run-down of the settings as defined by Microsoft itself. Setting Description Disabled The corresponding P-state-based behaviour is disabled. Collaborative Processor Performance Control (CPPC) behaviour is disabled. Enabled The corresponding P-state-based behaviour is enabled. CPPC behaviour is Efficient Enabled. Aggressive The corresponding P-state-based behaviour is enabled. CPPC behaviour is Aggressive. Efficient Enabled The corresponding P-state-based behaviour is Efficient. CPPC behaviour is Efficient Enabled. Efficient Aggressive The corresponding P-state-based behaviour is Efficient. CPPC behaviour is Aggressive. Aggressive At Guaranteed Windows calculates the desired extra performance above the guaranteed performance level, and asks the processor to deliver that specific performance level. Efficient Aggressive At Guaranteed Windows always asks the processor to deliver the highest possible performance above the guaranteed performance level. In the next part we shall be comparing these settings to explore how much of a benefit or regression they can provide in terms of performance and power efficiency. If you decide to change the values on your system and are experiencing problems like crashes or an overheating PC, make sure to revert the steps back to the original state.
  • Recent Achievements

    • Week One Done
      rolfus earned a badge
      Week One Done
    • One Month Later
      Leroy Jethro Gibbs earned a badge
      One Month Later
    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
    • One Month Later
      AndreaB earned a badge
      One Month Later
    • One Month Later
      agatameier earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      518
    2. 2
      +Edouard
      198
    3. 3
      PsYcHoKiLLa
      147
    4. 4
      ATLien_0
      93
    5. 5
      Steven P.
      78
  • Tell a friend

    Love Neowin? Tell a friend!