Gossamer Forum
Home : Products : DBMan : Customization :

direct Modify a record

Quote Reply
direct Modify a record
Hello,

can someone say me what should I make to add a link to the list of records, so that user can direct modify a record by clicking on the link.

I tried this : <a href="$db_script_link_url&$db_key=$tmp{$db_key}&modify_form=1">Modify</a>

but it doesn't work. :(

Last edited by:

uhrwerk: Jul 29, 2003, 7:27 AM
Quote Reply
Re: [uhrwerk] direct Modify a record In reply to
Check out the FAQ pages maintained by LoisC at:

http://webmagic.hypermart.net/dbman/

I remember seeing a whole category on "Links". The solution may be in there.

Here is what I use:

<A HREF="$db_script_link_url&modify_form=1&ID=$rec{'ID'}&userid=$in{'userid'}">Modify this Record</A>

This assumes you have the record ID in the database called "ID".

Last edited by:

Watts: Jul 29, 2003, 9:34 AM
Quote Reply
Re: [Watts] direct Modify a record In reply to
thank you very much!!!!!! it works!!!



Perhaps can you help me with one strange quetion:

I want to have a link, so by clicking on it you can see all records with all details but without division into pages "1,2,3 >>" . I have already installed a "short/long display-function" and I don't know how to make this link!

thanks in advance
Quote Reply
Re: [uhrwerk] direct Modify a record In reply to
in default.cfg

change this
Code:
# Default maximum number of hits returned in a search.
$db_max_hits = 10;

to something like 100 or so. See if this works.
Quote Reply
Re: [Watts] direct Modify a record In reply to
I know it, but I want to leave this function ($db_max_hits = 10;) as is and to add one more additional one: so that I can list all records without ckicking on "1,2,3,>>"
Quote Reply
Re: [uhrwerk] direct Modify a record In reply to
You should be able to change the value of db_max_hits "on the fly".

Use some sort of variable in the link to trigger the change. Such as adding to your link

&all_hits=1

then somewhere before the search routine evaluate $in{all_hits} like this

if $in{all_hits} $db_max_hits = 100;

Not tested, just a nice theory.
Quote Reply
Re: [joematt] direct Modify a record In reply to
Wink thank you for your advice.

But I couldn't insert "if $in{all_hits} $db_max_hits = 100;" right.

I received the error:"DBMan encountered an internal error. Please enable debugging to view."



Can you say me where I should insert this line: "if $in{all_hits} $db_max_hits = 100;" ??

thanks in advance
Quote Reply
Re: [uhrwerk] direct Modify a record In reply to
Sorry I was typing off the top of my head.

I think the more correct syntax is;


if ($in{all_hits}) { $db_max_hits = 100 };

As to where to put it;

It could go almost anywhere as long as it is prior to these lines in sub query

# Define the maximum number of hits we will allow, and the next hit counter.
$in{'mh'} ? ($maxhits = $in{'mh'}) : ($maxhits = $db_max_hits);
$in{'nh'} ? ($nh = $in{'nh'}) : ($nh = 1);
$numhits = 0;

Having said that, that seems like a nice place to put it, else perhaps in sub view_records

Sorry I can't be more exact or absolutely sure I'm correct.
Quote Reply
Re: [joematt] direct Modify a record In reply to
Sly It works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

thank you!