Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Fixing WordPress
    In reply to: Future Archives

    I got this working – I have installed View Future Posts, and followed the instructions in this comment, but the instructions below made all months containing future posts show up in the sidebar.

    Open wp-includes/template-functions-general.php, and search for:
    $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM $wpdb->posts WHERE post_date < '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);

    change it to:
    $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM $wpdb->posts WHERE post_date <> '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);

    Thread Starter andre_gr

    (@andre_gr)

    Well, I have taken a look at the limit_categories plugin (which helped out with quite a few things), and now the plan is to write a plugin that does the following:

    -When admin adds a new user, there is a new section on users.php that has a dropdown menu of all categories, so the appropriate one for this user can be selected. This selection writes the category choice (by category ID or category name) to a new column called “user_allowedcategory” in the wp_users table.

    -Then, there’s an action hooked onto admin_head that triggers when the user is on post.php. It gets the database info on the currently logged-in user, checks for a value in the “user_allowedcategory” column, and only outputs the allowed category to the page.

    Is this possible (especially the database additions), and does it sound like a reasonably sound way to do things?
    Has anyone written any tutorials on working with saving data to the database in plugins, or can anyone get me started on that part?

Viewing 2 replies - 1 through 2 (of 2 total)