Facebook to email

Facebook to email Commit Details

Date:2014-06-12 21:20:03 (5 years 3 months ago)
Author:Grégory Soutadé
Branch:master
Commit:f61cc3d36857c5258922bc2ba27388094ca8cf7e
Parents: b53d49e71542f0b3777d0abe364e9b879d0819b0
Message:Add function to test only one fb_object

Changes:
Mindex.php (3 diffs)
Mressources/f2email.js (1 diff)
Mrun.php (4 diffs)

File differences

index.php
6666
6767
6868
69
69
70
71
72
73
74
7075
7176
77
7278
7379
7480
......
215221
216222
217223
218
224
219225
220226
221227
......
304310
305311
306312
307
313
308314
309315
310
316
311317
312
318
313319
314
315
320
316321
317322
318323
echo '<input id="local_pref_' . $likes[$i]["id"] . '" type="text" value="'. $found->getLocalPref($likes[$i]["id"]) . '"/>';
echo '<input type="button" value="Set preference" onclick="set_local_pref('. $likes[$i]["id"] . ');"/>';
if ($remove_button)
echo '<form action="/f2email/" method="post"><input type="hidden" name="remove_custom" value="'. $likes[$i]["id"] . ' "/><input type="submit" value="Remove" onclick="return confirm(\'Do you really want to remove this item ?\')"/></form>';
echo '<form class="remove" action="/f2email/" method="post"><input type="hidden" name="remove_custom" value="'. $likes[$i]["id"] . ' "/><input type="submit" value="Remove" onclick="return confirm(\'Do you really want to remove this item ?\')"/></form>';
echo '<input type="button" onclick="test_configuration(' . $likes[$i]["id"] . ' );" value="Test"/><a href="#" class="bulle">[?]
<span>
Test the configuration with last feed
</span>
</a>';
echo '</div></div>';
if ((($i+1) % 3) == 0)
echo "<br/>";
}
else if (array_key_exists("test_configuration", $_POST))
{
echo run($user_profile['id']);
echo run($user_profile['id'], $db->escape($_POST['fb_object_id']));
return;
}
else
echo "</div>";
echo '<form style="display:inline;"><input id="global_pref_' . $p->getID() . '" value="' . $p->getGlobalPref() . '"></form>';
echo '<input type="button" onclick="set_global_pref('.$p->getID().');" value="Set global preference"/>';
echo "<br/>";
echo "<br/><br/>";
}
echo "<br/><br/>";
echo '<input type="button" onclick="test_configuration();" value="Test configuration"/><a href="#" class="bulle">[?]
echo '<input type="button" onclick="test_configuration(0);" value="Test configuration"/><a href="#" class="bulle">[?]
<span>
Test selected modules with last feed
Test selected modules of all objects with last feed
</span>
</a>'
</a>';
?>
<h2>You</h2>
<a class="title_link" href="https://www.facebook.com/<?php echo $user ?>"><img src="https://graph.facebook.com/<?php echo $user; ?>/picture"></a>
ressources/f2email.js
7373
7474
7575
76
76
7777
78
78
7979
8080
8181
local_prefs[key] = pref.value;
}
function test_configuration()
function test_configuration(fb_object_id)
{
send_request("test_configuration=1");
send_request("test_configuration=1&fb_object_id=" + fb_object_id);
}
// http://www.4guysfromrolla.com/articles/121708-1.aspx
run.php
6363
6464
6565
66
66
6767
6868
6969
......
8282
8383
8484
85
86
8587
8688
8789
......
103105
104106
105107
108
109
110
106111
107112
108113
......
141146
142147
143148
149
150
144151
145152
146153
return $plugins;
}
function run($user_id = 0)
function run($user_id = 0, $target_object_id = 0)
{
global $DATABASE_ADDRESS, $DATABASE_USER, $DATABASE_PASSWORD, $DATABASE_DATABASE;
global $APP_ID, $SECRET, $WEBSITE_URL, $FROM_ADDRESS;
{
if ($user['token_expired']) continue;
if ($user_id != 0 && $user_id != $user['id']) continue;
$facebook = new Facebook(array(
'appId' => $APP_ID,
'secret' => $SECRET
$assoc = $db->get_module_per_fb_id($user_profile);
foreach($assoc as $fb_object_id => $module_id)
{
if ($target_object_id != 0 && $target_object_id != $fb_object_id)
continue;
// Look for corresponding plugin
$plugin = null;
for($a=0; $a<count($plugins); $a++)
/* $ret .= "Use plugin " . $plugin->getName() . " for ID " . $fb_object_id . "\n" . print_r($feed["feed"]["data"][0], true); */
$plugin->manageNotification($fb_object, $feeds[0]);
}
if ($target_object_id != 0)
break;
continue;
}

Archive Download the corresponding diff file

Branches