Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Happy Hour
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2022-06-13 21:04:20
can this code be made randomly? i mean not to set it by myself , to randomly chose hours every day ? Thanx in advance

$happyhourstart = 15;  // Change this to the start time
$happyhourend = 17;   // Change this to the end time

if ((date("H") >= $happyhourstart) && (date("H") < $happyhourend)) {
$happyhour = true;
} else {
$happyhour = false;
}
2022-06-13 21:55:05
<?
if (in_array(date('l'), array('Saturday', 'Sunday'))) {
  // do stuff on these 2 days
}


For the randomizing part, I think you do this

<?
$array = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
if (shuffle($array)) {
  // do stuff on any random day selected
}
Last edited by STorrents2020 on 2022-06-13 22:00:26
2022-06-14 09:48:23
THX STorrents2020 ill give it a try :)
2022-06-14 19:44:17
shuffle($array) shuffles array keys (the days) randomly on each call. I realize this request may require more code, but let us know and we will help.

Anytime!
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 8
  • Members: 0
  • Guests online: 8
  • Comments: 3
  • Messages: 1,728