Gossamer Forum
Home : Products : Others : Gossamer Community :

[ NEW PLUGIN ] WordPressBlog v1.0

Quote Reply
[ NEW PLUGIN ] WordPressBlog v1.0
Hi,

I'm pleased to announce the release of WordPressBlog

This plugin lets your users setup their OWN seperate installation of WordPress, on your site. Very simple to install, and even easier for users who want to signup for a free blog =) Its all linked from the Members Area, with only 2 steps:

(1) click to say they want to install a blog
(2) Enter their blog name, and their admin email address.

Price: $100

This plugin is also part of the Community ULTRA Package [ details ] [ view plugins ]

Details: http://www.ultranerds.com/.../WordPressBlog_L259/ (screenshots can also be found on this page)

If you have any questions, please don't hesitate to ask.

I'll also be providing some globals, which you can use on your GForum or GLinks installations, to check if a user has a blog in your Gossamer Community installation, and if so -provide the link to it. Those globals will come very soon =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] WordPressBlog v1.0 In reply to
Hi,

OK, here is the global that should work for showing a LinkOwner's blog, IF they have one:

FOR GLINKS

Call with (in link.html/detailed.html/wherever the <%LinkOwner%> tag is available):

Code:
<%check_if_user_hash_blog($LinkOwner)%>
<%if BlogURL%>
Users blog: <%BlogURL%>
<%endif%>


The code for the global for check_if_user_hash_blog is as follows:

Code:
sub {

my $community_path = '/path/to/community/community_secure';

my $NEWDB = new GT::SQL (
def_path => $community_path . '/defs',
cache => 0,
debug => 0,
subclass => 1
);

my $user_hash = $NEWDB->table('comm_users')->select( { comm_username => $_[0] } )->fetchrow_hashref || {};

$user_hash->{BlogURL} ? return { BlogURL => $user_hash->{BlogURL} } : return '';

}



FOR GFORUM

In user_view.html, you can check if they have a blog URL, with the following:

Code:
<%check_if_user_hash_blog($user_username)%>
<%if BlogURL%>
Users blog: <%BlogURL%>
<%endif%>


The global is the same as above - but to save confusion, I'll put it here too ;)

The code for the global for check_if_user_hash_blog is as follows:

Code:
sub {

my $community_path = '/var/home/linkssql/ultradev.com/community_secure';

my $NEWDB = new GT::SQL (
def_path => $community_path . '/defs',
cache => 0,
debug => 0,
subclass => 1
);

my $user_hash = $NEWDB->table('comm_users')->select( { comm_username => $_[0] } )->fetchrow_hashref || {};

$user_hash->{BlogURL} ? return { BlogURL => $user_hash->{BlogURL} } : return '';

}


Both the above globals should work fine - but please let me know if you have any issues.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: May 24, 2008, 9:47 AM
Quote Reply
Re: [Andy] [ NEW PLUGIN ] WordPressBlog v1.0 In reply to
Hi,

Ok, here is the method used, to get the last blog entries:

get_latest_blogs_for_user

Code:
sub {
my $URL = $_[0];
$URL =~ s|/$||;
my @split = split /\//, $URL;

my $prefix = $split[$#split] . '_';

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


my $query = qq|SELECT * FROM ${prefix}posts ORDER BY ID DESC LIMIT 10|;

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 }

}


Example of being used :

Code:
<%check_if_user_hash_blog($LinkOwner)%>
<%if BlogURL%>
<p>Users blog: <a href="<%BlogURL%>"><%BlogURL%></a></p>
<%get_latest_blogs_for_user($BlogURL)%>
<%if blog_loop.length%>
<ul>
<%loop blog_loop%>
<li><a href="<%guid%>"><%post_title%></a> (<%post_date%>)</li>
<%endloop%>
</ul>
<%endif%>
<%endif%>

If anyone has any problems with this, please let mek now (tests ok on my dev installs =))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] WordPressBlog v1.0 In reply to
Hi Andy,

Excelent plugin idea.
Could you explain a bit further how it works.
Is there a copy of wordpress program on our server and everyone that wants one gets automaticly installed?
Is the corrsponding DB get created on its own? Or does it use the same one for everyone?
How much can they customise wordpress? Can they upload pics? Themes? plugins? etc.
Whats the URL that each install will receive? inside our own domain? or subdomain? What options are there if any?

I find the concept very interesting.

Do we have to have community installed? Or does it work with glinks standalone?
Can glinks be an exclusive directory of wordpress installs?

Thanks

Juan Carlos
Quote Reply
Re: [Gorospe] [ NEW PLUGIN ] WordPressBlog v1.0 In reply to
Hi,

Quote:
Excelent plugin idea.

Thanks :)

Quote:
Is there a copy of wordpress program on our server and everyone that wants one gets automaticly installed?
Is the corrsponding DB get created on its own? Or does it use the same one for everyone?

Yup, it uses a "base" copy (which you can then update, to have new themes/plugins etc already installed). You could also make it so they can't edit the theme themselves (by editing theme-editor.php, so it only shows an error message - instead of the theme editor itself.

Quote:
How much can they customise wordpress? Can they upload pics? Themes? plugins? etc.

Not so much plugins (as you have to have them installed already into the /plugins/ folder - which they can then tuirn on/off if they want.

Quote:
Whats the URL that each install will receive? inside our own domain? or subdomain? What options are there if any?

By default, although with a bit of custom work - I should be able to get it working on subdomains (assumes you are able to setup a "wildcard" DNS record)

Regarding the URL - it works like http://www.domain.co/blogs/username/ , http://www.domain.co/blogs/username/?p=2 etc. Obvioulsy this assumes the script is setup to make the Blogs in http://www.domain.co/blogs =)

Quote:
Do we have to have community installed? Or does it work with glinks standalone?
Can glinks be an exclusive directory of wordpress installs?

I'm afraid it will only work with GComm - as it uses that interface to "link" the system together, and a cetral place for users to manage/setup their blog.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Gorospe] [ NEW PLUGIN ] WordPressBlog v1.0 In reply to
BTW, if you want to use this plugin - I can set it up for you, to work with GLinks (just done it here on GLinks - http://www.thelookup.com/userblogs/andy.newby/ )

Its not really plugin based as such - and requires quite a bit of tweaking / manual uploading to get it started - but then it will run just like the Comm one, where you link your users to page.cgi?setup_blog=1, and it will set it upf or them (assuming they are logged in ;))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!