示例#1
0
function create_feed_story($user, $picked, $method = 'feedStory')
{
    $moods = get_moods();
    $content = '<style>.box2 {
  padding: 10px;
  width : 100px;
  float : left;
  text-align: center;
  border: black 1px;
  margin-right: 10px;
  margin-left: 10px;
  cursor: pointer;
  border: black solid 2px;
  background: orange;
  margin-left: 32px;
  margin-top: 30px;
}
h2 {
text-align: center;
font-size: 11px;
color:#3B5998;

}

.box2 .smiley {
  font-size: 35pt;
  font-weight: bold;
  padding: 20px;
}
</style>
<div class="box2"><div class="smiley">' . $moods[$picked][1] . '</div><div >
<fb:intl desc="Mood name for \'' . $moods[$picked][1] . '\'">' . $moods[$picked][0] . '</fb:intl></div></div>';
    $image = IMAGE_LOCATION . '/smile' . $picked . '.jpg';
    $images = array(array('src' => $image, 'href' => $image));
    $feed = array('template_id' => 14040772983, 'template_data' => array('mood' => $moods[$picked][1], 'images' => $images));
    $data = array('method' => $method, 'content' => array('feed' => $feed));
    return json_encode($data);
}
示例#2
0
<?php

/*
 * newsmiley.php - Create a new feed story
 *
 */
include_once 'constants.php';
include_once LIB_PATH . 'moods.php';
include_once LIB_PATH . 'display.php';
echo render_header('New');
$moods = get_moods();
echo '<h2>' . 'What\'s your mood today?' . '</h2>';
$fb = get_fb();
$set_count = $fb->api_client->data_getUserPreference(2);
if ($set_count > 0) {
    echo "<h3>You've set your mood {$set_count} time" . ($set_count > 1 ? 's' : '') . " in the past.</h3>";
}
$feed_handler = ROOT_LOCATION . '/handlers/feedHandler.php';
echo '<form fbtype="feedStory" action="' . $feed_handler . '">';
$js = 'final(' . FEED_STORY_1 . ',\'' . IMAGE_LOCATION . '\', \'http://apps.new.facebook.com/' . APP_SUFFIX . '\', \'' . ROOT_LOCATION . '\',';
echo render_emoticon_grid(get_moods(), $js);
echo '<input type="hidden" id="picked" name="picked" value="-1">' . '<div id="emoticon"></div>' . '</form></div>';
echo render_footer();
示例#3
0
<?php

include_once 'constants.php';
include_once LIB_PATH . 'moods.php';
include_once LIB_PATH . 'display.php';
$smile = $_GET['smile'];
$moods = get_moods();
echo render_inline_style();
echo '<div class="big_box"><div class="big_smiley">' . $moods[$smile][1] . '</div><div>' . '<fb:intl desc="Mood name for \'' . $moods[$smile][1] . '\'">' . $moods[$smile][0] . '</fb:intl>' . '</div></div>';