Skip to content
Permalink
Browse files

cleaner presentation of multidomain site; updates #816

  • Loading branch information...
following5 committed Sep 14, 2015
1 parent f995f49 commit 6fea17b12b5b7829c2097c049172c1f6f89c8d80
Showing with 358 additions and 263 deletions.
  1. +6 −0 bin/dbsv-update.php
  2. +5 −5 htdocs/config2/locale.inc.php
  3. +5 −4 htdocs/config2/settings-dev.inc.php
  4. +42 −15 htdocs/config2/settings-dist-common.inc.php
  5. +0 −1 htdocs/config2/settings-dist.inc.php
  6. +7 −3 htdocs/config2/settings-sample.inc.php
  7. +91 −105 htdocs/doc/sql/static-data/data.sql
  8. +1 −0 htdocs/doc/sql/tables/user.sql
  9. +1 −0 htdocs/editcache.php
  10. +1 −0 htdocs/lang/de/ocstyle/editcache.inc.php
  11. +1 −1 htdocs/lang/de/ocstyle/editcache.tpl.php
  12. +3 −3 htdocs/lang/de/ocstyle/email/de/notify_newcache.email
  13. +3 −3 htdocs/lang/de/ocstyle/email/de/notify_newoconly.email
  14. +3 −3 htdocs/lang/de/ocstyle/email/de/removed_log.email
  15. +2 −2 htdocs/lang/de/ocstyle/email/de/watchlist.email
  16. +3 −3 htdocs/lang/de/ocstyle/email/en/notify_newcache.email
  17. +3 −3 htdocs/lang/de/ocstyle/email/en/notify_newoconly.email
  18. +3 −3 htdocs/lang/de/ocstyle/email/en/removed_log.email
  19. +2 −2 htdocs/lang/de/ocstyle/email/en/watchlist.email
  20. +5 −5 htdocs/lang/de/ocstyle/email/fr/notify_newcache.email
  21. +5 −5 htdocs/lang/de/ocstyle/email/fr/notify_newoconly.email
  22. +4 −4 htdocs/lang/de/ocstyle/email/fr/removed_log.email
  23. +4 −4 htdocs/lang/de/ocstyle/email/fr/watchlist.email
  24. +4 −4 htdocs/lang/de/ocstyle/email/it/notify_newcache.email
  25. +5 −5 htdocs/lang/de/ocstyle/email/it/notify_newoconly.email
  26. +3 −3 htdocs/lang/de/ocstyle/email/it/removed_log.email
  27. +3 −3 htdocs/lang/de/ocstyle/email/it/watchlist.email
  28. +1 −1 htdocs/lang/de/ocstyle/main.tpl.php
  29. +2 −0 htdocs/lang/de/ocstyle/newcache.inc.php
  30. +1 −1 htdocs/lang/de/ocstyle/newcache.tpl.php
  31. +1 −1 htdocs/lang/de/ocstyle/varset.inc.php
  32. +41 −3 htdocs/lib/clicompatbase.inc.php
  33. +2 −2 htdocs/lib/login.class.php
  34. +5 −1 htdocs/lib/settings-dev.inc.php
  35. +8 −3 htdocs/lib/settings-dist.inc.php
  36. +2 −1 htdocs/lib2/OcSmarty.class.php
  37. +1 −6 htdocs/lib2/logic/data-license.inc.php
  38. +1 −1 htdocs/lib2/login.class.php
  39. +1 −0 htdocs/lib2/mail.class.php
  40. +7 −6 htdocs/lib2/search/search.gpx.inc.php
  41. +1 −0 htdocs/lib2/search/search.kml.inc.php
  42. +1 −1 htdocs/lib2/search/search.xml.inc.php
  43. +2 −0 htdocs/newcache.php
  44. +2 −1 htdocs/removelog.php
  45. +10 −10 htdocs/resource2/misc/google-earth/search.result.caches.kml.head.xml
  46. +1 −1 htdocs/templates2/mail/sys_main.tpl
  47. +4 −1 htdocs/templates2/ocstyle/articles/DE/dsb.tpl
  48. +1 −1 htdocs/templates2/ocstyle/articles/DE/team.tpl
  49. +1 −1 htdocs/templates2/ocstyle/articles/EN/cacheinfo.tpl
  50. +1 −1 htdocs/templates2/ocstyle/articles/EN/dsb.tpl
  51. +1 −1 htdocs/templates2/ocstyle/articles/EN/geocaching.tpl
  52. +1 −1 htdocs/templates2/ocstyle/articles/EN/team.tpl
  53. +1 −1 htdocs/templates2/ocstyle/articles/EN/verein.tpl
  54. +10 −10 htdocs/templates2/ocstyle/articles/ES/cacheinfo.tpl
  55. +2 −2 htdocs/templates2/ocstyle/error.tpl
  56. +3 −3 htdocs/templates2/ocstyle/myprofile.tpl
  57. +1 −1 htdocs/templates2/ocstyle/mystatpic.tpl
  58. +2 −2 htdocs/templates2/ocstyle/register.tpl
  59. +1 −1 htdocs/templates2/ocstyle/sys_main.tpl
  60. +3 −3 htdocs/templates2/ocstyle/sys_outofservice.tpl
  61. +3 −2 htdocs/util/notification/run_notify.php
  62. +18 −4 htdocs/util/watchlist/runwatch.php
@@ -619,6 +619,12 @@ function dbv_139()
sql("ALTER TABLE `user` ADD COLUMN `language_guessed` tinyint(1) NOT NULL default '0' AFTER `language`");
}
function dbv_140() // last-used user domain, for email contents
{
if (!sql_field_exists('user', 'domain'))
sql("ALTER TABLE `user` ADD COLUMN `domain` varchar(40) default NULL AFTER `language_guessed`");
}
// When adding new mutations, take care that they behave well if run multiple
// times. This improves robustness of database versioning.
@@ -117,7 +117,7 @@
$opt['locale']['EN']['page']['subtitle1'] = 'Geocaching with Opencaching';
$opt['locale']['EN']['page']['subtitle2'] = '';
$opt['locale']['EN']['page']['license_url'] = 'http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en';
$opt['locale']['EN']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">The Opencaching.de <a href="articles.php?page=impressum#datalicense">content</a> is licensed under Creative Commons <a rel="license" href="%1" target="_blank">BY-BC-ND 3.0 DE</a>.</div>';
$opt['locale']['EN']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">The {site} <a href="articles.php?page=impressum#datalicense">content</a> is licensed under Creative Commons <a rel="license" href="%1" target="_blank">BY-BC-ND 3.0 DE</a>.</div>';
$opt['locale']['EN']['helpwiki'] = "http://wiki.opencaching.de/index.php/";
$opt['locale']['EN']['mostly_translated'] = true;
$opt['locale']['EN']['what3words'] = true;
@@ -138,7 +138,7 @@
$opt['locale']['DE']['page']['subtitle1'] = 'Geocaching mit Opencaching';
$opt['locale']['DE']['page']['subtitle2'] = '';
$opt['locale']['DE']['page']['license_url'] = 'http://creativecommons.org/licenses/by-nc-nd/3.0/de/';
$opt['locale']['DE']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons Lizenzvertrag" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Die <a href="articles.php?page=impressum#datalicense">Inhalte</a> von Opencaching.de stehen unter der Creative-Commons-Lizenz <a rel="license" href="%1">BY-NC-ND 3.0 DE</a>.</div>';
$opt['locale']['DE']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons Lizenzvertrag" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Die <a href="articles.php?page=impressum#datalicense">Inhalte</a> von {site} stehen unter der Creative-Commons-Lizenz <a rel="license" href="%1">BY-NC-ND 3.0 DE</a>.</div>';
$opt['locale']['DE']['helpwiki'] = "http://wiki.opencaching.de/index.php/";
$opt['locale']['DE']['mostly_translated'] = true;
$opt['locale']['DE']['what3words'] = true; // "beta"
@@ -159,7 +159,7 @@
$opt['locale']['IT']['page']['subtitle1'] = 'Geocaching con Opencaching';
$opt['locale']['IT']['page']['subtitle2'] = '';
$opt['locale']['IT']['page']['license_url'] = 'http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.it';
$opt['locale']['IT']['page']['license'] = '<a rel="license" href="%1" target="_blank"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Il <a href="articles.php?page=impressum#datalicense">contenuto</a> di Opencaching.de è rilasciato sotto licenza Creative Commons <a rel="license" href="%1" target="_blank">BY-NC-ND 3.0 DE</a>.</div>';
$opt['locale']['IT']['page']['license'] = '<a rel="license" href="%1" target="_blank"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Il <a href="articles.php?page=impressum#datalicense">contenuto</a> di {site} è rilasciato sotto licenza Creative Commons <a rel="license" href="%1" target="_blank">BY-NC-ND 3.0 DE</a>.</div>';
$opt['locale']['IT']['mostly_translated'] = true;
$opt['locale']['IT']['what3words'] = false;
@@ -179,7 +179,7 @@
$opt['locale']['ES']['page']['subtitle1'] = 'Geocaching con Opencaching';
$opt['locale']['ES']['page']['subtitle2'] = '';
$opt['locale']['ES']['page']['license_url'] = 'http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.es_ES';
$opt['locale']['ES']['page']['license'] = '<a rel="license" href="%1" target="_blank"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">El <a href="articles.php?page=impressum#datalicense">contenido</a> está disponible bajo Creative Commons <a rel="license" href="%1" target="_blank">BY-NC-ND 3.0 DE</a> licencia.</div>';
$opt['locale']['ES']['page']['license'] = '<a rel="license" href="%1" target="_blank"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">El <a href="articles.php?page=impressum#datalicense">contenido</a> de {site} está disponible bajo Creative Commons <a rel="license" href="%1" target="_blank">BY-NC-ND 3.0 DE</a> licencia.</div>';
$opt['locale']['ES']['mostly_translated'] = true;
$opt['locale']['ES']['what3words'] = true;
@@ -199,7 +199,7 @@
$opt['locale']['FR']['page']['subtitle1'] = 'Geocaching avec Opencaching';
$opt['locale']['FR']['page']['subtitle2'] = '';
$opt['locale']['FR']['page']['license_url'] = 'http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.fr';
$opt['locale']['FR']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Le<a href="articles.php?page=impressum#datalicense">contenu</a> de Opencaching.de sont sous licence Creative Commons <a rel="license" href="%1" target="_blank">BY-BC-ND 3.0 DE</a>.</div>';
$opt['locale']['FR']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons License Terms" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Le<a href="articles.php?page=impressum#datalicense">contenu</a> de {site} sont sous licence Creative Commons <a rel="license" href="%1" target="_blank">BY-BC-ND 3.0 DE</a>.</div>';
$opt['locale']['FR']['helpwiki'] = "http://wiki.opencaching.de/index.php/";
$opt['locale']['FR']['mostly_translated'] = true;
$opt['locale']['FR']['what3words'] = true;
@@ -67,13 +67,14 @@
$opt['logic']['node']['id'] = 4;
$opt['logic']['waypoint_pool']['prefix'] = 'OC';
if (!$opt['page']['shortlink_domain'])
$opt['page']['shortlink_domain'] = 'opencaching.de';
/* server options
*
*/
set_absolute_urls($opt, $dev_baseurl, 2);
set_absolute_urls(
$opt,
$dev_baseurl,
isset($dev_shortlink_domain) ? $dev_shortlink_domain : 'opencaching.de',
2);
$opt['page']['develsystem'] = true;
$opt['page']['max_logins_per_hour'] = 1000; // for development ...
@@ -12,6 +12,8 @@
$opt['page']['title'] = 'OPENCACHING';
$opt['page']['subtitle1'] = 'Geocaching with Opencaching';
$opt['page']['subtitle2'] = '';
$opt['page']['sitename'] = 'Opencaching.de';
$opt['page']['slogan'] = 'Opencaching.de - Geocaching in Deutschland, Oesterreich und der Schweiz';
// directory of rotator pictures and script, relative to head images dir
$opt['page']['headimagepath'] = '';
@@ -94,7 +96,7 @@
$opt['cms']['login'] = 'http://wiki.opencaching.de/index.php/Login_auf_Opencaching.de';
// explanation of nature protection areas
$opt['cms']['npa'] = 'http://wiki.opencaching.de/index.php/Schutzgebiete';
$opt['cms']['npa'] = 'articles.php?page=npa&wiki';
/* HTTPS settings
*
@@ -123,14 +125,15 @@
* $opt['page']['default_primary_url'] the default-protocol base URL of the primary domain of this site
* $opt['page']['shortlink_url'] shortlink URL of the current protocol or false
* $opt['page']['default_shortlink_url'] default-protocol shortlink URL or false
* $opt['page']['default_primary_shortlink_url'] default-protocol shortlink URL of primary domain of this site, or false
* $opt['page']['https']['active'] true if the current request is https, else false
* $opt['page']['protocol'] the protocol of the current request, 'http' or 'https'
*
* These settings allow to run a consistently multi-protocol and multi-domain OC site.
* All generated URls end on '/'.
*/
function set_absolute_urls(&$opt, $primary_site_url, $lib)
function set_absolute_urls(&$opt, $primary_site_url, $primary_shortlink_domain, $lib)
{
// $opt is passed as parameter because it is *local* in okapi_settings.php.
@@ -145,10 +148,10 @@ function set_absolute_urls(&$opt, $primary_site_url, $lib)
$primary_site_url .= '/';
if (isset($opt['domain'][$primary_domain]['https']['is_default']))
$httpsdefault = $opt['domain'][$primary_domain]['https']['is_default'];
$primary_httpsdefault = $opt['domain'][$primary_domain]['https']['is_default'];
else
$httpsdefault = $opt['page']['https']['is_default'];
if ($httpsdefault)
$primary_httpsdefault = $opt['page']['https']['is_default'];
if ($primary_httpsdefault)
$opt['page']['default_primary_url'] = 'https' . strstr($primary_site_url, '://');
else
$opt['page']['default_primary_url'] = 'http' . strstr($primary_site_url, '://');
@@ -191,29 +194,49 @@ function set_absolute_urls(&$opt, $primary_site_url, $lib)
$absolute_server_URI = $opt['page']['absolute_url'];
if ($opt['page']['https']['is_default'])
{
$opt['page']['default_absolute_url'] = $opt['page']['absolute_https_url'];
$opt['page']['default_protocol'] = 'https';
}
else
{
$opt['page']['default_absolute_url'] = $opt['page']['absolute_http_url'];
$opt['page']['default_protocol'] = 'http';
}
// 3. create shortlink URLs
if (isset($opt['domain'][$current_domain]['shortlink_domain']))
$opt['page']['shortlink_domain'] = $opt['domain'][$current_domain]['shortlink_domain'];
if (!isset($opt['page']['shortlink_domain']) || !$opt['page']['shortlink_domain'])
if (!$primary_shortlink_domain)
{
$opt['page']['shortlink_url'] = false;
$opt['page']['default_shortlink_url'] = false;
$opt['page']['default_primary_shortlink_url'] = false;
}
else
{
if (strpos($opt['page']['shortlink_domain'], '://') !== false)
$opt['page']['shortlink_domain'] = parse_url($opt['page']['shortlink_domain'], PHP_URL_HOST);
$opt['page']['shortlink_url'] = $opt['page']['protocol'] . '://' . $opt['page']['shortlink_domain'] . '/';
if ($opt['page']['https']['is_default'])
$opt['page']['default_shortlink_url'] = 'https://' . $opt['page']['shortlink_domain'] . '/';
if ($primary_httpsdefault)
$opt['page']['default_primary_shortlink_url'] = 'https://' . $primary_shortlink_domain . '/';
else
$opt['page']['default_primary_shortlink_url'] = 'http://' . $primary_shortlink_domain . '/';
if (isset($opt['domain'][$current_domain]['shortlink_domain']) && $opt['domain'][$current_domain]['shortlink_domain'])
{
$opt['page']['shortlink_url'] = $opt['page']['protocol'] . '://' . $opt['domain'][$current_domain]['shortlink_domain'] . '/';
$opt['page']['default_shortlink_url'] = $opt['page']['default_protocol'] . '://' . $opt['domain'][$current_domain]['shortlink_domain'] . '/';
}
else
$opt['page']['default_shortlink_url'] = 'http://' . $opt['page']['shortlink_domain'] . '/';
{
if ($current_domain == $primary_domain)
{
$opt['page']['default_shortlink_url'] = $opt['page']['default_primary_shortlink_url'];
$opt['page']['shortlink_url'] = $opt['page']['protocol'] . strstr($opt['page']['default_shortlink_url'], '://');
}
else
{
$opt['page']['shortlink_url'] = false;
$opt['page']['default_shortlink_url'] = false;
}
}
}
// 4. set location of uploaded images
@@ -242,13 +265,17 @@ function set_common_domain_config(&$opt)
if (isset($opt['domain'][$domain]['country']))
$opt['template']['default']['country'] = $opt['domain'][$domain]['country'];
if (isset($opt['domain'][$domain]['sitename']))
$opt['page']['sitename'] = $opt['domain'][$domain]['sitename'];
if (isset($opt['domain'][$domain]['keywords']))
$opt['page']['meta']['keywords'] = $opt['domain'][$domain]['keywords'];
if (isset($opt['domain'][$domain]['description']))
$opt['page']['meta']['description'] = $opt['domain'][$domain]['description'];
if (isset($opt['domain'][$domain]['headoverlay']))
$opt['page']['headoverlay'] = $opt['domain'][$domain]['headoverlay'];
if (isset($opt['domain'][$domain]['slogan']))
$opt['page']['slogan'] = $opt['domain'][$domain]['slogan'];
}
}
@@ -185,7 +185,6 @@
*/
$opt['page']['origin_url'] = 'http://www.opencaching.de/'; // production installation for this OC site
$opt['page']['develsystem'] = false;
$opt['page']['shortlink_domain'] = false;
/*
* configure infos on 404.php
@@ -112,6 +112,7 @@
*/
//$opt['domain']['www.opencaching.de']['url'] = 'http://www.opencaching.de/';
//$opt['domain']['www.opencaching.de']['shortlink_domain'] = 'opencaching.de';
//$opt['domain']['www.opencaching.de']['sitename'] = 'Opencaching.de';
//$opt['domain']['www.opencaching.de']['locale'] = 'DE';
//$opt['domain']['www.opencaching.de']['fallback_locale'] = 'EN';
//$opt['domain']['www.opencaching.de']['style'] = 'ocstyle';
@@ -127,17 +128,20 @@
//$opt['domain']['www.opencaching.de']['https']['force_login'] = true;
//$opt['domain']['www.opencaching.pl']['url'] = 'http://www.opencaching.pl/';
//$opt['domain']['www.opencaching.pl']['sitename'] = 'Opencaching.PL';
//$opt['domain']['www.opencaching.pl']['locale'] = 'PL';
//$opt['domain']['www.opencaching.de']['fallback_locale'] = 'EN';
//$opt['domain']['www.opencaching.pl']['fallback_locale'] = 'EN';
//$opt['domain']['www.opencaching.pl']['style'] = 'ocstyle';
//$opt['domain']['www.opencaching.pl']['cookiedomain'] = '.opencaching.pl';
//$opt['domain']['www.opencaching.pl']['country'] = 'PL';
//$opt['domain']['www.opencaching.pl']['keywords'] = 'geocaching, geocache, cache, poszukiwanie skarbów, GPS, wolne, GPX, koordynować, hobby, natura'; // 5-10 keywords are recommended
//$opt['domain']['www.opencaching.pl']['description'] = 'Opencaching.pl jest darmowy portal dla Geocaching, gry Treasure Hunt. Za pomocą współrzędnych GPS można znaleźć pojemniki lub obiektów.';
//$opt['domain']['www.opencaching.pl']['headoverlay'] = 'oc_head_alpha3_pl';
// Supply the site's primary URL here. Can be overriden by domain settings.
set_absolute_urls($opt, 'http://www.opencaching.de/', 2);
// Supply the site's primary URL and the shortlink domain here.
// Can be overriden by domain settings.
// Set shortlink domain to false if not available.
set_absolute_urls($opt, 'http://www.opencaching.de/', 'opencaching.de', 2);
/* The OC site's ID; see settings-dist.inc.php for known IDs.
*/
Oops, something went wrong.

0 comments on commit 6fea17b

Please sign in to comment.
You can’t perform that action at this time.