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):
<%if BlogURL%>
Users blog: <%BlogURL%>
<%endif%>
The code for the global for check_if_user_hash_blog is as follows:
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:
<%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:
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!
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!