Friday Sermons (original)





Ahmadiyya Muslim Association – Tarbiyyat Department UK

= strtotime($endDate); $i = strtotime(‘-1 day’, $i)) {
// Friday is Day 5
if (date(‘N’, $i) == 5) {
$count++;
if ($count == 1) $friday1 = date(‘Y-m-d’, $i);
if ($count == 1) $friday11 = date(‘jS F Y’, $i);
if ($count == 2) $friday2 = date(‘Y-m-d’, $i);
if ($count == 2) $friday22 = date(‘jS F Y’, $i);
if ($count == 3) $friday3 = date(‘Y-m-d’, $i);
if ($count == 3) $friday33 = date(‘jS F Y’, $i);
if ($count == 4) $friday4 = date(‘Y-m-d’, $i);
if ($count == 4) $friday44 = date(‘jS F Y’, $i);
if ($count == 5) $friday5 = date(‘Y-m-d’, $i);
if ($count == 5) $friday55 = date(‘jS F Y’, $i);
}
}

// This section to create 5 different URL’s
// For the First previous Friday ——————————————————————————————-
$html = file_get_html(“http://www.alislam.org/friday-sermon/” . $friday1 . “.html”);

// Get Page Title
$start = strpos($html, ‘‘);<br /> $end = strpos($html, ‘‘, $start);
$paragraph = substr($html, $start, $end-$start+4);

$paragraph = html_entity_decode(strip_tags($paragraph));
$paragraph = str_replace(“Friday Sermon:”, “”, $paragraph);

$friday1 = $friday11;
$paragraph = $friday1 . ” – ” . $paragraph;
$khutbaTitle1 = $paragraph;

// Get Second Paragraph
$start = strpos($html, ‘”ArticleContent”>

‘);
$end = strpos($html, ‘

‘, $start);
$paragraph = substr($html, $start+17, $end-$start-8);
$paragraph = html_entity_decode(strip_tags($paragraph));
$khutbaSummary1 = $paragraph;
$khutbaMore1 = “http://www.alislam.org/friday-sermon/” . $friday1 . “.html”;

// It seems that Alislam put online the Khutba Title first, and then quite a few hours
// later, add the summary?
// While there is only the Khutba Title, the Summary always starts with “Other languages”!
// Therefore, if the Summary is “Other languages” then all three variables will be blank!
if ( strstr( $khutbaSummary1, “Other Languages”)) {
$khutbaTitle1 = ” “;
$khutbaSummary1 = ” “;
$khutbaMore1 = ” “;
}

// For the Second previous Friday ——————————————————————————————-
$html = file_get_html(“http://www.alislam.org/friday-sermon/” . $friday2 . “.html”);

// Get Page Title
$start = strpos($html, ‘‘);<br /> $end = strpos($html, ‘‘, $start);
$paragraph = substr($html, $start, $end-$start+4);

$paragraph = html_entity_decode(strip_tags($paragraph));
$paragraph = str_replace(“Friday Sermon:”, “”, $paragraph);

$friday2 = $friday22;
$paragraph = $friday2 . ” – ” . $paragraph;
$khutbaTitle2 = $paragraph;

// Get Second Paragraph
$start = strpos($html, ‘”ArticleContent”>

‘);
$end = strpos($html, ‘

‘, $start);
$paragraph = substr($html, $start+17, $end-$start-8);
$paragraph = html_entity_decode(strip_tags($paragraph));
$khutbaSummary2 = $paragraph;
$khutbaMore2 = “http://www.alislam.org/friday-sermon/” . $friday2 . “.html”;

// For the Third previous Friday ——————————————————————————————-
$html = file_get_html(“http://www.alislam.org/friday-sermon/” . $friday3 . “.html”);

// Get Page Title
$start = strpos($html, ‘‘);<br /> $end = strpos($html, ‘‘, $start);
$paragraph = substr($html, $start, $end-$start+4);

$paragraph = html_entity_decode(strip_tags($paragraph));
$paragraph = str_replace(“Friday Sermon:”, “”, $paragraph);

$friday3 = $friday33;
$paragraph = $friday3 . ” – ” . $paragraph;
$khutbaTitle3 = $paragraph;

// Get Second Paragraph
$start = strpos($html, ‘”ArticleContent”>

‘);
$end = strpos($html, ‘

‘, $start);
$paragraph = substr($html, $start+17, $end-$start-8);
$paragraph = html_entity_decode(strip_tags($paragraph));
$khutbaSummary3 = $paragraph;
$khutbaMore3 = “http://www.alislam.org/friday-sermon/” . $friday3 . “.html”;

// For the Fourth previous Friday ——————————————————————————————-
$html = file_get_html(“http://www.alislam.org/friday-sermon/” . $friday4 . “.html”);

// Get Page Title
$start = strpos($html, ‘‘);<br /> $end = strpos($html, ‘‘, $start);
$paragraph = substr($html, $start, $end-$start+4);

$paragraph = html_entity_decode(strip_tags($paragraph));
$paragraph = str_replace(“Friday Sermon:”, “”, $paragraph);

$friday4 = $friday44;
$paragraph = $friday4 . ” – ” . $paragraph;
$khutbaTitle4 = $paragraph;

// Get Second Paragraph
$start = strpos($html, ‘”ArticleContent”>

‘);
$end = strpos($html, ‘

‘, $start);
$paragraph = substr($html, $start+17, $end-$start-8);
$paragraph = html_entity_decode(strip_tags($paragraph));
$khutbaSummary4 = $paragraph;
$khutbaMore4 = “http://www.alislam.org/friday-sermon/” . $friday4 . “.html”;

// For the Fifth previous Friday ——————————————————————————————-
$html = file_get_html(“http://www.alislam.org/friday-sermon/” . $friday5 . “.html”);

// Get Page Title
$start = strpos($html, ‘‘);<br /> $end = strpos($html, ‘‘, $start);
$paragraph = substr($html, $start, $end-$start+4);

$paragraph = html_entity_decode(strip_tags($paragraph));
$paragraph = str_replace(“Friday Sermon:”, “”, $paragraph);

$friday5 = $friday55;
$paragraph = $friday5 . ” – ” . $paragraph;
$khutbaTitle5 = $paragraph;

// Get Second Paragraph
$start = strpos($html, ‘”ArticleContent”>

‘);
$end = strpos($html, ‘

‘, $start);
$paragraph = substr($html, $start+17, $end-$start-8);
$paragraph = html_entity_decode(strip_tags($paragraph));
$khutbaSummary5 = $paragraph;
$khutbaMore5 = “http://www.alislam.org/friday-sermon/” . $friday5 . “.html”;
?>


1 Response to Friday Sermons (original)

  1. Asalamoalaikumwarahmatullah
    May allah bless you,you are working very hard
    I have a request please down load your namaz presentation was very helpful and other presentation did you make Jazakallah

Leave a Reply

Your email address will not be published. Required fields are marked *