本文整理匯總了PHP中FabrikHelperHTML::facebookGraphAPI方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::facebookGraphAPI方法的具體用法?PHP FabrikHelperHTML::facebookGraphAPI怎麽用?PHP FabrikHelperHTML::facebookGraphAPI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::facebookGraphAPI方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
/**
* Draws the form element
*
* @param array $data to pre-populate element with
* @param int $repeatCounter repeat group counter
*
* @return string returns element html
*/
public function render($data, $repeatCounter = 0)
{
$params = $this->getParams();
$displayData = new stdClass();
$displayData->num = $params->get('fbcomment_number_of_comments', 10);
$displayData->width = $params->get('fbcomment_width', 300);
$displayData->colour = $params->get('fb_comment_scheme') == '' ? '' : ' colorscheme="dark" ';
$displayData->href = $params->get('fbcomment_href', '');
if (empty($data->href)) {
$rowId = $this->app->input->getString('rowid', '', 'string');
if ($rowId != '') {
$formModel = $this->getFormModel();
$formId = $formModel->getId();
$href = 'index.php?option=com_fabrik&view=form&formid=' . $formId . '&rowid=' . $rowId;
$href = JRoute::_($href);
$displayData->href = COM_FABRIK_LIVESITE_ROOT . $href;
}
}
if (!empty($displayData->href)) {
$w = new FabrikWorker();
$displayData->href = $w->parseMessageForPlaceHolder($data->href, $data);
$locale = $params->get('fbcomment_locale', 'en_US');
if (empty($locale)) {
$locale = 'en_US';
}
$displayData->graphApi = FabrikHelperHTML::facebookGraphAPI($params->get('opengraph_applicationid'), $locale);
}
$layout = $this->getLayout('form');
return $layout->render($displayData);
}
示例2: render
/**
* draws the form element
* @param array data to pre-populate element with
* @param int repeat group counter
* @return string returns element html
*/
function render($data, $repeatCounter = 0)
{
$params =& $this->getParams();
$str = FabrikHelperHTML::facebookGraphAPI($params->get('fbcomment_opengraph_applicationid'), $params->get('fbcomment_locale', 'en_US'));
$href = $params->get('fbcomment_href');
$width = $params->get('fbcomment_width', 300);
$num = $params->get('fbcomment_number_of_comments', 10);
$str .= '<div id="fb-root"><fb:comments href="' . $href . '" nmigrated="1" um_posts="' . $num . '" width="' . $width . '"></fb:comments>';
return $str;
}
示例3: render
/**
* draws the form element
* @param array data to pre-populate element with
* @param int repeat group counter
* @return string returns element html
*/
function render($data, $repeatCounter = 0)
{
$params =& $this->getParams();
$str = FabrikHelperHTML::facebookGraphAPI($params->get('opengraph_applicationid'));
//$id = $params->get('fbcomment_uniqueid');
$href = $params->get('fbcomment_href');
$width = $params->get('fbcomment_width', 300);
$num = $params->get('fbcomment_number_of_comments', 10);
$colour = $params->get('fb_comment_scheme') == '' ? '' : ' colorscheme="dark" ';
//$str .= "<fb:comments xid=\"$id\" numposts=\"$num\" width=\"$width\" />";
$str .= '<div id="fb-root"><fb:comments href="' . $href . '" nmigrated="1" um_posts="' . $num . '" width="' . $width . '"' . $colour . '></fb:comments>';
return $str;
}
示例4: render
/**
* draws the form element
* @param array data to pre-populate element with
* @param int repeat group counter
* @return string returns element html
*/
function render($data, $repeatCounter = 0)
{
$params =& $this->getParams();
$str = FabrikHelperHTML::facebookGraphAPI($params->get('opengraph_applicationid'), $params->get('fbrecommendations_locale', 'en_US'));
$domain = $params->get('fbrecommendations_domain');
$width = $params->get('fbrecommendations_width', 300);
$height = $params->get('fbrecommendations_height', 300);
$header = $params->get('fbrecommendations_header', 1) == 1 ? 'true' : 'false';
$border = $params->get('fbrecommendations_border', '');
$font = $params->get('fbrecommendations_font', 'arial');
$colorscheme = $params->get('fbrecommendations_colorscheme', 'light');
$str .= "<fb:recommendations site=\"{$domain}\" width=\"{$width}\" height=\"{$height}\" header=\"{$header}\" colorscheme=\"{$colorscheme}\" font=\"{$font}\" border_color=\"{$border}\" />";
return $str;
}
示例5: render
/**
* draws the form element
* @param array data to pre-populate element with
* @param int repeat group counter
* @return string returns element html
*/
function render($data, $repeatCounter = 0)
{
$params = $this->getParams();
$str = FabrikHelperHTML::facebookGraphAPI( $params->get('opengraph_applicationid'));
$domain = $params->get('fbactivityfeed_domain');
$width = $params->get('fbactivityfeed_width', 300);
$height = $params->get('fbactivityfeed_height', 300);
$header = $params->get('fbactivityfeed_header', 1) ? 'true' : 'false';
$border = $params->get('fbactivityfeed_border', '');
$font = $params->get('fbactivityfeed_font', 'arial');
$colorscheme = $params->get('fbactivityfeed_colorscheme', 'light');
$str .= "<fb:activity site=\"$domain\" width=\"$width\" height=\"$height\" header=\"$header\" colorscheme=\"$colorscheme\" font=\"$font\" border_color=\"$border\" />";
return $str;
}
示例6: render
/**
* draws the form element
* @param array data to pre-populate element with
* @param int repeat group counter
* @return string returns element html
*/
function render($data, $repeatCounter = 0)
{
$params =& $this->getParams();
$str = FabrikHelperHTML::facebookGraphAPI($params->get('opengraph_applicationid'), $params->get('fblikebox_locale', 'en_US'));
$pageid = $params->get('fblikebox_pageid', '');
$stream = $params->get('fblikebox_stream', 1) == 1 ? 'true' : 'false';
$width = $params->get('fblikebox_width', 300);
$header = $params->get('fblikebox_header', 1) == 1 ? 'true' : 'false';
$connections = $params->get('fblikebox_connections', 10);
$str .= "<fb:like-box href=\"{$pageid}\" width=\"{$width}\" connections=\"{$connections}\" stream=\"{$stream}\" header=\"{$header}\" />";
//<fb:like-box href="https://www.facebook.com/badmintonrochelais" width="292" show_faces="true" stream="true" header="true"></fb:like-box>
//$str .= "<fb:like-box id=\"185550966885\" width=\"292\" height=\"440\" connections=\"4\" stream=\"true\" header=\"true\" />";
return $str;
}
示例7: render
/**
* Draws the html form element
*
* @param array $data to preopulate element with
* @param int $repeatCounter repeat group counter
*
* @return string elements html
*/
public function render($data, $repeatCounter = 0)
{
$params = $this->getParams();
$str = FabrikHelperHTML::facebookGraphAPI($params->get('opengraph_applicationid'));
$pageid = $params->get('fblikebox_pageid', 0);
$stream = $params->get('fblikebox_stream', 1) == 1 ? 'true' : 'false';
$width = $params->get('fblikebox_width', 300);
$height = $params->get('fblikebox_height', 300);
$header = $params->get('fblikebox_header', 1) == 1 ? 'true' : 'false';
$connections = $params->get('fblikebox_connections', 10);
// $str .= "<fb:like-box id=\"$pageid\" width=\"$width\" height=\"$height\" connections=\"$connections\" stream=\"$stream\" header=\"$header\" />";
$str .= '<fb:like-box id="185550966885" width="292" height="440" connections="4" stream="true" header="true" />';
return $str;
}
示例8: render
/**
* Draws the html form element
*
* @param array $data to preopulate element with
* @param int $repeatCounter repeat group counter
*
* @return string elements html
*/
public function render($data, $repeatCounter = 0)
{
$params = $this->getParams();
$str = FabrikHelperHTML::facebookGraphAPI($params->get('opengraph_applicationid'));
$domain = $params->get('fbrecommendations_domain');
$width = $params->get('fbrecommendations_width', 300);
$height = $params->get('fbrecommendations_height', 300);
$header = $params->get('fbrecommendations_header', 1) == 1 ? 'true' : 'false';
$border = $params->get('fbrecommendations_border', '');
$font = $params->get('fbrecommendations_font', 'arial');
$colorscheme = $params->get('fbrecommendations_colorscheme', 'light');
$str .= '<fb:recommendations site="' . $domain . '" width="' . $width . '" height="' . $height . '" header="' . $header . '" colorscheme="' . $colorscheme . '" font="' . $font . '" border_color="' . $border . '" />';
return $str;
}
示例9: render
/**
* draws the form element
* @param array data to pre-populate element with
* @param int repeat group counter
* @return string returns element html
*/
function render($data, $repeatCounter = 0)
{
$params =& $this->getParams();
$meta = array();
$formModel = $this->getForm();
$config = JFactory::getConfig();
$ex = $_SERVER['SERVER_PORT'] == 80 ? 'http://' : 'https://';
$map = array('og:title' => 'fblike_title', 'og:type' => 'fblike_type', 'og:image' => 'fblike_image', 'og:description' => 'fblike_description', 'og:street-address' => 'fblike_street_address', 'og:locality' => 'fblike_locality', 'og:region' => 'fblike_region', 'og:postal-code' => 'fblike_postal_code', 'og:country-name' => 'fblike_country', 'og:email' => 'fblike_email', 'og:phone_number' => 'fblike_phone_number', 'og:fax_number' => 'fblike_fax_number');
foreach ($map as $k => $v) {
$elid = $params->get($v);
if ($elid != '') {
$el = $formModel->getElement($elid, true);
if (is_object($el)) {
$name = $el->getFullName(false, true, false);
$v = JArrayHelper::getValue($data, $name);
if ($k == 'og:image') {
$v = $ex . $_SERVER['SERVER_NAME'] . $v;
}
if ($v !== '') {
$meta[$k] = $v;
}
}
}
}
$locEl = $formModel->getElement($params->get('fblike_location'), true);
if ($locEl != '') {
$loc = JArrayHelper::getValue($data, $locEl->getFullName(false, true, false));
$loc = array_shift(explode(':', $loc));
$loc = explode(",", $loc);
if (count($loc) == 2) {
$meta['og:latitude'] = $loc[0];
$meta['og:longitude'] = $loc[1];
}
}
$meta['og:url'] = $ex . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$meta['og:site_name'] = $config->getValue('sitename');
$meta['fb:app_id'] = $params->get('fblike_opengraph_applicationid');
$str = FabrikHelperHTML::facebookGraphAPI($params->get('fblike_opengraph_applicationid'), $params->get('fblike_locale', 'en_US'), $meta);
$url = $params->get('fblike_url');
//$$$tom placeholder option for URL params
$w = new FabrikWorker();
$url = $w->parseMessageForPlaceHolder($url, $data);
return $str . $this->_render($url);
}