예제 #1
0
function gravatar_url($mail, $size, $echo = true)
{
    $rating = Helper::options()->commentsAvatarRating;
    $Request = new Typecho_Request();
    $default = null;
    $url = Typecho_Common::gravatarUrl($mail, $size, $rating, $default, $Request->isSecure());
    if ($echo) {
        echo $url;
    } else {
        return $url;
    }
}
예제 #2
0
 public static function run($archive, $select)
 {
     $db = Typecho_Db::get();
     $prefix = $db->getPrefix();
     $options = Helper::options();
     $domain = $_SERVER['HTTP_HOST'];
     $row = $db->fetchRow($db->select()->from($prefix . 'domaintheme')->where('domain = ?', $domain)->limit(1));
     if ($row) {
         $options->theme = is_dir($options->themeFile($row['theme'])) ? $row['theme'] : 'default';
         $themeDir = rtrim($options->themeFile($options->theme), '/') . '/';
         $archive->setThemeDir($themeDir);
         $options->siteUrl = (Typecho_Request::isSecure() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
         if ($row['user']) {
             $themeOptions = json_decode($row['user'], true);
             if (is_array($themeOptions)) {
                 foreach ($themeOptions as $key => $value) {
                     $options->push(array('name' => $key, 'value' => $value));
                 }
             }
         }
     }
 }