Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Other Links by This Member

Quote Reply
Other Links by This Member
is there a way to display Other Links by Member in the detail page?
thanks
Quote Reply
Re: [ajiimd] Other Links by This Member In reply to
Hi. You could try something like this;

<%global_name($LinkOwner)%>

...global;

Code:
sub {

my $user = $_[0];

my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('link', $hit);
}

return $back;
}

Hope that helps.

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] Other Links by This Member In reply to
Wow, this works great, thanks. is the a way to just show the titles with hyperlink?
Thanks
Quote Reply
Re: [ajiimd] Other Links by This Member In reply to
Quote:
Wow, this works great, thanks.

Cool

Quote:
is the a way to just show the titles with hyperlink?

Without going through the template parser?

Just change the line with "Links::SiteHTML::display", to;

Code:
$back .= qq|<a href="$CFG->{build_root_url}/Detailed/$hit->{ID}.html">$hit->{Title}</a>|;

Hope that helps.

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] Other Links by This Member In reply to
this works great. just added <li> ...</li>
thanks
Quote Reply
Re: [ajiimd] Other Links by This Member In reply to
I would like to do this as well ( Other Links by This Member ) but i didn't understand what was explained above.

Do I create a global in the admin panel

Where
Code is <%global_name($LinkOwner)%>
and where
Description is the code below
sub {

my $user = $_[0];

my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('link', $hit);
}

return $back;
}
then do I place this in the detailed.html template?
<%global_name($LinkOwner)%>
Quote Reply
Re: [cuppa] Other Links by This Member In reply to
Hi. You need to create a global (for example "get_links_by_owner") and then put the following code into the new global;

Code:
sub {

my $user = $_[0];

my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('link', $hit);
}

return $back;
}

Then just call this in detailed.html or link.html, with;

<%get_links_by_owner($LinkOwner)%>

That should do it Angelic

Hope that helps.

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] Other Links by This Member In reply to
Thanks Andy - I got this response after i did what you suggested :-(

Cheers
Steve
Quote Reply
Re: [cuppa] Other Links by This Member In reply to
Erm, what response? :/

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] Other Links by This Member In reply to
Sorry - forgot to post this >

Error: Variable 'global_name' is not a code reference

In globals I call the variable >
get_links_by_owner

I used this as the coding for the global
sub {

my $user = $_[0];

my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('link', $hit);
}

return $back;
}

I pasted this into detailed.html
<%get_links_by_owner($LinkOwner)%

Any ideas?

Thanks
Steve


Quote Reply
Re: [cuppa] Other Links by This Member In reply to
Erm, you DON'T use global_name Wink In your case, you would use;

<%get_links_by_owner($LinkOwner)%>

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] Other Links by This Member In reply to
Andy

I didn't use the phrase global_name anywhere - all the words i used are in the post above - did not use phrase global_name - strange eh?
Quote Reply
Re: [cuppa] Other Links by This Member In reply to
Can you email/PM over LinksSQL admin panel details? I think you must have used global_name somewhere, or else it wouldn't give you that error Crazy

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] Other Links by This Member In reply to
Andy, you were right in that I had a global called global_name and this was the global that was next in the column under the global I was trying to get work. So I deleted global_name variable and that fixed it :-) Thanks. Is there was a way to limited the number of posts shown for each Link Owner - I guess there's a set of words I need to include in your global code that says just show the last 6 posts for example?

Thanks
Steve
Quote Reply
Re: [cuppa] Other Links by This Member In reply to
No problem Wink

Try changing;


Code:
my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

..to;


Code:
my $tbl = $DB->table('Links');
$tbl->select_options(LIMIT 6');
my $sth = $tbl->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

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] Other Links by This Member In reply to
Here's the code i am now using Andy

---
sub {

my $user = $_[0];
my $tbl = $DB->table('Links');
$tbl->select_options(LIMIT 6');
my $sth = $tbl->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;
my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('link', $hit);
}

return $back;
}
---

here's the error message - when I re-build

---
Building What's New Index...
Number found where operator expected at (eval 47) line 5, near "LIMIT 6"
(Do you need to predeclare LIMIT?)
String found where operator expected at (eval 47) line 6, near "6');
my $sth = $tbl->select( { LinkOwner => $user, isValidated => '"
(Might be a runaway multi-line '' string starting on line 5)
(Missing operator before ');
my $sth = $tbl->select( { LinkOwner => $user, isValidated => '?)

A fatal error has occured:
Bizarre copy of HASH in sassign at /home/the3gportal.com/www/cgi-bin/admin/GT/Config.pm line 619.

Please enable debugging in setup for more details.
Bizarre copy of HASH in sassign at /home/the3gportal.com/www/cgi-bin/admin/GT/Config.pm line 619.
---

Cheers
Steve
Quote Reply
Re: [cuppa] Other Links by This Member In reply to
Sorry, typo =)

Should be;

$tbl->select_options('LIMIT 6');

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] Other Links by This Member In reply to
:-) Andy

Now a different error message

Unable to compile 'get_links_by_owner': Global symbol "$user" requires explicit package name at (eval 47) line 5.

This appears on the web page when i go look at a detailed entry

:-)
Steve
Quote Reply
Re: [cuppa] Other Links by This Member In reply to
Again, this must be a problem with how you've set it up. The line is formatted perfectly;

my $user = $_[0];

Wink

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] Other Links by This Member In reply to
Yeh Andy that line was the problem - i had missed it out completely,

Cheers
Steve

PS. I expect to be in touch about some mods I need to the basic Links SQL package. - first of all I need to finish drawing up the spec to talk to you about. More later this month via email.
Quote Reply
Re: [Andy] Other Links by This Member In reply to
Hi,

aren't we supposed to use 'VIEWABLE':

http://www.gossamer-threads.com/...ing=VIEWABLE;#266223

instead of just - isValidated => 'Yes'?


Thanks
Quote Reply
Re: [Payooo] Other Links by This Member In reply to
In Reply To:
Hi,

aren't we supposed to use 'VIEWABLE':

http://www.gossamer-threads.com/...ing=VIEWABLE;#266223

instead of just - isValidated => 'Yes'?

Thanks

Yup, assuming you are using payments =)

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] Other Links by This Member In reply to
Even if you aren't, you should. VIEWABLE will be correct when payments is on or off.

Adrian