rubhadubh
Forum Replies Created
-
Forum: Plugins
In reply to: [Maintenance] Suggested modification to fix subdirectory issueI just logged in to make the same suggestion. I changed the line to use get_home_url() instead, but the effect is the same, and it cures the same issue.
You might also want to change the wording of the error message on line 53, as the grammar is wrong. It should read either ‘You entered your login and password incorrectly!’ or ‘The login and password you entered are incorrect!’
Hope that helps – great plugin though – thanks.
Forum: Fixing WordPress
In reply to: No media attachments found.same issue, same version, same fix worked – but why?!
Forum: Hacks
In reply to: WordPress as CMS for custom dataMany thanks, another trip up the learning curve for me then.
Forum: Hacks
In reply to: WordPress as CMS for custom dataThanks guys, that’s the kind of pointer I needed. I have come across post types, but wondered if that was the way folks were handling this sort of scenario.
I have a lot of code written to handle members, companies, shop items – that sort of thing – add, edit, delete, re-order items and so on. I wasn’t sure how to integrate any of that code, or whether to abandon it and try using inbuilt features.
I’ll have a play with custom post types, but is there a way to add a wp-admin menu item which would open an application page in the right pane, much like ‘Settings’? The app code would have to be outside the core so as not to be written over on wordpress upgrade, but is that possible?
Forum: Plugins
In reply to: [Plugin: User Photo] Upload errorYes, you will get this error if you activate the plugin but haven’t altered permissions on the upload folder.
In wp-admin under Settings -> Miscellaneous -> Store uploads in this folder, there is a path. You need to make this folder writeable by chmod, so that the system can save images to it.
Worked great after doing that… hope that helps.
Forum: Plugins
In reply to: Setting up multi-author blogOk, a better solution…
Turns out that you can get the page id using $post->ID so I wrote a function get_page_author() and saved it in functions.php which takes the page id as a parameter and returns the post_author id from the wp_posts table, like so:
function get_page_author($pageid){ global $wpdb; $authorid = $wpdb->get_var("SELECT post_author FROM wp_posts WHERE ID = $pageid AND post_status = 'publish' AND post_type = 'page'";); if($authorid > 0) return $authorid; else return false; }in my blogger.php file I can then use that to filter the posts, like so:
$authorid = get_page_author($post->ID); if($authorid){ query_posts("author=$authorid"); }Once we have the authorid we can go get other details from the database with it – I guess there are pre-made functions, but I might stick to doing it my own way! I have spent more time trying to find my way around wordpress – I could have had the whole site built and signed off by now!!
Hope that helps you too?
Forum: Plugins
In reply to: Setting up multi-author blogGood grief, I’m reduced to a series of if statements!
The only way I can figure to do this at the moment is:
if(is_page('author-page-1')) {$auth = 2;} elseif(is_page('author-page-2')) {$auth = 3;} query_posts("author=$auth");it works, but it’s not very nice! There must be a better way – anyone?
Forum: Plugins
In reply to: Setting up multi-author blogYes, in WP Admin there is a drop down labelled Page Author, where I can pick from a list of users I have assigned as Authors. It only showed up once there were Authors created.
You would *think* that we could access this somehow on a page but I’ve spent all day looking for it – arghhh. Thanks for your help asechrest.
There must be a function like get_page_details that returns an array of information about the current page, but I’m damned if I can find it. Anyone?
Forum: Plugins
In reply to: Setting up multi-author blogWell, I have that working for a hardcoded author id, so many thanks for the query_posts() ref, but the problem remains how to get the author info from a request for a particular page where that Author is set as the Page Author – any ideas?
Is there an array with page info once you are on a page?
Forum: Plugins
In reply to: Setting up multi-author blogThis seems harder than it should be! I don’t really understand the distinction between Pages and Posts. I would have thought that mixing page content and filtered posts was a fairly common requirement?
I’m looking into query_posts() and will report back. I guess once you have the author_name, or id, then grabbing other bio data should be easy enough.
So, I have a parent page called Blogs and for each registered Author I create a child page called after their name. The child page is given a page template called blogger.php (to avoid confusion with author.php which is used by posts). In blogger.php I call query_post(‘author_name=xxxxx’) and then loop through the resulting posts? Does that roughly right? Thanks.