icetek
Forum Replies Created
-
Fixed by rm -rf all-in-one-seo-pack
Reinstalled.. Now all my settings are back…
Something about the convenient “Update plugin” ajax/jquery option in the plugin list.. Every time it does not work and I go in and check permissions according to the WordPress guide! When I try to “Update Plugin” again the table or something gets messed up and this ends up happening.
Tl;Dr-Site works ok now but I will always be mindful of the “Update PLugin” feature
Fixed by rm -rf all-in-one-seo-pack
Reinstalled.. Now all my settings are back…
Something about the convenient “Update plugin” ajax/jquery option in the plugin list.. Every time it does not work and I go in and check permissions according to the WordPress guide! When I try to “Update Plugin” again the table or something gets messed up and this ends up happening.
Tl;Dr-Site works ok now but I will always be mindful of the “Update PLugin” feature
Forum: Plugins
In reply to: [Videopack] I can't click the "Insert into Post" button?Uncaught TypeError: Cannot read property ‘models’ of undefined
6media-upload.php?chromeless=1&post_id=31443&tab=embedurl:1 Consider using ‘dppx’ units, as in CSS ‘dpi’ means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual ‘dpi’ of a screen. In media query expression: print, not all, (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi)That’s all I could find.. There was another error ‘uncaught exception’ but it disappeared.
Forum: Plugins
In reply to: [Videopack] I can't click the "Insert into Post" button?The button is ‘greyed out’. It doesn’t work for Youtube or FLV. It is greyed out in Chrome and Firefox. There are no errors in Developer Console.
Awesome man! Well I have a pretty nice full-featured blog now thanks to this so I’m glad it all worked out. Thank you. There is just that Rating-Widget API that costs $7.99 a month I have to work out if I want to sort posts by top rated. I’ll be on the lookout for the new patch.
Thanks, that would be wonderful!
Bump.. Hector I know you’re a busy guy do you want to see my site and see it in action? This is a good feature for your plugin too ?? Again it is only showing one post yet all my posts get traffic now.
Check these pictures out.. For the 7 days and 30 days tabs it says 6 total posts but for “All Time” tab it says only one.
https://ocpro.com/uploads/bug-in-plugin-maybe.png
https://ocpro.com/uploads/bug-in-plugin-maybe2.pngActually.. It is only showing one thing despite my giving traffic to a few articles. I’d love to see this working and I applaud your efforts but I really need to access this data and make the articles sort by most popular through user navigation menu.. Can you fix? I changed it from using wp_query to get_query_var here:
function wpp_query_order_by( $orderby ){ global $wpdb; $valid_order = array('asc', 'desc'); // Sorting by 'popular', order by pageviews if ( get_query_var('orderby') && 'popular' == get_query_var('orderby') ) { //return "{$wpdb->prefix}popularpostsdata.pageviews " . ( ( isset($wp_query->query['order']) && in_array($wp_query->query['order'], $valid_order) ) ? strtoupper($wp_query->query['order']) : "DESC" ); return "avg_views " . ( ( get_query_var('order') && in_array(get_query_var('order'), $valid_order) ) ? strtoupper(get_query_var('order')) : "DESC" ); // Added by HC } return $orderby; } function wpp_query_join( $join ) { global $wpdb; // Sorting by 'popular', join the popularpostsdata table into the query if ( get_query_var('orderby') && 'popular' == get_query_var('orderby') ) { $join .= " LEFT JOIN {$wpdb->prefix}popularpostsdata ON " . $wpdb->posts . ".ID = {$wpdb->prefix}popularpostsdata.postid "; } return $join; } // Added by HC function wpp_fields($fields){ global $wpdb; if (get_query_var('orderby') && 'popular' == get_query_var('orderby') ) { $now = current_time('mysql'); $fields .= ", ( {$wpdb->prefix}popularpostsdata.pageviews/(IF ( DATEDIFF('{$now}', MIN({$wpdb->prefix}popularpostsdata.day)) > 0, DATEDIFF('{$now}', MIN({$wpdb->prefix}popularpostsdata.day)), 1) ) ) AS 'avg_views'"; } return ($fields); } function sort_by_filter($query) { if ( !is_admin() && $query->is_main_query() ) { switch (get_query_var('orderby')) { case "views": add_filter('posts_join', 'wpv_query_join' ); add_filter('posts_orderby', 'wpv_query_orderby'); break; case "popular": add_filter('posts_fields', 'wpp_fields'); // Added by HC add_filter('posts_join', 'wpp_query_join' ); add_filter('posts_orderby', 'wpp_query_order_by'); break; case "rating": add_filter('posts_join', 'wpr_query_join'); add_filter('posts_orderby', 'wpr_query_orderby'); break; } } }
Here is some JS code I’ve tried to fix it.. No luck- even setting the ‘target’ as #grid-content (the masonry.js target area)
// select the target node var target = document.querySelector('.rw-action-area'); // create an observer instance var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { console.log("mutation : " + mutation); }); }); // configuration of the observer: var config = { attributes: true, childList: true, characterData: true } // pass in the target node, as well as the observer options observer.observe(target, config); var posts = document.querySelectorAll('.post'); var imgLoad = imagesLoaded(posts); imgLoad.on( 'progress', function( instance, image ) { var result = image.isLoaded ? 'loaded' : 'broken'; console.log( 'image is ' + result + ' for ' + image.img.src ); msnry.layout(); });
Looks good except it only shows one post. In situations where the site is new and only has one or two trafficked pages it would be good to show the rest too.
I’d like to start with all the popular ones ranked in order asc/desc then show the remaining posts.
It only shows one post with 2 hits – because my blog is new – the other 4 posts have 0. They don’t have to be in any particular order after the {asc|desc} ordered popular posts, just that it shows everything ??
Excellent work though on this altogether.
Here is a screenshot I made in MS paint of what I’m trying to do. Most views was one of the things I wanted to do with my navigation sorting menu. I want to order by avg. daily view – all time.
I was wondering how to pull this data ,your plugin settings page has the feature. Sorry I wasn’t being specific enough! This is the entire reason I downloaded the plugin – I was looking for a source of the data ?? here is the screenshot with comments on what I want
I found it it is Contributor mode but now I want to log all image uploads by IP and username to a .txt file in the media folder.
Forum: Hacks
In reply to: Made all my posts appear in FancyBox; Plugins don't load in iframe view-source:I redid this doing get_header(“fancybox”) and making a header-fancybox.php in the theme folder.
Still no plugins loading. Is there some kind of filter I’m missing? Can I just do this within single.php and expect my plugin-ready FancyBox modal post to work?
global $wp_global; if (isset($wp_query->query_vars['fancybox'])) { get_header("fancybox"); } else { get_header(); } ?>
Here’s what I ended up using, scrap the $wp_query global and anything calling $wp_query->* – replace it with get_query_var(‘<var>’);
I think it works. The desired function for ‘Most Popular’ is to sort by highest trafficked pages. The ‘Most Visited’ feature(yet to be made) will sort by visits only.add_action( 'pre_get_posts', 'sort_by_filter' ); function mv_main_orderby($orderby) {} function tr_main_orderby($orderby) {} function sort_by_filter($query) { if ( !is_admin() && $query->is_main_query() ) { switch (get_query_var('orderby')) { case "popular": add_filter('posts_join', 'wpp_query_join' ); add_filter('posts_orderby', 'wpp_query_order_by'); break; case "views": add_filter('posts_orderby', 'mv_main_orderby'); break; case "rating": add_filter('posts_orderby', 'tr_main_orderby'); break; } } } function wpp_query_join( $join ) { global $wpdb; // Sorting by 'popular', join the popularpostsdata table into the query if ( get_query_var('orderby') && 'popular' == get_query_var('orderby') ) { if ( get_query_var('orderby') && 'popular' == get_query_var('orderby') ) { $join .= " LEFT JOIN {$wpdb->prefix}popularpostsdata ON " . $wpdb->posts . ".ID = {$wpdb->prefix}popularpostsdata.postid "; } return $join; } function wpp_query_order_by( $orderby ){ global $wpdb; $valid_order = array('asc', 'desc'); // Sorting by 'popular', order by pageviews if ( get_query_var('orderby') && 'popular' == get_query_var('orderby') ) { return "{$wpdb->prefix}popularpostsdata.pageviews " . ( ( get_query_var('order') && in_array(get_query_var('order'), $valid_order) ) ? strtoupper(get_query_var('order')) : "DESC" ); } return $orderby; }
I actually have not got it working unfortunately.
//functions.php function mv_main_orderby($orderby) {} function tr_main_orderby($orderby) {} function sort_by_filter($query) { global $wp_query; if ( !is_admin() && $query->is_main_query() ) { switch ($wp_query->query_vars['orderby']) { case "popular": add_filter('posts_join', 'wpp_query_join' ); add_filter('posts_orderby', 'wpp_query_order_by'); break; case "views": add_filter('posts_orderby', 'mv_main_orderby'); break; case "rating": add_filter('posts_orderby', 'tr_main_orderby'); break; } } } function wpp_query_join( $join ) { global $wp_query, $wpdb; // Sorting by 'popular', join the popularpostsdata table into the query if ( isset($wp_query->query['orderby']) && 'popular' == $wp_query->query['orderby'] ) { $join .= " LEFT JOIN {$wpdb->prefix}popularpostsdata ON " . $wpdb->posts . ".ID = {$wpdb->prefix}popularpostsdata.postid "; } return $join; }
//index.php global $wp_query; if ($wp_query->query['orderby'] && $wp_query->query['orderby'] != "rand") { add_action( 'pre_get_posts', 'sort_by_filter' ); } get_header(); ?>
It is the same with the https://www.url.com/?orderby=popular&order=desc and without. There is no difference. The filter does not apply.