Autor Thema: "How to" make new cache type  (Gelesen 276 mal)

Offline harrieklomp

  • Team Opencaching Deutschland
  • Micro
  • *
  • Beiträge: 119
  • oc.nl team
"How to" make new cache type
« am: 17. April 2011, 12:34:24 »
The Dutch node would like to make a view cache types, like "Guestbook" and "Deaddrop (usb)"

It should be a good idea to make a kind of menu for the Admins to choose from what kind of caches there are available in a node.

Thanks and greetz,
« Letzte Änderung: 17. April 2011, 12:43:25 von harrieklomp »
Owner and allround admin of the Dutch OC node.

Harrie Klomp


oliver

  • Gast
Re: "How to" make new cache type
« Antwort #1 am: 17. April 2011, 20:51:33 »
1. Modification in database:

add to table cache_type (keep trans_id empty)
add to table cache_logtype (entries with log_type_id 1,2,3 is for Found, Not found, Note)

Note: cache_type.id needs to be continuous - don't leave out an id. At least map2.php requires that.


2. Additional files:

add icons to
resource2\ocstyle\images\cacheicon
resource2\ocstyle\images\cacheicon\cache
resource2\ocstyle\images\map
lang\de\ocstyle\images\cache (must be .gif)

To have it working in all situations, you have to add all combinations with -a, -n, -s in the filename.

same icons to lang\de\ocstyle\images\cache (for search.php)

3. Modifications in template files:

lang\de\ocstyle\search.tpl.php
templates2\ocstyle\res_cacheicon.tpl
templates2\ocstyle\res_cacheicon_15.tpl
templates2\ocstyle\res_cacheicon_22.tpl

4. translation

call translate.php and translate the cache type name
(you need to execute "Scan source codes" first)

---
Point 3 could probably be reduced to one res-tpl-file in future.

The concept is to have a few basic cache types like "traditional, multi, event" and do all other things with attributes. The cache types "math/physics" and such specific ones come from the beginning, where we did not have any attributes.
« Letzte Änderung: 29. April 2011, 20:06:23 von oliver »