示例#1
0
function colabsthemes_uploader_custom_fields($pID, $id, $std, $desc)
{
    // Start Uploader
    $upload = get_post_meta($pID, $id, true);
    $href = $upload;
    $uploader = '';
    $uploader .= '<input class="colabs_input_text" name="' . $id . '" type="text" value="' . esc_attr($upload) . '" />';
    $uploader .= '<div class="clear"></div>' . "\n";
    $uploader .= '<input type="file" name="attachement_' . $id . '" />';
    $uploader .= '<input type="submit" class="button button-highlighted" value="Save" name="save"/>';
    if ($href) {
        $uploader .= '<span class="colabs_metabox_desc description">' . $desc . '</span></td>' . "\n" . '<td class="colabs_metabox_image"><a href="' . $upload . '">';
        $uploader .= colabs_image('width=300&height=200&link=img&return=true&src=' . $href);
        $uploader .= '</a>';
    }
    return $uploader;
}
							<tr class="item_property_bookmark" id="bookmark-row-<?php 
        echo $id;
        ?>
">
							<td class="item-remove"><a href="javascript:void(0)" onClick="remove_item_from_bookmark(bookmark_ajax_web_url,<?php 
        echo $values->ID;
        ?>
, <?php 
        echo $id;
        ?>
);" class="remove" title="<?php 
        _e('Remove this item', 'colabsthemes');
        ?>
">&times;</a></td>
							<td class="aligncenter"><?php 
        colabs_image('width=100&height=100&single=true&id=' . $id);
        ?>
</td>
							<td class="center"><h5><a href="<?php 
        echo get_permalink($id);
        ?>
"><?php 
        echo get_the_title($id);
        ?>
</a></h5><p><?php 
        echo get_the_term_list($id, 'property_type', '', ', ', '');
        ?>
</p><p><?php 
        echo $address . ' ' . $citystate;
        ?>
</p></td>
			<span class="as-feature"><?php 
    _e('Sold', 'colabsthemes');
    ?>
</span>
			<?php 
} elseif (is_sticky($post->ID)) {
    ?>
			<span class="as-feature"><?php 
    _e('Featured', 'colabsthemes');
    ?>
</span>
			<?php 
}
?>
			<?php 
colabs_image('width=300&before=<figure class=entry-media>&after=</figure>');
?>
      <header class="entry-header">
        <h2 class="entry-title"><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></h2>
        <?php 
if (get_post_meta($post->ID, 'colabs_property_sold', true) != 'true') {
    ?>
            <?php 
    $terms = wp_get_object_terms($post->ID, 'property_status');
    ?>
    <div class="gallery-details">  
      <a href="<?php 
    colabs_image('link=url&size=full');
    ?>
" rel="lightbox"><i class="icon-eye-open"></i></a>
      <a href="<?php 
    the_permalink();
    ?>
"><i class="icon-link"></i></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>';
    echo '<div class="time">
          <p class="entry-time">
            <i class="icon-time"></i>
            <span>' . get_the_date() . '</span> 
          </p>
          </div>';
    ?>
    </div>
    <?php 
    colabs_image('width=300&link=img');
    ?>
	</li>
<?php 
}
示例#5
0
            } elseif ($single_top[0] == 'single_image') {
                $content .= '
						  <a href="' . colabs_image('link=url&return=true') . '" title="' . $meta . '"class="grouped" rel="lightbox">
						    ' . colabs_image('width=626&link=img&return=true') . '
						  </a>';
                $check_src = colabs_image('link=url&return=true');
            }
        }
        $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++;
                $url = wp_get_attachment_image_src($att_id, 'full', true);
                if ($check_src != $url[0]) {
                    $content .= '<a href="' . $url[0] . '" title="' . $meta . '"class="grouped" rel="lightbox">' . colabs_image('width=626&link=img&return=true&src=' . $url[0]) . '</a>';
                }
            }
        }
        if ($content != '') {
            ?>
		
        <div class="entry-top">
          <div class="innercontainer">
            <div class="slider">
              <?php 
            echo $content;
            ?>
				
            </div>
            <div class="single-slider-nav">
<?php

$content = file_get_contents("https://picasaweb.google.com/data/feed/base/user/" . get_option('colabs_username_picasa') . "?alt=rss&kind=photo&hl=id&imgmax=1600&max-results=" . get_option('colabs_piccount_picasa') . "&start-index=1");
$x = new SimpleXmlElement($content);
foreach ($x->channel->item as $entry => $value) {
    $title = $value->title;
    $image = $value->enclosure->attributes()->url;
    $urlimg = $image[0];
    $urlimgori = $image[0];
    $date = str_ireplace('+0000', '', $value->pubDate);
    echo '<li class="gallery-item">
						<a href="' . $urlimgori . '" title="' . $title . '" rel="lightbox">
							' . colabs_image('width=280&link=img&return=true&src=' . $urlimg) . '
						</a>
							<div class="time">
								<p class="entry-time">
									<i class="icon-time"></i> 
									<span>' . $date . '</span> 
								</p>
							</div>
					  </li>';
}
示例#7
0
        ?>
</a></span>
			</p>
    </header>

		<div class="entry-media">
			<?php 
        $single_top = get_post_custom_values("colabs_single_top");
        if ($single_top[0] != '' || $single_top[0] == 'none') {
            if ($single_top[0] == 'single_video') {
                $embed = colabs_get_embed('colabs_embed', 664, 350, 'single_video', $post->ID);
                if ($embed != '') {
                    echo $embed;
                }
            } elseif ($single_top[0] == 'single_image') {
                colabs_image('width=664');
            }
        }
        ?>
		</div>

		<div class="entry-content">
			<?php 
        the_content();
        ?>
			<div class="entry-tags"><?php 
        the_tags();
        ?>
</div>
			<?php 
        echo colabs_share();
<?php

while (have_posts()) {
    the_post();
    if (colabs_image('link=url&return=false') == '') {
        continue;
    }
    ?>
		  <li class="gallery-item"><a href="<?php 
    colabs_image('link=url');
    ?>
" rel="lightbox"><?php 
    colabs_image('width=157&height=157&link=img');
    ?>
</a></li>
		  <?php 
}
示例#9
0
post_class('entry-post');
?>
>
  <?php 
$single_top = get_post_custom_values("colabs_single_top");
if ($single_top[0] != '' || $single_top[0] == 'none') {
    if ($single_top[0] == 'single_video') {
        $embed = colabs_get_embed('colabs_embed', '626', '200', 'single_video', $post->ID);
        if ($embed != '') {
            echo '<div class="entry-top"><div class="innercontainer">' . $embed . '</div></div>';
        }
    } elseif ($single_top[0] == 'single_image') {
        colabs_image('width=626&height=200&link=img&before=<div class=entry-top><div class=innercontainer>&after=</div></div>');
    }
} else {
    colabs_image('width=626&height=200&link=img&before=<div class=entry-top><div class=innercontainer>&after=</div></div>');
}
?>
      
  <div class="entry-content row">    
    <div class="entry-text">
      <h3 class="entry-title"><a href="<?php 
the_permalink();
?>
"><?php 
the_title();
?>
</a></h3>
      <ul class="entry-meta clearfix">
        <?php 
colabs_post_meta();
function colabs_background_slideshow()
{
    echo '<script type="text/javascript">';
    query_posts(array('post_type' => 'photograph', 'meta_key' => 'colabs_feature_photograph', 'meta_value' => 'true'));
    $slide = '';
    while (have_posts()) {
        the_post();
        $slide .= "{                  \n          image   :'" . colabs_image('link=url&return=true') . "',                \n          title   :'" . wptexturize(get_the_title()) . "',\n          url   :'" . get_permalink() . "',               \n          caption :'" . addslashes(wptexturize(get_the_excerpt())) . "'\n        },";
    }
    wp_reset_query();
    if ($slide != '') {
        echo 'slides = [' . rtrim($slide, ",") . ']';
    }
    echo '</script>';
}
 function colabsthemes_medialibrary_uploader($_id, $_value, $_mode = 'full', $_desc = '', $_postid = 0)
 {
     $output = '';
     $id = '';
     $class = '';
     $int = '';
     $value = '';
     $id = strip_tags(strtolower($_id));
     // If a post id is present, use it. Otherwise, search for one based on the $_id.
     if ($_postid != 0) {
         $int = $_postid;
     } else {
         $int = colabsthemes_mlu_get_silentpost($id);
         // Change for each field, using a "silent" post. If no post is present, one will be created.
     }
     // End IF Statement
     // If we're on a post add/edit screen, call the post meta value.
     if ('postmeta' == $_mode) {
         $value = get_post_meta($_postid, $id, true);
     } else {
         $value = get_option($id);
     }
     // End IF Statement
     // If a value is passed and we don't have a stored value, use the value that's passed through.
     if ($_value != '' && '' == $value) {
         $value = $_value;
     }
     // End IF Statement
     if ($value) {
         $class = ' has-file';
     }
     // End IF Statement
     $output .= '<input type="text" name="' . $id . '" id="' . $id . '" value="' . $value . '" class="upload' . $class . '" />' . "\n";
     $output .= '<input id="upload_' . $id . '" class="upload_button button" type="button" value="' . __('Upload', 'colabsthemes') . '" rel="' . $int . '" />' . "\n";
     if ($_desc != '') {
         $output .= '<span class="colabs_metabox_desc description">' . $_desc . '</span>' . "\n";
     }
     // End IF Statement
     $output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
     if ($value != '') {
         $remove = '<a href="javascript:(void);" class="mlu_remove button">Remove</a>';
         $image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $value);
         if ($image) {
             $value = colabs_image('width=334&height=223&return=true&link=url&src=' . $value);
             $output .= '<img src="' . $value . '" alt="" />' . $remove . '';
         } else {
             $parts = explode("/", $value);
             for ($i = 0; $i < sizeof($parts); ++$i) {
                 $title = $parts[$i];
             }
             // End FOR Loop
             // No output preview if it's not an image.
             $output .= '';
             // Standard generic output if it's not an image.
             $title = __('View File', 'colabsthemes');
             $output .= '<div class="no_image"><span class="file_link"><a href="' . $value . '" target="_blank" rel="external">' . $title . '</a></span>' . $remove . '</div>';
         }
         // End IF Statement
     }
     // End IF Statement
     $output .= '</div>' . "\n";
     return $output;
 }
示例#12
0
    while ($query_products->have_posts()) {
        $query_products->the_post();
        $product = get_product(get_the_ID());
        ?>
 
      <tr class="cart_table_item">
        <td class="product-remove">
          <a href="#" class="btn-delete" data-id="<?php 
        echo $product->id;
        ?>
" data-action="delete_user_product">&times;</a>
        </td>

        <td class="product-thumbnail">
          <?php 
        colabs_image('width=90&height=90&single=false');
        ?>
        </td>

        <!-- Product Name -->
        <td class="product-name">
          <a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a>
        </td>
        
        <!-- Product price -->
示例#13
0
    ?>
</a></li>
        <?php 
}
?>

        <li><a href="#property-facilities"><i class="icon-tasks"></i> <?php 
_e('Facilities', 'colabsthemes');
?>
</a></li>
      </ul>

      <div class="property-info-panel" id="property-gallery">
        <div class="property-gallery-large">
          <?php 
colabs_image('width=600&link=img&id=' . $property->ID);
?>
        </div>
      </div>
  
      <?php 
if ($maps_active == 'on') {
    ?>
        <div class="property-info-panel" id="property-maps">
          <?php 
    $mode = get_post_meta($id, 'colabs_maps_mode', true);
    $streetview = get_post_meta($id, 'colabs_maps_streetview', true);
    $address = get_post_meta($id, 'colabs_maps_address', true);
    $long = get_post_meta($id, 'colabs_maps_long', true);
    $lat = get_post_meta($id, 'colabs_maps_lat', true);
    $pov = get_post_meta($id, 'colabs_maps_pov', true);
  </thead>

  <tbody>
    <?php 
    while ($publish_query->have_posts()) {
        $publish_query->the_post();
        $pending_payment = colabs_get_pending_payment($post->ID);
        $expire_date = '';
        $poststatus = colabs_get_post_status($post);
        global $wpdb;
        $total_cost = $wpdb->get_var($wpdb->prepare("SELECT cost FROM " . $wpdb->prefix . "colabs_orders WHERE property_id=%d;", $post->ID));
        ?>
 
    <tr>
      <td class="property-col-image text-center"><?php 
        colabs_image('key=property_image&width=100&height=100');
        ?>
</td>
      
      <td class="property-col-title">
        <h5>
          <?php 
        if ($post->post_status == 'pending' || $post->post_status == 'draft' || $poststatus == 'ended' || $poststatus == 'offline') {
            ?>
            <?php 
            the_title();
            ?>
          <?php 
        } else {
            ?>
            <a href="<?php 
示例#15
0
function colabs_shortcode_pinterest($atts, $content = null)
{
    global $post;
    $defaults = array('count' => 'horizontal', 'float' => 'none', 'url' => '', 'image_url' => '', 'description' => '', 'use_post' => 'false');
    $atts = shortcode_atts($defaults, $atts);
    extract($atts);
    $allowed_floats = array('left' => ' fl', 'right' => ' fr', 'none' => '');
    if (!in_array($float, array_keys($allowed_floats))) {
        $float = 'none';
    }
    $allowed_counts = array('horizontal', 'vertical', 'none');
    if (!in_array($count, array_keys($allowed_counts))) {
        $count = 'horizontal';
    }
    $output = '';
    // Use the custom URL, if it has been specified.
    if ($atts['url'] != '') {
        $url = esc_url($atts['url']);
    } else {
        // Use the URL to the current $post in the loop.
        $url = esc_url(get_permalink($post));
    }
    // Use the custom image URL, if it has been specified.
    if ($atts['image_url'] != '') {
        $image_url = esc_url($atts['image_url']);
    } else {
        // Use the image of the current $post in the loop.
        $image_url = esc_url(colabs_image('link=url&return=true'));
    }
    // Use the custom description, if it has been specified.
    if ($atts['description'] != '') {
        $description = esc_attr($atts['description']);
    } else {
        // Use the excerpt of the current $post in the loop, if no description is set and if instructed to do so.
        if ('true' == $atts['use_post']) {
            $description = esc_attr(strip_shortcodes(apply_filters('get_the_excerpt', $post->post_excerpt)));
        }
    }
    $output = apply_filters('colabs_shortcode_pinterest', '<div class="shortcode-pinterest' . $allowed_floats[$float] . '"><a href="http://pinterest.com/pin/create/button/?url=' . urlencode($url) . '&media=' . urlencode($image_url) . '&description=' . urlencode($description) . '" class="pin-it-button" count-layout="' . $count . '">' . __('Pin It', 'colabsthemes') . '</a></div><!--/.shortcode-pinterest-->' . "\n", $atts);
    // Enqueue the Pinterest button JavaScript from their API.
    add_action('wp_footer', 'colabs_shortcode_pinterest_javascript');
    add_action('colabs_shortcode_generator_preview_footer', 'colabs_shortcode_pinterest_javascript');
    return $output . "\n";
}
function colabs_facebook_fetch_album_content($aid, $params)
{
    //Combine optional parameters with default values
    $defaults = array('cols' => 4, 'start' => 0, 'max' => 99999999999, 'swapHead' => false, 'hideHead' => true, 'hideCaps' => false, 'noLB' => false, 'rand' => false, 'isGroup' => false, 'isPage' => false, 'isEvent' => false, 'orderby' => 'normal');
    //Can be "normal" or "reverse" (for now)
    $params = array_merge($defaults, $params);
    $itemwidth = $params['cols'] > 0 ? floor(100 / $params['cols']) : 100;
    $itemwidth -= 0.5 / $params['cols'];
    //For stupid IE7, which rounds fractional percentages UP (shave off 0.5%, or the last item will wrap to the next row)
    $retVal = array();
    //Connect to Facebook and restore our user's session
    global $appapikey, $appsecret;
    global $option_fb_sess_key, $option_fb_sess_sec;
    if (!class_exists('Facebook')) {
        if (version_compare('5', PHP_VERSION, "<=")) {
            require_once 'facebook-platform/facebook.php';
        } else {
            die("Sorry, but as of version 1.0.0, Facebook Photo Album requires PHP5.");
        }
    }
    $facebook = new Facebook($appapikey, $appsecret, null, true);
    $facebook->api_client->session_key = get_option($option_fb_sess_key);
    $facebook->api_client->secret = get_option($option_fb_sess_sec);
    //Get the specified album, its photos, and its author
    //(Different methods of fetching the photos albums, groups, pages, etc)
    if ($params['isGroup']) {
        //NOTE: According to http://wiki.developers.facebook.com/index.php/Photos.get,
        //you should be able to do this for events too - but it photos_get always returns null.
        $group = $facebook->api_client->groups_get('', $aid, '');
        if (!$group) {
            $retVal['content'] = "Invalid Group ID ({$aid})";
            return $retVal;
        }
        $group = $group[0];
        $photos = $facebook->api_client->photos_get($aid, '', '');
        $album['link'] = "http://www.facebook.com/group.php?gid={$aid}";
        $album['name'] = $group['name'];
        $retVal['thumb'] = $group['pic_big'];
    } else {
        if ($params['isPage']) {
            $page = $facebook->api_client->pages_getInfo($aid, array('name', 'pic_big'), null, null);
            if (!$page) {
                $retVal['content'] = "Invalid Page ID ({$aid})";
                return $retVal;
            }
            $page = $page[0];
            $photos = $facebook->api_client->fql_query("SELECT pid, aid, owner, src, src_big, src_small, link, caption, created FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = {$aid})");
            $album['link'] = "http://www.facebook.com/profile.php?id={$aid}";
            $album['name'] = $page['name'];
            $retVal['thumb'] = $page['pic_big'];
        } else {
            if ($params['isEvent']) {
                $retVal['content'] = "Events not yet supported.";
                return $retVal;
            } else {
                try {
                    $album = $facebook->api_client->photos_getAlbums(null, $aid);
                } catch (Exception $e) {
                    $albums = false;
                }
                if (!$album) {
                    $retVal['content'] = "Invalid Album ID ({$aid}) - Please relogin your facebook";
                    return $retVal;
                }
                $album = $album[0];
                if (!$album) {
                    $retVal['content'] = "Facebook Photo Album was unable to connect to Facebook.  Please check its options and verify that it's been associated with your account, then re-fetch this album.";
                    return $retVal;
                }
                $photos = $facebook->api_client->photos_get(null, $aid, null);
                $author = $facebook->api_client->users_getInfo($album['owner'], array('name', 'profile_url'));
                $author = $author[0];
            }
        }
    }
    if (!is_array($photos)) {
        $photos = array();
    }
    $album['size'] = count($photos);
    //Store the filename of the album thumbnail when found
    //Note: we want the fullsize, because when WP uploads it it'll auto-resize it to an appropriate thumbnail for us.
    //We must do this here, prior to slicing down the array of photos.
    if (isset($album['cover_pid']) && !isset($retVal['thumb']) && isset($GLOBALS['add-from-server'])) {
        foreach ($photos as $photo) {
            if (strcmp($photo['pid'], $album['cover_pid']) == 0) {
                $retVal['thumb'] = $photo['src_big'];
            }
        }
    }
    //Reorder the photos if necessary
    if ($params['orderby'] == 'reverse') {
        $photos = array_reverse($photos);
    }
    //Slice the photo array as necessary
    if (count($photos) > 0) {
        //Slice the photos between "start" and "max"
        if ($params['start'] > $album['size']) {
            $retVal['content'] .= "<b>Error: Start index " . $params['start'] . " is greater than the total number of photos in this album; Defaulting to 0.</b><br /><br />";
            $params['start'] = 0;
        }
        if ($params['max'] > $album['size'] - $params['start']) {
            $params['max'] = $album['size'] - $params['start'];
        }
        $photos = array_slice($photos, $params['start'], $params['max']);
        //If "rand" is specified, randomize the order and slice again
        if ($params['rand']) {
            shuffle($photos);
            $photos = array_slice($photos, 0, $params['rand']);
        }
    }
    $retVal['count'] = count($photos);
    //Create a header with some info about the album
    if (!$params['hideHead']) {
        $headerTitle = 'From <a href="' . htmlspecialchars($album['link']) . '">' . $album['name'] . '</a>';
        if (isset($author) && isset($album['created'])) {
            $headerTitle .= ', posted by <a href="' . htmlspecialchars($author['profile_url']) . '">' . $author['name'] . '</a>';
            $headerTitle .= ' on ' . date('n/d/Y', $album['created']);
        }
        if ($retVal['count'] < $album['size']) {
            $headerTitle .= ' (Showing ' . $retVal['count'] . ' of ' . $album['size'] . " items)\n";
        } else {
            $headerTitle .= ' (' . $retVal['count'] . " items)\n";
        }
        $headerTitle .= '<br /><br />';
        if ($album['description']) {
            $headerDesc = '"' . $album['description'] . '"<br /><br />' . "\n";
        } else {
            $headerDesc = "";
        }
    }
    //Output the album!  Starting with a (hidden) timestamp, then the header, then each photo.
    global $colabs_facebook_version;
    $retVal['content'] .= "<!-- ID " . $aid . " Last fetched on " . date('m/d/Y H:i:s') . " v{$colabs_facebook_version}-->\n";
    if ($params['swapHead']) {
        $retVal['content'] .= $headerTitle . $headerDesc;
    } else {
        $retVal['content'] .= $headerDesc . $headerTitle;
    }
    foreach ($photos as $photo) {
        //Output this photo (must get rid of [], or WP will try to run it as shortcode)
        $caption = preg_replace("/\\[/", "(", $photo['caption']);
        $caption = preg_replace("/\\]/", ")", $caption);
        $caption = preg_replace("/\r/", "", $caption);
        if (!$params['hideCaps']) {
            $caption_no_br = htmlspecialchars(preg_replace("/\n/", " ", $caption));
        }
        $link = '<a rel="lightbox" href="' . $photo['images'][0]['source'] . '" title="' . $caption_no_br . '" >' . colabs_image('width=222&link=img&return=true&src=' . $photo['src_big']) . '</a>';
        $retVal['content'] .= '<li class="gallery-item">';
        $retVal['content'] .= "{$link}";
        $like = $photo['like_info']['like_count'];
        $date = date(get_option('date_format'), $photo['created']);
        $retVal['content'] .= '<div class="like">
											<p class="entry-likes">
												<i class="icon-heart"></i> 
												<span>' . $like . '</span> 
												' . __("Likes", "colabsthemes") . '
											</p>
										</div>
										<div class="time">
											<p class="entry-time">
												<i class="icon-time"></i> 
												<span>' . $date . '</span> 
											</p>
										</div>';
        $retVal['content'] .= '</li>';
    }
    $retVal['content'] .= "<!-- End Album " . $aid . " -->\n";
    return $retVal;
}
    function og_meta()
    {
        ?>
	<?php 
        if (is_home() && '' == get_option('colabs_og_enable')) {
            ?>
	<meta property="og:title" content="<?php 
            echo bloginfo('name');
            ?>
" />
	<meta property="og:type" content="author" />
	<meta property="og:url" content="<?php 
            home_url();
            ?>
" />
	<meta property="og:image" content="<?php 
            echo get_option('colabs_og_img');
            ?>
"/>
	<meta property="og:site_name" content="<?php 
            echo get_option('colabs_og_sitename');
            ?>
" />
	<meta property="fb:admins" content="<?php 
            echo get_option('colabs_og_admins');
            ?>
" />
	<meta property="og:description" content="<?php 
            echo get_option('blogdescription ');
            ?>
" />
	<?php 
        }
        ?>
	
	<?php 
        if ((is_page() || is_single()) && '' == get_option('colabs_og_enable')) {
            ?>
	<meta property="og:title" content="<?php 
            the_title();
            ?>
" />
	<meta property="og:type" content="article" />
	<meta property="og:url" content="<?php 
            echo get_permalink();
            ?>
" />
	<?php 
            $image = colabs_image('return=true&link=img&width=100&height=100&size=thumbnail');
            if ($image) {
                //get img url
                preg_match('@<img.+src="(.*)".*>@Uims', $image, $matches);
                $src = $matches[1];
                ?>
        <meta property="og:image" content="<?php 
                echo $src;
                ?>
"/>
    <?php 
            }
            ?>
	<meta property="og:site_name" content="<?php 
            echo get_option('colabs_og_sitename');
            ?>
" />
	<meta property="fb:admins" content="<?php 
            echo get_option('colabs_og_admins');
            ?>
" />
	<?php 
        }
        ?>
    
    <meta name="viewport" content="width=1024,maximum-scale=1.0" />
<?php 
    }
示例#18
0
    <aside class="widget widget_property_author">
      <h4 class="widget-title"><?php 
        _e('Listed By', 'colabsthemes');
        ?>
</h4>
      <p><?php 
        _e("To arrange a viewing or request more details about this property, contact", "colabsthemes");
        ?>
 :</p>
      <div class="property-author">
        <div class="property-author-image">
				<?php 
        if ($agent_id != 'self') {
            ?>
				<?php 
            colabs_image('width=65&height=65&class=avatar&id=' . $agent_id);
            ?>
				<?php 
        } else {
            ?>
				<?php 
            echo get_avatar(get_the_author_meta('user_email', $post->post_author), 65);
            ?>
				<?php 
        }
        ?>
				</div>
        <div class="property-author-name">
          <?php 
        if ($agent_id != 'self') {
            ?>
示例#19
0
} elseif (get_option('colabs_home') == 'Dribbble') {
    $feed_url = 'http://api.dribbble.com/players/' . get_option('colabs_username_dribbble') . '/shots?per_page=' . get_option('colabs_piccount_dribbble');
    $json = wp_remote_get($feed_url);
    $array = json_decode($json['body']);
    $shots = $array->shots;
    if (!empty($shots)) {
        foreach ($shots as $item) {
            $src = $item->image_url;
            $pin_caption = $item->title;
            $like = $item->likes_count;
            echo '
					<article class="entry-post">
						<div class="innercontainer">
							<div class="entry-top">
								<a href="' . $src . '" title="' . $pin_caption . '" rel="lightbox-">
									' . colabs_image('width=222&link=img&return=true&src=' . $src) . '<span><i class="icon-search"></i></span>
								</a>
							</div>
							<h3 class="entry-title"><a href="' . $src . '" target="_blank">' . $pin_caption . '</a></h3>
							<p class="entry-likes"><i class="icon-heart "></i> <span>' . $like . '</span> Loves</p>
							</div>
					</article>';
        }
    }
} else {
    $latest = new WP_Query(array('post_type' => 'post', 'post__not_in' => get_option('sticky_posts'), 'paged' => $paged));
    if ($latest->have_posts()) {
        while ($latest->have_posts()) {
            $latest->the_post();
            get_template_part('content', 'photograph');
        }
示例#20
0
 function og_meta()
 {
     if (is_home() && '' == get_option('colabs_og_enable')) {
         echo '<meta property="og:title" content="' . get_bloginfo('name') . '" />' . "\n";
         echo '<meta property="og:type" content="author" />' . "\n";
         echo '<meta property="og:url" content="' . home_url('') . '" />' . "\n";
         echo '<meta property="og:image" content="' . get_option('colabs_og_img') . '"/>' . "\n";
         echo '<meta property="og:site_name" content="' . get_option('colabs_og_sitename') . '" />' . "\n";
         echo '<meta property="fb:admins" content="' . get_option('colabs_og_admins') . '" />' . "\n";
         echo '<meta property="og:description" content="' . get_option('blogdescription ') . '" />' . "\n";
     }
     if ((is_page() || is_single()) && '' == get_option('colabs_og_enable')) {
         echo '<meta property="og:title" content="' . get_the_title() . '" />' . "\n";
         echo '<meta property="og:type" content="article" />' . "\n";
         echo '<meta property="og:url" content="' . get_permalink() . '" />' . "\n";
         $ogdesc = str_replace('[&hellip;]', '&hellip;', strip_tags(get_the_excerpt()));
         echo '<meta property="og:description" content="' . $ogdesc . '" />' . "\n";
         $image = colabs_image('return=true&link=img&width=300&height=300&size=thumbnail');
         if ($image) {
             //get img url
             preg_match('@<img.+src="(.*)".*>@Uims', $image, $matches);
             $src = $matches[1];
             echo '<meta property="og:image" content="' . $src . '"/>' . "\n";
         }
         echo '<meta property="og:site_name" content="' . get_option('colabs_og_sitename') . '" />' . "\n";
         if (get_option('colabs_og_admins')) {
             echo '<meta property="fb:admins" content="' . get_option('colabs_og_admins') . '" />' . "\n";
         }
         $tags = get_the_tags();
         if (!is_wp_error($tags) && (is_array($tags) && $tags !== array())) {
             foreach ($tags as $tag) {
                 echo '<meta property="article:tag" content="' . $tag->name . '>" />' . "\n";
             }
         }
         $terms = get_the_category();
         if (!is_wp_error($terms) && (is_array($terms) && $terms !== array())) {
             foreach ($terms as $term) {
                 echo '<meta property="article:section" content="' . $term->name . '" />' . "\n";
             }
         }
         $pub = get_the_date('c');
         echo '<meta property="article:published_time" content="' . $pub . '" />' . "\n";
         $mod = get_the_modified_date('c');
         if ($mod != $pub) {
             echo '<meta property="article:modified_time" content="' . $mod . '" />' . "\n";
             echo '<meta property="og:updated_time" content="' . $mod . '" />' . "\n";
         }
     }
 }
示例#21
0
 function colabs_share()
 {
     $return = '';
     $colabs_share_twitter = get_option('colabs_share_twitter');
     $colabs_share_fblike = get_option('colabs_share_fblike');
     $colabs_share_google_plusone = get_option('colabs_share_google_plusone');
     $colabs_share_pinterest = get_option('colabs_share_pinterest');
     $colabs_share_linkedin = get_option('colabs_share_linkedin');
     //Share Button Functions
     global $colabs_options;
     $url = get_permalink();
     $share = '';
     //Twitter Share Button
     if (function_exists('colabs_shortcode_twitter') && $colabs_share_twitter == "true") {
         $tweet_args = array('url' => $url, 'style' => 'horizontal', 'source' => $colabs_options['colabs_twitter_username'] ? $colabs_options['colabs_twitter_username'] : '', 'text' => '', 'related' => '', 'lang' => '', 'float' => 'fl');
         $share .= colabs_shortcode_twitter($tweet_args);
     }
     //Google +1 Share Button
     if (function_exists('colabs_shortcode_google_plusone') && $colabs_share_google_plusone == "true") {
         $google_args = array('size' => 'medium', 'language' => '', 'count' => '', 'href' => $url, 'callback' => '', 'float' => 'left', 'annotation' => 'bubble');
         $share .= colabs_shortcode_google_plusone($google_args);
     }
     //Facebook Like Button
     if (function_exists('colabs_shortcode_fblike') && $colabs_share_fblike == "true") {
         $fblike_args = array('float' => 'left', 'url' => '', 'style' => 'button_count', 'showfaces' => 'false', 'width' => '80', 'height' => '', 'verb' => 'like', 'colorscheme' => 'light', 'font' => 'arial');
         $share .= colabs_shortcode_fblike($fblike_args);
     }
     global $post;
     if (is_attachment()) {
         $att_image = wp_get_attachment_image_src($post->id, "thumbnail");
         $image = $att_image[0];
     } else {
         $image = colabs_image('return=true&link=url&id=' . $post->ID);
     }
     //Pinterest Share Button
     if (function_exists('colabs_shortcode_pinterest') && $colabs_share_pinterest == "true") {
         $pinterest_args = array('count' => 'horizontal', 'float' => 'left', 'use_post' => 'true', 'image_url' => $image, 'url' => $url);
         $share .= colabs_shortcode_pinterest($pinterest_args);
     }
     //Linked Share Button
     if (function_exists('colabs_shortcode_linkedin_share') && $colabs_share_linkedin == "true") {
         $linkedin_args = array('url' => $url, 'style' => 'right', 'float' => 'left');
         $share .= colabs_shortcode_linkedin_share($linkedin_args);
     }
     $return .= '<div class="social_share">' . $share . '</div><div class="clear"></div>';
     return $return;
 }
示例#22
0
    function colabs_tabs_latest($posts = 5, $size = 35)
    {
        global $post;
        $latest = get_posts('caller_get_posts=1&showposts=' . $posts . '&orderby=post_date&order=desc');
        foreach ($latest as $post) {
            setup_postdata($post);
            ?>
	<li>
		<?php 
            if ($size != 0) {
                colabs_image('height=' . $size . '&width=' . $size . '&class=thumbnail&single=true');
            }
            ?>
		<div class="tabs-content">
			<a title="<?php 
            the_title();
            ?>
" href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a>
			<span class="meta"><?php 
            the_time(get_option('date_format'));
            ?>
</span>
			<div class="clear"></div>
		</div>
	</li>
	<?php 
        }
    }
    /**
     * Tabs Latest
     */
    function colabs_tabs_latest($posts = 5, $size = 35)
    {
        global $post;
        $args = array('post_type' => array('post', 'review'), 'post_status' => 'publish', 'showposts' => $posts, 'orderby' => 'post_date', 'order' => 'desc', 'caller_get_posts' => 1);
        $latest = get_posts($args);
        foreach ($latest as $post) {
            setup_postdata($post);
            ?>
		<li>
			<div class="tabs-content">
				<?php 
            colabs_image('width=50&height=50');
            ?>
				<div class="tabs-text">
					<span class="meta"><?php 
            the_time(get_option('date_format'));
            ?>
</span>
					<a title="<?php 
            the_title();
            ?>
" href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a>
				</div>
			</div>
		</li>
		<?php 
        }
    }
		    <?php 
        colabs_post_meta();
        ?>
          </header>
            
          <figure class="entry-media">
			<?php 
        $single_top = get_post_custom_values("colabs_single_top");
        if ($single_top[0] != '' || $single_top[0] == 'none') {
            if ($single_top[0] == 'single_video') {
                $embed = colabs_get_embed('colabs_embed', 400, 231, 'single_video', $post->ID);
                if ($embed != '') {
                    echo '<div class="single_video">' . $embed . '</div>';
                }
            } elseif ($single_top[0] == 'single_image') {
                colabs_image('width=620&link=img');
            }
        }
        ?>
          </figure><!-- .entry-media -->
          
          <div class="entry-content">
			<?php 
        the_content();
        ?>
			<?php 
        wp_link_pages(array('before' => __('<p><strong>Pages:</strong>', 'colabsthemes'), 'after' => '</p>', 'next_or_number' => 'number'));
        ?>
		  </div><!-- .entry-content -->
          
          <?php 
示例#25
0
    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 '
							<a style="display:none" href="' . $url[0] . '" title="' . get_the_title() . '" rel="lightbox-' . get_the_ID() . '">
							  ' . colabs_image('width=626&link=img&return=true&src=' . $url[0]) . '<div class="desc">' . $attachment->post_content . '</div>
							</a>';
        }
    }
}