I've already been using the global for the "last 5 links", but how to make a global for the lastn by user? Or would this have to be more specific than a global?
Jun 2, 2003, 7:28 AM
User (254 posts)
Jun 2, 2003, 7:28 AM
Post #2 of 13
Views: 4271
This would be useful for a visitor to "Read all posts by this user" or "View all links by this User"
Last edited by:
SSmeredith: Jun 2, 2003, 7:42 AM
Jun 2, 2003, 7:57 AM
Veteran / Moderator (18436 posts)
Jun 2, 2003, 7:57 AM
Post #3 of 13
Views: 4240
Inside the 'last n links', you would just need to put something like;
select ( { LinkOwner => $linkowner } );
...and pass some extra details to the routine. Like;
<%last_x($LinkOwner)%>
with that value being passed via;
my $LinkOwner = shift;
If you paste the global you are using, I could make these changes for you. I just don't know which version your are using
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!
select ( { LinkOwner => $linkowner } );
...and pass some extra details to the routine. Like;
<%last_x($LinkOwner)%>
with that value being passed via;
my $LinkOwner = shift;
If you paste the global you are using, I could make these changes for you. I just don't know which version your are using

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!
Jun 2, 2003, 9:36 AM
User (254 posts)
Jun 2, 2003, 9:36 AM
Post #4 of 13
Views: 4234
HI Andy,
This is what I have...
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my $sth = $link_db->select( { isNew => "Yes", isValidated => "Yes" } );
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
Not using it yet, so I can work with changes
Thanks!
This is what I have...
sub {
my $vals = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my $sth = $link_db->select( { isNew => "Yes", isValidated => "Yes" } );
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
Not using it yet, so I can work with changes
Thanks!
Jun 2, 2003, 9:43 AM
Veteran / Moderator (18436 posts)
Jun 2, 2003, 9:43 AM
Post #5 of 13
Views: 4275
something like this should work then;
my $LinkOwner = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
if ($LinkOwner) {
my $sth = $link_db->select( { isNew => "Yes", isValidated => "Yes", LinkOwner => $LinkOwner } );
} else {
my $sth = $link_db->select( { isNew => "Yes", isValidated => "Yes" } );
}
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
Call with;
<%global_name($LinkOwner)%>
If no link owner is specified, it will just check for normal new links. So to show the last 6 links, by anyone, you could use;
<%global_name%>
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!
Code:
sub { my $LinkOwner = shift;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
if ($LinkOwner) {
my $sth = $link_db->select( { isNew => "Yes", isValidated => "Yes", LinkOwner => $LinkOwner } );
} else {
my $sth = $link_db->select( { isNew => "Yes", isValidated => "Yes" } );
}
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
Call with;
<%global_name($LinkOwner)%>
If no link owner is specified, it will just check for normal new links. So to show the last 6 links, by anyone, you could use;
<%global_name%>
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!
Jun 2, 2003, 10:00 AM
User (254 posts)
Jun 2, 2003, 10:00 AM
Post #6 of 13
Views: 4230
okay, I'll give it a try -
One question - how to state which user's links I want to appear?
What I mean is who's - Andy's, Mine, Dick's, Jane's... you know ?
Should I have asked for a global to see all links by that USER?
One question - how to state which user's links I want to appear?
What I mean is who's - Andy's, Mine, Dick's, Jane's... you know ?
Should I have asked for a global to see all links by that USER?
Last edited by:
SSmeredith: Jun 2, 2003, 10:01 AM
Jun 2, 2003, 10:14 AM
Veteran / Moderator (18436 posts)
Jun 2, 2003, 10:14 AM
Post #7 of 13
Views: 4225
To see a specific person, just use something like;
<%global_name("Andy")%>
<%global_name("Merdith")%>
<%global_name("Dick")%>
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!
<%global_name("Andy")%>
<%global_name("Merdith")%>
<%global_name("Dick")%>
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!
Jun 3, 2003, 8:49 AM
Veteran / Moderator (18436 posts)
Jun 3, 2003, 8:49 AM
Post #10 of 13
Views: 4224
Mmm..that may have something to do with the 'my' inside the 'if' statement. Give this one a go;
my $LinkOwner = shift;
my $sth;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
if ($LinkOwner) {
$sth = $link_db->select( { isNew => "Yes", isValidated => "Yes", LinkOwner => $LinkOwner } );
} else {
$sth = $link_db->select( { isNew => "Yes", isValidated => "Yes" } );
}
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
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!
Code:
sub { my $LinkOwner = shift;
my $sth;
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC', 'LIMIT 6');
if ($LinkOwner) {
$sth = $link_db->select( { isNew => "Yes", isValidated => "Yes", LinkOwner => $LinkOwner } );
} else {
$sth = $link_db->select( { isNew => "Yes", isValidated => "Yes" } );
}
my $output = '';
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
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!
Jun 3, 2003, 9:07 AM
Veteran / Moderator (18436 posts)
Jun 3, 2003, 9:07 AM
Post #12 of 13
Views: 4232
LOL...you have such a 'lovely' way of putting things
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!

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!
Jun 3, 2003, 11:13 AM
Novice (37 posts)
Jun 3, 2003, 11:13 AM
Post #13 of 13
Views: 4212
Hi Andy,
Its working fine, but one small problem.
I am using this global on a detail page. It's showing all the 5 New links from the LinkOwner including the one on the Detail page.
I want to display 5 Links except the one on the detail page.
I appreciate your help
Thanks.
Its working fine, but one small problem.
I am using this global on a detail page. It's showing all the 5 New links from the LinkOwner including the one on the Detail page.
I want to display 5 Links except the one on the detail page.
I appreciate your help
Thanks.