PDA

View Full Version : I don’t need URL field


vuarnet
05-23-2006, 09:32 PM
Hi

Hello I need to make a directory of places where to eat, which not always have URL. It is possible that field URL is not indispensable to fill?

Since the places that do not have website, cannot be added.

I want to make a directory of restaurants although they do not have URL.

It is possible?

Thanks a lot...

:sos:

Loren
05-23-2006, 11:07 PM
I believe you could remove that column from your MySQL database, what the ramifications are i wouldn't know, so it would be best to get clarifications from Nick or Simon, but like you i didn't want to have a url that was compulsory to fill in. If you notice if you don't fill in an url it wont let you add link. In my case the clients may not have a website, so i am stuck if any of my visitors doesn't have a web. Plus i have asked many times for this to be answered, and i have had no reply :(

Hope you have better luck :good:

WTM
05-23-2006, 11:34 PM
There is validation script somewhere which is checking for required fields to be filled in. If you can find and remove it - you don't have to bother with database.

vuarnet
05-24-2006, 12:44 AM
There is validation script somewhere which is checking for required fields to be filled in. If you can find and remove it - you don't have to bother with database.

Well...
To the aim I obtained it, but green link description appears very ugly

http://

http://chilangabanda.com/guia/el-d-f-por-zonas/centro-hist-rico/

Thanks anyway

WTM
05-24-2006, 01:04 AM
...To the aim I obtained it, but green link description appears very ugly...

Now you can just remove "url" field from link-display.tpl and view-link.tpl if you don't need it

WTM
05-24-2006, 01:09 AM
http://chilangabanda.com/guia/el-d-f-por-zonas/centro-hist-rico/


Also I would suggest to remove borders around your search box in the header and reduce font-size for breadcrumb.

Just my opinion...

vuarnet
05-24-2006, 01:18 AM
http://chilangabanda.com/guia/el-d-f-por-zonas/centro-hist-rico/


Also I would suggest to remove borders around your search box in the header and reduce font-size for breadcrumb.

Just my opinion...


:D

Right now I am working in adapting layout, thanks...

In the end those edges are not going to appear...;)

:good:

Greg
05-24-2006, 01:32 AM
There is validation script somewhere which is checking for required fields to be filled in. If you can find and remove it - you don't have to bother with database.

Well...
To the aim I obtained it



vuarnet
Why don't you post your solution. I'm sure Loren would appreciate it. :)

WTM
05-24-2006, 04:14 AM
I believe this section of the code in the suggest-link.php file should be removed to avoid url validation: /** check URL **/
if (!$link['url'])
{
$error = true;
$msg .= " {$gDirLang['error_url']}";
}
else
{
$link['domain'] = get_domain($_POST['url']);

/** check if link already exists **/
if ($gDirConfig['duplicate_checking'])
{
$check = ($gDirConfig['duplicate_type'] == 'domain') ? $link['domain'] : $link['url'];
$status = $gDirDb->checkDuplicateLinks($check, $gDirConfig['duplicate_type']);
if ('banned' == $status)
{
$error = true;
$msg .= " {$gDirLang['error_banned']}";
}
elseif ($status)
{
$error = true;
$msg .= " {$gDirLang['error_link_present']}";
}
}

/** checking for correct url **/
$link['link_header'] = 200;
if ($gDirConfig['link_check'])
{
$link['link_header'] = get_link_header($_POST['url']);

$correct_headers = explode(',', $gDirConfig['http_headers']);
if (!in_array($link['link_header'], $correct_headers))
{
$error = true;
$msg .= " {$gDirLang['error_broken_link']}";
}
}
}

WARNING!

Make sure to make a copy of the file before altering the code!

Loren
05-24-2006, 06:32 AM
:yahoo: Thank You for the info on removing url. That is just what i needed!

As for ugly http:// I don't mind it being there. As long as information can be submitted.

I thought you might be able not to display it, by clicking off the buttons in manage link fields "url"... But alas, another thing that doesn't work. The defaults are still unchangeable even though they appear to be now changeable. :(

When you go into the defaults they actually don't look available, sort of opaque coloured, but you can change the text, and click on the buttons not to display in the url field, but it gives you a bizarre error regarding field length :rolleyes: so nothing changes.

Nick what's happening with all these bugs? Are they likely to be fixed any day soon?

Loren
05-24-2006, 06:38 AM
Actually just going back over code which i removed, i can see there maybe problems with removing this for the urls that are put in, and the other functions associated with bans, duplicate links etc, unfortunately you cant take just the url info out you have to take that whole section. Nick maybe you can advise how to change the first part to except urls but not compulsory for adding link.

Nick Collins
05-25-2006, 12:11 PM
Ok Loren! Here is detailed instruction how to get rid of external urls:

***open suggest-link.php***
***find and remove or comment the following code***
if (!$_POST['url'] || ($_POST['url'] == 'http://'))
{
$error = true;
$msg = 'Please input correct URL.';
}
***save***

***open link-display.tpl***
***find the following code***
<div class="title">ALL CONTENT OF THIS DIV<div>
***replace with***
<div class="title">{$link.title}</div>
***find and remove the following code***
<div class="url">div content</div>
***save***

***open view-link.tpl***
***find the following code***
{foreach from=$fields item=field}
{assign var="key" value=$field.name}
***after add, ***
{assign var="show" value='1'}
{if 'url' == $key && ('http://' == $link.$key || '' == $link.$key)}{assign var="show" value='0'}{/if}
{if '1' == $show}
***find***
{/foreach}
***before add, ***
{/if}
***save***

Notes:
Define div.title in style.css file. Switch off thumbnails and PR in admin panel. Now you can simply ignore “Link URL” field in admin panel (i.e. leave it blank)

Do not hesitate to ask me in case you have more questions.

tonino
12-20-2006, 10:21 AM
I did the above modifications to version 1.2 that I was using and it was working fine. Then I applied the patch 1.2.01 and now the "Link Field" is required again...:sorry:

I tried changing the files again, but the code looks different now in the above files and the MOD does not work.


Are there any instructions on how to do this with the patched version 1.2.0.1???

John Turner
12-20-2006, 10:56 AM
Hi tonino,

We offer to use V2.0.01 PRO.

tonino
12-20-2006, 11:40 AM
Hi tonino,

We offer to use V2.0.01 PRO.

I use 1.2 Pro, you mean that I should upgrade to V2.0.01 PRO? Is this functionality included in V2.0.01 PRO by default?

The problem is that I 've made several changes to the templates and some other files I do not have the time-resources to upgrade & re-apply all the modifications all over again.:sos:

As I see it now, I have 2 options:

1. Find a way to modify V1.2.0.1 in order to NOT require the link field and simply continue using it as it perfectly meets my requirements.

2. Upgrade to V2.0.01 PRO and re-apply all the modifications I 've made. But, like I said above, I cannot afford to do it now...


Please advise.

Michael Hill
12-21-2006, 06:11 AM
Hello, tonino!

We are strongly recommend to you make upgrate to 2.0 version. 1.2 version we will not develop in future. Some problems was solved in 2.0 version and different setting was added.

You can upgrade your script to 2.0 version, and then customise it with mods.

tonino
12-21-2006, 08:45 AM
Hello, tonino!

We are strongly recommend to you make upgrate to 2.0 version. 1.2 version we will not develop in future. Some problems was solved in 2.0 version and different setting was added.

You can upgrade your script to 2.0 version, and then customise it with mods.

Dear Michael,

I see your point, but you must take into account that it is not very comfortable to re-apply all mods and changes (which usually takes some days & many trial & error tests) whenever a new version is shipped.

John Turner
12-21-2006, 08:50 AM
Hi tonino,

Please submit a ticket in our ticket system.
I' ll try to help you.

tonino
12-21-2006, 09:04 AM
Hi tonino,

Please submit a ticket in our ticket system.
I' ll try to help you.

Hi John!

I think you solved it already some minutes ago..!!! Thank you very much. I would just like to ask you if you could document the changes that were made in order to 1st have them documented and 2nd help any others with the same issue.

Thanks a lot guys!

John Turner
12-22-2006, 08:27 AM
You are welcome tonino.
Always at your services.

I hacked code which checks url. That's all.