Permalink
Browse files

* Ad code update

* fql_query function created, much easier to implement and change globally


git-svn-id: https://burst-dev.com/svn/music/trunk@180 e45f5610-fc3d-44b0-8132-aad8e3f4226b
  • Loading branch information...
1 parent 3f09743 commit 605aba010a900af4de75f9bd21930626b0e22448 stevenlu committed Dec 20, 2010
Showing with 38 additions and 5 deletions.
  1. +6 −1 app.friends.php
  2. +1 −1 app.help.php
  3. +1 −1 inc.add.php
  4. +1 −1 inc.super-rewards.php
  5. +1 −1 include/advertisement.php
  6. +28 −0 include/functions.php
View
@@ -74,7 +74,12 @@ function render($user_friends_uploads, $user_friends_info, $rel_url)
}
//multiquerying facebook db for the appropriate dataset
-$fb_data = $facebook->api_client->fql_multiquery('{"query1":"SELECT name,page_id FROM page WHERE page_id IN (SELECT page_id FROM page_fan WHERE uid=' . $user . ') AND has_added_app", "query2":"SELECT uid,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=' . $user . ') AND is_app_user"}');
+$queries = array(
+ 'SELECT name,page_id FROM page WHERE page_id IN (SELECT page_id FROM page_fan WHERE uid=' . $user . ') AND has_added_app',
+ 'SELECT uid,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=' . $user . ') AND is_app_user'
+);
+
+$fb_data = fql_query($queries, $facebook);
/*
Since MySQL cannot take array format to search,
View
@@ -21,7 +21,7 @@
<fb:dialog-button type="button" value="Close" close_dialog=1 />
</fb:dialog>
-<?php $announcements = $facebook->api_client->fql_query("SELECT status_id,time,message FROM status WHERE uid='2436915755' ORDER BY time DESC LIMIT 10"); ?>
+<?php $announcements = fql_query("SELECT status_id,time,message FROM status WHERE uid='2436915755' ORDER BY time DESC LIMIT 10", $facebook); ?>
<fb:dialog id="ann" width="500">
<fb:dialog-title>Announcements</fb:dialog-title>
View
@@ -1,7 +1,7 @@
<?php
if (isset($_GET['fb_page_id']))
{
- $otherids = $facebook->api_client->fql_query("SELECT page_id FROM page WHERE page_id IN (SELECT page_id FROM page_admin WHERE uid=" . $_POST['fb_sig_user'] . ") AND has_added_app=1");
+ $otherids = fql_query("SELECT page_id FROM page WHERE page_id IN (SELECT page_id FROM page_admin WHERE uid=" . $_POST['fb_sig_user'] . ") AND has_added_app=1", $facebook);
$array_otherids = array();
foreach ($otherids as $page) $array_otherids[] = $page['page_id'];
}
View
@@ -2,7 +2,7 @@
//sjlu: 12-19-2010 - third party id's need to be implemented before 1-1-2011
//we are assuming that the user needs to visit this page to order slots... and that's when we'll index the third party id
-$thirdPartyId = $facebook->api_client->fql_query('SELECT third_party_id FROM user WHERE uid=' . $user . '');
+$thirdPartyId = fql_query('SELECT third_party_id FROM user WHERE uid=' . $user . '', $facebook);
//$thirdPartyId = $facebook->api(array('method' => 'fql.query', query => 'SELECT third_party_id FROM user WHERE uid=' . $user . ''));
$thirdPartyId = $thirdPartyId[0]['third_party_id'];
@@ -34,7 +34,7 @@
$timestamp = date("mdyHis");
$social_media = '<fb:iframe src="http://www.socialmedia.com/facebook/monetize.php?fmt=canvas&pubid=a0fb5ac60e4cd72075b1337eb6fb4336&bgcolor=F7F7F7&bordercolor=F7F7F7&textcolor=000&linkcolor=3B5998&e" border="0" width="645" height="60" scrolling="no" frameborder="0" />';
-$cubics = "<fb:iframe src='http://social.bidsystem.com/displayAd.aspx?pid=14311&plid=15965&adSize=728x90&channel=&appid=43221&pfid=" . $user . "' width='728' height='90' frameborder='0' border='0' scrolling='no'></fb:iframe>";
+$cubics = "<fb:iframe src='http://social.bidsystem.com/displayAd.aspx?pid=14311&appId=43221&plid=15965&adSize=728x90&channel=banner' width='728' height='90' frameborder='0' border='0' scrolling='no'></fb:iframe>";
$zohark = '<script>var zohark_api_key = "cd92203d073c3556a00ca2167c661421";var zohark_background_color = "FFFFFF";var zohark_border_color = "6D84B4";var zohark_text_color = "000000";var zohark_title_color = "0000FF";var zohark_display_url_color = "6D84B4";var zohark_button_color = "6D84B4";var zohark_button_text = "FFFFFF";var zohark_button = "6D84B4-FFFFFF";</script><fb:ref url="http://www.niagaramedia.com/facebook/fbml_ads/?ad_format=646x60" />';
$lookery = '<fb:iframe id="lookery-ad-8169" name="lookery-ad-8169" src="http://ads.lookery.com/ad/?p=7c7945c922cf4735cdf2dbfc2e374c36&z=8169&d=645x60" framespacing="no" frameborder="no" scrolling="no" width="645" height="80"></fb:iframe>';
$super_rewards = '<center><fb:iframe src="http://apps.kitnmedia.com/superrewards/banner_fbml.php?h=utxwppn" frameborder="0" width="648" height="60" scrolling="no" /></center>';
View
@@ -1,4 +1,32 @@
<?php
+// just an easier way to hnadle fql queries
+// this way we can change this up if they method
+// facebook uses changes. this will also handle
+// fql_multiquries if $query is an array()
+function fql_query($query, $facebook)
+{
+ if (is_array($query))
+ {
+ $string = '{';
+ for ($i = 0; $i < count($query); $i++)
+ {
+ $j = $i+1;
+ $string .= '"query' . $j . '":"' . $query[$i] . '",';
+ }
+
+ $string = substr($string, 0, -1);
+ $string .= '}';
+
+ return $facebook->api_client->fql_multiquery($string);
+ // $req_array = array('method' => 'fql.multiquery', 'queries' => $string);
+ }
+ else
+ {
+ return $facebook->api_client->fql_query($query);
+ // $req_array = array('method' => 'fql.query', 'query' => $query);
+ }
+}
+
function pages($fb_page_id) {
if($fb_page_id !== 0 AND $fb_page_id !== NULL) { return '&fb_page_id=' . $fb_page_id . ''; }
}

0 comments on commit 605aba0

Please sign in to comment.