Greenguy's Board WebcamWiz CRAZY $5,000 Reward Bonuses

WebcamWiz CRAZY $5,000 Reward Bonuses WebcamWiz CRAZY $5,000 Reward Bonuses WebcamWiz CRAZY $5,000 Reward Bonuses WebcamWiz CRAZY $5,000 Reward Bonuses WebcamWiz CRAZY $5,000 Reward Bonuses

Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-04-29, 05:17 PM   #1
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
AutoGallery SQL question...

How can I do the "Monday" "Tuesday" ...etc. thing, like seen here:

http://www.puppykibble.com/

Thanks,

Bill
tortus32 is offline   Reply With Quote
Old 2005-05-01, 03:37 PM   #2
f69j69b
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
 
f69j69b's Avatar
 
Join Date: Jan 2004
Location: colorado
Posts: 318
one of the board moderators might want to get rid of that link when I clicked on it my virus program went off saying i had picked up a trojan

Fred
__________________
https://furry-yiff.com/
f69j69b is offline   Reply With Quote
Old 2005-05-01, 04:56 PM   #3
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
dayrotate.pl
Code:
#!/usr/bin/perl

use File::Copy;

@weekdays = ('sunday.jpg','monday.jpg','tuesday.jpg','wednesday.jpg',
             'thursday.jpg','friday.jpg','saturday.jpg');

my ($sec,$min,$hour,$mday,$mon,$year,
          $wday,$yday,$isdst) = localtime time;

  copy($weekdays[$wday],'today.jpg');
  copy($weekdays[($wday==0?7:($wday-1))],'yesterday.jpg');
  copy($weekdays[($wday<1?($wday+6):($wday-2))],'twodaysago.jpg');
  copy($weekdays[($wday<2?($wday+5):($wday-3))],'threedaysago.jpg');
cron entry:
Code:
0 0 * * * cd /var/www/domain.com/images/;/usr/bin/perl /var/www/domain.com/images/dayrotate.pl > /dev/null
Your 'day' images will be sunday.jpg, monday.jpg, etc.

in your html, you refer to

today.jpg, yesterday.jpg, twodaysago.jpg and threedaysago.jpg
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-01, 09:05 PM   #4
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
Wow, this might be beyond my abilities, but what the heck, I'll give this a try!

Do I edit the cron.cgi file that came with AutoGallery SQL and add that line of code somewhere?

Thanks,

Bill
tortus32 is offline   Reply With Quote
Old 2005-05-01, 09:19 PM   #5
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
that runs completely independently from AutoGallery. All this does is rotate 7 images and set the appropriate filenames -- requires no 'hook' into AutoGallery.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-02, 08:46 AM   #6
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
Ok, cool.

if I want to show all 7 days of the week, do I just add more code to the dayrotate.pl file?

Like:
Code:
copy($weekdays[($wday<3?($wday+4):($wday-4))],'fourdaysago.jpg');
copy($weekdays[($wday<4?($wday+3):($wday-5))],'fivedaysago.jpg');
copy($weekdays[($wday<5?($wday+2):($wday-6))],'sixdaysago.jpg');
Thanks,

Bill
tortus32 is offline   Reply With Quote
Old 2005-05-02, 11:24 AM   #7
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
yep, that would do it.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-02, 11:32 AM   #8
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
Ok, cool.

I have customer support helping me with this at webair and they're telling me there's errors generated by the dayrotate.pl file.

Here's the error messages:

/www/virtual/tortus32/www.largelovelys.com/images/dayrotate.pl: line 1: {rtf1macansicpg10000cocoartf102: command not found
/www/virtual/tortus32/www.largelovelys.com/images/dayrotate.pl: line 2: syntax error near unexpected token `}'
/www/virtual/tortus32/www.largelovelys.com/images/dayrotate.pl: line 2: `{\fonttbl\f0\fmodern\fcharset77 Courier;}'

Let me know what you think.

Thanks,

Bill
tortus32 is offline   Reply With Quote
Old 2005-05-02, 11:37 AM   #9
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
looks like you uploaded a microsoft word file.

Needs to be uploaded as ascii text -- from notepad or some other text editor.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-02, 11:50 AM   #10
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
Yep, that's what I did.

I copied the code from above and pasted it into a text file with TextEdit.
Uploaded it with Fetch to my images folder.

And once it was uploaded, the file type says Perl Source.

Thanks,

Bill
tortus32 is offline   Reply With Quote
Old 2005-05-02, 05:54 PM   #11
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
Is this the only way to do this?

Even the support people at webair can't figure out what's wrong.

Bill
tortus32 is offline   Reply With Quote
Old 2005-05-02, 07:20 PM   #12
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
use php

<?php

echo date("l");
echo date("l",time() - (1* 86400));
echo date("l",time() - (2* 86400));
echo date("l",time() - (3* 86400));
echo date("l",time() - (4* 86400));
echo date("l",time() - (5* 86400));
echo date("l",time() - (6* 86400));

?>


although I really hate doing date calculations on every pageload -- especially 7 of them

you could also do the same thing with an array, find the current position, cycle through and set the variable.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-05-03, 01:51 AM   #13
Wazza
I'm a jaded evil bastard, I wouldn't piss on myself if I was on fire...
 
Join Date: Apr 2003
Location: Melbourne, Australia
Posts: 808
Send a message via ICQ to Wazza
The answer is under Template Values on this page - http://www.jmbsoft.com/owners/ags/ma...lates.tgp.html

You could always ask in the owners forums and get Tech Support to give you a hand

|viking|
__________________
I sale Internet

My sites have no traffic and no PR - let's trade - PM me
Wazza is offline   Reply With Quote
Old 2005-05-03, 07:14 AM   #14
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
Those are both great, but I want to do this with image files for each day that say the day of the week, as seen in the link I posted above..

I already posted in teh owners forum there, but they always take a few days to reply. Not the speediest bunch.

Thanks,

Bill
tortus32 is offline   Reply With Quote
Old 2005-05-03, 08:46 AM   #15
tortus32
A little nonsense, now and then, is relished by the wisest men
 
tortus32's Avatar
 
Join Date: Jan 2005
Location: Montague, NJ
Posts: 628
Send a message via ICQ to tortus32 Send a message via AIM to tortus32 Send a message via Yahoo to tortus32
Quote:
Originally Posted by Wazza
The answer is under Template Values on this page - http://www.jmbsoft.com/owners/ags/ma...lates.tgp.html
Ok, I used that and got it to work!

All I had to do was this:
Code:
<img src="images/##Weekday##.gif"> - shows today's image "Tuesday"
<img src="images/##Weekday-1##.gif"> - shows yesterday's image "Monday"
Thanks a bunch!

Bill
tortus32 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:56 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc