PDA

View Full Version : 2 Things


E
07-11-2002, 07:13 AM
Number one.. how can i make numbers riound offf..... is floor got somehting to do withit??

and is there a way to make things happen at a certain time evryday

Xenon
07-11-2002, 07:27 AM
1) use the round() function

2) you have to use cronjobs as i know

E
07-11-2002, 07:29 AM
ok thanks.... ill look up round()

Admin
07-11-2002, 07:32 AM
With round(), 2.4 becomes 2 and 2.6 becomes 3. If you want 2.4 to become 3, use ceil(). If you want 2.6 to become 2 use floor().

E
07-11-2002, 07:39 AM
round() works fine thanks... any help on the second one?

E
07-11-2002, 07:41 AM
for example.. say i wanted to put a max post per day.. id add another field... and every time u post it would add to the field as well.. when that got to max u cant post anymore... but the field gets reset to 0 evry midnight

i know there is probably a hack for this but
this isnt exactly wat i want.. its just an example

(the bit of code that says
if time = midnight update userfield set field=0 where userid!=0

Admin
07-11-2002, 07:42 AM
Use a cron job or wait for vB3.

E
07-11-2002, 07:42 AM
hwo do i use cronjobs?

E
07-11-2002, 07:51 AM
i mena.. wat do i put in the command part, and how do i call it up?

Xenon
07-11-2002, 08:04 AM
thanks chen, but everything is possible with the round()-function too round(x-0.5)=floor(x) isn't it ;)

E
07-11-2002, 08:06 AM
hmm....

E
07-11-2002, 08:35 AM
yo.. i see that cron jobs run off cfg fileS?? can they also run off php... ima try it anyway