#!/usr/bin/perl -w ## Don't change these 3 lines use CGI; use DBI; $q = new CGI; #$basedir = "/home8/sub002/sc15028-HAUA/www/demo"; $baseurl = "http://www.your-brand-demo.info"; $imgurl = "http://www.your-brand-demo.info/images"; #$imgdir = "/home/demo/public_html"; $basedir = "/home/demo/public_html/"; $imgdir = "/home/demo/public_html/images"; ## A place for session files. This should be a directory ## outside of your www root #$siddir = "/home8/sub002/sc15028-HAUA/sessiondata/"; $siddir = "/home/demo/public_html/sessiondata/"; ## Password for admin area $adminpass = "ftg45u8jdf32d"; ## MySQL login details $db_name = "demo_main"; $db_user = "demo_user"; $db_pass = "dt3frhl0ws"; $db_host = "localhost"; ## Path to sendmail binary $sendmail = "/usr/lib/sendmail"; ## Controls the size of textareas in the admin panel ## No need to change these unless you want. $textrows = 30; $textcols = 100; $joinbonus = "0.02"; #this returns the current payment run which is each Wednesday sub payment_run { #get current time my $now = time; #get the current time info my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime($now); my $difference_in_days_from_wednesday = ($wday <= 3) ? (3 - $wday) : (7 + 3 - $wday); #find out how many seconds we need to add to now. my $additional_seconds = $difference_in_days_from_wednesday * 24 * 60 * 60; $now += $additional_seconds; #now we have a day on a Wednesday, in the future. ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime($now); #build the resulting text my @list = ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); my $text = "th"; if (($day_of_month == 1) || ($day_of_month == 21) || ($day_of_month == 1)) { $text = "st"; } elsif (($day_of_month == 2) || ($day_of_month == 22)) { $text = "nd"; } elsif (($day_of_month == 3) || ($day_of_month == 23)) { $text = "rd"; } return "Wednesday $day_of_month$text $list[$month]"; } sub change_feature { my $previous = shift; my $now = time; #get the current time info my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime($now); my $text_now = "$day_of_month $month $year"; ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime($previous); my $text_previous = "$day_of_month $month $year"; if ($text_now eq $text_previous) { return 0; } else { return ($wday == 1); } } sub send_mail { my $hash = shift; my $realname = $hash->{'realname'}; my $from = $hash->{'from'}; my $to = $hash->{'to'}; my $subject = $hash->{'subject'}; my $version = '1.2'; my $lang_charset = 'iso-8859-1'; my $body = $hash->{'body'}; my $sendmail1 = '/usr/lib/sendmail'; open (SENDMAIL, "|" . $sendmail1 . " -oem -oi -F '$realname' -f '$from' -t 1>&2"); print SENDMAIL "From: $from\n"; print SENDMAIL "To: $to\n"; print SENDMAIL "Subject: $subject\n"; print SENDMAIL "X-Mailer: Email $version\n"; print SENDMAIL "X-IPAddress: $ENV{REMOTE_ADDR}\n"; print SENDMAIL "MIME-Version: 1.0\n"; print SENDMAIL "Content-Type: text/html; charset=$lang_charset\n\n$body\n"; close(SENDMAIL); } sub send_british_rewards_email { my $hash = shift; $hash->{'realname'} = 'DragonCashback'; send_mail($hash); }