diff --git a/wp-content/plugins/mark-as-read/includes/dashboard-widgets.php b/wp-content/plugins/mark-as-read/includes/dashboard-widgets.php new file mode 100644 index 0000000..c8c9bfd --- /dev/null +++ b/wp-content/plugins/mark-as-read/includes/dashboard-widgets.php @@ -0,0 +1,14 @@ +'; + } + if($read_text == '') { + if($mar_options['read_text'] != '') { + $read_text = $mar_options['read_text']; + } else { + $read_text = 'Mark as Read'; + } + } + if($unread_text == '') { + if($mar_options['unread_text'] != '') { + $unread_text = $mar_options['unread_text']; + } else { + $unread_text = 'Mark as Unread'; + } + } + + if(mar_check_post_is_read($post_id, mar_get_user_id())) { + $link .= '' . $unread_text . ''; + $link .= ''; + } else { + $link .= ''; + $link .= '' . $read_text . ''; + } + if($wrapper == true) { + $link .= ''; + } + return $link; + } +} + +// show mark as read / unread links automatically if enabled. Do not use this as a template tag +function mar_show_links($content) { + global $post; + global $mar_options; + + if(is_single() && get_post_type() == 'post' && $mar_options['show_links'] == true) { + + if($mar_options['post_position'] == 'Top') { + $content = mar_read_unread_links($mar_options['read_text'], $mar_options['unread_text']) . $content; + } else { + $content = $content . mar_read_unread_links($mar_options['read_text'], $mar_options['unread_text']); + } + } + return $content; +} +add_filter('the_content', 'mar_show_links'); + + +function mar_list_unread_posts($number = 5) { + if(is_user_logged_in()) { + $read_ids = mar_get_user_read_posts( mar_get_user_id() ); + $unread_posts = get_posts(array('exclude' => $read_ids, 'numberposts' => $number)); + ob_start(); ?> + + true, + 'unread' => true, + 'total' => true, + 'percentage' => true, + 'labels' => array( + 'read' => 'Read Posts: ', + 'unread' => 'Unread Posts: ', + 'total' => 'Total Posts: ', + 'percentage' => 'Percentage Complete: ' + ) + ); + $args = wp_parse_args( $args, $defaults ); + extract( $args, EXTR_SKIP ); + + $report = mar_get_user_report(); + + ob_start(); ?> + + get_results("SELECT * FROM " . $mar_db_table . " WHERE read_count != 0 ORDER BY read_count DESC LIMIT $number;"); + if($read_posts) { + $popular_list = ''; + } + return $popular_list; +} \ No newline at end of file diff --git a/wp-content/plugins/mark-as-read/includes/mar-widgets.php b/wp-content/plugins/mark-as-read/includes/mar-widgets.php new file mode 100644 index 0000000..2cfd8a9 --- /dev/null +++ b/wp-content/plugins/mark-as-read/includes/mar-widgets.php @@ -0,0 +1,321 @@ + 'Show unread posts for the current user')); + } + + /** @see WP_Widget::widget */ + function widget($args, $instance) { + extract( $args ); + + if(is_user_logged_in()) { + + $title = apply_filters('widget_title', $instance['title']); + $number = (int)$instance['number']; + if($number == '' || !isset($number)) { $number = 5; } + + echo $before_widget; + if ( $title ) { + echo $before_title . $title . $after_title; + } + echo mar_list_unread_posts($number); + echo $after_widget; + } + } + + /** @see WP_Widget::update */ + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['number'] = strip_tags($new_instance['number']); + return $instance; + } + + /** @see WP_Widget::form */ + function form($instance) { + + $title = esc_attr($instance['title']); + $number = esc_attr($instance['number']); + + ?> +

+ + +

+

+ + +

+ 'Show the number of posts the user has read, not read, etc')); + } + + /** @see WP_Widget::widget */ + function widget($args, $instance) { + extract( $args ); + + if(is_user_logged_in()) { + + $title = apply_filters('widget_title', $instance['title']); + $read_posts = (bool)$instance['read_posts']; + $read_label = $instance['read_label']; + $unread_posts = (bool)$instance['unread_posts']; + $unread_label = $instance['unread_label']; + $total_posts = (bool)$instance['total_posts']; + $total_label = $instance['total_label']; + $percentage = (bool)$instance['percentage']; + $percentage_label = $instance['percentage_label']; + + $labels = array( + 'read' => $read_label, + 'unread' => $unread_label, + 'total' => $total_label, + 'percentage' => $percentage_label + ); + + echo $before_widget; + if ( $title ) { + echo $before_title . $title . $after_title; + } + echo mar_list_user_report( + array( + 'read' => $read_posts, + 'unread' => $unread_posts, + 'total' => $total_posts, + 'percentage' => $percentage, + 'labels' => array( + 'read' => $read_label, + 'unread' => $unread_label, + 'total' => $total_label, + 'percentage' => $percentage_label + ) + ) + ); + echo $after_widget; + } + } + + /** @see WP_Widget::update */ + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['read_posts'] = strip_tags($new_instance['read_posts']); + $instance['read_label'] = strip_tags($new_instance['read_label']); + $instance['unread_posts'] = strip_tags($new_instance['unread_posts']); + $instance['unread_label'] = strip_tags($new_instance['unread_label']); + $instance['total_posts'] = strip_tags($new_instance['total_posts']); + $instance['total_label'] = strip_tags($new_instance['total_label']); + $instance['percentage'] = strip_tags($new_instance['percentage']); + $instance['percentage_label'] = strip_tags($new_instance['percentage_label']); + return $instance; + } + + /** @see WP_Widget::form */ + function form($instance) { + + $title = esc_attr($instance['title']); + $read_posts = esc_attr($instance['read_posts']); + $read_label = esc_attr($instance['read_label']); + $unread_posts = esc_attr($instance['unread_posts']); + $unread_label = esc_attr($instance['unread_label']); + $total_posts = esc_attr($instance['total_posts']); + $total_label = esc_attr($instance['total_label']); + $percentage = esc_attr($instance['percentage']); + $percentage_label = esc_attr($instance['percentage_label']); + ?> +

+ + +

+

+ /> + +

+

+ + +

+

+ /> + +

+

+ + +

+

+ /> + +

+

+ + +

+

+ /> + +

+

+ + +

+ 'Show your most read posts')); + } + + /** @see WP_Widget::widget */ + function widget($args, $instance) { + extract( $args ); + + $title = apply_filters('widget_title', $instance['title']); + $number = (int)$instance['number']; + $read_count = (bool)$instance['read_count']; + if($number == '' || !isset($number)) { $number = 5; } + echo $before_widget; + if ( $title ) { + echo $before_title . $title . $after_title; + } + echo mar_most_read($number, $read_count); + echo $after_widget; + + } + + /** @see WP_Widget::update */ + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['number'] = strip_tags($new_instance['number']); + $instance['read_count'] = strip_tags($new_instance['read_count']); + return $instance; + } + + /** @see WP_Widget::form */ + function form($instance) { + + $title = esc_attr($instance['title']); + $number = esc_attr($instance['number']); + $read_count = esc_attr($instance['read_count']); + + ?> +

+ + +

+

+ + +

+

+ /> + +

+ 'Show link to mark current post as read or unread')); + } + + /** @see WP_Widget::widget */ + function widget($args, $instance) { + extract( $args ); + $title = apply_filters('widget_title', $instance['title']); + $read = apply_filters('widget_title', $instance['read']); + $unread = apply_filters('widget_title', $instance['unread']); + + if(is_single() && is_user_logged_in()) { + + echo $before_widget; + if ( $title ) { + echo $before_title . $title . $after_title; + } + echo mar_read_unread_links($read, $unread); + echo $after_widget; + } + } + + /** @see WP_Widget::update */ + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['read'] = strip_tags($new_instance['read']); + $instance['unread'] = strip_tags($new_instance['unread']); + return $instance; + } + + /** @see WP_Widget::form */ + function form($instance) { + + $title = esc_attr($instance['title']); + $read = esc_attr($instance['read']); + $unread = esc_attr($instance['unread']); + + ?> +

+ + +

+

+ + +

+

+ + +

+ ID; +} + +// adds a post to the user meta +function mar_add_to_usermeta($post_id) { + $user_id = mar_get_user_id(); + $mar_read = mar_get_user_read_posts($user_id); + // add out post id to the end of the array + $mar_read[] = $post_id; + mar_update_user_meta($mar_read, $user_id); +} + +// removes a post ID from the user meta +function mar_remove_from_usermeta($post_id) { + $user_id = mar_get_user_id(); + $mar_read = mar_get_user_read_posts($user_id); + foreach ($mar_read as $read_post => $id) { + if ($id == $post_id) { + unset($mar_read[$read_post]); + } + } + mar_update_user_meta($mar_read, $user_id); +} + +// updates the current users read IDs +function mar_update_user_meta($arr, $user_id) { + return update_user_meta($user_id,'mar_read_posts', $arr); +} + +// gets all read posts for the current user +function mar_get_user_read_posts($user_id) { + return get_user_meta($user_id, 'mar_read_posts', true); +} + +// processes the ajax mark as read request +function mar_post_mark_as_read() { + if ( isset( $_POST["post_read"] ) ) { + $post_id = intval($_POST["post_read"]); + + $mark_as_read = mar_add_to_usermeta($post_id); + $update_count = mar_increase_count($post_id); + + die(); + } +} +add_action('wp_ajax_mark_post_as_read', 'mar_post_mark_as_read'); + +// processes the ajax mark as unread request +function mar_post_mark_as_unread() { + if ( isset( $_POST["del_post_id"] ) ) { + $post_id = intval($_POST["del_post_id"]); + $mark_as_unread = mar_remove_from_usermeta($post_id); + $update_count = mar_decrease_count($post_id); + die(); + } +} +add_action('wp_ajax_mark_post_as_unread', 'mar_post_mark_as_unread'); + +// increases the read posts count for $post_id +function mar_increase_count($post_id) { + global $wpdb; + global $mar_db_table; + + // add the post ID to the count database if it doesn't already exist + if(!$wpdb->query("SELECT `read_count` FROM `" . $mar_db_table . "` WHERE id=" . $post_id . ";")) { + $add_post_id = $wpdb->insert( $mar_db_table, + array( + 'id' => $post_id, + 'read_count' => 1 + ) + ); + } else { + $count = $wpdb->query("UPDATE " . $mar_db_table . " SET read_count = read_count + 1 WHERE id=" . $post_id . ";"); + } +} + +// decreases the bookmark count for $post_id +function mar_decrease_count($post_id) { + global $wpdb; + global $mar_db_table; + + $count = $wpdb->query("UPDATE " . $mar_db_table . " SET read_count = read_count - 1 WHERE id=" . $post_id . ";"); +} + +// retrieves all report card data for the current user +// this includes unread / read posts with counts +function mar_get_user_report() { + $user_report = array(); + + // get all read posts for the current user + $read_posts = mar_get_user_read_posts( mar_get_user_id() ); + + // get all unread posts for the current user + $unread_posts = get_posts(array('exclude' => $read_posts, 'posts_per_page' => -1)); + + $total_posts = count($unread_posts) + count($read_posts); + // calculate the percentage of post sthat have been read + $read_percentage = round( ( count($read_posts) * 100 ) / $total_posts); + + $user_report['read_posts'] = $read_posts; + $user_report['read_posts_count'] = count($read_posts); + $user_report['unread_posts_count'] = count($unread_posts); + $user_report['total_posts'] = $total_posts; + $user_report['read_percentage'] = $read_percentage; + + return $user_report; +} + +// automarks a post as read after the user has been on the post for the designated length of time +function mar_auto_mark_as_read($content) { + global $mar_options, $post; + + // proceed if the auto option is enabled and we are on a single post + if($mar_options['auto'] && is_single()) { + // proceed if the post is not already marked as read + if(!mar_check_post_is_read($post->ID, mar_get_user_id())) { + mar_load_auto_scripts(); + } + } +} +add_action('template_redirect', 'mar_auto_mark_as_read'); \ No newline at end of file diff --git a/wp-content/plugins/mark-as-read/includes/mark-as-read.js b/wp-content/plugins/mark-as-read/includes/mark-as-read.js new file mode 100644 index 0000000..f3ef4f6 --- /dev/null +++ b/wp-content/plugins/mark-as-read/includes/mark-as-read.js @@ -0,0 +1,45 @@ +jQuery(document).ready( function($) { + + var read_message = mark_as_read_js.read_message; + var unread_message = mark_as_read_js.unread_message; + + $(".mar_mark_as_read").click( function() { + var post_id = $(this).attr('rel'); + var data = { + action: 'mark_post_as_read', + post_read: post_id + }; + $.post(mark_as_read_js.ajaxurl, data, function(response) { + if(mark_as_read_js.show_alerts == '1') { + alert(read_message); + } + $('.mar_read_control_'+post_id).toggle(); + }); + return false; + }); + $(".mar_mark_as_unread").click( function() { + + if(mark_as_read_js.show_alerts == '1') { + if(confirm(unread_message)) { + var post_id = $(this).attr('rel'); + var data = { + action: 'mark_post_as_unread', + del_post_id: post_id + }; + $.post(mark_as_read_js.ajaxurl, data, function(response) { + $('.mar_read_control_'+post_id).toggle(); + }); + } + } else { + var post_id = $(this).attr('rel'); + var data = { + action: 'mark_post_as_unread', + del_post_id: post_id + }; + $.post(mark_as_read_js.ajaxurl, data, function(response) { + $('.mar_read_control_'+post_id).toggle(); + }); + } + return false; + }); +}); \ No newline at end of file diff --git a/wp-content/plugins/mark-as-read/includes/profile-post-report.php b/wp-content/plugins/mark-as-read/includes/profile-post-report.php new file mode 100644 index 0000000..a1dd078 --- /dev/null +++ b/wp-content/plugins/mark-as-read/includes/profile-post-report.php @@ -0,0 +1,24 @@ + +

+ + + + +
+ array( + 'read' => __('Posts Read: '), + 'unread' => __('Posts Unread: '), + 'total' => __('Total Posts on This Site: '), + 'percentage' => __('Percentage of Total Posts Read: '), + ) + ); + echo mar_list_user_report($args); + ?> +
+ admin_url( 'admin-ajax.php' ), + 'read_message' => $read_text, + 'unread_message' => $unread_text, + 'show_alerts' => $mar_options['alerts'] + ) + ); +} +add_action('wp_print_scripts', 'mar_mark_as_read_js'); + +function mar_load_auto_scripts() { + global $mar_base_dir, $post, $mar_options; + wp_enqueue_script( "mark-as-read-auto", $mar_base_dir . 'includes/mark-as-read-auto.js', array( 'jquery' ) ); + wp_localize_script( 'mark-as-read-auto', 'mark_as_read_auto_js', + array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'post_id' => $post->ID, + 'time' => $mar_options['auto_time'] + ) + ); +} + +function mar_custom_css() { + global $mar_options; + + if($mar_options['mar_css']) { + echo '' . PHP_EOL; + } +} +add_action('wp_head', 'mar_custom_css'); \ No newline at end of file diff --git a/wp-content/plugins/mark-as-read/includes/settings.php b/wp-content/plugins/mark-as-read/includes/settings.php new file mode 100644 index 0000000..395b12a --- /dev/null +++ b/wp-content/plugins/mark-as-read/includes/settings.php @@ -0,0 +1,140 @@ + +
+
+

Mark as Read Settings

+ + +

+ +
+ + + +

Mark as Read Automatically

+

+ /> + +

+

+ +
+

+ +

Mark as Read / Unread Links

+

+ /> + +

+

+ + + +

+

+ +
+

+

+ +
+

+ +

Alert Messages

+

+ /> + +

+

+ +
+

+

+ +
+

+ +

Custom CSS

+

+
+ +

+ + +

+ +

+ + +
+
+
+ + + +

HTML Class Names

+

The selectors below can be used in your CSS to customize the look of your bookmark links, the add / remove bookmark links, and more.

+ +

Mark as Read / Unread Controls

+ + +

Most Read Posts List

+ + +

User Report

+ + + 5 + ), $atts ) + ); + + return mar_most_read($number); +} +add_shortcode('most_read', 'mar_most_read_shortcode'); + +function mar_user_report_shortcode($content = null ) { + return mar_list_user_report( $args ); +} +add_shortcode('user_report', 'mar_user_report_shortcode'); + +function mar_unread_posts_shortcode($atts, $content = null ) { + + extract( shortcode_atts( array( + 'number' => 5 + ), $atts ) + ); + + return mar_list_unread_posts( $number ); +} +add_shortcode('unread_posts', 'mar_unread_posts_shortcode'); \ No newline at end of file diff --git a/wp-content/plugins/mark-as-read/mark-as-read.php b/wp-content/plugins/mark-as-read/mark-as-read.php new file mode 100644 index 0000000..c0d6238 --- /dev/null +++ b/wp-content/plugins/mark-as-read/mark-as-read.php @@ -0,0 +1,60 @@ +prefix . "mar_read_counts"; + +// bookmark count table version +global $mar_table_version; +$mar_table_version = 1.0; + + +function mar_install() +{ + global $wpdb; + global $mar_db_table; + global $mar_table_version; + + if($wpdb->get_var("show tables like '$mar_db_table'") != $mar_db_table) + { + $sql = "CREATE TABLE " . $mar_db_table . " ( + id mediumint(9) NOT NULL AUTO_INCREMENT, + read_count mediumint NOT NULL, + UNIQUE KEY id (id) + );"; + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); + dbDelta($sql); + + add_option("mar_database_version", $mar_table_version); + } +} +register_activation_hook( __FILE__, 'mar_install' ); \ No newline at end of file diff --git a/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php b/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php index accb484..751bd5e 100644 --- a/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php +++ b/wp-content/themes/score/dedications/single/home-column-dedicated-2-me.php @@ -24,8 +24,10 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
> -
thumbnail-no-wrap"> +
thumbnail-no-wrap"> + + <?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
                 echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
diff --git a/wp-content/themes/score/dedications/single/home-column-my-dedications.php b/wp-content/themes/score/dedications/single/home-column-my-dedications.php
index 6555ca6..3f04583 100644
--- a/wp-content/themes/score/dedications/single/home-column-my-dedications.php
+++ b/wp-content/themes/score/dedications/single/home-column-my-dedications.php
@@ -25,7 +25,9 @@ $dedication_link = bp_core_get_userlink($bp->displayed_user->id, false, true) .
         <!--Begin Image-->
         <?php if (has_post_thumbnail()) { ?>					
             <div class= thumbnail-no-wrap"> + + <?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
                 echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
diff --git a/wp-content/themes/score/functions.php b/wp-content/themes/score/functions.php
index c761ee6..316ef63 100644
--- a/wp-content/themes/score/functions.php
+++ b/wp-content/themes/score/functions.php
@@ -744,4 +744,37 @@ function asociate_dedications_to_new_user($user_id) {
 add_action( 'user_register', 'asociate_dedications_to_new_user');
 
 
+function gp_last_login($login) {
+    global $user_ID;
+    $user = get_userdatabylogin($login);
+    update_usermeta($user->ID, 'last_login', current_time('mysql'));
+}
+add_action('wp_login','gp_last_login');
+
+function gp_get_last_login($user_id) {
+    $last_login = get_user_meta($user_id, 'last_login', true);
+    $date_format = get_option('date_format') . ' ' . get_option('time_format');
+    $the_last_login = mysql2date($date_format, $last_login, false);
+    return $the_last_login;
+}
+
+
+function gp_get_total_unread_dedications() {
+    if(is_user_logged_in()) {
+        $user_id = mar_get_user_id();
+        $read_ids = mar_get_user_read_posts( $user_id );
+
+        $args = array( 
+            'exclude' => $read_ids, 
+            'numberposts' => -1, 
+            'cat' => DEDICATION_CATEGORY_SLUG,
+            'meta_key' => 'ghostpool_destination_user_id',
+            'meta_value' => $user_id
+            );
+        $unread_posts = get_posts( $args );
+        return count($unread_posts);
+    }
+    else return 0;
+}
+
 ?>
\ No newline at end of file
diff --git a/wp-content/themes/score/header.php b/wp-content/themes/score/header.php
index 64bae5f..d18bdfc 100644
--- a/wp-content/themes/score/header.php
+++ b/wp-content/themes/score/header.php
@@ -65,9 +65,17 @@
                     $category_link = get_category_link( $category_id );
                 ?>
                 <li><a title=" class="events" href=""> -
  • +
  • + + + +
  • -
  • +
  • + + + +
  • @@ -112,10 +120,6 @@ - - - -
    diff --git a/wp-content/themes/score/index.php b/wp-content/themes/score/index.php index d12ccda..6d8e676 100644 --- a/wp-content/themes/score/index.php +++ b/wp-content/themes/score/index.php @@ -75,8 +75,10 @@ query_posts($args);
    > -
    thumbnail-no-wrap"> +
    thumbnail-no-wrap"> + + <?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?> diff --git a/wp-content/themes/score/lib/admin/inc/theme-options.php b/wp-content/themes/score/lib/admin/inc/theme-options.php index 66dded0..497e17b 100644 --- a/wp-content/themes/score/lib/admin/inc/theme-options.php +++ b/wp-content/themes/score/lib/admin/inc/theme-options.php @@ -100,7 +100,7 @@ $options = array( "std" => "", "desc" => '', "type" => "text"), - array( + /*array( "name" => __('Twitter URL', 'gp_lang'), "id" => $shortname . "_twitter", "std" => "", @@ -160,6 +160,8 @@ $options = array( "id" => $shortname . "_additional_social_icons", "std" => "", "type" => "textarea"), + * + */ array("type" => "divider"), array( "name" => __('Favicon URL (.ico)', 'gp_lang'), @@ -187,6 +189,7 @@ $options = array( "std" => "", "type" => "textarea"), array("type" => "divider"), + /* array( "name" => __('Scroller Display', 'gp_lang'), "desc" => __('Choose how to display the scroller.', 'gp_lang'), @@ -220,6 +223,8 @@ $options = array( "type" => "text", "size" => "small"), array("type" => "divider"), + * + */ array( "name" => __('Footer Widgets', 'gp_lang'), "desc" => __('Choose where to display your footer widgets.', 'gp_lang'), @@ -263,7 +268,7 @@ $options = array( array("type" => "close"), -array("name" => __('Video Slider Settings', 'gp_lang'), + array("name" => __('Video Slider Settings', 'gp_lang'), "type" => "title"), array("type" => "open", "id" => $shortname . "_video_slider_settings"), @@ -276,6 +281,20 @@ array("name" => __('Video Slider Settings', 'gp_lang'), "size" => "small"), array("type" => "close"), + + array("name" => __('Dedication Settings', 'gp_lang'), + "type" => "title"), + array("type" => "open", + "id" => $shortname . "_dedication_settings"), + array( + "name" => __('Show \'new\' label', 'gp_lang'), + "desc" => __('Show new label on dedication thumbs', 'gp_lang'), + "id" => $shortname . "_show_new_label", + "std" => "1", + "options" => array(__('Disable', 'gp_lang'), __('Enable', 'gp_lang')), + "type" => "radio"), + array("type" => "close"), + array("name" => __('Slider Settings', 'gp_lang'), diff --git a/wp-content/themes/score/lib/admin/inc/theme-widgets.php b/wp-content/themes/score/lib/admin/inc/theme-widgets.php index 5666d5f..a70e7c0 100644 --- a/wp-content/themes/score/lib/admin/inc/theme-widgets.php +++ b/wp-content/themes/score/lib/admin/inc/theme-widgets.php @@ -83,7 +83,7 @@ class SidebarPosts extends WP_Widget {
    > -
    +
    <?php if (get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) {
diff --git a/wp-content/themes/score/lib/images/icons.png b/wp-content/themes/score/lib/images/icons.png
index 2f5a594..11694c6 100644
Binary files a/wp-content/themes/score/lib/images/icons.png and b/wp-content/themes/score/lib/images/icons.png differ
diff --git a/wp-content/themes/score/lib/scripts/custom.php b/wp-content/themes/score/lib/scripts/custom.php
index 003aad0..2c7c84a 100644
--- a/wp-content/themes/score/lib/scripts/custom.php
+++ b/wp-content/themes/score/lib/scripts/custom.php
@@ -104,7 +104,6 @@ function updateInfo() {
         var artist = jQuery('#postdata-artist-' + id).html();
         var song = jQuery('#postdata-song-' + id).html();
         var link = jQuery('#postdata-link-' + id).html();
-        var comments = jQuery('#postdata-comments-' + id).html();
 
         var nUrl = oUrl + 'id/' + the_id;
         jQuery('#dedicate_this_song_button').attr( 0) { + console.log('doy por leido ' + id); + jQuery('#postdata-mark-read-' + id + ' .mar_mark_as_read').click(); + jQuery('#postdata-mark-read-' + id).remove(); + console.log('quito elemento ' + id); + } } } diff --git a/wp-content/themes/score/loop-dedication-data.php b/wp-content/themes/score/loop-dedication-data.php index a3bf530..ddd7562 100644 --- a/wp-content/themes/score/loop-dedication-data.php +++ b/wp-content/themes/score/loop-dedication-data.php @@ -17,6 +17,8 @@ if(get_post_meta($post->ID, 'ghostpool_thumbnail_height', true) && get_post_meta $gp_settings['image_height'] = $gp_settings['thumbnail_height']; } + + // Song data $gp_settings['video'] = get_post_meta($post->ID, 'ghostpool_dedication_url', true); $gp_settings['artist'] = get_post_meta($post->ID, 'ghostpool_dedication_artist', true); @@ -30,12 +32,22 @@ if ($gp_settings['artist_song_span_short'] != $gp_settings['artist_song_span']) $gp_settings['artist_song_span_short'] .= '...'; } + + // from user $gp_settings['from_user_id'] = get_the_author_meta('ID'); $gp_settings['from_user_link'] = ''.bp_core_get_username($gp_settings['from_user_id']).''; //bp_core_get_userlink($gp_settings['from_user_id']); $gp_settings['from_flag'] = gp_get_the_flag($gp_settings['from_user_id']); +if ($gp_settings['from_user_id'] == mar_get_user_id()) : + $mark_as_read = mar_add_to_usermeta($post->ID); + $update_count = mar_increase_count($post->ID); +endif; +$read_posts = mar_get_user_read_posts( mar_get_user_id() ); + +$gp_settings['unreaded'] = (!in_array($post->ID, $read_posts)); + // to user $gp_settings['to_user_id'] = get_post_meta($post->ID, 'ghostpool_destination_user_id', true); $gp_settings['to_user_email'] = get_post_meta($post->ID, 'ghostpool_destination_user_email', true); diff --git a/wp-content/themes/score/post-loop-dedication-template.php b/wp-content/themes/score/post-loop-dedication-template.php index 050f319..6683dcb 100644 --- a/wp-content/themes/score/post-loop-dedication-template.php +++ b/wp-content/themes/score/post-loop-dedication-template.php @@ -17,8 +17,10 @@ -
    thumbnail-no-wrap"> +
    thumbnail-no-wrap"> + + <?php if(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) { echo get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); } else { echo get_the_title(); } ?> diff --git a/wp-content/themes/score/style-asong2u.css b/wp-content/themes/score/style-asong2u.css index e33f04b..bc650db 100644 --- a/wp-content/themes/score/style-asong2u.css +++ b/wp-content/themes/score/style-asong2u.css @@ -149,7 +149,7 @@ ul.navmenu { ul.navmenu li { float: left; width: 51px; - height: 85px; + height: 90px; margin-left: 15px; } @@ -157,13 +157,32 @@ ul.navmenu li a { background-color: transparent; display: block; width: 51px; - height: 85px; + height: 90px; + position: relative; } ul.navmenu li a span { display: none; } +ul.navmenu li span.sign { + background-image: url("lib/images/icons.png"); + background-position: 2px -451px; + background-repeat: no-repeat; + bottom: 4px; + color: #FFFFFF; + display: inline; + font-size: 9px; + font-weight: bold; + height: 22px; + line-height: 30px; + padding: 0 3px 0 0; + position: absolute; + right: 0; + text-align: right; + width: 22px; +} + ul.navmenu li a.friends { background-image: url(lib/images/icons.png); background-position: 0px -270px; @@ -1230,7 +1249,22 @@ h3.comments { background-color: #F5F1F0; } +.post-thumbnail a { + position: relative; + display: inline-block; +} +.new-label { + background-image: url("lib/images/icons.png"); + background-position: -57px -451px; + background-repeat: no-repeat; + height: 45px; + position: absolute; + right: 0px; + top: -2px; + width: 45px; + z-index: 2; +} /*************************** BuddyPress ***************************/ diff --git a/wp-content/themes/score/video-slider.php b/wp-content/themes/score/video-slider.php index c6b1987..ac9adfc 100644 --- a/wp-content/themes/score/video-slider.php +++ b/wp-content/themes/score/video-slider.php @@ -122,9 +122,7 @@ if (have_posts()) { $data_type = 'vimeo_single'; $data_path = 'http://vimeo.com/api/v2/video/' . $video_id . '.json'; } - ?> -
  • @@ -134,6 +132,7 @@ if (have_posts()) { + FROM: