Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Clickable links in multiple_modify search results?

Quote Reply
Clickable links in multiple_modify search results?
Hi ...

I feel this should be possible, and I have spent about four hours trying to figure out -- but I have failed completely.

This is what we need, and it might be useful to many others:
When we use the Modify Multiple option in Admin > Database > Links > Modify, we get back a page of link records all ready for editing, with a modify checkbox for each one. The only thing missing is clickable links to the URLS so we can see what we are supposed to be modifying. Not having the links is a major productivity problem.

It's easy to put clickable links in the normal modify search results (the ones with the radio buttons), but the multiple_modify forms are constructed in a different way. I can't even find the right file to start editing in.

Does anyone know how to do it? GT staff? LSQL veterans?
Quote Reply
Re: [YoYoYoYo] Clickable links in multiple_modify search results? In reply to
I was justr having a look in the files, in admin/Links/, but couldn't see the actual code needed. I'm assuming its either in Tools.pm, Browser.pm, or Admin.pm. I had a quick look through these 3 files, and found reference to modifying, and a little HTML....but couldn't find the specific code related to the mutliple list that gets shown after a search..sorry.

Thats as good as I could find Tongue

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] Clickable links in multiple_modify search results? In reply to
It's possible, but it's not very intuitive. Unsure

You'll have to go into your admin/GT/SQL/Admin.pm file and add some code.

Specificially you'll have to add code to the subroutine: modify_multi_search_results

In that module (for me it was around line 1064 in ...GT/SQL/Admin.pm), where you see

Code:
print $self->{html}->form ( { mode => 'modify_multi_search_results', values => $result, multiple => $i, view_key => 1, file_field => 1, file_delete => 1 } );

You will have to add the following code before that line. You will also have to modify that line so it reflects the following:

Code:
my $code = {
URL => sub {
my ( $self, $col, $values ) = @_;
my $field_name = $self->{multiple} ? "$self->{multiple}-$col" : $col;
my $value = $values->{URL};

my $visit_link = $value ? qq!<sup><a href='$value' target=_blank>visit link</a></sup>! : '';

my $buf = qq!
<tr $self->{tr}>
<td $self->{td}>
<font $self->{col_font}>URL</font>
</td>

<td $self->{td}>
<font $self->{val_font}>
<input type="text" name="$field_name" value="$value">
$visit_link
</font>
</td>
</tr>
!;
return $buf;
},
};
print $self->{html}->form ( { mode => 'modify_multi_search_results', values => $result, multiple => $i, view_key => 1, file_field => 1, file_delete => 1, code => $code } );

That should setup your modify-multiple so that there will be a little "visit link" twiddle beside the URL value (if the URL value exists) that will open the link in a new window.

I may have some syntax errors in there so please let me know and I'll fix it.
Quote Reply
Re: [Aki] Clickable links in multiple_modify search results? In reply to
Incredible! I don't understand it at all .. but it works perfectly!

I made one small change here
Code:
<input type="text" name="$field_name" value="$value">
It overrides the specified URL field length, so I inserted size="60"

THANK YOU <> OBRIGADO
Quote Reply
Re: [YoYoYoYo] Clickable links in multiple_modify search results? In reply to
Whoops Blush guess I forgot that part. Glad to hear it works.

If the URL visibility is a concern, you may find this css tip handy, if you're using Mozilla or IE replace the size="60" with something like style='width : 100%' (or some other percentage), that will setup the input box so that the field will be as wide as your screen will allow it.
Quote Reply
Re: [Aki] Clickable links in multiple_modify search results? In reply to
Hi,

Will this be added to Links SQL for future releases??


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Clickable links in multiple_modify search results? In reply to
In Reply To:
Will this be added to Links SQL for future releases??

Personally, I would like to see more functionality in the lists of records we can generate in Admin > Database.

The Category Browser is great for handling occasional or scattered edits, but not very good for intensive editing of many records, eg: when creating a new project.

If the links are in multiple categories, it is even more difficult. We need to be able to process links outside their categories. I think it would be good if this could be included in the editor interface as well, perhaps as a setup option -- as an alternative to the Category Browser, give editors a search restricted to their own categories; the search results should have Edit & Delete buttons on every record.
Quote Reply
Re: [pugdog] Clickable links in multiple_modify search results? In reply to
Unimpressed I don't see any reasons why it shouldn't be, it's a handy little addition. I'll run it past Alex to make sure that it doesn't break anything else.
Quote Reply
Re: [Aki] Clickable links in multiple_modify search results? In reply to
Don't forget to point out that it will increase sales!