RobotHero
Forum Replies Created
-
Forum: Plugins
In reply to: WordPress Photolog New VersionMore than one picture at one time? You mean, like, you would upload a series of related photos which would appear as one post? Yeah, I could see that as a good thing.
I guess as long as the series is on one theme, it might be nice to just have one thumbnail as representative of them all, rather than all of them. Is that how you were planning on doing it?Forum: Fixing WordPress
In reply to: ignore categoryWell, I’ve gone and done it the hard way.
This goes in my-hacks:
function the_category_IDs() {
$IDs = array();
$categories=get_the_category();
foreach ($categories as $category)
{
$IDs[] = $category->category_id;
};
return $IDs;
}
function isthree($post) {
return (in_array(3,the_category_IDs()));
}
function remove_posts($function) {
global $posts, $post;
$newposts = array ();
if (stristr($function,'!'))
{
$function = explode('!',$function);
$function = $function[1];
foreach ($posts as $post) {
if ($function($post))
{
$newposts[] = $post;
}
}
} else {
foreach ($posts as $post) {
if (!$function($post))
{
$newposts[] = $post;
}
}
}
return $newposts;
}
the_category_IDs() is a function I had written before that returns an array of the categories of $post.
remove_posts() takes a function as a parameter. This function should accept $post as a parameter, and return a boolean. Any post for which the function returns True will be removed from the array of posts returned by remove_posts(). If remove_posts() is passed the name of a function preceded by ! it will remove all posts for which the function returns False.
isthree() is just a function that tests if a post is of category 3. You can replace it with whatever test you want to perform on your posts.
Then, in my index.php, I include this immediately before the Loop:
<?php $posts = remove_posts('isthree') ?>
Note that removing posts this way will reduce the total number of posts. IE: if your posts_per_page is set to 5, and 3 of your posts are removed, then you will only display 2 posts. I’ll see what I can do to improve that.Forum: Plugins
In reply to: category functionsOkay. I added this to myhacks.
function the_category_IDs() {
$IDs = array();
$categories=get_the_category();
for ($i=0;$i<count($categories);$i++)
{
$IDs[] = $categories[$i]->category_id;
};
return $IDs;
}
And then anywhere I want to test to see if a post is in a category, I just useif (in_array(X,the_category_IDs()))
where X is the category ID I’m testing for.Forum: Fixing WordPress
In reply to: New user, multiple blogs, cross posting etcSo, would you, for example, have US posts that appear in all the US regions? What about world-wide posts?
Or do you want to make posts that will span multiple regions?Forum: Your WordPress
In reply to: https://weblog.lokrin.netYour main page is too broad. I’m using a 1024 x 768 screen, and I have to scroll sideways to see the sidebars.
Forum: Plugins
In reply to: Creating Master/Feeder blog & dbhttps://www.homeofficefiles.com/?cat=4
Forum: Plugins
In reply to: WP/phpBB2 integrationThis sounds exactly like something I wanted to do. I’d be very interested in the how-to.
Forum: Everything else WordPress
In reply to: WP vs. Livejournal?Personally, you can have my-hacks.php when you pry it from my cold, dead hands. But she seems committed to the LJ community.
But still, I’m curious.
Can you list archives by title instead of date? Can you have multiple bloggers on one blog? Can you have catagories?Forum: Plugins
In reply to: Filtered before posting?Okay, I think I’ll change the format_to_post function in functions.php, adding $content = apply_filters(‘format_to_post’, $content);
And then I should be able to use my-hacks.php to define the specific stuff.
function format_to_post($content) {
global $post_autobr,$comment_autobr;
$content = addslashes($content);
if ($post_autobr || $comment_autobr) { $content = autobrize($content); }
$content = apply_filters('format_to_post', $content);
return $content;
}