Currently I have our program working through the login process. If I have a company that has 20 listings and they want to modify one of them.......you can't tell what category they are in unless you click the radio button and go into edit. See the following photo is there a way to list what categories are associated with these links?
Jun 29, 2010, 1:42 PM
User (424 posts)
Jun 29, 2010, 1:42 PM
Post #2 of 18
Views: 10911
Here is a global which I use to show category or categories below link
Hope that helps.
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
my $title = Links::Build::build ('title_linked', { name => $name, complete => 1 });
$cat .= "".$title."<br />";
}
return $cat;
}
Hope that helps.
Code:
sub { my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
my $title = Links::Build::build ('title_linked', { name => $name, complete => 1 });
$cat .= "".$title."<br />";
}
return $cat;
}
Jun 29, 2010, 11:11 PM
Veteran / Moderator (18436 posts)
Jun 29, 2010, 11:11 PM
Post #3 of 18
Views: 10963
May help to show how to use it
Call the global "get_links_cat_bread", and then call with:
(from memory, the template is modify_select.html I believe)
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!

Call the global "get_links_cat_bread", and then call with:
Code:
<%get_links_cat_bread($ID)%>(from memory, the template is modify_select.html I believe)
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 30, 2010, 4:14 AM
Novice (19 posts)
Jun 30, 2010, 4:14 AM
Post #5 of 18
Views: 10888
I'm still unsure exactly how to do that.
I'm in the modify_select.html template and there is the callout for the links loop.....I was assuming that the category code would go after the <%include link.html%> ....however I've never worked with globals so I'm a little unsure exactly what to do. Sort of new to this.
<form action="<%config.db_cgi_url%>/modify.cgi" method="post">
<%~loop link_results_loop%>
<input type="radio" name="LinkID" value="<%escape_html ID%>" class="radio"<%if isValidated eq No or isExpired or isUnpaid%> disabled="disabled"<%endif%> />
<%include link.html%>
<%~endloop%>
<input type="submit" value="Modify Link" class="submit" />
</form>
I'm in the modify_select.html template and there is the callout for the links loop.....I was assuming that the category code would go after the <%include link.html%> ....however I've never worked with globals so I'm a little unsure exactly what to do. Sort of new to this.
<form action="<%config.db_cgi_url%>/modify.cgi" method="post">
<%~loop link_results_loop%>
<input type="radio" name="LinkID" value="<%escape_html ID%>" class="radio"<%if isValidated eq No or isExpired or isUnpaid%> disabled="disabled"<%endif%> />
<%include link.html%>
<%~endloop%>
<input type="submit" value="Modify Link" class="submit" />
</form>
Jun 30, 2010, 5:06 AM
Veteran / Moderator (18436 posts)
Jun 30, 2010, 5:06 AM
Post #7 of 18
Views: 10914
Hi,
You would call it something like this:
<input type="radio" name="LinkID" value="<%escape_html ID%>" class="radio"<%if isValidated eq No or isExpired or isUnpaid%> disabled="disabled"<%endif%> />
Category: <%get_links_cat_bread($ID)%>
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!
You would call it something like this:
Code:
<%~loop link_results_loop%> <input type="radio" name="LinkID" value="<%escape_html ID%>" class="radio"<%if isValidated eq No or isExpired or isUnpaid%> disabled="disabled"<%endif%> />
Category: <%get_links_cat_bread($ID)%>
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 30, 2010, 6:22 AM
Veteran / Moderator (18436 posts)
Jun 30, 2010, 6:22 AM
Post #9 of 18
Views: 10910
Did you add this global:
http://www.gossamer-threads.com/...ge._P308971/#p308971
...by going into Build > Template Globals, then going to the bottom of the page and putting that code into the TEXTAREA, and then "'get_links_cat_bread" as the new globals name?
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!
http://www.gossamer-threads.com/...ge._P308971/#p308971
...by going into Build > Template Globals, then going to the bottom of the page and putting that code into the TEXTAREA, and then "'get_links_cat_bread" as the new globals name?

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 30, 2010, 6:30 AM
Novice (19 posts)
Jun 30, 2010, 6:30 AM
Post #10 of 18
Views: 10915
Did exactly that and now getting
CGI ErrorThe specified CGI application misbehaved by not returning a complete set of HTTP headers.
Went and created a new global called (get_links_cat_breat) and entered the following:
sub {
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
my $title = Links::Build::build ('title_linked', { name => $name, complete => 1 });
$cat .= "".$title."<br />";
}
return $cat;
}
THEN WENT TO MODIFY_SELECT.HTML AND ENTERED THE FOLLOWING exactly where you told me
Category: <%get_links_cat_bread($ID)%>
CGI ErrorThe specified CGI application misbehaved by not returning a complete set of HTTP headers.
Went and created a new global called (get_links_cat_breat) and entered the following:
sub {
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
my $title = Links::Build::build ('title_linked', { name => $name, complete => 1 });
$cat .= "".$title."<br />";
}
return $cat;
}
THEN WENT TO MODIFY_SELECT.HTML AND ENTERED THE FOLLOWING exactly where you told me
Category: <%get_links_cat_bread($ID)%>
Jun 30, 2010, 6:32 AM
Veteran / Moderator (18436 posts)
Jun 30, 2010, 6:32 AM
Post #11 of 18
Views: 10942
Quote:
Went and created a new global called (get_links_cat_breat) and entered the following:You called it get_links_cat_breat or get_links_cat_bread ?
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 30, 2010, 7:20 AM
Veteran / Moderator (18436 posts)
Jun 30, 2010, 7:20 AM
Post #16 of 18
Views: 10878
Hi,
Mmm, using a SQL server shouldn't make any difference (although most people use mySQL)
Do you have any kinda error logs you can check? As far as I can see, the code should work fine.
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!
Mmm, using a SQL server shouldn't make any difference (although most people use mySQL)
Do you have any kinda error logs you can check? As far as I can see, the code should work fine.
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!