Opencaching.de

Opencaching International => HOWTO questions => Thema gestartet von: harrieklomp am 17. April 2011, 14:31:08

Titel: "how to" make new attributes
Beitrag von: harrieklomp am 17. April 2011, 14:31:08
We from the Dutch node like to add some more attributes on the site like "paddo" (roadsigns for bikes in a shape of a mushroom), bike and some other attributes.
It would be great to get a "how to" make this on our own.

We have found some one who is very artistic with graphics and he has no problems that other nodes will use the attributes icons, look for a sample at http://www.opencaching.nl/articles.php?page=cacheinfo#attributes .

Greetings
Titel: Re: "how to" make new attributes
Beitrag von: oliver am 17. April 2011, 20:59:45
1. database changes:

add to table cache_attrib
(category and group refers to table attribute_categories and attribute_groups)
(keep trans_id empty)

2. additional files:

place them in resource2\ocstyle\images\attributes

3. translation:

call translate.php and translate the cache type name
(you need to execute "Scan source codes" first)
Titel: Re: "how to" make new attributes
Beitrag von: OlofL am 17. April 2011, 22:53:30
... and start with ID number 61 and allocate the number by posting the attribute name and number in this thread.
Titel: Re: "how to" make new attributes
Beitrag von: zaanhoeve am 24. April 2011, 14:03:04
added:
   Edit    Delete    60    Stealth    stealth    1746    5    1    0    0    0    resource2/ocstyle/images/attributes/stealth.png    resource2/ocstyle/images/attributes/stealth-no.png    resource2/ocstyle/images/attributes/stealth-disabl...    The cache is in an urban environment and will requ...    1747
   Edit    Delete    61    Benchmark    meetspijker    1744    4    1    0    0    0    resource2/ocstyle/images/attributes/meetspijker.pn...    resource2/ocstyle/images/attributes/meetspijker-no...    resource2/ocstyle/images/attributes/meetspijker-di...    Dit attribuut is voor de meetspijkers van het Kada...    1748
   Edit    Delete    62    Mushroom    paddo    0    4    1    0    0    0    resource2/ocstyle/images/attributes/paddo.png    resource2/ocstyle/images/attributes/paddo-no.png    resource2/ocstyle/images/attributes/paddo-disabled...    Dit is een attribuut voor de ANWB " paddenstoelen"...    

tnx for the help
Titel: Re: "how to" make new attributes
Beitrag von: OlofL am 25. April 2011, 08:48:37
63:

6x    Wheelchair accessible    wheelchair    1802    2    1    0    1    0    resource2/ocstyle/images/attributes/wheelchair.png    resource2/ocstyle/images/attributes/wheelchair-no....    resource2/ocstyle/images/attributes/wheelchair-dis...    This geocache is accessible from wheelchair.    1803    NULL

(I will change this to use 63 right away avoid future confusion, it is using one of the already allocated numbers above)
Titel: Re: "how to" make new attributes
Beitrag von: OlofL am 25. April 2011, 09:10:09
An important feature added in the upcoming release is a possibility to hide attribute types.

With the attribute hidden, the user cannot select it when modifying his/her caches, the user cannot search for it etc, but the attribute is still there. The reason for this is to make site integration easier and at the same time allow the freedom of node-operators to choose which attributes are interesting for each node.
Titel: Re: "how to" make new attributes
Beitrag von: harrieklomp am 25. April 2011, 09:32:08
For a non programmer like me :-[ it would be nice to run a small program where we can select or deselect  all available attributes.
Titel: Re: "how to" make new attributes
Beitrag von: OlofL am 25. April 2011, 11:46:00
Yes, maybe that should go somewhere on the admin-screen, but it is not complicated to do without it: Locate the table cache_attrib. It has a new column "hidden". Set the value to 1 for attributes that should hidden or 0 or null for attributes that should not be hidden.

But the hidden attribute is not in your code yet, only in mine, be patient.
Titel: Re: "how to" make new attributes
Beitrag von: oliver am 25. April 2011, 14:21:54
In the past we had an attribute "Hyperlink to another caching portal only".

We have disabled it, but it is still there. For old caches that have this attribute assigned, you can see it, you can search for it and the owner can remove it. But for new caches, it cannot be assigned. Thats the use of column "selectable". I think that fits our requirement that some node maintainers wants to hide some attributes.

In my opinion, an attribute should always be shown when the owner of the caches has assigned it. Think of the atttribute "dangers". If you hide it, that could be bad for the finder. Regardless of the node the user is actually using ... the attribute must be shown.