Gossamer Forum
Quote Reply
global for bbpress
Hi Andy,
pretty quiet in here ;-)
So what about a global to get the latest bbpress plugin threads?
This code below calls the latest wordpress entries. Perhabs there is not much to change for bbpress?
Code:
sub {
my $prefix = 'wp_';

use DBI;
my $dbh = DBI->connect('DBI:mysql:xxxxxxxxxxxxxxxxxxxxxxxx
) || die "Could not connect to database: $DBI::errstr";


my $query = qq|SELECT * FROM ${prefix}posts WHERE post_parent < 1 AND post_status = 'publish' AND post_type = "post" ORDER BY ID DESC LIMIT 3|;

my $sth = $dbh->prepare($query) || die $DBI::errstr;
$sth->execute() || die $DBI::errstr;

my @loop;
while (my $hit = $sth->fetchrow_hashref) {
push @loop, $hit;
}

$sth->finish();
$dbh->disconnect();

return { blog_loop => \@loop }

}

Thanks

Matthias
gpaed.de
Subject Author Views Date
Thread global for bbpress Matthias70 7348 Jan 22, 2015, 1:40 PM
Thread Re: [Matthias70] global for bbpress
Andy 7263 Jan 23, 2015, 12:49 AM
Thread Re: [Andy] global for bbpress
Matthias70 7254 Jan 23, 2015, 5:46 AM
Thread Re: [Matthias70] global for bbpress
Andy 7271 Jan 23, 2015, 5:48 AM
Thread Re: [Andy] global for bbpress
Matthias70 7249 Jan 23, 2015, 6:30 AM
Thread Re: [Matthias70] global for bbpress
Andy 7253 Jan 23, 2015, 6:39 AM
Thread Re: [Andy] global for bbpress
Matthias70 7247 Jan 23, 2015, 8:05 AM
Thread Re: [Matthias70] global for bbpress
Andy 7249 Jan 23, 2015, 8:20 AM
Post Re: [Andy] global for bbpress
Matthias70 7234 Jan 23, 2015, 8:42 AM