The index.php file of my website is giving me an error right above where I have a php include. The error is this:
Notice: Use of undefined constant str_pad_left - assumed 'str_pad_left' in /hsphere/local/home/trienell/summitnorthwest.org/includes/thisweek.php on line 13 Notice: Use of undefined constant str_pad_left - assumed 'str_pad_left' in /hsphere/local/home/trienell/summitnorthwest.org/includes/thisweek.php on line 20
The include is for a file in /includes/thisweek.php. The code for thisweek.php is:
That script is used to display what's happening this week and next week for church. It updates every weekend, and what's displayed corresponds to the week # of the year. I haven't changed anything for a long time (more than a year ago?) other than adding more weeks as we go along, but for some reason it just now started showing up in the last day or two...
Any ideas?
Notice: Use of undefined constant str_pad_left - assumed 'str_pad_left' in /hsphere/local/home/trienell/summitnorthwest.org/includes/thisweek.php on line 13 Notice: Use of undefined constant str_pad_left - assumed 'str_pad_left' in /hsphere/local/home/trienell/summitnorthwest.org/includes/thisweek.php on line 20
The include is for a file in /includes/thisweek.php. The code for thisweek.php is:
Code:
<?php
$paras = array(
'30' => 'Date: Saturday, July 26<br />Speaker: Ron Hessel<br />Sermon Title/Topic: The Child of Faith<br />Sermon Series: Father Abraham: Friend of God<br />Music Team: Bruce Christensen, Gayle Dohrman, Terry & Keriana Forrester, Skip Meyer, Kelly Sailas, Cher Leiske, Kevin Smith, Sam Smith, and Mike Christensen.',
'31' => 'Date: Saturday, August 2<br />Speaker: Ron Hessel<br />Sermon Title/Topic: The Testing of Faith<br />Sermon Series: Father Abraham: Friend of God<br />Music Team: Kelly Armstrong, Brad & Karen Drury, Fred & Mindy Weber, Lindsay Armstrong, Sydney Drury, Bruce Christensen, Kevin Smith, Sam Smith, and Liz Coulter.',
'32' => 'Date: Saturday, August 9<br />Speaker: Ron Hessel<br />Sermon Title/Topic: How to Know if you are Living<br />Sermon Series: Abundant Life Bootcamp, Part II<br />Music Team: Geoff Heald, Tina Bauer, Mike & Tawnya Breakie, Carrie Graves, Karalee Rhuman, Kelly Armstrong, Brad Billington, Kevin Smith, and Ron Tobin.',
'33' => 'Date: Saturday, August 16<br />Speaker: Ron Hessel<br />Sermon Title/Topic: Actually Living<br />Sermon Series: Abundant Life Bootcamp, Part II<br />Music Team: Brad & Nancy Billington, Mike Christensen, Jeremy Marinos, Sherliyn Jones, Kevin Smith, and Bryan and Kim Anderson.',
'34' => 'Date: Saturday, August 23<br />Speaker: Ron Hessel<br />Sermon Title/Topic: Peaceful Evangelism<br />Sermon Series: Abundant Life Bootcamp, Part II<br />Music Team: Bruce Christensen, Gayle Dohrman, Terry & Keriana Forrester, Skip Meyer, Kelly Sailas, Cher Leiske, Kevin Smith, Sam Smith, and Mike Christensen.');
$today = date("W");
// The number below represents which day of the week begins a new week. By default a new week begins on Monday, but we wanted the script to update Saturday night at midnight (on Sunday) instead of Sunday night at midnight (on Monday) we use a 0. 0 = Sunday, 6 = Saturday. Because we put in 0, the script will update as soon as 12:01 Sunday arrives. If we want the script to update on Wednesday at midnight, we'd use a 4 instead. Well not 100% true... It actually just always bumps Sunday forward to the next week, so it would take more modifying than that.
if (date("w") == 0) {
$myday = $today+1;
$today = str_pad($myday,2,'0',str_pad_left);
}
$nextweek = strtotime("+1 week");
$nextweek = date('W',$nextweek);
// Same goes for the number below as well.
if (date("w") == 0) {
$mydaynextweek = $nextweek+1;
$nextweek = str_pad($mydaynextweek,2,'0',str_pad_left);
}
foreach ($paras as $key => $para) {
if ($today == $key) {
print $para;
}
}
echo "</p><h3 class=\"title\">Next week at Summit Northwest Ministries</h3><p>";
foreach ($paras as $key => $para) {
if ($nextweek == $key) {
print $para;
}
}
?>
That script is used to display what's happening this week and next week for church. It updates every weekend, and what's displayed corresponds to the week # of the year. I haven't changed anything for a long time (more than a year ago?) other than adding more weeks as we go along, but for some reason it just now started showing up in the last day or two...
Any ideas?