pu2
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Finding ordinal post (not ID) number?I’m still trying to find something that will do this for me, and I’m a complete PHP n00b.. ??
whooami, I know WordPress is php, I just posted that to illustrate what I wanted to get done. And I’m sorry, but “just a simple sql query” to me reads like “gresche be sql delorim” — plainly, I have no clue how to do that :). I posted here to get some community help.
Feels like a broken record, but: Doesn’t anyone know? I just switched from Movable Type, and I remember I had a plugin that was pretty simple, just a .pl file that counted through the database for posted topics and assigned numbers:
# entrynumber.pl - Entry numbering plugin by Lummox JR # Designed to replace EntryID for permalinks so blogs survive import/export intact package LummoxJR::entrynumber; use MT::Template::Context; use MT::Entry; MT::Template::Context->add_tag(EntryNumber => \&entrynumber); my $entryN={}; sub entrynumber { my($ctx,$args)=@_; my $tag=$ctx->stash('tag'); my $entry=$ctx->stash('entry'); return $ctx->error(MT->translate("An entry context is required in [_1]", "<MT$tag>")) unless $entry && $entry->id; my $form=$args->{author}?'author':''; $entryN->{$form}=$entryN->{$form} || {}; my $cache=$entryN->{$form}; my $count; unless($count=$cache->{$entry->id}) { my %terms = ( blog_id => $entry->blog_id, status => MT::Entry::RELEASE() ); $terms{author_id}=$entry->author_id if($args->{author}); my $iter=MT::Entry->load_iter(\%terms, {sort => 'created_on', direction => 'ascend'}); my($e,$n); while($e=$iter->()) {$cache->{$e->id}=++$n;} $count=$cache->{$entry->id}; } $args->{pad} ? (sprintf "%06d", $count) : "$count"; } 1;
Puh ??
There’s no way just to have a script that counts through the database and distinguish / identify posts that are published?Is bumping allowed? ??
Forum: Plugins
In reply to: Show number of member’s comments on profile?Hey, this is what I want too, but I only get the output “59” disregarding which account I’m logged in with. I have more than 59 comments in total on the blog, so it can’t be it shows total number of comments, and the accounts I use to login are nowhere near 59 comments..
Forum: Fixing WordPress
In reply to: main page to show one entry & other pages more than one entriesAwesome, thanks a lot for this!