本文整理匯總了PHP中Piwik\Common::getSocialUrls方法的典型用法代碼示例。如果您正苦於以下問題:PHP Common::getSocialUrls方法的具體用法?PHP Common::getSocialUrls怎麽用?PHP Common::getSocialUrls使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Common
的用法示例。
在下文中一共展示了Common::getSocialUrls方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getSocialsLogoFromUrl
/**
* Return social network logo path by URL
*
* @param string $domain
* @return string path
* @see plugins/Referrers/images/socials/
*/
function getSocialsLogoFromUrl($domain)
{
$social = getSocialNetworkFromDomain($domain);
$socialNetworks = Common::getSocialUrls();
$filePattern = 'plugins/Referrers/images/socials/%s.png';
foreach ($socialNetworks as $domainKey => $name) {
if ($social == $socialNetworks[$domainKey] && file_exists(PIWIK_INCLUDE_PATH . '/' . sprintf($filePattern, $domainKey))) {
return sprintf($filePattern, $domainKey);
}
}
return sprintf($filePattern, 'xx');
}
示例2: setSocialIdSubtables
/**
* Sets the subtable IDs for the DataTable returned by getSocial.
*
* The IDs are int indexes into the array in /core/DataFiles/Socials.php.
*
* @param DataTable $dataTable
*/
private function setSocialIdSubtables($dataTable)
{
if ($dataTable instanceof DataTable\Map) {
foreach ($dataTable->getDataTables() as $childTable) {
$this->setSocialIdSubtables($childTable);
}
} else {
foreach ($dataTable->getRows() as $row) {
$socialName = $row->getColumn('label');
$i = 1;
// start at one because idSubtable=0 is equivalent to idSubtable=false
foreach (Common::getSocialUrls() as $name) {
if ($name == $socialName) {
$row->c[Row::DATATABLE_ASSOCIATED] = $i;
break;
}
++$i;
}
}
}
}