function grabAnchors($hrefLinks, $main_site) { // grab the last id for this main site $query = 'SELECT max(link_id),link_id FROM scrapper WHERE main_site_id = ' . $hrefLinks['main_site_id']; $result = fetch_record($query); $id = intval($result['link_id']); // cURL the link and dump into the array the result $array = curlHREF($hrefLinks['ref_link']); sort($array); // $array is returned as sorted array. get the fist and last // index of the a-html-tag and start the loop from there // anything else can be ignored // get begin index $startpos = getStart($array); // get last index $endpos = getLast($array, $startpos); // if startpos = endpos, it would mean that the a-html-tag is not found properly // update the document and exit if ($startpos == $endpos) { updateDocument($hrefLinks); return; } // start parsing the a-html-tag for ($i = $startpos; $i <= $endpos; $i++) { // extract the href from the a-html-tag $href_a = getHREF($array[$i]); // check if link if to be excluded if (excludLink($href_a, $main_site) === false) { if (checkduplicate($href_a) === true) { $id = $id + 1; $query = "INSERT INTO scrapper (main_site_id, ref_link, link_id) VALUES ('" . $hrefLinks['main_site_id'] . "','" . $href_a . "','" . $id . "')"; // add the links run_mysql_query($query); } } } // update the document after the parsing of the a-html-tag updateDocument($hrefLinks); return; }
{ $query = "update users set points={$points} where fbid ='{$userid}'"; $result = $conn->query($query); if ($result == TRUE) { } else { echo "error" . $sql . "<br>" . $conn->error; } } //----------------------------------------------------------------------- //------1 month alone------- // steak counter $count = getCount($conn, $userid); // streak total $total = getTotal($conn, $userid); // get start date $start = getStart($conn, $userid); // date = start date $date = $start; $todayts = strtotime(date("Y-m-d")); //$tommrts = strtotime("+1 day", $todayts); // this is the formatted date for tomorrow: date("Y-m-d", $tommrts); while (true) { $datets = strtotime($date); // if date not equal tomorrow's date -- edit: todays date - day not completed if ($datets != $todayts) { // get day steps $steps = getSteps($date, $conn); if ($steps >= 7000) { // add steps to streak total $total = $total + $steps; $count++;
<?php //print 'aaa'; include_once "inc/HTMLTemplate.php"; getStart("Home"); getHeader(); //echo welcom picture echo <<<END \t<div id = "welcome"> \t\t<img src="http://www.peopleofar.com/wp-content/uploads/JNTU-EXPRESS-Welcome-738x355.jpg"/> \t</div> END; echo $footer;