function like_show()
{
    $args = func_get_args();
    if (get_post('page')) {
        $page = intval(get_post('page'));
    } else {
        $page = "";
    }
    $content = '';
    include_once "theme.inc.php";
    $favorites = get_likes(10, $page);
    include_once "apply_sent.inc.php";
    $allapp = get_sent_applies(32767, "");
    foreach ($favorites as $f) {
        $content .= '<div class="item" id="' . $f['tweet_id'] . '">
                   <div class="item-delete">
                       <a class="right"></a>
                   </div>
                   <div class="left item-pic">
                       <img src="' . $f['profile_image_url'] . '" alt="" width="50" height="50" />
                   </div>
                   <div class="left item-content">
                       <div class="item-blog">
                           <a class="item-blog-name">' . $f['post_screenname'] . '</a>:' . $f['content'] . '
                       </div>
                       <div class="item-other">
                           <a target="_blank" href="http://api.t.sina.com.cn/' . $r['user_site_id'] . '/statuses/' . $r['tweet_site_id'] . '" class="left item-time">' . time_tran($f['post_datetime']) . '</a> ' . $source . '
                           <a class="right item-favourite item-action delete">取消收藏</a> ';
        if ($f['type'] != 1) {
            $app = 0;
            foreach ($allapp as $r) {
                if ($f['tweet_id'] == $r['tweet_id']) {
                    $app = 1;
                    break;
                }
            }
            if (!$app) {
                $content .= '<a class="right item-favourite item-doapply apply" onclick="JobApply(this,\'' . $f['tweet_id'] . '\',\'' . $f['post_screenname'] . '\')">
                                            申请该职位</a><a class="right item-favourite item-doapply unapply" style="display: none;" onclick="JobUnApply(this,\'' . $f['tweet_id'] . '\')">
                                            取消申请</a>';
            } else {
                $content .= '<a class="right item-favourite item-doapply apply" style="display: none;" onclick="JobApply(this,\'' . $f['tweet_id'] . '\',\'' . $f['post_screenname'] . '\')">
                                            申请该职位</a><a class="right item-favourite item-doapply unapply" onclick="JobUnApply(this,\'' . $f['tweet_id'] . '\')">
                                            取消申请</a>';
            }
        }
        $content .= '
                       </div>
                   </div>
                   <div class="clear">
                   </div>
               </div>';
    }
    echo $content;
}
Exemple #2
0
                     die;
                 } else {
                     if ($amount <= 0) {
                         $message = delete_collection_item($collection_item_id);
                     } else {
                         //echo $amount;
                         $message = update_collection_item($collection_item_id, $amount);
                     }
                 }
             }
             if ($message == 'success') {
                 $message = 'Collection Updated';
             } elseif ($message == 'error') {
                 $message = 'Something went Wrong';
             }
             $likes = get_likes($collection_id);
             $collection_items = get_collection_items($collection_id);
             include 'collectionView.php';
         }
     } else {
         $message = 'Please sign in to manage collections';
         include 'home.php';
     }
     break;
 case 'changecollection':
     $collection_id = filter_input(INPUT_GET, 'collectionid', FILTER_VALIDATE_INT);
     $collection = change_collection($collection_id);
     echo '<div id="namevalue">' . $collection['collection_name'] . '</div>
           <div id="descvalue">' . $collection['collection_description'] . '</div>
           <div id="publicvalue">' . $collection['is_public'] . '</div>
           <div id="priorityvalue">' . $collection['priority'] . '</div>';
Exemple #3
0
require_once '../model/bin/logger.php';
$Secret = new Secret();
$Logger = new Logger();
$Like = new Like();
$action = isset($_GET['action']) ? $_GET['action'] : $_POST['action'];
switch ($action) {
    case 'all':
        $p = [];
        if (isset($_POST["limit"])) {
            $p["limit"] = $_POST["limit"];
        }
        if (isset($_POST["offset"])) {
            $p["offset"] = $_POST["offset"];
        }
        $r = $Secret->all($p);
        get_likes($r);
        for ($i = 0; $i < count($r); $i++) {
            $Logger->log("r[{$i}][id]:" . $r[$i]["id"], false);
        }
        echo json_encode($r);
        break;
    case 'get':
        $r = $Secret->find_by("category", $_POST['category'], false);
        $Logger->log("Secrets::get " . serialize($_POST));
        $Logger->log($r);
        echo json_encode($r);
        break;
    case 'get_one':
        $r = $Secret->find($_POST['id'], false);
        $Logger->log("Secrets::get_one " . serialize($_POST));
        $Logger->log($r);
Exemple #4
0
<?php

include "../model/msgdb.php";
include "../model/likedb.php";
if ($_POST['method'] == "insert") {
    insert_message();
}
if ($_POST['method'] == "getall") {
    get_messages();
}
if ($_POST['method'] == "like") {
    insert_like();
}
if ($_POST['method'] == "getlike") {
    get_likes();
}
        ?>
        <div class="block single-soc-share">

            <?php 
        if ($facebook_share != 'yes') {
            ?>
                <div class="pull-left single-soc-share-link-fb">
                    <a target="_blank" href="http://www.facebook.com/sharer.php?u=<?php 
            echo $thepermalink;
            ?>
&t=<?php 
            the_title();
            ?>
">
                        <span><?php 
            echo get_likes($thepermalink);
            ?>
</span>
                        <p><?php 
            _e('Facebook', 'tkingdom');
            ?>
</p>
                    </a>
                </div><!--/single-soc-share-link-fb-->
            <?php 
        }
        ?>

            <?php 
        if ($twitter_share != 'yes') {
            ?>
function theme_result($result, $keyword = '', $admin = false)
{
    include_once "login.inc.php";
    include_once "hot.inc.php";
    if (user_is_authenticated()) {
        include_once "like.inc.php";
        $allfav = get_likes(32767, "");
        include_once "apply_sent.inc.php";
        $allapp = get_sent_applies(32767, "");
    }
    $content = "";
    foreach ($result as $r) {
        if ($keyword) {
            $jg = parsekeyword($keyword, parselink(str_replace(array("<", ">"), array("&lt;", "&gt;"), $r['content'])));
        } else {
            $jg = parselink(str_replace(array("<", ">"), array("&lt;", "&gt;"), $r['content']));
        }
        $tags = get_tags($r['tweet_id']);
        if (strstr($r['source'], '<')) {
            $source = str_replace("<a ", '<a target="_blank" class="left microblog-item-position"', $r['source']);
        } else {
            $source = '<a class="left microblog-item-position" target="_blank">' . $r['source'] . '</a>';
        }
        $content .= '<div class="microblog-item" id="' . strtotime($r['post_datetime']) . '">
                    <div class="left microblog-item-pic">
                        <a target="_blank" href="' . BASE_URL . 'profile/' . $r['post_screenname'] . '"><img alt="" width="50" height="50" src="' . $r['profile_image_url'] . '"/></a>
                    </div>
                    <div class="left microblog-item-content">
                        <div class="microblog-item-blog">
                            <a class="microblog-item-blog-name" target="_blank" href="' . BASE_URL . 'profile/' . $r['post_screenname'] . '">' . $r['post_screenname'] . '</a>:' . $jg . '
        </div>';
        if ($r['thumbnail']) {
            $content .= '
                        <div><a onclick="ShowMiddlePic(\'' . str_replace("/thumbnail/", "/bmiddle/", $r['thumbnail']) . '\')"><img src="' . $r['thumbnail'] . '" /></a></div>';
        }
        $content .= '
                        <div class="microblog-item-other">
                            <a target="_blank" href="http://api.t.sina.com.cn/' . $r['user_site_id'] . '/statuses/' . $r['tweet_site_id'] . '" class="left microblog-item-time">' . time_tran($r['post_datetime']) . '</a> ' . $source;
        if ($admin) {
            $content .= '<a class="right item-control last delete" onclick="DeleteTweet(\'' . $r['tweet_id'] . '\', this)">删除</a>';
        } else {
            if (user_is_authenticated()) {
                $fav = 0;
                $app = 0;
                foreach ($allfav as $f) {
                    if ($f['tweet_id'] == $r['tweet_id']) {
                        $fav = 1;
                        break;
                    }
                }
                foreach ($allapp as $f) {
                    if ($f['tweet_id'] == $r['tweet_id']) {
                        $app = 1;
                        break;
                    }
                }
                if (!$fav) {
                    $content .= '<a class="right microblog-item-control like" onclick="JobLike(this,\'' . $r['tweet_id'] . '\')">收藏</a><a class="right microblog-item-control unlike"
                                            style="display: none;" onclick="JobUnLike(this,\'' . $r['tweet_id'] . '\')">取消收藏</a> ';
                } else {
                    $content .= '<a class="right microblog-item-control like" style="display: none;" onclick="JobLike(this,\'' . $r['tweet_id'] . '\')">收藏</a><a class="right microblog-item-control unlike"
                                             onclick="JobUnLike(this,\'' . $r['tweet_id'] . '\')">取消收藏</a> ';
                }
                $role = get_current_user_role();
                if ($role == 1) {
                    if ($r['type'] != 1 and !$app) {
                        $content .= '<a class="right microblog-item-control microblog-item-apply apply" onclick="JobApply(this,\'' . $r['tweet_id'] . '\',\'' . $r['post_screenname'] . '\')">
                                 申请该职位</a><a class="right microblog-item-control microblog-item-apply unapply" style="display: none;" onclick="JobUnApply(this,\'' . $r['tweet_id'] . '\')">
                                 取消申请</a>';
                    } elseif ($app) {
                        $content .= '<a class="right microblog-item-control microblog-item-apply apply" style="display: none;" onclick="JobApply(this,\'' . $r['tweet_id'] . '\',\'' . $r['post_screenname'] . '\')">
                                 申请该职位</a><a class="right microblog-item-control microblog-item-apply unapply" onclick="JobUnApply(this,\'' . $r['tweet_id'] . '\')">
                                 取消申请</a>';
                    }
                }
            }
            if ($tags) {
                $content .= '</div><div class="microblog-item-other1">
                                <span class="left microblog-item-relate">相关职位:</span> ';
                foreach ($tags as $t) {
                    $content .= '<a class="left keyword microblog-item-relate" onclick="SearchContent(false, \'' . $t . '\', 0, 0)">' . $t . '</a>';
                }
            }
        }
        $content .= '
                        </div>
                    </div>
                </div>';
    }
    return $content;
}
Exemple #7
0
        $total = $p->count;
    }
    render('category', array('page' => $page, 'author' => $categoryposts, 'tags' => $tags, 'category' => $category, 'likes' => $likes, 'has_pagination' => has_pagination($page, $total)));
});
get('/post/:title', function ($title) {
    $post = find_post($title);
    if (!$post) {
        not_found();
    }
    foreach ($post as $ps) {
        $id = $ps['id'];
    }
    $tags = get_tags();
    $comments = get_comments($id);
    $category = get_category();
    $likes = get_likes();
    render('post', array('title' => $post->title . ' ⋅ ' . config('blog.title'), 'p' => $post, 'tags' => $tags, 'comments' => $comments, 'category' => $category, 'likes' => $likes));
});
// The JSON API
get('/api/json', function () {
    header('Content-type: application/json');
    // Print the 10 latest posts as JSON
    echo generate_json(get_posts(1, 10));
});
// Show the RSS feed
get('/rss', function () {
    header('Content-Type: application/rss+xml');
    // Show an RSS feed with the 30 latest posts
    echo generate_rss(get_posts(1, 30));
});
// If we get here, it means that