function buildValidateLink($link, $level)
    {
        if (substr($link->url, 0, 4) != 'http' || !$link->validate) {
            return;
        }
        $validationIconSrc = 'validate.php?id=' . $link->id . '&uniq=' . SB_StopWatch::getMicroTime();
        if (strlen($link->favicon) && $this->deleteInvalidFavicons && !$this->fc->isFaviconCached($link->favicon)) {
            $this->tree->updateLink($link->id, array('favicon' => ''), false);
        }
        if ($this->discoverMissingFavicons) {
            $validationIconSrc .= '&get_favicon=1';
        }
        $url = SB_Page::quoteValue($link->url);
        $name = SB_Page::quoteValue($link->name);
        $this->linkCount++;
        $this->fields['-raw' . $this->counter++ . '-'] = <<<__LINK
<div class="link">
    <img class="favicon" height=16 width=16 src="{$validationIconSrc}" alt="">
    <a href="{$url}">{$name}</a>
</div>
__LINK;
    }
Exemple #2
0
 function _buildFavicon($lid, $favicon)
 {
     $wrong = SB_Skin::imgsrc('link_wrong_favicon');
     $txt = '';
     $binary = substr($favicon, 0, 7) == 'binary:';
     if ($this->um->getParam('config', 'use_favicon_cache')) {
         $link = $this->tree->getLink($lid);
         if ($link->favicon) {
             $cached = 'favicon.php?';
             if ($binary) {
                 $cached .= $favicon;
             } else {
                 $cached .= md5($favicon) . '=' . $lid . '&amp;refresh=' . SB_StopWatch::getMicroTime();
             }
             $txt .= SB_T('Cached: ') . '<img class="favicon" alt="" height=16 width=16 src="' . $cached . '" onerror="this.src=\'' . $wrong . '\'">';
             $txt .= '&nbsp;';
         }
     }
     if (!$binary) {
         $txt .= SB_T("Original: ") . '<img alt="" src="' . $favicon . '" onerror="this.src=\'' . $wrong . '\'">';
     }
     return '<div>' . $txt . "</div>\n";
 }