Example #1
0
 function SB_Writer_search()
 {
     parent::__construct();
     $this->switches['flat'] = 1;
     $this->tree->sortMode = 'hits';
     $this->search = SB_safeVal($_COOKIE, 'SB3SEARCH');
     if (SB_reqChk('q') != '') {
         $this->search = SB_reqVal('q');
     }
     $this->type = $this->um->getParam('user', 'default_search');
     // Check search pattern
     if (preg_match("/^(url|desc|name|all):(.*)\$/i", $this->search, $matches)) {
         $this->type = $matches[1];
         // If we have pattern then use it
         if ($this->type == 'url' || $this->type == 'desc' || $this->type == 'name' || $this->type == 'all') {
             $this->search = $matches[2];
         }
     }
     $url = $this->um->getParamB64('user', 'search_engine_url');
     $url = str_replace('%SEARCH%', $this->search, $url);
     $url = str_replace('%BASEURL%', urlencode(SB_Page::absBaseUrlShort()), $url);
     $url = str_replace('%LOGO%', urlencode(SB_Page::absBaseUrl() . SB_Skin::imgsrc('logo')), $url);
     $this->engineURL = $url;
     // We would not get here if no engine is specified
     if ($this->um->getParam('user', 'hide_xslt') || SB_reqVal("web") == 1) {
         header('Location: ' . $this->engineURL);
         exit;
     }
 }
Example #2
0
 function getXSLPath($file)
 {
     /**
      * The path to URL should use &
      * IE - handles OK
      * Firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=286132
      * Safari - omits parameters after the first
      *
      * Workaround, use ; as parameter delimiter.
      */
     return SB_Page::absBaseUrl() . 'xsl.php?file=' . $file . ';skin=' . str_replace(' ', '%20', SB_Skin::get());
 }
Example #3
0
 function SB_WriterInterface()
 {
     $this->um =& SB_UserManager::staticInstance();
     $this->SB_Converter($this->um->getParam('config', 'use_conv_engine'));
     $this->tree =& SB_Tree::staticInstance();
     // Set the default value accordingly
     $this->switches['hits'] = $this->um->getParam('config', 'use_hit_counter');
     if (!isset($_SERVER['HTTPS']) && $this->um->getParam('user', 'private_over_ssl_only')) {
         $this->tree->skipPrivate = true;
     }
     SB_Skin::set($this->um->getParam('user', 'skin'));
     $this->sw = new SB_StopWatch();
     $this->sw->start();
 }
Example #4
0
 function drawHead()
 {
     $this->drawXMLPI();
     $this->drawTagOpen('rss', array('version' => '2.0', 'xmlns:rss' => 'http://purl.org/rss/2.0/'));
     $this->drawTagOpen('channel');
     $this->drawTag('title', null, $this->quoteText($this->getTitle()));
     $desc = $this->settingsValue('feed_desc') . ' ' . SB_Page::absBaseUrl();
     $this->drawTag('description', null, $this->quoteText($desc));
     $this->drawTagOpen('image');
     $this->drawTag('title', null, $this->quoteText($this->getTitle()));
     $this->drawTag('url', null, SB_Page::absBaseUrl() . SB_Skin::imgsrc('root_transparent'));
     $this->drawTag('link', null, $this->settingsValue('feed_link'));
     $this->drawTagClose('image');
     $this->drawTag('link', null, $this->settingsValue('feed_link'));
     $this->drawTag('managingEditor', null, $this->quoteText($this->settingsValue('feed_managing_editor')));
     $this->drawTag('webMaster', null, $this->quoteText($this->settingsValue('feed_webmaster')));
     $this->drawTag('copyright', null, $this->quoteText($this->settingsValue('feed_copyright')));
     $this->drawTag('language', null, str_replace('_', '-', $this->um->getParam('user', 'lang')));
     $this->drawTag('generator', null, 'SiteBar ' . SB_CURRENT_RELEASE . ' (Bookmark Server; http://sitebar.org/)');
     // Time to live in minutes
     $this->drawTag('ttl', null, '60');
 }
Example #5
0
    function drawHeader()
    {
        ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/REC-html40/loose.dtd">

<html>
<head>
    <title><?php 
        echo SB_T("Private Messages");
        ?>
</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="StyleSheet"    href="<?php 
        echo SB_Skin::webPath() . '/messenger.css';
        ?>
" type="text/css" media="all">
    <link rel="Shortcut Icon" href="<?php 
        echo SB_Skin::webPath() . '/root_transparent.png';
        ?>
">
    <link rel="Author"        href="http://brablc.com/">
    <script type="text/javascript" src="<?php 
        echo SB_Page::absBaseUrl() . "/js/sitebar.js\"";
        ?>
></script>
    <script type="text/javascript">
        var SB_messengerImgNew = '<?php 
        echo SB_Page::absBaseUrl();
        ?>
/skins/msg_new.gif';
        var SB_messengerImgRead = '<?php 
        echo SB_Page::absBaseUrl();
        ?>
/skins/msg_read.gif';

        function SB_messengerToggle()
        {
            var checkBoxes = document.getElementsByTagName('input');

            for (var i=0; i< checkBoxes.length; i++)
            {
                var cb = checkBoxes[i];
                if (cb.className && cb.className=='checkBox')
                {
                    cb.checked = !cb.checked;
                }
            }
        }

        function SB_messengerToggleItem(img,mid)
        {
            var http = SB_xmlHttpGet();

            // We have old browser
            if (!http)
            {
                return;
            }

            http.onreadystatechange = function()
            {
                if (SB_xmlHttpReady(http))
                {
                    var div = http.responseText.indexOf(';');
                    var mid = http.responseText.substr(0,div);
                    var img = http.responseText.substr(div+1);
                    var imgObj = document.getElementById('img'+mid);
                    imgObj.src = (img=='new'?SB_messengerImgNew:SB_messengerImgRead);
                }
            }

            var url = 'messenger.php?ajax=1&command['+(img.src.indexOf(SB_messengerImgNew)>-1?'mark':'unmark')+']=1&mid['+mid+']=1';
            SB_xmlHttpSend(http, url);
        }
    </script>

</head>
<body class="siteBar siteBarBaseFont siteBarPageBackground ">
    <div class="title cmnTitleColorInverse"><?php 
        echo SB_T('Private Messages');
        ?>
</div>
    <div class="folders">
<?php 
        foreach ($this->folders as $folder => $label) {
            echo '[';
            if ($folder != $this->folder) {
                echo '<a style="color: black;" href="' . $this->getUrl(array('folder' => $folder)) . '">';
            }
            echo SB_T($label);
            if ($folder != $this->folder) {
                echo '</a>';
            }
            echo ']';
        }
        ?>
    </div>
    <form method="post" action="">
    <div class="buttons">
    <input type="button" value="<?php 
        echo SB_T("Toggle Selection");
        ?>
" onClick="SB_messengerToggle()">
<?php 
        if ($this->folder == 'inbox') {
            ?>
    <input name='command[mark]' type="submit" value="<?php 
            echo SB_P('messenger::read');
            ?>
">
    <input name='command[unmark]' type="submit" value="<?php 
            echo SB_P('messenger::unread');
            ?>
">
    <input name='command[save]' type="submit" value="<?php 
            echo SB_P('messenger::save');
            ?>
">
<?php 
        }
        ?>
    <input name='command[delete]' type="submit" value="<?php 
        echo SB_P('messenger::delete');
        ?>
">
<?php 
        if ($this->folder == 'outbox' && $this->um->isAdmin()) {
            ?>
    <input name='command[back]' type="submit" value="<?php 
            echo SB_P('messenger::cancel');
            ?>
">
    <input name='command[expire]' type="submit" value="<?php 
            echo SB_P('messenger::expire');
            ?>
">
<?php 
        }
        ?>
    </div>
<?php 
    }
Example #6
0
    function headerContent($inscript)
    {
        ?>
    <link rel="stylesheet" type="text/css" href="<?php 
        echo SB_Skin::webPath();
        ?>
/sitebar.css?version=<?php 
        echo STATIC_VERSION;
        ?>
" media="all">
    <script type="text/javascript" src="<?php 
        echo SB_Page::absBaseUrl();
        ?>
js/sitebar.js?version=<?php 
        echo STATIC_VERSION;
        ?>
"></script>
    <script type="text/javascript">
SB_gSkinDir = '<?php 
        echo SB_Skin::webPath();
        ?>
/';
<?php 
        echo $inscript . "\n";
        ?>
    </script>
<?php 
    }
Example #7
0
$urlParts = parse_url(SB_Page::absBaseUrl());
$uniqName = preg_replace("/[^\\w]*/", "", $urlParts['host']);
$extra = array('sitebar_client' => array('label' => 'SiteBar Client', 'url' => 'https://addons.mozilla.org/firefox/3605/', 'desc' => SB_P('integrator::hint_sitebar')), 'livebookmarks' => array('label' => 'Live Bookmarks', 'url' => sprintf('%sindex.php?w=firefox&amp;mode=download', SB_Page::absBaseUrl()), 'desc' => SB_P('integrator::hint_livebookmarks')), 'sidebar' => array('label' => 'Sidebar', 'url' => sprintf("javascript:sidebar.addPanel('SiteBar','%sindex.php','')", SB_Page::absBaseUrl()), 'desc' => SB_P('integrator::hint_sidebar')), 'search_engine' => array('label' => 'Add Search Engine', 'url' => sprintf("javascript:void(window.sidebar.addSearchEngine('%s', '%s', '%s', '%s'))", SB_Page::absBaseUrl() . 'integrator.php?lang=' . SB_GetLanguage() . '&amp;search_engine=/sitebar' . $uniqName . '.src', SB_Page::absBaseUrl() . '' . SB_Skin::imgsrc('root_transparent') . '?rename=/sitebar' . $uniqName . '.png', strlen($um->getParamB64('config', 'feed_root_name')) ? $um->getParamB64('config', 'feed_root_name') : 'SiteBar', SB_T("Bookmarks")), 'desc' => SB_P('integrator::hint_search_engine')), 'sidebar_mozilla' => array('label' => 'Sidebar', 'url' => sprintf("javascript:sidebar.addPanel('SiteBar','%sindex.php','')", SB_Page::absBaseUrl()), 'desc' => SB_P('integrator::hint_sidebar_mozilla')), 'sidebar_konqueror' => array('label' => 'Sidebar', 'url' => null, 'desc' => SB_P('integrator::hint_sidebar_konqueror', SB_Page::absBaseUrl())), 'hotlist' => array('label' => 'Add to Panel', 'url' => SB_Page::absBaseUrl() . 'index.php', 'params' => array('title' => 'SiteBar', 'rel' => 'sidebar'), 'desc' => SB_P('integrator::hint_hotlist')), 'install' => array('label' => 'Install', 'url' => 'integrator.php?lang=' . SB_GetLanguage() . '&amp;install=1', 'desc' => SB_P('integrator::hint_install')), 'uninstall' => array('label' => 'Uninstall', 'url' => 'integrator.php?lang=' . SB_GetLanguage() . '&amp;install=0', 'desc' => SB_P('integrator::hint_uninstall')), 'searchbar' => array('label' => 'Show in Search Bar', 'url' => sprintf("javascript:void(_search=open('%sindex.php','_search'))", SB_Page::absBaseUrl()), 'desc' => SB_P('integrator::hint_searchbar')), 'maxthon_sidebar' => array('label' => 'Sidebar Plugin', 'url' => sprintf("http://sitebar.org/plugin/maxthon/?sidebar=%s", SB_Page::absBaseUrlShort()), 'desc' => SB_P('integrator::hint_maxthon_sidebar')), 'maxthon_toolbar' => array('label' => 'Toolbar Plugin', 'url' => sprintf("http://sitebar.org/plugin/maxthon/?toolbar=%s", SB_Page::absBaseUrlShort()), 'desc' => SB_P('integrator::hint_maxthon_toolbar')), 'gentoo' => array('label' => 'Gentoo Ebuild', 'url' => 'http://www.gentoo-portage.com/www-apps/sitebar', 'desc' => SB_P('integrator::hint_gentoo')), 'debian' => array('label' => 'Debian', 'url' => 'http://packages.debian.org/unstable/web/sitebar', 'desc' => SB_P('integrator::hint_debian')), 'phplm' => array('label' => 'PHP Layers Menu', 'url' => 'http://phplayersmenu.sourceforge.net/', 'desc' => SB_P('integrator::hint_phplm', sprintf('%sindex.php?w=phplm', SB_Page::absBaseUrl()))));
$general = array('addpage' => array('label' => 'Add Page to SiteBar', 'url' => $bookmarklet, 'desc' => SB_P('integrator::hint_addpage')), 'window' => array('label' => 'SiteBar', 'url' => SB_Page::absBaseUrl() . 'index.php', 'desc' => SB_P('integrator::hint_window')), 'dir' => array('label' => 'SiteBar Directory', 'url' => SB_Page::absBaseUrl() . 'index.php?w=dir', 'desc' => SB_P('integrator::hint_dir')), 'popup' => array('label' => 'SiteBar Pop-up', 'url' => $popup, 'desc' => SB_P('integrator::hint_popup')), 'iframe' => array('label' => 'SiteBar iframe', 'url' => SB_Page::absBaseUrl() . 'iframe.php', 'desc' => str_replace('<IFRAME>', '&lt;IFRAME&gt;', SB_P('integrator::hint_iframe', array(SB_Page::absBaseUrl() . 'iframe.php')))), 'google' => array('label' => 'Google Widget', 'url' => SB_Page::absBaseUrl() . 'google.php', 'desc' => SB_P('integrator::hint_google', array(SB_Page::absBaseUrl() . 'google.php'))));
?>

<div id="main">
<div id="launcher">

  <div>
    <div id="home">
      <a href="http://sitebar.org/"><img alt="" title="<?php 
echo SB_T('SiteBar Homepage');
?>
" src="<?php 
echo SB_Skin::imgsrc('logo');
?>
"></a>
      <br>
      [<a href="http://sitebar.org/"><?php 
echo SB_T('SiteBar Homepage');
?>
</a>]
    </div>

    <div id="tip"><?php 
echo SB_P('integrator::welcome');
?>
</div>
  </div>
Example #8
0
 function faviconReturn($favicon_md5, $lid = null, $refresh = false)
 {
     $ico = $this->faviconGet($favicon_md5, $lid, $refresh);
     // 30 days keep cached in browser
     $age = 60 * 60 * 24 * 30;
     if (!$ico) {
         // Sent wrong icon image
         SB_Skin::set($this->um->getParam('user', 'skin'));
         $ico = $this->file_get_contents(SB_Skin::imgsrc('link_wrong_favicon'));
         $age = 60 * 60 * 24;
         // Try tomorrow
     }
     if ($refresh) {
         $age = -1;
     }
     header('Accept-Ranges: bytes');
     header('Cache-Control: public, max-age=' . $age);
     header('Content-Length: ' . strlen($ico));
     $type = 'image/x-icon';
     if (substr($ico, 0, 3) == 'GIF') {
         $type = 'image/gif';
     } else {
         if (substr($ico, 6, 4) == 'JFIF') {
             $type = 'image/jpeg';
         } else {
             if (substr($ico, 1, 3) == 'PNG') {
                 $type = 'image/png';
             }
         }
     }
     header('Content-Type: ' . $type);
     print $ico;
 }
 function buildProperties()
 {
     $fields = array();
     $link = null;
     if ($this->command != 'Add Bookmark') {
         $link = $this->tree->getLink(SB_reqValInt('lid_acl'));
         if (!$link) {
             return null;
         }
     } else {
         $link = new SB_Tree_Link(array());
     }
     $fields['-hidden1-'] = array('name' => 'lid_acl', 'value' => $link->id);
     $fields['URL'] = array('name' => 'url');
     if ($this->command != 'Delete Bookmark') {
         /* Show the 'Retrieve Info' button only in case it has not been yet
          * performed
          */
         $fields['Get Bookmark Information'] = array('type' => 'addbutton');
         $fields['-hidden4-'] = array('name' => 'origin', 'value' => $this->command);
     }
     $fields['Bookmark Name'] = array('name' => 'name', 'maxlength' => 255);
     $size = strlen($link->comment);
     $MAXSIZETOEDIT = 4096;
     if ($size <= $MAXSIZETOEDIT) {
         $fields['Description'] = array('name' => 'comment', 'type' => 'textarea');
     } else {
         $fields['-raw1-'] = SB_T("Description too long for inplace editing, please use export feature!");
     }
     if ($this->um->getParam('user', 'use_favicons')) {
         $fields['Favicon'] = array('name' => 'favicon', 'maxsize' => 32000);
         $fields['-raw2-'] = '';
     }
     if (strlen(SB_reqVal('url'))) {
         $link->url = SB_reqVal('url');
     }
     if ($this->getInfo && strlen(SB_reqVal('url'))) {
         $link->name = SB_reqVal('name');
         $link->comment = SB_reqVal('comment');
         $link->favicon = SB_reqVal('favicon');
         /* Try to get the title and favicon */
         require_once './inc/pageparser.inc.php';
         $page = new SB_PageParser($link->url);
         if ($page->getInformation(array('CHARSET', 'TITLE', 'FAVURL', 'DESC', 'KEYWORDS'))) {
             $cp = 'iso-8859-1';
             if ($page->errorCode['CHARSET'] < PP_ERR) {
                 $cp = $page->info['CHARSET'];
             }
             require_once './inc/converter.inc.php';
             $c = new SB_Converter($this->um->getParam('config', 'use_conv_engine'), $cp);
             if (!$link->name && isset($page->info['TITLE'])) {
                 $link->name = $c->utf8RawUrlDecode($page->info['TITLE']);
             }
             if (!$link->comment && isset($page->info['DESC'])) {
                 $link->comment = $c->utf8RawUrlDecode($page->info['DESC']);
             }
             if ($this->um->getParam('user', 'use_favicons')) {
                 if (!$link->favicon && isset($page->info['FAVURL'])) {
                     $link->favicon = $page->info['FAVURL'];
                     /* Show the retrieved favicon. */
                     if ($this->command == 'Add Bookmark') {
                         /* Show the retrieved favicon. */
                         $wrong = SB_Skin::imgsrc('link_wrong_favicon');
                         $fields['-raw2-'] = "<div><img class='favicon' alt='' src='" . $link->favicon . "' onerror='this.src=\"{$wrong}\"'></div>";
                     } else {
                         $fields['-raw2-'] = $this->_buildFavicon(SB_reqValInt('lid_acl'), $link->favicon);
                     }
                 }
             }
         }
     }
     $fields['URL']['value'] = $link->url;
     $fields['Bookmark Name']['value'] = $link->name;
     $fields['Description']['value'] = $link->comment;
     if ($this->um->getParam('user', 'use_favicons')) {
         if ($this->command != 'Add Bookmark') {
             $favicon = $link->favicon;
             if (substr($link->favicon, 0, 7) == 'binary:') {
                 require_once './inc/faviconcache.inc.php';
                 $fc =& SB_FaviconCache::staticInstance();
                 $favicon = 'data:image/x-icon;base64,' . base64_encode($fc->faviconGet($link->favicon, null));
             }
             if ($link->favicon) {
                 $fields['-raw2-'] = $this->_buildFavicon($link->id, $link->favicon);
             }
         }
         $fields['Favicon']['value'] = $link->favicon;
     }
     $size = strlen($link->comment);
     $MAXSIZETOEDIT = 4096;
     if ($size <= $MAXSIZETOEDIT) {
         $fields['Description'] = array('name' => 'comment', 'type' => 'textarea', 'value' => $link->comment);
     } else {
         $fields['-raw1-'] = SB_T("Description too long for inplace editing, please use export feature!");
     }
     $fields['Feed Bookmark'] = array('name' => 'is_feed', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_is_feed'));
     if ($link->is_feed) {
         $fields['Feed Bookmark']['checked'] = null;
     }
     if ($this->command == 'Add Bookmark' || $this->tree->inMyTree($link->id_parent)) {
         $fields['Private'] = array('name' => 'private', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_private'));
         if ($link->private) {
             $fields['Private']['checked'] = null;
         }
     }
     if ($link->is_dead) {
         $fields['Dead Bookmark'] = array('name' => 'is_dead_check', 'type' => 'checkbox', 'checked' => null, 'title' => SB_P('command::tooltip_is_dead_check'));
         $fields['-hidden2-'] = array('name' => 'is_dead', 'type' => 'hidden', 'value' => 1);
     }
     if ($this->um->getParam('config', 'use_outbound_connection')) {
         $fields['Exclude From Validation'] = array('name' => 'novalidate', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_novalidate'));
         if (!$link->validate) {
             $fields['Exclude From Validation']['checked'] = null;
         }
     }
     $fields['Target'] = array('name' => 'link_target', 'value' => $link->target);
     if ($this->command != 'Delete Bookmark') {
         if ($this->um->getParam('config', 'comment_impex') && strlen($link->comment) > 0 || strlen($link->comment) >= $MAXSIZETOEDIT) {
             $fields['Export Description'] = array('name' => 'command', 'type' => 'addbutton');
         }
         if ($this->um->getParam('config', 'comment_impex')) {
             $fields['Import Description'] = array('name' => 'command', 'type' => 'addbutton');
         }
     }
     if ($this->command == 'Properties') {
         $fields['Delete Bookmark'] = array('type' => 'addbutton');
     }
     return $fields;
 }
Example #10
0
 function drawNodeOpen(&$node, $last = false)
 {
     $showChildren = $this->showChildren($node);
     $node->aclstr = '';
     foreach ($node->getACL() as $right => $value) {
         if (!$value) {
             continue;
         }
         list($prefix, $name) = explode('_', $right);
         $node->aclstr .= $name[0];
     }
     if ($node->deleted_by) {
         $node->aclstr .= 'p';
     }
     if ($node->isRoot) {
         echo '<div class="tree">' . "\r";
     }
     $nodename = 'n' . $node->id;
     /* Init images */
     $inode = SB_Skin::img('node', 'n', $nodename);
     $inodeo = SB_Skin::img('node_open', 'n', $nodename);
     $iplus = SB_Skin::img('plus', 's', $nodename);
     $iplusl = SB_Skin::img('plus_last', 's', $nodename);
     $iminus = SB_Skin::img('minus', 's', $nodename);
     $iminusl = SB_Skin::img('minus_last', 's', $nodename);
     $onclick = 'SB_node(event,this.parentNode)';
     if ($this->loadOpenNodesOnly) {
         $onclick = 'SB_nodeReload(event,this.parentNode)';
     }
     echo '<div id="' . $nodename . '"' . ' class="node"' . ' x_level="' . $node->level . '"' . ' x_acl="' . $node->aclstr . ($node->deleted_by ? '' : '*') . '"' . '><span' . ' onclick="' . $onclick . '"' . ' oncontextmenu="return SB_menuOn(event,this.parentNode)">';
     $this->nodeCount++;
     $hasChildren = $node->childrenCount() || !$showChildren && $this->loadOpenNodesOnly;
     if (!$node->isRoot) {
         if ($hasChildren == 0) {
             $iplus = $this->ijoin;
             $iplusl = $this->ijoinl;
             $iminus = $this->ijoin;
             $iminusl = $this->ijoinl;
         }
         echo implode('', $this->treearr) . ($last ? $showChildren ? $iminusl : $iplusl : ($showChildren ? $iminus : $iplus));
         array_push($this->treearr, $last ? $this->iempty : $this->iconnect);
     } else {
         if ($node->deleted_by == null) {
             $inodeo = SB_Skin::img('root', 'n', $nodename, 'root');
             if ($hasChildren == 0) {
                 $inode = $inodeo;
             } else {
                 $inode = SB_Skin::img('root_plus', 'n', $nodename, 'root');
             }
         } else {
             $inode = SB_Skin::img('root_deleted', 'n', $nodename, 'root');
             $inodeo = $inode;
         }
     }
     $decorated = $this->showACL && $node->hasACL();
     echo '<a id="a' . $nodename . '" name="n' . $node->id . '"' . ($decorated && !$node->isRoot ? ' class="acl"' : '') . ($this->useToolTips ? SB_Page::toolTip() : '') . ($node->comment ? ' ' . ($this->useToolTips ? 'x_' : '') . 'title="' . $this->quoteAtt($node->comment) . '"' : '') . ($this->um->getParam('user', 'menu_icon') ? '' : SB_Page::dragDropNode($node->id)) . '>' . ($showChildren ? $inodeo : $inode) . $this->nmenu . ($decorated && $node->isRoot ? '<span class="acl">' : '') . $this->quoteText($node->name) . ($decorated && $node->isRoot ? '</span>' : '') . "</a></span>\r" . '<div id="c' . $nodename . '" class="children' . ($showChildren ? 'Expanded' : 'Collapsed') . '">' . "\r";
 }
Example #11
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";
 }
Example #12
0
 function validate($lid, $getFavicon)
 {
     if (!$this->um->isAuthorized('Validation', false, null, null, $lid)) {
         echo 'Access denied!';
         die;
     }
     $link = $this->tree->getLink($lid);
     $deadCount = $link->is_dead + 1;
     // Mark as dead
     $set = array('tested' => array('now' => ''), 'is_dead' => $deadCount < 127 ? $deadCount : 0);
     $this->tree->updateLink($link->id, $set, false);
     $page = new SB_PageParser($link->url);
     $page->getInformation($getFavicon ? array('FAVURL') : null);
     // Unmark early if not dead
     if (!intval($page->isDead)) {
         $set['is_dead'] = 0;
         $this->tree->updateLink($link->id, $set, false);
     }
     $location = SB_Skin::imgsrc('link');
     if ($page->isDead) {
         $location = SB_Skin::imgsrc('link_wrong_favicon');
     } else {
         $set = array();
         if (isset($page->info['FAVURL'])) {
             $favicon = $page->info['FAVURL'];
             $set['favicon'] = $favicon;
             if ($this->um->getParam('config', 'use_favicon_cache')) {
                 $location = 'favicon.php?' . md5($favicon) . '=' . $link->id;
             } else {
                 $location = $favicon;
             }
         } else {
             if ($getFavicon) {
                 $set['favicon'] = '';
             }
         }
         if (isset($set['favicon'])) {
             $this->tree->updateLink($link->id, $set, false);
         }
     }
     header('Location: ' . $location);
     exit;
 }