Support » Plugins and Hacks » Popularity Contest Plugin (beta)

Viewing 15 replies - 1 through 15 (of 57 total)
  • normgregory

    (@normgregory)

    At the bottom of the Most Popular Posts page I got this error message:

    Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/normgregory.com/subdomains/blog/httpdocs/wp-content/plugins/popularity-contest.php on line 941

    XeroCool

    (@xerocool)

    Same here.

    I get 2:

    Warning: Invalid argument supplied for foreach() in /usr/home/xerocool/domains/r0x0rz.info/public_html/wp-content/plugins/popularity-contest.php on line 710

    and:
    /usr/home/xerocool/domains/r0x0rz.info/public_html/wp-content/plugins/popularity-contest.php on line 710

    and:
    /usr/home/xerocool/domains/r0x0rz.info/public_html/wp-content/plugins/popularity-contest.php on line 940

    I meant 3 ;).

    Alex King

    (@alexkingorg)

    Thanks, easy fix for next release. Looks like you have some categories without posts.

    Arlo

    (@arlo)

    How do I turn off showing the % in all the posts? I would only want to use it in the sidebar.

    edit: nevermind..it helps to read the source 🙂

    Alex King

    (@alexkingorg)

    From the README.txt:

    …read the installation instructions at the top of the plugin to disable showing popularity for each post.

    Arlo

    (@arlo)

    I got these errors in the report page:

    WordPress database error: [Got error 12 from storage engine]
    SELECT DISTINCT c.cat_name AS cat_name, AVG(pop.total) AS avg FROM wp_posts p LEFT JOIN wp_ak_popularity pop ON p.ID = pop.post_id LEFT JOIN wp_post2cat pc ON p.ID = pc.post_id LEFT JOIN wp_categories c ON pc.category_id = c.cat_ID GROUP BY c.cat_ID ORDER BY avg DESC

    Warning: Invalid argument supplied for foreach() in /www/a/automatorwor/htdocs/wordpress/wp-content/plugins/popularity-contest.php on line 754
    WordPress database error: [Got error 12 from storage engine]
    SELECT MONTH(p.post_date) AS month, AVG(pop.total) AS avg FROM wp_posts p LEFT JOIN wp_ak_popularity pop ON p.ID = pop.post_id WHERE YEAR(p.post_date) = ‘2005’ GROUP BY month ORDER BY avg DESC

    Warning: Invalid argument supplied for foreach() in /www/a/automatorwor/htdocs/wordpress/wp-content/plugins/popularity-contest.php on line 774
    WordPress database error: [Got error 12 from storage engine]
    SELECT MONTH(p.post_date) AS month, AVG(pop.total) AS avg FROM wp_posts p LEFT JOIN wp_ak_popularity pop ON p.ID = pop.post_id WHERE YEAR(p.post_date) = ‘2004’ GROUP BY month ORDER BY avg DESC

    Warning: Invalid argument supplied for foreach() in /www/a/automatorwor/htdocs/wordpress/wp-content/plugins/popularity-contest.php on line 774

    Alex King

    (@alexkingorg)

    Interesting – can you run that top SQL query on the database directly and let me know what the error from MySQL is?

    Arlo

    (@arlo)

    weird– I restarted the plugin and they’re gone now (I am still getting the two errors already described above).

    This is working well for me now– quesiton: I’m using it in my sidebar like this, which gives me a nice “top 10” ordered list of posts in category 1. :
    <ol><php akpc_most_popular_in_cat(10,'<li>','</li>',1); ?></ol>

    I have a number of subcategories under a top-level category that doesn’t have the posts explicitly attached to them–as a way method to have an “invisible” category. Is there a way to use the top level cat and have all the sub-cats show in the list? Short of this, could there be a way to include multiple categories?

    Alex King

    (@alexkingorg)

    The example code included in sidebar.php makes it easy to make the list ‘category aware’ for a single category. However, there is no concept of showing multiple categories in the current code.

    Feel free to add/edit as you like – it shouldn’t be hard to modify.

    Arlo

    (@arlo)

    Easy for you to say, I’m not a coder 🙂

    I’m setting up some conditional bits which mostly work, but “is_home” is going utterly ignored–it’s returning nothing on the home page, but “is_page” and “is_single” work fine:

    <php if (is_home() || is_page() || is_single()) { ?>
    <php akpc_most_popular_in_cat(10,'<li>','</li>',61); ?>

    <php } elseif (is_category()) { ?>
    <php akpc_most_popular_in_cat(10,'<li>','</li>'); ?>

    <php } elseif (is_month()) { ?>
    <php akpc_most_popular_in_month(10,'<li>','</li>'); ?>
    <php } ?>

    Ideas?

    Karb

    (@karb)

    Hi there,

    Great plugin
    I too have the errors mention and yes I have categories not used. I also get it for ‘Last Year’ – Warning: Invalid argument supplied for foreach() in /home/editor/public_html/news/wp-content/plugins/popularity-contest.php on line 940

    How do you limit ‘most popular posts’ in the side bar please?

    Thanks

    cou

    (@cou)

    Was looking forward to using this, but for some reason it’s altered something. My site now only displays one post per page – it has the “next page” links, but still only one post at a time. No other settings have been changed, no other files – deactivated the plugin, and deleted it from the server.

    Ideas welcome, please! Can’t think what has gone wrong.

    WildDuck

    (@wildduck)

    Hi Alex
    Great plugin

    I have the Line 940 error too

    Keep coding !

    Karb

    (@karb)

    Does this screw up feeds as my feedburner link no longer works I get: Error on line -1: Premature end of file. on Feedburner or do you think that is unrelated?

    Thanks

    Alex King

    (@alexkingorg)

    cou – I don’t see the problem you describe on your site

    Karb – I don’t see why it would hurt your feeds, however I’ve changed the plugin for the next release so that it doesn’t show popularity in the feeeds. I don’t think I understand you sidebar question.

Viewing 15 replies - 1 through 15 (of 57 total)
  • The topic ‘Popularity Contest Plugin (beta)’ is closed to new replies.