diff --git a/plugins/staticpages/functions.inc b/plugins/staticpages/functions.inc index 9b7f78571..246084e0e 100755 --- a/plugins/staticpages/functions.inc +++ b/plugins/staticpages/functions.inc @@ -648,11 +648,39 @@ function SP_displayPage($page, $A, $comment_order = 'ASC', $comment_mode = 'nest function SP_printPage($page, $A) { global $_CONF, $_TABLES, $LANG01, $LANG_STATIC, $LANG_DIRECTION, - $_IMAGE_TYPE; + $_IMAGE_TYPE, $_SCRIPTS; $print = COM_newTemplate(CTL_plugin_templatePath('staticpages')); $print->set_file(array('print' => 'printable.thtml')); $print->set_var('site_slogan', $_CONF['site_slogan']); + + + // Add Cookie Consent ( https://cookieconsent.osano.com ) + if (isset($_CONF['cookie_consent']) && $_CONF['cookie_consent']) { + $_SCRIPTS->setCssFile( + 'cookiconsent', 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css', + true, array(), 100 + ); + $_SCRIPTS->setJavaScriptFile( + 'cookie_consent', 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js', + false, 100, false, + array('data-cfasync' => 'false') + ); + + if (isset($_CONF['cookie_consent_theme_customization']) && $_CONF['cookie_consent_theme_customization']) { + // Theme should have already set customizations in functions.php + + } else { + $_SCRIPTS->setJavaScriptFile( + 'cookie_consent_config', '/javascript/cookie_consent.js', + true, 110 + ); + } + } + + $print->set_var('plg_headercode', $_SCRIPTS->getHeader()); + + $print->set_var('plg_footercode', $_SCRIPTS->getFooter()); $print->set_var('direction', $LANG_DIRECTION); COM_setLangIdAndAttribute($print); @@ -669,6 +697,7 @@ function SP_printPage($page, $A) . '/staticpages/index.php?page=' . $page); $print->set_var('sp_url', $sp_url); $print->set_var('sp_title', stripslashes($A['sp_title'])); + $print->set_var('sp_inblock', $A['sp_inblock']); $print->set_var('sp_content', $A['sp_content']); $author_name = COM_getDisplayName($A['owner_id']); diff --git a/plugins/staticpages/templates/default/printable.thtml b/plugins/staticpages/templates/default/printable.thtml index 4c7178cb4..7ba95c3a1 100644 --- a/plugins/staticpages/templates/default/printable.thtml +++ b/plugins/staticpages/templates/default/printable.thtml @@ -5,6 +5,7 @@ + {plg_headercode} @@ -13,7 +14,9 @@ {# begin {templatelocation} #} + {!if sp_inblock}

{sp_title}

+ {!endif} {sp_content} @@ -25,6 +28,7 @@
{site_name}
{sp_url}
+ {plg_footercode} {# end {templatelocation} #} diff --git a/plugins/staticpages/templates/denim/printable.thtml b/plugins/staticpages/templates/denim/printable.thtml index 6457987a4..506a4c64f 100644 --- a/plugins/staticpages/templates/denim/printable.thtml +++ b/plugins/staticpages/templates/denim/printable.thtml @@ -5,6 +5,7 @@ + {plg_headercode} @@ -14,10 +15,12 @@ {# begin {templatelocation} #}
+ {!if sp_inblock} - + {!endif} +
{sp_content}
@@ -30,6 +33,7 @@

{page_title}
{sp_url}

+ {plg_footercode} {# end {templatelocation} #} diff --git a/plugins/staticpages/templates/denim_three/printable.thtml b/plugins/staticpages/templates/denim_three/printable.thtml index 6457987a4..d22418234 100644 --- a/plugins/staticpages/templates/denim_three/printable.thtml +++ b/plugins/staticpages/templates/denim_three/printable.thtml @@ -5,6 +5,7 @@ + {plg_headercode} @@ -14,9 +15,11 @@ {# begin {templatelocation} #}
+ {!if sp_inblock} + {!endif}
{sp_content} @@ -30,6 +33,7 @@

{page_title}
{sp_url}

+ {plg_footercode} {# end {templatelocation} #} diff --git a/public_html/article.php b/public_html/article.php index f09e594d3..07c770919 100644 --- a/public_html/article.php +++ b/public_html/article.php @@ -193,10 +193,36 @@ function extractExternalLinks($text) { $_SCRIPTS->setCssFile('print', '/' . $path, true, array('media' => 'print')); } } - - // Override style for tags + + // Override style for tags $_SCRIPTS->setCSS('a { color: blue !important; text-decoration: underline !important; }'); + + // Add Cookie Consent ( https://cookieconsent.osano.com ) + if (isset($_CONF['cookie_consent']) && $_CONF['cookie_consent']) { + $_SCRIPTS->setCssFile( + 'cookiconsent', 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css', + true, array(), 100 + ); + $_SCRIPTS->setJavaScriptFile( + 'cookie_consent', 'https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js', + false, 100, false, + array('data-cfasync' => 'false') + ); + + if (isset($_CONF['cookie_consent_theme_customization']) && $_CONF['cookie_consent_theme_customization']) { + // Theme should have already set customizations in functions.php + + } else { + $_SCRIPTS->setJavaScriptFile( + 'cookie_consent_config', '/javascript/cookie_consent.js', + true, 110 + ); + } + } + $articleTemplate->set_var('plg_headercode', $_SCRIPTS->getHeader()); + + $articleTemplate->set_var('plg_footercode', $_SCRIPTS->getFooter()); $page_title = $article->DisplayElements('page_title'); if (empty($page_title)) { diff --git a/public_html/docs/history b/public_html/docs/history index 9ab77476d..bf189d68f 100644 --- a/public_html/docs/history +++ b/public_html/docs/history @@ -21,6 +21,7 @@ For more in-depth explanation of the issues below see: https://github.com/Geeklo - [Bug] [#1046] Fixed Users can only be set to certain statuses by Admins [Tom] - [Bug] [#1047] Fixed Admin login form for those who try to access the Geeklog Admin area. Regular Logged in Users get just a message now instead of showing a login form [Tom] - [Bug] [#1048] Fixed related Articles are Missing From the Article Page [Tom] +- [Bug] [#1049] Fixed Print Pages for Articles and Staticpages javascript crashing issue [Tom] The following items are all current Geeklog API, functions, and/or global variables that are planned to be either required or depreciated by a current Geeklog version. Plugin and Theme developers please take note of these changes in case they affect you. diff --git a/public_html/docs/japanese/history.html b/public_html/docs/japanese/history.html index a251aaf4e..3278ee22a 100644 --- a/public_html/docs/japanese/history.html +++ b/public_html/docs/japanese/history.html @@ -47,6 +47,7 @@

March ? 2020 (2.2.1sr1)

  • [Bug] [#1046] Fixed Users can only be set to certain statuses by Admins [Tom]
  • [Bug] [#1047] Fixed Admin login form for those who try to access the Geeklog Admin area. Regular Logged in Users get just a message now instead of showing a login form [Tom]
  • [Bug] [#1048] Fixed related Articles are Missing From the Article Page [Tom]
  • +
  • [Bug] [#1049] Fixed Print Pages for Articles and Staticpages javascript crashing issue [Tom]
  • The following items are all current Geeklog API, functions, and/or global variables that are planned to be either required or depreciated by a current Geeklog version. Plugin and Theme developers please take note of these changes in case they affect you.
    diff --git a/public_html/layout/denim/article/printable.thtml b/public_html/layout/denim/article/printable.thtml index 5361b249c..210dfd1e7 100644 --- a/public_html/layout/denim/article/printable.thtml +++ b/public_html/layout/denim/article/printable.thtml @@ -17,21 +17,22 @@

    {story_title}

    {lang_contributedby} {story_author} {story_date}

    - +
    {story_text_no_br}
    - +

    {comments_with_count}

    - + - + - -{# end {templatelocation} #} + {plg_footercode} + +{# end {templatelocation} #} diff --git a/public_html/layout/denim_three/article/printable.thtml b/public_html/layout/denim_three/article/printable.thtml index 5361b249c..30ae23bd4 100644 --- a/public_html/layout/denim_three/article/printable.thtml +++ b/public_html/layout/denim_three/article/printable.thtml @@ -17,21 +17,22 @@

    {story_title}

    {lang_contributedby} {story_author} {story_date}

    - +
    {story_text_no_br}
    - +

    {comments_with_count}

    - + - + + {plg_footercode} -{# end {templatelocation} #} +{# end {templatelocation} #} diff --git a/public_html/layout/modern_curve/article/printable.thtml b/public_html/layout/modern_curve/article/printable.thtml index ee9f7f6ae..ae201cfa8 100644 --- a/public_html/layout/modern_curve/article/printable.thtml +++ b/public_html/layout/modern_curve/article/printable.thtml @@ -31,6 +31,8 @@ {external_links} + {plg_footercode} + {# end {templatelocation} #}