Shoutbox

PHP Script Question - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: PHP Script Question (/showthread.php?tid=46985)

PHP Script Question by Mike on 06-29-2005 at 08:03 AM

Hello.

I'm currently making some new signatures & avatars.
I want them to be random, but I dont want for example the random avatar script to show my current avatar and the random sig script to show another signature...
I want the avatar & sig to match...

I was wondering, is it possible to do?

I thought something like this:

When the random avatar script is executed, it will write the avatar number to a file.
When the random sig script is executed, it will read the avatar number and it will display the corresponding signature.

Thank you :)


RE: PHP Script Question by John Anderton on 06-29-2005 at 08:19 AM

Yes it is possible to do it afaik 8-)

quote:
Originally posted by Mike
When the random avatar script is executed, it will write the avatar number to a file.
When the random sig script is executed, it will read the avatar number and it will display the corresponding signature.
Exactly what i was thinking .... make a file to link the sig and the corresponding avy so that they are triggered together .... but it could be tough. Theoretically it can be done ... practically ... not sure but its tough i think :-/
RE: PHP Script Question by Eljay on 06-29-2005 at 08:25 AM

its easy really

just have one of the scripts writing to a file AFTER the picture is output

and then have both of them reading the file BEFORE the image is output

this is the easiest way to guarantee they both have the corresponding image


RE: PHP Script Question by Veggie on 06-29-2005 at 08:29 AM

or could could make them random by time, that way there will be no need to write to a file.


RE: PHP Script Question by John Anderton on 06-29-2005 at 08:49 AM

quote:
Originally posted by Veggie
or could could make them random by time, that way there will be no need to write to a file.
U mean .... but then how will the avy and the sig match :S
Actually i thought of this a long time back but since i dont make matching sigs and avy's i dropped it :P
I am making a tech sig right now so mabbe ill make a tech avy too :D
RE: PHP Script Question by L. Coyote on 06-29-2005 at 09:10 AM

quote:
Originally posted by John Anderton
quote:
Originally posted by Veggie
or could could make them random by time, that way there will be no need to write to a file.
U mean .... but then how will the avy and the sig match :S
You obviously have to calculate the timestamp so that they match.

I'm going to sleep now, else I'd do a few tests.
RE: PHP Script Question by -dt- on 06-29-2005 at 10:51 AM

[Image: xso_undecided.gif] in sql record the IP and the random set used , then look it up in your sig/avatar then remove that IP , should provide less mismatches then the other mentioned ways because your targetting the user


RE: PHP Script Question by Mike on 06-29-2005 at 02:22 PM

quote:
Originally posted by -dt-
[Image: xso_undecided.gif] in sql record the IP and the random set used , then look it up in your sig/avatar then remove that IP , should provide less mismatches then the other mentioned ways because your targetting the user
Well, my server allows to make sql dbs but I dont know how to do this...

I might just use the file method... :-/
RE: PHP Script Question by RaceProUK on 06-29-2005 at 06:42 PM

Do you have phpMyAdmin installed? I believe that allows you to create and manage MySQL DBs.


RE: PHP Script Question by L. Coyote on 06-29-2005 at 06:48 PM

Do you really think it's (MySQL) that necessary for a sig/av script? It could be easily done with a file.


RE: PHP Script Question by absorbation on 06-29-2005 at 06:48 PM

quote:
Originally posted by Mike
Well, my server allows to make sql dbs but I dont know how to do this...

I might just use the file method...

Erm using cpanel and phpmyadmin :P the file method is easier as he might be limted to using a database etc :P

Well it's not eaiser but i dont think he knowd myqul yet ;)
RE: PHP Script Question by Mike on 06-29-2005 at 07:07 PM

My hosts only gives me phpMyAdmin.
No cPanel...

Anyway, I will probably go for the file one, thanks :P


RE: PHP Script Question by KeyStorm on 06-29-2005 at 07:12 PM

This should be added to CBC soon with some complex algorithms to have them both matched, but if you have a normal random avatar script, lift the change time to 1 second and that will do just fine. if you set both image series (avatars and sigs) in the same order.