コード例 #1
0
ファイル: feed.php プロジェクト: archcidburnziso/Bilboplanet
 $item = convert_iso_special_html_char(html_entity_decode(html_entity_decode($post_list->content, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'));
 $url = $post_list->permalink;
 if ($blog_settings->get('internal_links')) {
     $url = BP_PLANET_URL . "/index.php?post_id=" . $post_list->post_id . "&go=external";
 }
 $id = uuid($url, 'urn:uuid:');
 # Other link
 $links = '<i>' . sprintf('Original post of <a href="%s" title="Visit the source">%s</a>.', $url, $nom);
 $links .= sprintf(T_('Vote for this post on <a href="%s" title="Go on the planet">%s</a>.'), BP_PLANET_URL, $blog_settings->get('planet_title')) . '</i>';
 # Remove html tag to post content
 $desc = strip_tags($item);
 # Split string only on space char
 $desc = short_str($desc, 300, false);
 # Gravatar
 if ($blog_settings->get('planet_avatar')) {
     $avatar_url = getUserIcon($post_list->user_email);
     //			$avatar_email = strtolower($post_list->user_email);
     //			$avatar_url = "http://cdn.libravatar.org/avatar/".md5($avatar_email)."?d=".urlencode(BP_PLANET_URL."/themes/".$blog_settings->get('planet_theme')."/images/gravatar.png")."&s=40";
     $avatar = '<img src="' . $avatar_url . '" alt="' . sprintf(T_('Gravatar of %s'), $post_list->user_fullname) . '" class="gravatar" />';
 }
 if ($blog_settings->get('planet_avatar')) {
     $item = $item . "\n<p>" . $avatar;
 }
 $item = $item . "<br/>" . $links . "</p>";
 # Similar posts
 $post_tags = getPostTags($post_list->post_id);
 if ($blog_settings->get("show_similar_posts") && !empty($post_tags)) {
     $sql_sim = getSimilarPosts_SQL($post_list->post_id, $post_tags);
     $rsimilar = $core->con->select($sql_sim);
     if ($rsimilar->count() > 0) {
         $sim_html = '<div class="similar-block"><h3>' . T_('Similar posts') . '</h3><ul>';
コード例 #2
0
ファイル: users.php プロジェクト: archcidburnziso/Bilboplanet
$current_page = "users";
include dirname(__FILE__) . '/tpl.php';
#
header('Content-type: text/html; charset=utf-8');
# Valeurs par defaut
$params = array('title' => $blog_settings->get('planet_title') . " - " . T_('Users'));
$core->tpl->setVar('params', $params);
$sql_users = "SELECT\n\t\t" . $core->prefix . "user.user_id,\n\t\t" . $core->prefix . "user.user_fullname,\n\t\t" . $core->prefix . "user.user_email,\n\t\t" . $core->prefix . "site.site_url,\n\t\tMAX(" . $core->prefix . "post.post_pubdate) as pubdate,\n\t\tCOUNT(" . $core->prefix . "post.post_id) as nb_post\n\tFROM " . $core->prefix . "user, " . $core->prefix . "post, " . $core->prefix . "site\n\tWHERE " . $core->prefix . "user.user_status = 1\n\tAND " . $core->prefix . "user.user_id = " . $core->prefix . "post.user_id\n\tAND " . $core->prefix . "user.user_id = " . $core->prefix . "site.user_id\n\tGROUP BY " . $core->prefix . "user.user_id\n\tORDER BY pubdate DESC";
//print $sql_users;
//exit;
$rs = $core->con->select($sql_users);
while ($rs->fetch()) {
    $puser_settings = new bpSettings($core, $rs->user_id);
    if ($puser_settings != null && $puser_settings->get('social.shaarli')) {
        $shaarli = $puser_settings->get('social.shaarli.instance');
        $core->tpl->setVar('user_shaarli', $shaarli);
        $core->tpl->render('user.shaarli');
    }
    $user = array("id" => $rs->user_id, "fullname" => $rs->user_fullname, "email" => $rs->user_email, "website" => $rs->site_url, "last" => mysqldatetime_to_date("d/m/Y", $rs->pubdate), "nb_post" => $rs->nb_post);
    $core->tpl->setVar('user', $user);
    //$avatar_email = strtolower($rs->user_email);
    //$libravatar = "http://cdn.libravatar.org/avatar/".md5($avatar_email)."?default=identicon";
    $libravatar = getUserIcon($rs->user_email);
    $core->tpl->setVar('avatar_url', $libravatar);
    $core->tpl->render("user.block");
}
$core->tpl->render("content.users");
# Show result
$analytics_code = getAnalyticsCode();
$core->tpl->setVar('analytics_html', $analytics_code);
$core->renderTemplate();
コード例 #3
0
ファイル: photo.php プロジェクト: hoogle/ttt
      </div>
      <div id="navi" class="yui-u">
        <div class="hd">
          <form action="" method="post">
            <input type="text" name="qkey" style="width:236px;border:1px solid gray;" />
            <select name="type">
              <option value="0">標題</option>
              <option value="0">發表人</option>
            </select>
            <input type="submit" value="搜尋" />
          </form>
        </div>
        <div class="bd">
          <div id="profile" class="clearfix">
            <img src="<?php 
echo getUserIcon('richardw', 60);
?>
" />
            <div id="author">作者:<a href="#">richardw</a></div>
            <ul>
              <li>上傳時間:<?php 
echo $picAry[0]['curr_time'];
?>
</li>
            <ul>
          </div>
          <div id="map"></div>
          <div id="locinfo">
          <?php 
include WEBROOT_PATH . "include/mod_exif.php";
?>
コード例 #4
0
ファイル: mod_my.php プロジェクト: hoogle/ttt
  float:left;
  padding:0 10px 0 5px;
  width:170px;
  overflow:hidden;
}
</style>

  <div class="yui-d3">
    <div class="hd"></div>
    <div class="bd">
      <div class="yui-gf">
        <div class="yui-u first" style="border:1px solid gray;width:210px;height:500px;">
          <div class="hd"></div>
          <div class="bd">
            <div class="myicon"><img src="<?php 
echo getUserIcon('richardw', 150);
?>
" /></div>
            <h1>laudieh</h1>
          </div>
          <div class="ft"></div>
        </div>
        <div class="yui-u" style="width:750px;">
          <div class="hd"></div>
          <div class="bd">
            <div id="my-tab-all" class="yui-navset">
              <ul class="yui-nav">
                <li class="selected"><a href="#t1"><em>我的行程</em></a></li>
                <li><a href="#t2"><em>參考的行程</em></a></li>
                <li><a href="#t3"><em>跟團的行程</em></a></li>
                <li><a href="#t4"><em>帶團的行程</em></a></li>
コード例 #5
0
function showSinglePost($rs, $tpl, $search_value, $multiview = true, $strip_tags = false)
{
    global $blog_settings, $core, $user_settings;
    $avatar = $blog_settings->get('planet_avatar');
    $post_permalink = $rs->f('permalink');
    if ($blog_settings->get('internal_links')) {
        $post_permalink = BP_PLANET_URL . "/index.php?post_id=" . $rs->f('post_id') . "&go=external";
    }
    $title = html_entity_decode($rs->f('title'), ENT_QUOTES, 'UTF-8');
    $content = html_entity_decode($rs->f('content'), ENT_QUOTES, 'UTF-8');
    $short_content = html_entity_decode($rs->f('short_content'), ENT_QUOTES, 'UTF-8');
    $short = true;
    if (strlen($content) < 1200) {
        $short = false;
        $short_content = $content;
    }
    $post = array("id" => $rs->f('post_id'), "date" => mysqldatetime_to_date("d/m/Y", $rs->f('pubdate')), "day" => mysqldatetime_to_date("d", $rs->f('pubdate')), "month" => mysqldatetime_to_date("m", $rs->f('pubdate')), "year" => mysqldatetime_to_date("Y", $rs->f('pubdate')), "hour" => mysqldatetime_to_date("H:i", $rs->f('pubdate')), "permalink" => urldecode($post_permalink), "title" => $title, "content" => $content, "short_content" => $short_content, "image" => $rs->f('image'), "author_id" => $rs->f('user_id'), "author_fullname" => $rs->f('user_fullname'), "author_email" => $rs->f('user_email'), "nbview" => $rs->f('nbview'), "last_viewed" => mysqldatetime_to_date('d/m/Y H:i', $rs->f('last_viewed')), "user_votes" => getNbVotes(null, $rs->f('user_id')), "user_posts" => getNbPosts(null, $rs->f('user_id')));
    $post['description'] = sprintf(T_('By %s, on %s at %s.'), '<a href="#" onclick="javascript:add_user(\'' . $rs->f('user_id') . '\')">' . $rs->f('user_fullname') . '</a>', $post["date"], $post["hour"]);
    $post['description'] .= ' <a href="' . BP_PLANET_URL . '/index.php?post_id=' . $rs->f('post_id') . '" title="' . $post['title'] . '">' . T_("View post detail") . '</a>';
    if (!empty($search_value)) {
        # Format the occurences of the search request in the posts list
        $post['content'] = split_balise($search_value, '<span class="search-content">' . $search_value . '</span>', $post['content'], 'str_ireplace', 1);
        # Format the occurences of the search request in the posts title
        $post['title'] = split_balise($search_value, '<span class="search_title">' . $search_value . '</span>', $post['title'], 'str_ireplace', 1);
    }
    if ($short) {
        $last_space = strripos($post['short_content'], ' ');
        $post['short_content'] = substr($post['short_content'], 0, $last_space);
        $post['short_content'] = '<span class="short-content">' . strip_tags($post['short_content']) . "&nbsp;[...] </span>" . '<br /><span class="read-more"><a href="' . BP_PLANET_URL . '/?post_id=' . $post['id'] . '" title="' . $title . '">' . T_('Read more') . '</a></span>';
    }
    if ($strip_tags) {
        $post['content'] = $post['short_content'];
    }
    $post_tags = getPostTags($rs->f('post_id'));
    $tpl->setVar('post', $post);
    # Gravatar
    if ($avatar) {
        $libravatar = getUserIcon($post['author_email']);
        $tpl->setVar('avatar_url', $libravatar);
        $tpl->render('post.block.gravatar');
    }
    if ($multiview) {
        if ($post['image'] != '') {
            $tpl->render('post.image');
        }
        $tpl->render('post.multi');
    }
    if ($blog_settings->get('planet_vote')) {
        $votes = array("html" => afficheVotes($rs->f('score'), $rs->f('post_id')));
        $tpl->setVar('votes', $votes);
        $tpl->render('post.block.votes');
    }
    if (!empty($post_tags)) {
        foreach ($post_tags as $tag) {
            $tpl->setVar('post_tag', $tag);
            $tpl->render('post.tags');
        }
    }
    if ($blog_settings->get('allow_post_modification')) {
        if ($blog_settings->get('allow_tagging_everything')) {
            $tpl->render('post.action.tags');
        } else {
            if ($core->auth->userID() == $rs->f('user_id')) {
                $tpl->render('post.action.tags');
            }
        }
    }
    if ($user_settings != null) {
        if ($user_settings->get("social.twitter")) {
            $tpl->render('social.twitter');
        }
        if ($user_settings->get("social.shaarli")) {
            $simple_title = $post['title'];
            $tpl->setVar('stripped_title', addslashes($simple_title));
            $tpl->render('social.shaarli');
        }
        if ($user_settings->get("social.google")) {
            $tpl->render('social.google');
        }
        if ($user_settings->get("social.statusnet")) {
            $tpl->setVar('stripped_title', urlencode($rs->f('title')));
            $tpl->render('social.statusnet');
        }
        if ($user_settings->get("social.reddit")) {
            $tpl->setVar('stripped_title', addslashes($simple_title));
            $tpl->setVar('encoded_url', urlencode(BP_PLANET_URL . '/?post_id=' . $post['id']));
            $tpl->render('social.reddit');
        }
    }
    if ($blog_settings->get('show_similar_posts') && !empty($post_tags)) {
        $sql_sim = getSimilarPosts_SQL($rs->f('post_id'), $post_tags);
        $rsimilar = $core->con->select($sql_sim);
        if ($rsimilar->count() > 0) {
            while ($rsimilar->fetch()) {
                $post_permalink = $rsimilar->permalink;
                if ($blog_settings->get('internal_links')) {
                    $post_permalink = BP_PLANET_URL . "/index.php?post_id=" . $rsimilar->post_id;
                }
                $similar = array("author" => $rsimilar->user_fullname, "title" => $rsimilar->post_title, "permalink" => urldecode($post_permalink), "pubdate" => mysqldatetime_to_date("d/m/Y", $rsimilar->post_pubdate));
                $tpl->setVar('similar', $similar);
                $tpl->render("post.similar.item");
            }
            $tpl->render("post.similar.block");
        }
    }
    if ($blog_settings->get('allow_post_comments')) {
        if ($core->auth->userID() == $rs->f('user_id') || $core->hasRole('manager')) {
            if ($rs->f('comment')) {
                $tpl->render('post.action.uncomment');
            } else {
                $tpl->render('post.action.comment');
            }
        }
    }
    if ($blog_settings->get('allow_post_comments') && $rs->f('comment') == 1) {
        $sql = "SELECT * FROM " . $core->prefix . "comment\n\t\t\tWHERE post_id=" . $rs->f('post_id');
        //		print $sql;
        //		exit;
        $rs_comment = $core->con->select($sql);
        while ($rs_comment->fetch()) {
            $fullname = $rs_comment->user_fullname;
            if (!empty($rs_comment->user_site)) {
                $fullname = '<a href="' . $rs_comment->user_site . '">' . $fullname . '</a>';
            }
            $content = $core->wikiTransform($rs_comment->content);
            $comment = array("id" => $rs_comment->comment_id, "post_id" => $rs_comment->post_id, "user_fullname_link" => $fullname, "user_fullname" => $rs_comment->user_fullname, "user_site" => $rs_comment->user_site, "content" => $content, "pubdate" => mysqldatetime_to_date("d/m/Y", $rs_comment->created));
            $tpl->setVar("comment", $comment);
            $tpl->render('post.comment.element');
        }
        $tpl->render('post.comment.block');
    }
    if ($rs->count() > 1) {
        $tpl->render('post.backsummary');
    }
    return $tpl;
}