ID);
- $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
+ $portfolio_options = get_option( 'prtfl_options' );
+ $meta_values = get_post_custom( $post->ID );
+ $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
if ( empty ( $post_thumbnail_id ) ) {
$args = array(
- 'post_parent' => $post->ID,
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- 'numberposts' => 1
+ 'post_parent' => $post->ID,
+ 'post_type' => 'attachment',
+ 'post_mime_type' => 'image',
+ 'orderby' => 'menu_order',
+ 'order' => 'ASC',
+ 'numberposts' => 1
);
- $attachments = get_children( $args );
- $post_thumbnail_id = key($attachments);
+ $attachments = get_children( $args );
+ $post_thumbnail_id = key($attachments);
}
- $image = wp_get_attachment_image_src( $post_thumbnail_id, 'portfolio-thumb' );
- $image_large = wp_get_attachment_image_src( $post_thumbnail_id, 'large' );
- $image_alt = get_post_meta( $post_thumbnail_id, '_wp_attachment_image_alt', true );
- $image_desc = get_post($post_thumbnail_id);
- $image_desc = $image_desc->post_content;
- if ( get_option( 'prtfl_postmeta_update' ) == '1' ) {
- $post_meta = get_post_meta( $post->ID, 'prtfl_information', true);
- $date_compl = $post_meta['_prtfl_date_compl'];
- if( ! empty( $date_compl ) && 'in progress' != $date_compl) {
- $date_compl = explode( "/", $date_compl );
- $date_compl = date( get_option( 'date_format' ), strtotime( $date_compl[1]."-".$date_compl[0].'-'.$date_compl[2] ) );
- }
- $link = $post_meta['_prtfl_link'];
- $short_descr = $post_meta['_prtfl_short_descr'];
- $full_descr = $post->post_content != "" ? $post->post_content : $post_meta['_prtfl_short_descr'];
- $svn = $post_meta['_prtfl_svn'];
- } else {
- $date_compl = get_post_meta( $post->ID, '_prtfl_date_compl', true );
- if( ! empty( $date_compl ) && 'in progress' != $date_compl) {
- $date_compl = explode( "/", $date_compl );
- $date_compl = date( get_option( 'date_format' ), strtotime( $date_compl[1]."-".$date_compl[0].'-'.$date_compl[2] ) );
- }
- $link = get_post_meta($post->ID, '_prtfl_link', true);
- $short_descr = get_post_meta($post->ID, '_prtfl_short_descr', true);
- $full_descr = $post->post_content != "" ? $post->post_content : get_post_meta($post->ID, '_prtfl_short_descr', true);
- $svn = get_post_meta($post->ID, '_prtfl_svn', true);
- } ?>
-
+
-
-
-
-
+ $image = wp_get_attachment_image_src( $post_thumbnail_id, 'portfolio-thumb' );
+ $image_large = wp_get_attachment_image_src( $post_thumbnail_id, 'large' );
+ $image_alt = get_post_meta( $post_thumbnail_id, '_wp_attachment_image_alt', true );
+ $image_desc = get_post($post_thumbnail_id);
+ $image_desc = $image_desc->post_content;
+ $full_descr = $post->post_content != "" ? $post->post_content : '';
+ $post_meta = get_post_meta( $post->ID, 'prtfl_information', true );
+ $date_compl = isset( $post_meta['_prtfl_date_compl'] ) ? $post_meta['_prtfl_date_compl'] : '';
+ if ( ! empty( $date_compl ) && 'in progress' != $date_compl) {
+ $date_compl = explode( "/", $date_compl );
+ $date_compl = date( get_option( 'date_format' ), strtotime( $date_compl[1] . "-" . $date_compl[0] . '-' . $date_compl[2] ) );
+ }
+ $link = isset( $post_meta['_prtfl_link'] ) ? $post_meta['_prtfl_link'] : '';
+ if ( empty( $full_descr ) )
+ $full_descr = isset( $post_meta['_prtfl_short_descr'] ) ? $post_meta['_prtfl_short_descr'] : '';
+ $svn = $post_meta['_prtfl_svn'];
+ if ( ! empty( $image[0] ) ) { ?>
+
+
+
+
+
+
@@ -65,62 +73,61 @@ - + if ( false !== parse_url( $link ) ) { ?> +
- - -
- + +
+ +
", $full_descr); ?>
-", $full_descr); ?>
- - + if ( 0 != $user_id && $portfolio_options ) { + if ( 1 == $portfolio_options['prtfl_svn_additional_field'] ) { ?>ID, 'portfolio_executor_profile' ); ?>
0) - $content .= ', '; ?> - name; ?> + foreach ( $executors_profile as $profile ) { + if ( $count > 0 ) + echo ', '; ?> + name; ?>
-
- $post->ID,
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'numberposts' => -1,
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- 'exclude' => $post_thumbnail_id
+ $post->ID,
+ 'post_type' => 'attachment',
+ 'post_mime_type' => 'image',
+ 'numberposts' => -1,
+ 'orderby' => 'menu_order',
+ 'order' => 'ASC',
+ 'exclude' => $post_thumbnail_id
);
- $attachments = get_children( $args );
- $array_post_thumbnail_id = array_keys($attachments);
- $count_element = count( $array_post_thumbnail_id );
-
- while( list( $key, $value ) = each( $array_post_thumbnail_id ) ) {
- $image = wp_get_attachment_image_src( $value, 'portfolio-photo-thumb' );
- $image_large = wp_get_attachment_image_src( $value, 'large' );
- $image_alt = get_post_meta( $value, '_wp_attachment_image_alt', true );
- $image_title = get_post_meta( $value, '_wp_attachment_image_title', true );
- $image_desc = get_post($value);
- $image_desc = $image_desc->post_content;
-
- if( 0 == $key ) { ?>
-
+ $attachments = get_children( $args );
+ $array_post_thumbnail_id = array_keys( $attachments );
+ $count_element = count( $array_post_thumbnail_id );
+
+ while ( list( $key, $value ) = each( $array_post_thumbnail_id ) ) {
+ $image = wp_get_attachment_image_src( $value, 'portfolio-photo-thumb' );
+ $image_large = wp_get_attachment_image_src( $value, 'large' );
+ $image_alt = get_post_meta( $value, '_wp_attachment_image_alt', true );
+ $image_title = get_post_meta( $value, '_wp_attachment_image_title', true );
+ $image_desc = get_post($value);
+ $image_desc = $image_desc->post_content;
+
+ if ( 0 == $key ) { ?>
+
+
+
@@ -129,51 +136,73 @@
-
-
+ if ( 0 < $count_element ) { ?>
-