本文整理汇总了PHP中facebook函数的典型用法代码示例。如果您正苦于以下问题:PHP facebook函数的具体用法?PHP facebook怎么用?PHP facebook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了facebook函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: SDPanel
<?php
/**
* Main object.
* @author Kikapp
* @version 1.0
*/
$win = new SDPanel();
$win->setCaption("First Facebook Post!");
$actionBar = new ActionBar();
$actionBar->setClass("applicationBars");
$mainTable = new Table();
$input = new InputText();
//create input
$input->setLabelCaption("Write your thoughts");
$button = new Button();
$button->setCaption("Post on Facebook");
$button->onTap(facebook());
$button->setClass("button.blue");
$mainTable->addControl($input, 1, 1, 1, 1, "Center", "Middle");
$mainTable->addControl($button, 2, 1, 1, 1, "Center", "Middle");
$win->addControl($mainTable);
function facebook()
{
Facebook::PostToWall("First post", "Caption", $input, "http://www.kikapptools.com", "");
}
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:26,代码来源:FB.php
示例2: blog_title
echo $bodyclass;
?>
" itemscope="itemscope" itemtype="http://schema.org/Blog">
<div class="hide">
<meta content="<?php
echo blog_title();
?>
" itemprop="name"/>
<meta content="<?php
echo blog_description();
?>
" itemprop="description"/>
</div>
<?php
if (facebook()) {
echo facebook();
}
if (login()) {
toolbar();
}
?>
<!-- ******HEADER****** -->
<header class="header">
<div class="container">
<div class="logo pull-left"><img class="logo-image" src="<?php
echo site_url();
?>
themes/blog/images/logo.png"/></div>
<div class="branding pull-left">
<?php
if (is_index()) {
开发者ID:austinvernsonger,项目名称:htmly,代码行数:31,代码来源:layout.html.php
示例3: elseif
echo $p->authorUrl;
?>
"><?php
echo $p->author;
?>
</a></span>
<?php
if (disqus_count()) {
?>
-
<span><a href="<?php
echo $p->url;
?>
#disqus_thread">Comments</a></span>
<?php
} elseif (facebook()) {
?>
-
<a href="<?php
echo $p->url;
?>
#comments"><span><fb:comments-count href=<?php
echo $p->url;
?>
></fb:comments-count> Comments</span></a>
<?php
}
?>
</div>
<?php
if (!empty($p->image)) {
开发者ID:austinvernsonger,项目名称:htmly,代码行数:31,代码来源:main.html.php
示例4: get_related
<a class="googleplus" target="_blank"
href="https://plus.google.com/share?url=<?php
echo $p->url;
?>
">Google+</a>
</div>
</div>
<div class="related">
<h4>Related posts</h4>
<?php
echo get_related($p->tag);
?>
</div>
<div id="comments" class="comments border">
<?php
if (facebook()) {
?>
<div class="fb-comments" data-href="<?php
echo $p->url;
?>
" data-numposts="<?php
echo config('fb.num');
?>
" data-colorscheme="<?php
echo config('fb.color');
?>
"></div>
<?php
}
?>
<?php
开发者ID:andreaspada,项目名称:htmly,代码行数:31,代码来源:post.html.php
示例5: die
<?php
if (!path('root')) {
die('Restrict');
}
$GLOBALS['SK']['FACEBOOK']['FACEBOOK'] = null;
switch (env()) {
case 'development':
$GLOBALS['SK']['FACEBOOK']['APP_ID'] = '';
$GLOBALS['SK']['FACEBOOK']['APP_SECRET'] = '';
break;
case 'test':
$GLOBALS['SK']['FACEBOOK']['APP_ID'] = '';
$GLOBALS['SK']['FACEBOOK']['APP_SECRET'] = '';
break;
case 'production':
default:
$GLOBALS['SK']['FACEBOOK']['APP_ID'] = '';
$GLOBALS['SK']['FACEBOOK']['APP_SECRET'] = '';
break;
}
if (strlen(trim(facebook('APP_ID'))) > 0 and strlen(trim(facebook('APP_SECRET'))) > 0) {
$GLOBALS['SK']['FACEBOOK']['FACEBOOK'] = new Facebook(array('appId' => facebook('APP_ID'), 'secret' => facebook('APP_SECRET'), 'cookie' => true, 'fileUpload' => true));
}
开发者ID:orguin,项目名称:slimkeleton,代码行数:24,代码来源:007_facebook.conf.php
示例6: Label
$lbl_home = new Label();
$lbl_home->setClass("label.MenuOption");
$lbl_home->setCaption("Home");
$table_home->onTap(home());
$table_home->addControl($img_home, 1, 1, 1, 1, "Center", "Middle");
$table_home->addControl($lbl_home, 1, 2, 1, 1, "Left", "Middle");
$table_facebook = new Table();
$table_facebook->setClass("tableMenuOption");
$table_facebook->setColumnsStyle("20%;80%");
$img_facebook = new Image();
$img_facebook->setImage("img/Android/hdpi/ic_facebook.png");
$img_facebook->setClass("image.menu");
$lbl_facebook = new Label();
$lbl_facebook->setClass("label.MenuOption");
$lbl_facebook->setCaption("Facebook");
$table_facebook->onTap(facebook());
$table_facebook->addControl($img_facebook, 1, 1, 1, 1, "Center", "Middle");
$table_facebook->addControl($lbl_facebook, 1, 2, 1, 1, "Left", "Middle");
$table_twitter = new Table();
$table_twitter->setClass("table.MenuOption");
$table_twitter->setColumnsStyle("20%;80%");
$img_twitter = new Image();
$img_twitter->setImage("img/Android/hdpi/ic_twitter.png");
$img_twitter->setClass("image.menu");
$lbl_twitter = new Label();
$lbl_twitter->setClass("label.MenuOption");
$lbl_twitter->setCaption("Twitter");
$table_twitter->onTap(twitte());
$table_twitter->addControl($img_twitter, 1, 1, 1, 1, "Center", "Middle");
$table_twitter->addControl($lbl_twitter, 1, 2, 1, 1, "Left", "Middle");
$table_map = new Table();
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:31,代码来源:main.php
示例7: session_start
<?php
require_once '../bootstrap.php';
// This API requires a session this its not necessary using a framework
session_start();
// Check the bootstrap to see how this function works
$facebook_login_url = facebook()->getLoginUrl();
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Dnetix\Social\FacebookHandler</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<h1>Facebook Connection Plugin</h1>
<div class="container">
<div class="well">Note that this example will not work unless this script its executed in a public server that facebook can redirect to, and you provide true facebook application data.</div>
<p>This will send the user to the facebook platform and then will be redirected to the entry_point defined by the login_callback_url</p>
<a href="<?php
echo $facebook_login_url;
?>
">Accede con Facebook</a>
</div>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
开发者ID:dnetix,项目名称:utils,代码行数:31,代码来源:index.php
示例8: facebook
<?php
require_once '../bootstrap.php';
$fb = facebook();
$graphUser = $fb->getMe();
// Analize the attributes of the graphUser to obtain more information
if ($graphUser) {
// First check if already created the user in the database with the external ID
$externalId = $graphUser->getId();
$name = $graphUser->getName();
// If it hasnt been created or in the database, obtain the values from the graphUser
$email = $graphUser->getEmail();
// Obtain the accessToken that will last 2 months
$accessToken = $fb->getLongLivedAccessToken();
// The accessToken provided will expire in two months, take that in account
$expiresOn = date('Y-m-j H:i:s', strtotime('+2 month'));
$profileImageUrl = $graphUser->getPicture()->getUrl();
print_r($name);
print_r($email);
print_r($accessToken);
print_r($expiresOn);
echo '<img src="' . $profileImageUrl . '" alt="' . $name . '" />';
} else {
// A user has not been obtained so... handle that
}
// Now to use it later, check the API of the Facebook/Facebook class but initialize with the accessToken Provided
开发者ID:dnetix,项目名称:utils,代码行数:26,代码来源:entry_point.php
示例9: SDPanel
$win = new SDPanel();
//$win -> setCaption("Detail of product");
$id = new InputNumeric();
$productUrl = new InputText();
Data::getParm($id, $title, $desc, $price, $stock, $productUrl);
$table = new Table();
$table->setClass("tableGray");
//Action Bar and Action Group.
$apb1 = new ActionBar();
$acg1 = new ActionGroup();
$acg1->setCaption("");
$acg1->setImage("img/ic_share.png");
$btn_facebook = new ButtonBar();
$btn_facebook->setCaption("Facebook");
$btn_facebook->setImage("img/ic_facebook.png");
$btn_facebook->onTap(facebook());
$btn_tw = new ButtonBar();
$btn_tw->setCaption("Twitter");
$btn_tw->setImage("img/ic_tw.png");
$btn_tw->onTap(twitter());
$btn_sms = new ButtonBar();
$btn_sms->setCaption("SMS");
$btn_sms->setImage("img/ic_sms.png");
$btn_sms->onTap(sms());
$btn_email = new ButtonBar();
$btn_email->setCaption("EMail");
$btn_email->setImage("img/ic_email.png");
$btn_email->onTap(email());
$acg1->addControl($btn_facebook);
$acg1->addControl($btn_tw);
$acg1->addControl($btn_sms);
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:31,代码来源:ProductDetail.php
示例10: login
function login($lang)
{
$with_name = true;
$with_captcha = true;
$with_facebook = false;
$with_newuser = true;
$with_newpassword = true;
if ($with_facebook) {
require_once 'facebook.php';
$facebook = facebook();
}
$login = $password = $code = $token = false;
if (isset($_SESSION['login'])) {
$login = $_SESSION['login'];
}
$action = 'init';
if (isset($_POST['login_enter'])) {
$action = 'enter';
}
switch ($action) {
case 'init':
if ($with_facebook) {
$facebook_user = $facebook->getUser();
if ($facebook_user) {
try {
$facebook_user_profile = $facebook->api('/me', 'GET');
if (!empty($facebook_user_profile['email'])) {
$login = $facebook_user_profile['email'];
}
$action = 'facebook';
} catch (FacebookApiException $e) {
}
$facebook->destroySession();
}
}
break;
case 'enter':
if (isset($_POST['login_login'])) {
$login = strtolower(strflat(readarg($_POST['login_login'])));
}
if (isset($_POST['login_password'])) {
$password = readarg($_POST['login_password']);
}
if (isset($_POST['login_code'])) {
$code = readarg($_POST['login_code']);
}
if (isset($_POST['login_token'])) {
$token = readarg($_POST['login_token']);
}
break;
default:
break;
}
$missing_code = false;
$bad_code = false;
$bad_token = false;
$missing_login = false;
$bad_login = false;
$missing_password = false;
$access_denied = false;
switch ($action) {
case 'enter':
if (!isset($_SESSION['login_token']) or $token != $_SESSION['login_token']) {
$bad_token = true;
break;
}
if ($with_captcha) {
if (!$code) {
$missing_code = true;
break;
}
$captcha = isset($_SESSION['captcha']['login']) ? $_SESSION['captcha']['login'] : false;
if (!$captcha or $captcha != strtoupper($code)) {
$bad_code = true;
break;
}
}
if (!$password) {
$missing_password = true;
}
/* fall thru */
/* fall thru */
case 'facebook':
if (!$login) {
$missing_login = true;
} else {
if (!(validate_user_name($login) or validate_mail($login))) {
$bad_login = true;
}
}
break;
default:
break;
}
switch ($action) {
case 'enter':
case 'facebook':
if ($bad_token or $missing_code or $bad_code or $missing_login or $bad_login or $missing_password) {
break;
}
//.........这里部分代码省略.........
开发者ID:RazorMarx,项目名称:izend,代码行数:101,代码来源:login.php
示例11: header
?>
<div class='col-sm-12'>
<div class='alert alert-danger' role='alert'><?php
echo $m['social_error'];
?>
</div>
</div>
<?php
}
} else {
header('Location: ' . $script_path . 'login.php');
}
}
// Check if it is a callback from Facebook
if ($_GET['return'] == "facebook" && getSetting("enable_facebook", "text") == "true") {
$facebook = facebook();
// Initialize Facebook
$sid = mysqli_real_escape_string($con, $facebook->getUser());
$logged_in = false;
if ($sid) {
try {
$me = $facebook->api('/me');
if ($me) {
// Check if login is successful
$logged_in = true;
}
} catch (FacebookApiException $e) {
$logged_in = false;
}
}
if ($logged_in) {
开发者ID:pikepa,项目名称:fitfasnfab,代码行数:31,代码来源:social.php
示例12: process_domain
function process_domain($d)
{
global $stats;
global $inputdir;
global $triggers;
global $domains;
global $messages;
global $nresources;
// echo("$d\n");
$stats['n_domains']++;
$c = file_get_contents($inputdir . $d);
$lines = explode("\n", $c);
foreach ($lines as $i => $line) {
if (substr($line, 0, 1) != '{') {
$lines[$i] = '';
}
}
$c = implode("\n", $lines);
$c = "[" . $c . "]";
$c = str_replace("\n", "", $c);
$c = str_replace(",]", "]", $c);
$c = str_replace("Syntax error: parse error", "", $c);
$c = str_replace("\n", "", $c);
$resources = array_unique(json_decode($c, 1), SORT_REGULAR);
$n = count($resources);
if ($n == 0) {
echo "{$d} has errors\n";
$stats['n_domains_with_errors']++;
return;
}
@$nresources[$n / 10]++;
if ($n > 500) {
$messages[] = "{$d} has {$n} resources";
}
// and then update the statistics
$has_js = false;
$has_external_js = false;
$has_flash = false;
$has_external_flash = false;
$has_external_content = false;
$has_google = false;
$has_facebook = false;
$has_yahoo = false;
$has_twitter = false;
$has_ads = false;
$triggered = [];
foreach ($triggers as $trigger) {
$triggered[$trigger] = false;
}
foreach ($resources as $res) {
$url = $res['url'];
$type = $res['content-type'];
if (isflash($type, $url)) {
$has_flash = true;
$is_flash = true;
} else {
$is_flash = false;
}
if (isjs($type, $url)) {
$has_js = true;
$is_js = true;
} else {
$is_js = false;
}
if (!$has_ads) {
if (ads($url)) {
echo "{$d} contains ads from {$url}\n";
$has_ads = true;
}
}
foreach ($triggers as $trigger) {
if (contains($url, $trigger)) {
$triggered[$trigger] = $url;
}
}
if (contains($url, 'jquery')) {
$has_jquery = true;
}
if (facebook($url)) {
$has_facebook = true;
}
if (google($url)) {
$has_google = true;
}
if (yahoo($url)) {
$has_yahoo = true;
}
if (twitter($url)) {
$has_twitter = true;
}
if (!same_domain($d, $url)) {
if ($is_js) {
$has_external_js = true;
}
if ($is_flash) {
$has_external_flash = true;
}
$has_external_content = true;
}
}
//.........这里部分代码省略.........
开发者ID:jacquesmattheij,项目名称:remoteresources,代码行数:101,代码来源:process.php
示例13: echo
if($uid !== "error" && $uid !== "invalid") {
$q = "SELECT identifier FROM userz WHERE uid='$uid'";
$query = $db->query($q);
$fetch = $query->fetch();
echo ($fetch !== FALSE) ? current($fetch) : "error";
} else {
echo "invalid";
}
}
// Main auth control logic
if($_GET['a'] == "login") {
switch($_GET['m']) {
case "facebook":
facebook();
break;
case "twitter":
twitter();
break;
case "google":
google();
break;
case "windows":
break;
}
} else if($_GET['a'] == "logout") {
logout();
开发者ID:nham,项目名称:pungent,代码行数:31,代码来源:index.php
注:本文中的facebook函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论