本文整理汇总了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;
}
}
}
}