function scrape_pby_page($pby_id, $page)
{
    global $debug;
    if ($debug) {
        print "Pby:" . $pby_id . " Page:" . $page . "\n";
    }
    $nextref = "";
    $dom = getpbypage($pby_id, $page);
    $next = $dom->find("a[class='next']", 0);
    //print "Next:" . $next . "/" . sizeof($next) ."\n";
    // list of churches on this page.
    foreach ($dom->find('li[class^=result]') as $data) {
        getchurch($data, $pby_id);
    }
    $page++;
    return $next;
}
예제 #2
0
     if (isset($_GET['UN'])) {
         $username = $_GET['UN'];
     }
     $date = date('Y-m-d');
     $memberID = $_GET['senderid'];
 }
 //daily_guide_lessons_comment_id - {bigint(20)} member_id -
 //{bigint(20)} daily_guide_lesson_id - {int(11)}
 //	comment - {text} date_added - {datetime}
 $date = date('Y-m-d h:i:s');
 $query = "INSERT into `daily_guide_lessons_comments`(\n\t`comment` ,\n\t`date_added` ,\n\t`member_id` ,\n\t`daily_guide_lesson_id` ) VALUES (\n\t'{$data}', NOW( ) , '{$memberID}', '{$cid}'\n\t);";
 $results = mysql_query($query) or die(mysql_error());
 if ($results) {
     $devotionDetails = array();
     $devotionDetails = getDevotionDetails($cid);
     $churchID = getchurch($cid);
     $deviceIDs = getReceiversDeviceIDs($churchID, $memberID);
     $message = array();
     $val = array();
     $i = 0;
     $val[$i] = $deviceIDs;
     $message = array();
     $message['data-head'] = $devotionID;
     $message['alert'] = $username . " commented on a devotion ";
     $message['other-param'] = $username;
     echo $message['devotion_details'] = $devotionDetails;
     $message = json_encode($message);
     $gcm = new GCMmanager();
     $type = "Devotion Comment";
     $gcm->sendPush($deviceIDs, $message, $type);
     //echo alertForDevotionComment($cid,$devotionDetails,$churchID,$memberID,$username);