$fb_page_likes_last_update = get_fb_page_likes_last_update($page_data['id_page']); $fb_page_likes_nun_dates = get_fb_page_likes_nun_dates($page_data['id_page']); if ($fb_page_likes_nun_dates > 1) { $crecimiento_fans['dia'] = getCrecimientoFacebookFansPage($page_data['id_page'], $fb_page_likes_last_update, 1); } if ($fb_page_likes_nun_dates > 7) { $crecimiento_fans['semana'] = getCrecimientoFacebookFansPage($page_data['id_page'], $fb_page_likes_last_update, 7); } if ($fb_page_likes_nun_dates > 15) { $crecimiento_fans['quincena'] = getCrecimientoFacebookFansPage($page_data['id_page'], $fb_page_likes_last_update, 15); } if ($fb_page_likes_nun_dates > 30) { $crecimiento_fans['mes'] = getCrecimientoFacebookFansPage($page_data['id_page'], $fb_page_likes_last_update, 30); } if ($fb_page_likes_nun_dates > 60) { $crecimiento_fans['dos_meses'] = getCrecimientoFacebookFansPage($page_data['id_page'], $fb_page_likes_last_update, 60); } } ?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="description" content="Analiza el crecimiento de fans, el PTA y otras estadísticas de la página de <?php echo $page_data['name']; ?> en Facebook." /> <meta name="robots" content="index,follow" /> <meta http-equiv="content-language" content="es" /> <meta http-equiv="pragma" content="nocache" /> <meta http-equiv="cache-control" content="no-cache, must-revalidate" />
$page = 1; } elseif ($_POST['page'] > ceil($page_total_count / PAGER_PP)) { $page = ceil($page_total_count / PAGER_PP); } else { $page = $_POST['page']; } } $sql = "SELECT p.id_page, username, name, picture, location, is_verified, p.likes total_likes, plf.likes local_likes, talking_about, first_local_fans_country \n\t FROM facebook_page p JOIN facebook_page_local_fans_country plf ON p.id_page = plf.id_page \n\t WHERE id_country = " . mysql_real_escape_string($id_country) . " \n\t AND plf.date = '" . $local_fans_last_date . "' \n\t AND active = 1 \n\t ORDER BY local_likes DESC, total_likes DESC, talking_about DESC \n\t LIMIT " . PAGER_PP * ($page - 1) . ", " . PAGER_PP . ";"; $res = mysql_query($sql) or die(mysql_error()); $cont = 1 + PAGER_PP * ($page - 1); while ($fila = mysql_fetch_assoc($res)) { $crecimiento_fans = array('semana' => array('value' => $n_a, 'porcentaje' => $n_a)); $fb_page_likes_last_update = get_fb_page_likes_last_update($fila['id_page']); $fb_page_likes_nun_dates = get_fb_page_likes_nun_dates($fila['id_page']); if ($fb_page_likes_nun_dates > 7) { $crecimiento_fans['semana'] = getCrecimientoFacebookFansPage($fila['id_page'], $fb_page_likes_last_update, 7); } ?> <div class="owloo_ranking_item"> <div class="owloo_rank"><?php echo str_pad($cont++, 2, '0', STR_PAD_LEFT); ?> </div> <div class="owloo_fb_username"> <div class="owloo_fb_avatar"> <a href="<?php echo URL_ROOT; ?> facebook-stats/pages/<?php echo strtolower($fila['username']); ?>
$likes_grow_7 = $aux['likes']; $talking_about_grow_7 = $aux['talking_about']; } if ($fb_page_likes_nun_dates > 15) { $likes_grow_15 = getCrecimientoFacebookFansPage($id_page, $fb_page_likes_last_update, 15); $aux = getCrecimientoFacebookFansPage($id_page, $fb_page_likes_last_update, 15); $likes_grow_15 = $aux['likes']; $talking_about_grow_15 = $aux['talking_about']; } if ($fb_page_likes_nun_dates > 30) { $aux = getCrecimientoFacebookFansPage($id_page, $fb_page_likes_last_update, 30); $likes_grow_30 = $aux['likes']; $talking_about_grow_30 = $aux['talking_about']; } if ($fb_page_likes_nun_dates > 60) { $aux = getCrecimientoFacebookFansPage($id_page, $fb_page_likes_last_update, 60); $likes_grow_60 = $aux['likes']; $talking_about_grow_60 = $aux['talking_about']; } $country_code = "NULL"; $country_name = "NULL"; $country_name_en = "NULL"; $country_ranking = "NULL"; if (!empty($pages['location'])) { $country_code = $countries[$pages['location']]['code']; $country_name = $countries[$pages['location']]['name']; $country_name_en = $countries[$pages['location']]['name_en']; if (!in_array($pages['location'], $id_country_uses)) { $id_country_uses[] = $pages['location']; } }