function photograph_custom_columns($column)
{
    global $post;
    switch ($column) {
        case "photograph-categories":
            echo get_the_term_list($post->ID, 'photograph-categories', '', ', ', '');
            break;
        case "likes":
            if (function_exists('get_like')) {
                echo get_like($post - ID);
            }
            break;
        case "photo":
            if (has_post_thumbnail()) {
                the_post_thumbnail(array(75, 75));
            }
            break;
        case "feature":
            $url = wp_nonce_url(admin_url('admin-ajax.php?action=photograph-feature&id=' . $post->ID), 'photograph-feature');
            if (get_post_meta($post->ID, 'colabs_feature_photograph', true) == 'true') {
                $icon = '<img src="' . get_template_directory_uri() . '/images/on.png" />';
            } else {
                $icon = '<img src="' . get_template_directory_uri() . '/images/off.png" />';
            }
            echo '<a href="' . $url . '">' . $icon . '</a>';
            break;
    }
}
Пример #2
0
function photograph_custom_columns($column)
{
    global $post;
    switch ($column) {
        case "photograph-categories":
            echo get_the_term_list($post->ID, 'photograph-categories', '', ', ', '');
            break;
        case "likes":
            if (function_exists('get_like')) {
                if (isset($post->ID)) {
                    echo get_like($post->ID);
                }
            }
            break;
        case "photo":
            if (has_post_thumbnail()) {
                the_post_thumbnail('thumbnail');
            }
            break;
    }
}
Пример #3
0
</li>
              <?php 
        if (comments_open()) {
            ?>
                    <li class="entry-comments-count icon-comment"><a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('Add Comment', 'colabsthemes'), __('1 Comment', 'colabsthemes'), __('% Comments', 'colabsthemes'));
            ?>
</a></li>
              <?php 
        }
        ?>
              <li class="entry-author icon-heart"><?php 
        echo get_like(get_the_ID());
        ?>
</li>
            </ul>
          </header>
          
          <?php 
        if (has_post_thumbnail()) {
            ?>
  
          <figure class="entry-media">
            <?php 
            the_post_thumbnail('full');
            $attachment_metadata = wp_get_attachment_metadata(get_post_thumbnail_id($post->ID));
            if ($camera == '') {
                $camera = $attachment_metadata['image_meta']['camera'];
Пример #4
0
        $additional = $_POST['additional'];
        $like_object = $_POST['like'];
        $fbuid = $_POST['fbuid'];
        process($like_object, $additional, $fbuid);
        break;
    case 'save_forum_relation':
        $like_id = $_POST['like_id'];
        $forum_id = $_POST['forum_id'];
        $category_id = $_POST['category_id'];
        save_forum_relation($like_id, $forum_id);
        break;
    case 'getlike':
        $like_id = $_POST['likeid'];
        $like_object = $_POST['like'];
        $fbuid = $_POST['fbuid'];
        get_like($like_id, $fbuid, $like_object);
        break;
    case 'save_existing_like':
        $like_id = $_POST['likeid'];
        $additional = $_POST['additional'];
        $fbuid = $_POST['fbuid'];
        save_existing_like($like_id, $additional, $fbuid);
        break;
    case 'get_fxp_categories':
        $links = $_POST['links'];
        get_fxp_categories($links);
        break;
    default:
        break;
}
function get_fxp_categories($links)
Пример #5
0
function set_new_like($like_id, $page_name, $is_like_data)
{
    // before all, check if like already exist in db
    $like = get_like($like_id);
    if (!$like) {
        if ($is_like_data) {
            $like_data = get_like_data_fb($like_id);
        }
        $like_name = $page_name;
        insert_new_like_mysql($like_id, $like_name, $is_like_data);
        // done
    } else {
        return $like->like_id;
    }
}
Пример #6
0
function get_all_posts($db, $posts, $db)
{
    // checking likes
    $ret_text = "";
    foreach ($posts as $single_post) {
        $user_id = file_exists("images/ava/" . $single_post["users_id"] . ".png") ? $single_post["users_id"] : "unknown";
        $img = "";
        $tmp_img = get_image($single_post["id"]);
        if ($tmp_img) {
            $img = '<div class="post_pictures"><img src="' . $tmp_img . '" class="with_shadow2 img_post" ></div>';
        }
        $tmp_arr = $db->DBSelectOne("users", "name, email", array("id" => $single_post["users_id"]));
        $tmp_username = $tmp_arr ? $tmp_arr["name"] : "Unknown user";
        $check_like = check_post_likes($single_post["id"], $_SESSION["user_id"], $db);
        $like_part = get_like($single_post["id"], $check_like);
        if (isset($_POST["edit_post_id"]) && $_POST["edit_post_id"] == $single_post["id"]) {
            $edit_form = edit_post_form($single_post["id"], $db);
        } else {
            $edit_form = "";
        }
        $ret_text .= '<div class="single_post">
                        ' . $edit_form . '
                        <div class="post_avatar"><img src="images/ava/' . $user_id . '.png" class="img-circle"></div>
                        <div class="post_text">
                            <div style="float:left;"><h2><a href="index.php?web=profile&email=' . $tmp_arr["email"] . '">' . $tmp_username . '</a></h2></div>
                            <div style="float:right;">
                                ' . check_rights($single_post["users_id"], $_SESSION["user_id"], $single_post["id"]) . '
                            </div>

                            <div class="post_time clear_panel">' . get_time(time() - $single_post["time"]) . '</div>
                                <div>' . $single_post["text"] . '<br><br></div>
                                ' . $img . '
                                <div class="like_counter">
                                    <form method="POST" class="form_nonstyle">
                                        ' . $like_part . '
                                    </form></div>';
        $all_comments_arr = $db->DBSelectAll("comments", "id, text, time, posts_id, users_id", array("posts_id" => $single_post["id"]));
        foreach ($all_comments_arr as $single_comment) {
            $commentator = $db->DBSelectOne("users", "id, name, email", array("id" => $single_comment["users_id"]));
            $ret_text .= '  <div class="post_comment">
                                     <div class="comment_avatar"><img src="' . get_ava($commentator["id"]) . '" class="img-circle"></div>
                                        <div class="comment_text">
                                             <div style="float:left; font-weight:bold;"><a href="index.php?web=profile&email=' . $commentator["email"] . '">' . $commentator["name"] . '</a></div>
                                            <div class="post_time" style="float:right;">' . get_time(time() - $single_comment["time"]) . '</div>
                                            <div style="clear:both;"></div>
                                            ' . $single_comment["text"] . '
                                        </div>
                                    <div class="clear_panel min_size"></div>
                                    
                                </div>';
        }
        $ret_text .= '</div>
                            <div class="clear_panel min_size"></div>
                                <div class="new_comment">
                                    <form method="POST" class="new_comment_form" name="new_comment_form" onsubmit="return validate_textarea_newcomment()">
                                        <textarea rows="2" cols="90" maxlength="300" name="comment_textarea" class="form-control" placeholder="Write a comment..."></textarea>
                                        <input type="hidden" value="' . $single_post["id"] . '" name="post_id">
                                        <input type="submit" value="Comment" class="btn btn-primary">
                                    </form>
                                </div>
                            <div class="clear_panel"></div></div>';
        // end single_post,
    }
    return $ret_text;
}
while (have_posts()) {
    the_post();
    ?>
		  <li class="gallery-item">
		  <a href="<?php 
    colabs_image('link=url');
    ?>
" rel="lightbox"><?php 
    colabs_image('width=157&height=157&link=img');
    ?>
</a>
		  <?php 
    echo '<div class="like">
						<p class="entry-likes" data-like="' . get_like(get_the_ID()) . '_' . get_the_ID() . '">
							<i class="icon-heart ' . $_COOKIE['like_' . get_the_ID()] . '"></i> 
							<span>' . get_like(get_the_ID()) . '</span> 
							' . __("Loves", "colabsthemes") . '
						</p>
					  </div>';
    ?>
		  <?php 
    echo '<div class="time">
						<p class="entry-time">
							<i class="icon-time"></i> 
							<span>' . get_the_date() . '</span> 
						</p>
					  </div>';
    ?>
		  </li>
		  <?php 
}
Пример #8
0
    } elseif ($single_top[0] == 'single_image') {
        $check_image = colabs_image('link=url&return=true');
        echo colabs_image('width=222&link=img&return=true') . '<span><i class="icon-search"></i></span><div class="desc">' . get_post_field('post_content', get_post_thumbnail_id()) . '</div>';
    }
} else {
    $check_image = colabs_image('link=url&return=true');
    echo colabs_image('width=222&link=img&return=true') . '<span><i class="icon-search"></i></span><div class="desc">' . get_post_field('post_content', get_post_thumbnail_id()) . '</div>';
}
echo '		</a>
					</div>
					<h3 class="entry-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h3>
					<p class="entry-likes" data-like="' . get_like(get_the_ID()) . '_' . get_the_ID() . '"><i class="icon-heart ';
if (isset($_COOKIE['like_' . get_the_ID()])) {
    echo $_COOKIE['like_' . get_the_ID()];
}
echo '"></i> <span>' . get_like(get_the_ID()) . '</span> Loves</p>
					<p class="entry-tags">
					  <i class="icon-tags"></i>
					  ' . get_the_term_list(get_the_ID(), 'photograph-categories', '', ', ', '') . get_the_term_list(get_the_ID(), 'post_tag', '', ', ', '') . '  
					</p>
				</div>
			</article>';
$attachments = get_children(array('post_parent' => get_the_ID(), 'numberposts' => 100, 'post_type' => 'attachment', 'post_mime_type' => 'image'));
if (!empty($attachments)) {
    $count = 0;
    foreach ($attachments as $att_id => $attachment) {
        $count++;
        //if ($count <= $offset) continue;
        $url = wp_get_attachment_image_src($att_id, 'full', true);
        if ($check_image != $url[0]) {
            echo '