From 25a1cbdeb8d637ef53adc60ccb7897d303f81deb Mon Sep 17 00:00:00 2001 From: david Date: Fri, 9 Dec 2011 20:32:47 +0000 Subject: [PATCH] Cambios en la plantilla git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_Web/trunk@6 7e4b4a24-fdbc-5948-a674-f6f81f2ee942 --- src/wp-config.php | 10 +- src/wp-content/themes/fiatlux/archive.php | 57 +-- .../themes/fiatlux/functions/portfolio.php | 22 + .../includes/loop-portfolio-2cols.bak.php | 384 ++++++++++++++++++ .../fiatlux/includes/loop-portfolio-2cols.php | 79 ++-- .../includes/loop-single-portfolio.php | 9 +- .../fiatlux/includes/loop-skill-2cols.php | 152 +++++++ .../themes/fiatlux/taxonomy-ml_skill.php | 10 + .../themes/fiatlux/template-skill-2cols.php | 14 + 9 files changed, 637 insertions(+), 100 deletions(-) create mode 100644 src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.bak.php create mode 100644 src/wp-content/themes/fiatlux/includes/loop-skill-2cols.php create mode 100644 src/wp-content/themes/fiatlux/taxonomy-ml_skill.php create mode 100644 src/wp-content/themes/fiatlux/template-skill-2cols.php diff --git a/src/wp-config.php b/src/wp-config.php index 6d44f53..8d46d28 100644 --- a/src/wp-config.php +++ b/src/wp-config.php @@ -16,13 +16,13 @@ // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ -define('DB_NAME', 'dqxjaadh_abetoprueba'); +define('DB_NAME', 'abeto'); /** MySQL database username */ -define('DB_USER', 'dqxjaadh_abeto'); +define('DB_USER', 'usuario'); /** MySQL database password */ -define('DB_PASSWORD', 't3t19b4lm'); +define('DB_PASSWORD', 'password'); /** MySQL hostname */ define('DB_HOST', 'localhost'); @@ -89,5 +89,5 @@ if ( !defined('ABSPATH') ) /** Sets up WordPress vars and included files. */ require_once(ABSPATH . 'wp-settings.php'); -#define('WP_SITEURL', 'http://www.rodax-software.com/abetoprueba'); -#define('WP_HOME', 'http://www.rodax-software.com/abetoprueba'); \ No newline at end of file +//define('WP_SITEURL', 'http://192.168.0.2/abeto/'); +//define('WP_HOME', 'http://192.168.0.2/abeto/'); \ No newline at end of file diff --git a/src/wp-content/themes/fiatlux/archive.php b/src/wp-content/themes/fiatlux/archive.php index 61ba31a..eee7308 100644 --- a/src/wp-content/themes/fiatlux/archive.php +++ b/src/wp-content/themes/fiatlux/archive.php @@ -1,56 +1 @@ - -
-
-
- - - -

- -

- -

- -

- -

- -

"display_name; ?>"

- -

- -
- -
- - \ No newline at end of file +

"display_name; ?>"

\ No newline at end of file diff --git a/src/wp-content/themes/fiatlux/functions/portfolio.php b/src/wp-content/themes/fiatlux/functions/portfolio.php index 25d69a3..189177e 100644 --- a/src/wp-content/themes/fiatlux/functions/portfolio.php +++ b/src/wp-content/themes/fiatlux/functions/portfolio.php @@ -88,6 +88,28 @@ function register_cpt_ml_portfolio() { } +add_filter('manage_ml_portfolio_posts_columns', 'skill_column' ); //Filter out Post Columns with 2 custom columns +add_action('manage_ml_portfolio_posts_custom_column', 'skill_custom_column', 10, 2); + +function skill_column($defaults) { + $defaults['ml_skill'] = __('Skill'); //Language and Films is name of column + return $defaults; +} + +function skill_custom_column($column_name, $post_id) { + $taxonomy = $column_name; + $post_type = get_post_type($post_id); + $terms = get_the_terms($post_id, $taxonomy); + + if ( !empty($terms) ) { + foreach ( $terms as $term ) + $post_terms[] = " " . esc_html(sanitize_term_field('name', $term->name, $term->term_id, $taxonomy, 'edit')) . ""; + echo join( ', ', $post_terms ); + } + else echo 'No terms.'; +} + + //requires the meta-box script for custom meta fields require_once ('meta-box.php'); diff --git a/src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.bak.php b/src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.bak.php new file mode 100644 index 0000000..bd96eca --- /dev/null +++ b/src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.bak.php @@ -0,0 +1,384 @@ + + + + +ID, 'id_skill', true); + +?> +
+
    + + +
  • + + + $skill_id, 'hide_empty' => 0)); + $count = count($terms); + if ( $count > 0 ){ + foreach ( $terms as $term ) { + echo "
  • " . $term->name . "
  • "; + } + } + ?> + +
+
+
+ + 'ml_portfolio', + 'posts_per_page' => -1, + 'orderby' => 'title', + 'order' => 'ASC', + 'tax_query' => array('taxonomy' => 'ml_skill', 'field' => 'id', 'terms' => $skill_id) +); +query_posts( $args ); +?> + +
+
+ + +ID, 'ml_skill' ); // get an array of all the terms as objects. + +$terms_slugs = array(); +$portfolio_item = ''; + +foreach( $terms as $term ) { + $portfolio_item = $portfolio_item . ' ' . 'skill_' . sanitize_title($term->name) . ' '; // save each sanitized name inside the array and add a 'skill_' prefix to prevent conclicts +} + +$portfolio_item = $portfolio_item . 'portfolio-item'; +?> + +
> + + ID), 'full'); + $featured_normal = $featured_normal[0]; + + //get the featured image description + $featured_id = get_post_meta($post->ID, '_thumbnail_id', true); + $featured_attachment = get_post($featured_id); + $featured_description = $featured_attachment->post_excerpt == "" ? $featured_attachment->post_content : $featured_attachment->post_excerpt; + //if don't have any description, make it blank + if (!($featured_description)) { + $featured_description = ' '; + } + + + //Lightbox - YouTube. + if(get_post_meta($post->ID, 'ml_fc_featured_content', true) == 'lightbox_youtube') { + //Video URL + $featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_youtube', true); + ?> + + + + + + ID, 'ml_fc_featured_content', true) == 'lightbox_vimeo') { + //Video URL + $featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_vimeo', true); + //Content Poster + $content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true); + $content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100'; + ?> + + + + + + ID, 'ml_fc_featured_content', true) == 'lightbox_mov') { + //Video URL + $featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_mov', true) + . '?width=' + . get_post_meta($post->ID, 'ml_fc_featured_content_width', true) + . '&height=' + . get_post_meta($post->ID, 'ml_fc_featured_content_height', true); + //Content Poster + $content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true); + $content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100'; + ?> + + + + + + ID, 'ml_fc_featured_content', true) == 'lightbox_swf') { + //Video URL + $featured_content = get_post_meta($post->ID, 'ml_fc_lightbox_swf', true) + . '?width=' + . get_post_meta($post->ID, 'ml_fc_featured_content_width', true) + . '&height=' + . get_post_meta($post->ID, 'ml_fc_featured_content_height', true); + //Content Poster + $content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true); + $content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100'; + ?> + + + + + + ID, 'ml_fc_featured_content', true) == 'lightbox_html') { + $featured_content = '#lightbox_html_'.$post->ID; + //Content Poster + $content_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true); + $content_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $content_poster . '&w=416&h=234&zc=1&q=100'; + ?> + + + + + + + + ID, 'ml_fc_featured_content', true) == 'embedded_audio') { + $embedded_audio_mp3 = get_post_meta($post->ID, 'ml_fc_embedded_audio_mp3', true); + $embedded_audio_oga = get_post_meta($post->ID, 'ml_fc_embedded_audio_oga', true); + ?> + + + + + + + ID, 'ml_fc_featured_content', true) == 'embedded_video') { + $embedded_video_m4v = get_post_meta($post->ID, 'ml_fc_embedded_video_m4v', true); + $embedded_video_ogv = get_post_meta($post->ID, 'ml_fc_embedded_video_ogv', true); + $embedded_video_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true); + $embedded_video_height = 'style="height:214px;"'; + ?> + + + + + + + ID, 'ml_fc_featured_content', true) == 'embedded_html') { + $embedded_html_poster = get_post_meta($post->ID, 'ml_fc_embedded_video_poster', true); + $embedded_html_poster = get_template_directory_uri() . '/includes/timthumb.php?src=' . $embedded_html_poster . '&w=416&h=234&zc=1&q=100' + ?> + + HTML + + ID, 'ml_fc_featured_content', true) == 'slider') { ?> + +
+ ID, 'ml_fc_image_slider_'.$slide_num, true); + if($slide) { + $slide = get_template_directory_uri() . '/includes/timthumb.php?src=' . $slide . '&h=416&w=416&zc=1&q=100'; + ?> + + Slide <?php echo $slide_num; ?> + + +
+ + ID), 'full' ); + $featured_image = $featured_array[0]; + //add the picture icon to the background of the featured image + $featured_class = 'ml_icon_picture'; + //if have featured image, get it and add a content wrapper + if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?> + + + + + +

+

*/ ?> + +
+ + + +
+
+ + + + + +
+ +

+ +
+ + + + \ No newline at end of file diff --git a/src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.php b/src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.php index 4b9b1e0..7f1e986 100644 --- a/src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.php +++ b/src/wp-content/themes/fiatlux/includes/loop-portfolio-2cols.php @@ -1,7 +1,4 @@ - -
-
    - - -
  • - - - 0 ){ - foreach ( $terms as $term ) { - echo "
  • " . $term->name . "
  • "; - } - } - ?> - -
-
+ $term->term_id, 'hide_empty' => 1)); +$count = count($terms); +if ( $count > 0 ){ +?> +
+ +
+ +
+ 'ml_portfolio', + 'posts_per_page' => -1, + 'orderby' => 'title', + 'order' => 'ASC', + 'tax_query' => array( + array('taxonomy' => 'ml_skill', 'field' => 'slug', 'terms' => $term->slug) + ) +); +query_posts( $args ); +?> +
-
+
ID, 'ml_skill' ); // get an array of all the terms as objects. -$terms_slugs = array(); $portfolio_item = ''; - -foreach( $terms as $term ) { - $portfolio_item = $portfolio_item . ' ' . 'skill_' . sanitize_title($term->name) . ' '; // save each sanitized name inside the array and add a 'skill_' prefix to prevent conclicts -} - +$portfolio_item = $portfolio_item . ' ' . 'skill_' . sanitize_title($term->name) . ' '; // save each sanitized name inside the array and add a 'skill_' prefix to prevent conclicts $portfolio_item = $portfolio_item . 'portfolio-item'; ?>
> - - ID), 'full'); diff --git a/src/wp-content/themes/fiatlux/includes/loop-single-portfolio.php b/src/wp-content/themes/fiatlux/includes/loop-single-portfolio.php index f8c4f82..1205966 100644 --- a/src/wp-content/themes/fiatlux/includes/loop-single-portfolio.php +++ b/src/wp-content/themes/fiatlux/includes/loop-single-portfolio.php @@ -11,7 +11,6 @@ $slides_anim_speed = of_get_option('ml_slides_anim_speed', '0.5') * 1000; $slides_pause_time = of_get_option('ml_slides_pause_time', '2.5') * 1000; ?>
> - - <?php echo $title; ?> + <?php echo $title; ?> ID, 'id_skill', true); + +?> +
+
+ + + + + $skill_id, + 'hide_empty' => 0, + 'orderby' => 'title', + 'order' => 'ASC' + ) + ); + $count = count($terms); + if ( $count > 0 ){ + foreach ( $terms as $term ) { ?> + +
> + +
+ +
+ 'ml_portfolio', + 'posts_per_page' => $latest_n_pictures, + 'tax_query' => array( + array( + 'taxonomy' => 'ml_skill', + 'field' => 'slug', + 'terms' => $term->slug + ) + ) + ); + $loop = new WP_Query( $args ); + while ( $loop->have_posts() ) : $loop->the_post(); + //full image URL + $featured_array = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' ); + $featured_image = $featured_array[0]; + //add the picture icon to the background of the featured image + $featured_class = 'ml_icon_picture'; + //if have featured image, get it and add a content wrapper + if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { + if ($loop->found_posts == 1) {?> + + + + + + + + ID, 'ml_fc_featured_content', true) == 'slider') { + for ($slide_num = 1; $slide_num <= cte_slide_num; $slide_num++) { + $slide = get_post_meta($post->ID, 'ml_fc_image_slider_'.$slide_num, true); + if($slide) { + $slide = get_template_directory_uri() . '/includes/timthumb.php?src=' . $slide . '&h=416&w=416&zc=1&q=100'; + if ($loop->found_posts == 1) {?> + + + + + Slide <?php echo $slide_num; ?> + + +
+
+ + + + + found_posts == 1) {?> +

name; ?>

+

description,30); ?>

+ + +

name; ?>

+

description,30); ?>

+ + +
+ + + +
+
+ + \ No newline at end of file diff --git a/src/wp-content/themes/fiatlux/taxonomy-ml_skill.php b/src/wp-content/themes/fiatlux/taxonomy-ml_skill.php new file mode 100644 index 0000000..f441d04 --- /dev/null +++ b/src/wp-content/themes/fiatlux/taxonomy-ml_skill.php @@ -0,0 +1,10 @@ + +
+
+ +
+ + \ No newline at end of file diff --git a/src/wp-content/themes/fiatlux/template-skill-2cols.php b/src/wp-content/themes/fiatlux/template-skill-2cols.php new file mode 100644 index 0000000..5164cef --- /dev/null +++ b/src/wp-content/themes/fiatlux/template-skill-2cols.php @@ -0,0 +1,14 @@ + +
+
+ +
+ + \ No newline at end of file