andre_gr
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Future ArchivesI 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);
Forum: Fixing WordPress
In reply to: A way to restrict category choices (per user) on post.phpWell, 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?