diff -r 346c88efed21 -r 5e2f62d02dcd wp/wp-content/plugins/portfolio/template/portfolio-post.php --- a/wp/wp-content/plugins/portfolio/template/portfolio-post.php Mon Jun 08 16:11:51 2015 +0000 +++ b/wp/wp-content/plugins/portfolio/template/portfolio-post.php Tue Jun 09 03:35:32 2015 +0200 @@ -1,62 +1,70 @@ -
-
+
+
+
- -
- +
+
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); - } ?> -
- - <?php echo $image_alt; ?> - -
+ $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] ) ) { ?> +
+ + <?php echo $image_alt; ?> + +
+

@@ -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 ) { ?> +
- -
+ +
+ if ( 0 < $count_element ) { ?>
-
-
+
+
 
- ID, 'portfolio_technologies' ) ; - if ( is_array( $terms ) && count( $terms ) > 0) { ?> + ID, 'portfolio_technologies' ); + if ( is_array( $terms ) && 0 < count( $terms ) ) { ?>
- 0 ) - echo ', '; - echo 'name ) . '" ' . '>' . $term->name.''; - $count++; - } ?> -
+ 0 ) + echo ', '; + echo 'name ) . '" ' . '>' . $term->name . ''; + $count++; + } ?> +
-
- - - + + + + + - + \ No newline at end of file