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

Allow users to submit/modify in multiple categorys?

Quote Reply
Allow users to submit/modify in multiple categorys?
Hello People! Thought it was time to consult the resident LinksSQL gurus once again...

I've found a few threads on this topic but can't seem to find a solution suitable for my needs. Here's all I hope to accomplish:

- Users could submit / modify listings to multiple categorys via a multi select form in the include_form.html ( addition to 3 categorys only )
- Have Users somehow aware of what Categories they are currently listed in for modification purposes.
- To hopefully use some sort of global instead of code hacks for future updating ease.

Here's a thread and global I found on this topic:
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=196090;#196090

Warwick from Humorlinks.com was nice enough to offer this global except it doesn't seen to work for me. It did show a few top categorys in which I was using SUB1 as a Description for use with the YahooSubcats Plugin. It didn't display as a multiselect form either. I removed those SUB1 in the Category Descriptions and no Categories would show at all.

I'm still trying to finish up my first LinksSQL project and I don't know enough to fix this global myself...

----------------------------------------------------------
From Humorlinks:

Hi.

This can be done by using a global.

Call it something like <%selected_cats%>

It will replace <%Category%> in include_form.html

sub {
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table('CatLinks');
my @sids = $db->select ( ['CategoryID'], { 'LinkID' => $id } )->fetchall_list;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name ASC');
my $sth = $cat_db->select ( { 'Description' => 'SUB1' }, ['ID', 'Full_Name'] );
my $output;
$output .= "<SELECT MULTIPLE SIZE='5' name='CatLinks.CategoryID'>";
$output .= "<option value=''>-------</option>";
while (my ($cid,$name) = $sth->fetchrow_array) {
$output .= "<option value='$cid'";
foreach my $sid (@sids) {
if ($sid eq $cid) {
$output .= " selected";
}
}
$output .= ">$name</option>";
}
$output .= "</SELECT>";
return $output;
}

----------------------------------------------------------

Many Many Many Thanks for any help getting some sort of multi select category option working in my include_form.html.

Ryan Wink
Quote Reply
Re: [Jonze] Allow users to submit/modify in multiple categorys? In reply to
Well I think I've got the problem fixed thanks to Warwick over at Humorlinks.com. Million thanks to him for that great global....it works great.

I wasn't using SUB1 in all of my Categorys Description fields Crazy .

Later
Quote Reply
Re: [Jonze] Allow users to submit/modify in multiple categorys? In reply to
My Xtended Add.Modify.Delete plugin (XAMD) will contain the limit to submit a link to maximum X categories feature you want.

Check the info about the plugin here:
[PLUGIN] Xtended Add.Modify.Delete plugin (XAMD) development news

The plugin itself is still under development, and is not ready for release. Please follow the thread above to get the latest news about the plugin, and the new features.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...