gnucash-htdocs beta: Multiple changes pushed

Frank H.Ellenberger fell at code.gnucash.org
Wed Oct 21 21:08:41 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash-htdocs/commit/5e6c9e3c (commit)
	 via  https://github.com/Gnucash/gnucash-htdocs/commit/e861bc23 (commit)
	from  https://github.com/Gnucash/gnucash-htdocs/commit/c940ae24 (commit)



commit 5e6c9e3ce509cbfe911b25b8fdcbef8328b3f65c
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Thu Oct 22 03:07:28 2020 +0200

    Use UTF-8 also in atom.php

diff --git a/atom.php b/atom.php
index 8583d39..d5c5f63 100644
--- a/atom.php
+++ b/atom.php
@@ -1,7 +1,7 @@
 <?php
   // TODO:
   // - reasonable permalinks
-  // - I18N, charset?
+  // - I18N?
 
   $top_dir = ".";
   require_once $top_dir.'/externals/global_params.php';
@@ -11,7 +11,7 @@
   {
     $contentType = $_GET["content-type"];
   }
-  $charset = "iso-8859-1";
+  $charset = "utf-8";
   header("Content-Type: $contentType; charset=$charset");
 
   $entry_count = 10;

commit e861bc23cba599a612ded543af2ae5fb2110c9c1
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Thu Oct 22 02:15:31 2020 +0200

    Use DEFAULT_URL

diff --git a/atom.php b/atom.php
index 7be3af2..8583d39 100644
--- a/atom.php
+++ b/atom.php
@@ -1,8 +1,11 @@
 <?php
   // TODO:
   // - reasonable permalinks
-  $top_dir = ".";
+  // - I18N, charset?
 
+  $top_dir = ".";
+  require_once $top_dir.'/externals/global_params.php';
+  
   $contentType = "application/atom+xml";
   if (isset($_GET["content-type"]))
   {
@@ -35,12 +38,12 @@
 
 <feed xmlns="http://www.w3.org/2005/Atom">
   <title>GnuCash News</title>
-  <subtitle>GnuCash is personal and small-business financial-accounting software, freely licensed under the GNU GPL and available for GNU/Linux, BSD, Solaris, Mac OS X and Microsoft Windows.</subtitle>
+  <subtitle><?=strip_tags($default_description)?></subtitle>
   <generator>GnuCash htdocs/master/atom.php 1.0 <gnucash-devel at gnucash.org></generator>
-  <logo>https://www.gnucash.org/images/icons/gnc-icon.png</logo>
-  <link rel="alternate" href="https://www.gnucash.org/" />
-  <link rel="self" href="https://www.gnucash.org/atom.php" />
-  <id>https://www.gnucash.org/</id>
+  <logo><?=\DEFAULT_URL?>images/icons/gnc-icon.png</logo>
+  <link rel="alternate" href="<?=\DEFAULT_URL?>" />
+  <link rel="self" href="<?=\DEFAULT_URL?>atom.php" />
+  <id><?=\DEFAULT_URL?></id>
   <?php
   $news_items = get_news($newsdir, $newsdir);
   $news_items = array_slice($news_items, 0, $entry_count);
@@ -60,7 +63,7 @@
   <entry>
     <id>urn:x-gnucash:news:<?= urlencode($key) ?></id>
     <title><?= $title ?></title>
-    <link rel="alternate" href="https://www.gnucash.org/news.phtml#n-<?=generate_anchor($key);?>" />
+    <link rel="alternate" href="<?=\DEFAULT_URL?>news.phtml#n-<?=generate_anchor($key);?>" />
     <author>
       <name>GnuCash Developers</name>
       <email>gnucash-devel at gnucash.org</email>
diff --git a/externals/global_params.php b/externals/global_params.php
index 861f2ed..1a9a187 100644
--- a/externals/global_params.php
+++ b/externals/global_params.php
@@ -1,4 +1,5 @@
 <?php
+  require_once 'lang.php';
      // This section defines the most recent version numbers for all platforms.
      // Each platform can define its own latest version or follow the default.
      // Both a latest stable version and a latest unstable version are defined.
@@ -72,12 +73,13 @@
      $latest_unstable_mac_intel="Gnucash Intel ".$latest_unstable_mac_intel.".dmg";
      $latest_unstable_source="gnucash-".$latest_unstable.".tar.bz2";
 
+     // The URLs, we use:
+     define("DEFAULT_URL", "https://www.gnucash.org/"); // The main webserver
      $URL_FLATHUB="https://flathub.org/apps/details/org.gnucash.GnuCash";
      $URL_FLATPAK="https://flatpak.org/";
      $URL_WIKI="https://wiki.gnucash.org/wiki/";
 
      // some defaults for metatags in case the page does not set them
-     $default_url= "https://www.gnucash.org/";
-     $default_title= T_ ( "Free Accounting Software" );
+     $default_title= T_("Free Accounting Software");
      $default_description= T_("<span class=\"gnucash\">GnuCash</span> is personal and small-business financial-accounting software, freely licensed under the <a href=\"https://www.gnu.org/\">GNU</a> GPL and available for GNU/Linux, BSD, Solaris, Mac OS X and Microsoft Windows.");
      ?>
diff --git a/externals/header.phtml b/externals/header.phtml
index 81f6624..41ce4d5 100644
--- a/externals/header.phtml
+++ b/externals/header.phtml
@@ -59,8 +59,8 @@
     ?>
     <meta property="og:title" content="<?=$full_title?>"/>
     <meta property="og:type" content="website"/>
-    <meta property="og:url" content="<?=$default_url.$page?>"/>
-    <meta property="og:image" content="<?=$default_url."externals/logo_w120.png"?>"/>
+    <meta property="og:url" content="<?=\DEFAULT_URL.$page?>"/>
+    <meta property="og:image" content="<?=\DEFAULT_URL."externals/logo_w120.png"?>"/>
     <meta property="og:site_name" content="GnuCash"/>
     <meta property="og:description" content="<?=strip_tags($description)?>"/>
 <?php // end of Open Graph properties ?>
@@ -154,7 +154,7 @@
       </span> <!-- language -->
       <span id="location">  <?php /* The mirrors currently not exist
          <?= _("Continent"); ?>:
-         (<a class="nav" href="https://www.gnucash.org/">US</a>)
+         (<a class="nav" href="<?=\DEFAULT_URL?>">US</a>)
          (<a class="nav" href="http://www.at.gnucash.org/">EU</a>) 
          (<a class="nav" href="http://www.au.gnucash.org/">AU</a>)  */ ?>
       </span> <!-- Continent -->
diff --git a/viewdoc.phtml b/viewdoc.phtml
index 5522bdf..e184b8b 100644
--- a/viewdoc.phtml
+++ b/viewdoc.phtml
@@ -13,7 +13,7 @@ include("externals/header.phtml");
 include("externals/menu.phtml");
 
 # Some base parameters used later on
-$basepath       = "https://www.gnucash.org/docs";
+$basepath       = \DEFAULT_URL."docs";
 $helpdoc        = "gnucash-help/help.html";
 $tcdoc          = "gnucash-guide/index.html";
 $current_stable = $major_stable;



Summary of changes:
 atom.php                    | 19 +++++++++++--------
 externals/global_params.php |  6 ++++--
 externals/header.phtml      |  6 +++---
 viewdoc.phtml               |  2 +-
 4 files changed, 19 insertions(+), 14 deletions(-)



More information about the gnucash-changes mailing list