Gossamer Forum
Home : Products : Links 2.0 : Customization :

Any advise welcome - PLEASE HELP !!!!

Quote Reply
Any advise welcome - PLEASE HELP !!!!
Hi,

I am having a small problem. In my admin centre I have created a few new fields. I created all the form elements in the links.def file.

However when I fill out the data, only the original fields send there data to be stored. Is there anyway else I need to mention these new fields or have I missed some really silly.

Martin
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Are you speaking of a link owner modifying a record and you wanting the original data to be kept for the new fields?

Or are you referring to a record being modified on the admin screen?

If the latter, and the fields were added correctly in links.def, there should be no problem.

If the former, you need to go to sub process_form in modify.cgi find this code:

Code:
# Print out the modified record to a "modified database" where it is stored until
# the admin decides to add it into the real database.

Beneath that code, you need to add statements similar to:

Code:
# Keep original data
$in{$db_cols[$db_newfield1]} = $original{'Newfield1'};
$in{$db_cols[$db_newfield2]} = $original{'Newfield2'};

You would need to change the $db_newfield1 and $db_newfield2 as well as 'Newfield1' and 'Newfield2' to what is defined in links.def.

I hope this helps.
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Bobsie,

The aim really is to add links only via the admin, so the visitor has no addition control, however I have to decided to work this problem step by step and by this I started adding a entry via the add.cgi script.

I added a field called "Postcode" into site_html.pl file. It shows the field when I run add.cgi, I fill the field in and submit, it passes this entry over correctly to the success page.

At this point I go to admin to see what's happened. All the fields details been passed over except the Postcode one, even though it was in the sucess page.

What do I need to do to trace this problem down for a Starter for 10.

Martin
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Can you post how you have this field defined in %db_def in links.def along with any other related variables you assigned in links.def?

Or, provide a URL where we can look at links.def?
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
In order for you to be able to display your new data to your site via the site_html.pl add the following it:

$rec{'Postcode'}

No editing of the add.cgi or or the modify.cgi is needed. All you need to do is add the field in your links.def like this:

Postcode => [18, 'numer', 6, 6, 0, '', ''],



------------------
TheByrdMan Out!

//-Tweet-\\
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Byrdman,

He isn't asking about site_html.pl. He is speaking of admin_html.pl. He also stated he already defined the field in links.def.
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Hi BObsie,

I have uploaded the links.def file that I have be working on.

It can be found at http://www.march.force9.co.uk/testdata/links.def

or in text format at http://www.march.force9.co.uk/testdata/links.txt

I honestly can't see whats wrong with it, maybe a fresh set of eyes will spot the problem.

Martin

Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Now here is a perfect example of not enough information. Nowhere in any of this discussion was there any mention of the fact that this is Links v1.1, a very important piece of information. All the advice I have been giving has been based on Links v2.0, so scratch everything I have said previously. Let me study what you have done and I'll get back to you. It may not be immediate since I am rather ill today.
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Bobsie,

As far as I knew this part of Links was not effected from the Links 1.1 to Links 2.0 conversion.

Would you say that is time to bite the bullet and move over to Links 2.0??

Martin
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Martin,

Let me put it this way. When I saw the differences between Links v1.1 and Links v2 (even in beta), I could hardly wait to switch to the new script. I just waited for a more stable beta before I did and I think it was beta 4 where I started using Links v2 live.

Adding fields is so much easier and there is so much more flexibility in the script. There are also some problems with v2.0 (verifying links being the biggest one) but overall, Links v2.0 is a much better script.

The only thing you have to watch for when upgrading is if your Links v1.1 has the "Rate It" mod installed. The Votes and Ratings fields are reversed of what is used in Links v2.0, so you have to switch the field numbers for those two fields in the v2.0 links.def when doing the upgrading.

Let me know if you decide to upgrade since I am trying to figure out your problem with Links v1.1. I can also provide help with the upgrade if you run into problems.

For the most part, you can just cut and paste the routines from the v1.1 site_html.pl you use into the corresponding v2.0 site_html.pl. Later, when you are more comfortable with v2.0, you can switch over to templates. Alternatively, you can jump right in by using templates. Templates are not that hard to understand. The main differences between v1.1 and v2.0 with templates is that the HTML code for the pages goes into the template files instead of the script and the template files use macros (aka links_tags) like <%Category%> instead of $Category.

Lots of people here to provide support when you have difficulties, including myself.

The choice is yours. Let me know.
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Bobsie,

In order to help me decide, can you tell me if Links 2.0 searches the database faster than Links 1.1?

Martin
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Yes, it does. According to the readme.txt in Links2, it is about 100% faster.

John
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Martin,

A lot depends on the size of your database but yes, in general Links v2.0 is faster searching than Links v1.1.
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Bobsie,

Basically this project I am working on is one from scatch, therefore is has no data, however at this time each record will be expecting to have around 30 fields as you would have seen from the url links above, and could be expected the search on around 10 of these fields.

Though from the outset I know I have used Links 1.11 for a while now, I have found Links 2.0 to be hard to setup unlike Links 1.11 was which is one of the reasons that has put me off working with it?

Just a couple more questions:

1) Are all the mods created for Links 1.11 available to Links 2.0?

2) And has anyone heard anything more about the Windows Installer that I heard was being worked on to install Links?

Martin
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
 
Quote:
1) Are all the mods created for Links 1.11 available to Links 2.0?

No, all the v1.11 mods are not available in Links v2.0. Partially because some of them are already incorporated in Links v2.0 to begin with, while others just are not easily adapted to Links v2.0 because of the differences in the two versions. There are many mods availabe though. Just look through the Gossamer Threads Script Resources located at http://www.gossamer-threads.com/scripts/resources/ .

Quote:
2) And has anyone heard anything more about the Windows Installer that I heard was being worked on to install Links?

No more than you have. Alex indicated when Links v2.0 was released that he would release one, but haven't heard anything since specifically about it.

It is my considered opinion that Links v2.0 is no more difficult to install than was Links v1. If fact, I consider it easier since it is much easier to add fields, something you indicate you need to do. Adding fields in Links v1 is a multi-step process that needs to be done, if I remember correctly, in more than one file. In Links v2.0, it is quite simple and is all done in a single file, links.def (or category.def if adding category fields). Configurations for the script are done in one other file, links.cfg, instead doing it in multiple files.

The basic structure of site_html.pl is nearly identical in both versions, so there is not too much recoding involved, although some is necessary. Most of the problems people have with Links v2.0 is template related because they are unclear of the relationship between site_html_templates.pl and the template files themselves. Most of those problems are easily solved however.

If, as you say, you are starting a new Links project, then I encourage you to try it with Links v2.0. I think you will be pleasantly surprised!
Quote Reply
Re: Any advise welcome - PLEASE HELP !!!! In reply to
Bobsie,

I have listened and I have decided this weekend to try and get my head around installing Links 2.0.

The only requirements I really need at this time is new fields, and only having to add the details in one file sounds much better.

I will be in touch no doubt with a couple of ideas that I have thought of.

Martin