Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Jan 11, 2022
2 parents 4478112 + 1c464c8 commit 344b751
Show file tree
Hide file tree
Showing 25 changed files with 206 additions and 138 deletions.
114 changes: 47 additions & 67 deletions plugins/staticpages/services.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -940,73 +940,53 @@ function service_get_staticpages($args, &$output, &$svc_msg)
$output['sp_content'] = SP_render_content($output);
}
} else { // an error occurred (page not found, access denied, ...)
/**
* if the user has edit permissions and the page does not exist,
* send them to the editor so they can create it "wiki style"
*/
$create_page = false;
if (($mode !== 'autotag') && ($count == 0) &&
SEC_hasRights('staticpages.edit')
) {
// check again without permissions
if (DB_count($_TABLES['staticpage'], 'sp_id', $page) == 0) {
$url = $_CONF['site_admin_url']
. '/plugins/staticpages/index.php?mode=edit&sp_new_id='
. $page . '&msg=21';
$output = COM_refresh($url);
$create_page = true;
}
}

if (!$create_page) {
if (empty($page)) {
$failflg = 0;
} else {
$failflg = DB_getItem($_TABLES['staticpage'], 'sp_nf', "sp_id = '$page'");
}
if ($failflg) {
$output .= SEC_loginRequiredForm();
if ($mode !== 'autotag') {
// Is user already logged in
if (COM_isAnonUser()) {
// Okay anonymous user ask to login
// Retrieve required info to display login page
$sql = "SELECT sp_title, sp_page_title, sp_format FROM {$_TABLES['staticpage']} WHERE sp_id = '$page'";
$resultA = DB_query($sql);
$A = DB_fetchArray($resultA);

if ($A['sp_format'] === 'allblocks' || $A['sp_format'] === 'leftblocks') {
$what = 'menu';
} else {
$what = 'none';
}

$page_title = stripslashes($A['sp_page_title']);
if (empty($page_title)) {
$page_title = stripslashes($A['sp_title']);
}

if (($A['sp_format'] == 'allblocks')) {
$rightblock = true;
} elseif (($A['sp_format'] == 'leftblocks') || ($A['sp_format'] == 'noblocks')) {
$rightblock = false;
} else {
$rightblock = -1;
}

$output = COM_createHTMLDocument($output, array('what' => $what, 'pagetitle' => $page_title, 'rightblock' => $rightblock));
} else {
// then he has no access and let him know
$output = COM_showMessageText($LANG_STATIC['deny_msg'], $LANG_STATIC['access_denied']);
$output = COM_createHTMLDocument($output, array('pagetitle' => $LANG_STATIC['access_denied']));
}
}
} else {
if ($mode !== 'autotag') {
COM_handle404();
}
}
}
if (empty($page)) {
$failflg = 0;
} else {
$failflg = DB_getItem($_TABLES['staticpage'], 'sp_nf', "sp_id = '$page'");
}
if ($failflg) {
$output .= SEC_loginRequiredForm();
if ($mode !== 'autotag') {
// Is user already logged in
if (COM_isAnonUser()) {
// Okay anonymous user ask to login
// Retrieve required info to display login page
$sql = "SELECT sp_title, sp_page_title, sp_format FROM {$_TABLES['staticpage']} WHERE sp_id = '$page'";
$resultA = DB_query($sql);
$A = DB_fetchArray($resultA);

if ($A['sp_format'] === 'allblocks' || $A['sp_format'] === 'leftblocks') {
$what = 'menu';
} else {
$what = 'none';
}

$page_title = stripslashes($A['sp_page_title']);
if (empty($page_title)) {
$page_title = stripslashes($A['sp_title']);
}

if (($A['sp_format'] == 'allblocks')) {
$rightblock = true;
} elseif (($A['sp_format'] == 'leftblocks') || ($A['sp_format'] == 'noblocks')) {
$rightblock = false;
} else {
$rightblock = -1;
}

$output = COM_createHTMLDocument($output, array('what' => $what, 'pagetitle' => $page_title, 'rightblock' => $rightblock));
} else {
// then he has no access and let him know
$output = COM_showMessageText($LANG_STATIC['deny_msg'], $LANG_STATIC['access_denied']);
$output = COM_createHTMLDocument($output, array('pagetitle' => $LANG_STATIC['access_denied']));
}
}
} else {
if ($mode !== 'autotag') {
COM_handle404();
}
}

return PLG_RET_ERROR;
}
Expand Down
7 changes: 7 additions & 0 deletions public_html/docs/english/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ <h2>Creating a Child Theme</h2>

<h2><a id="changes">Changes</a></h2>

<h2><a name="changes222">Theme changes in Geeklog 2.2.2</a></h2>

<ul>
<li>New Block Header Child template called <span class="tt">blockheader-child.thtml</span>. This is used by User Profile page and allows for nesting blocks within the main block. This change required bumping Geeklog minimum version for themes to 2.2.2.</li>
<li>For the <span class="tt">users\profile.thtml</span> file, all {end_block} template variables updated with unique names.</li>
</ul>

<h2><a name="changes221">Theme changes in Geeklog 2.2.1</a></h2>

<ul>
Expand Down
7 changes: 7 additions & 0 deletions public_html/docs/japanese/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ <h3><a name="tips">ヒントと注意点</a></h3>

<h2><a id="changes">変更点</a></h2>

<h2><a name="changes222">Theme changes in Geeklog 2.2.2</a></h2>

<ul>
<li>New Block Header Child template called <span class="tt">blockheader-child.thtml</span>. This is used by User Profile page and allows for nesting blocks within the main block. This change required bumping Geeklog minimum version for themes to 2.2.2.</li>
<li>For the <span class="tt">users\profile.thtml</span> file, all {end_block} template variables updated with unique names.</li>
</ul>

<h2><a name="changes221">Geeklog 2.2.1におけるテーマの変更点</a></h2>

<ul>
Expand Down
7 changes: 7 additions & 0 deletions public_html/layout/denim/blockheader-child.thtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{# begin {templatelocation} #}

<section class="block-child-center{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h3>{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle" {gl-help-popup} href="{help_url}" title="Help" target="_blank"></a>{!endif}</h3>
<div class="block-center-content">

{# end {templatelocation} #}
6 changes: 6 additions & 0 deletions public_html/layout/denim/css_ltr/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

/* Used by blockheader-child.thtml and based on block-center CSS class */
#centerblocks section.block-child-center,
#centerblocks div.block-child-center {
margin: 0 0 1.25em 0;
}
6 changes: 6 additions & 0 deletions public_html/layout/denim/css_rtl/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@
width: 64px;
height: 64px;
}

/* Used by blockheader-child.thtml and based on block-center CSS class */
#centerblocks section.block-child-center,
#centerblocks div.block-child-center {
margin: 0 0 1.25em 0;
}
4 changes: 2 additions & 2 deletions public_html/layout/denim/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ function theme_config_denim()
return array(
'theme_name' => 'Denim', // Required
'theme_version' => '1.1.4', // Required - This theme version released Geeklog v2.2.2
'theme_gl_version' => '2.2.1', // Required - Minimum Geeklog version theme is compatible with
'theme_gl_version' => '2.2.2', // Required - Minimum Geeklog version theme is compatible with
'theme_description' => '', // Can contain HTML
'theme_author' => 'dengen',
'theme_author_url' => 'https://www.geeklog.net/users.php?mode=profile&uid=13649',
'theme_homepage' => 'https://www.geeklog.net/',
'theme_download_url' => '',
'theme_copyright' => '2012-2020',
'theme_copyright' => '2012-2022',
'theme_license' => 'GPL-2.0+',
'theme_path_site_logo' => '/layout/denim/images/logo2.png', // Used to override path_site_logo config option if needed. Empty or should have absolute path with Logo image filename. See path_site_logo option in config docs for more info
'image_type' => 'png',
Expand Down
34 changes: 17 additions & 17 deletions public_html/layout/denim/users/profile.thtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# start {templatelocation} #}
{# begin {templatelocation} #}

{start_block_userprofile}
<dl id="profile-userprofile">
<dl id="profile-userprofile" style="margin-bottom:15px;">
<dt>{lang_username}</dt>
<dd>{username}&nbsp;{user_fullname} {edit_link}</dd>
<dd id="profile-user_photo">{user_photo}</dd>
Expand All @@ -28,25 +28,25 @@

{display_fields}
</dl>
{end_block}

{last10_blocks}
{last10_blocks}

{start_block_postingstats}
<dl id="profile-postingstats">
<dt>{lang_number_stories}</dt>
<dd>{number_stories}</dd>
{start_block_postingstats}
<dl id="profile-postingstats">
<dt>{lang_number_stories}</dt>
<dd>{number_stories}</dd>

<dt>{lang_number_comments}</dt>
<dd>{number_comments}</dd>
<dt>{lang_number_comments}</dt>
<dd>{number_comments}</dd>

{field_statistics}
</dl>
{field_statistics}
</dl>

<div id="profile-all_postings_by">
<a href="{site_url}/search.php?type=all&amp;author={user_id}&amp;mode=search">{lang_all_postings_by}</a>
</div>
{end_block}
<div id="profile-all_postings_by">
<a href="{site_url}/search.php?type=all&amp;author={user_id}&amp;mode=search">{lang_all_postings_by}</a>
</div>
{end_block_postingstats}
{end_block_userprofile}

<!-- BEGIN display_field -->
<dt>{lang_field}</dt>
Expand All @@ -61,7 +61,7 @@
<!-- BEGIN last10_block -->
{start_block_last10}
{last10_rows}
{end_block}
{end_block_last10}
<!-- END last10_block -->

<!-- BEGIN last10_row -->
Expand Down
6 changes: 6 additions & 0 deletions public_html/layout/denim_curve/css_ltr/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
margin: 0 auto;
/* width: 1140px; */
}

/* Used by blockheader-child.thtml and based on block-center CSS class */
#centerblocks section.block-child-center,
#centerblocks div.block-child-center {
margin: 0 0 1.25em 0;
}
6 changes: 6 additions & 0 deletions public_html/layout/denim_curve/css_rtl/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
margin: 0 auto;
/* width: 1140px; */
}

/* Used by blockheader-child.thtml and based on block-center CSS class */
#centerblocks section.block-child-center,
#centerblocks div.block-child-center {
margin: 0 0 1.25em 0;
}
4 changes: 2 additions & 2 deletions public_html/layout/denim_curve/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ function theme_config_denim_curve()
return array(
'theme_name' => 'Denim Curve', // Required
'theme_version' => '1.0.4', // Required - This theme version released Geeklog v2.2.2
'theme_gl_version' => '2.2.1', // Required - Minimum Geeklog version theme is compatible with
'theme_gl_version' => '2.2.2', // Required - Minimum Geeklog version theme is compatible with
'theme_description' => '', // Can contain HTML
'theme_author' => 'dengen',
'theme_author_url' => 'https://www.geeklog.net/users.php?mode=profile&uid=13649',
'theme_homepage' => 'https://www.geeklog.net/',
'theme_download_url' => '',
'theme_copyright' => '2012-2020',
'theme_copyright' => '2012-2022',
'theme_license' => 'GPL-2.0+',
'theme_path_site_logo' => '/layout/denim_curve/images/logo2.png', // Used to override path_site_logo config option if needed. Empty or should have absolute path with Logo image filename. See path_site_logo option in config docs for more info
'image_type' => 'png',
Expand Down
7 changes: 7 additions & 0 deletions public_html/layout/denim_three/blockheader-child.thtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{# begin {templatelocation} #}

<section class="block-child-center{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h3>{block_title}{!if help_url}<a class="blocktitle block-help-icon" {gl-help-popup} href="{help_url}" title="Help" target="_blank" uk-icon="icon:question; ratio:0.85"></a>{!endif}</h3>
<div class="block-center-content">

{# end {templatelocation} #}
6 changes: 6 additions & 0 deletions public_html/layout/denim_three/css_ltr/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

/* Used by blockheader-child.thtml and based on block-center CSS class */
#centerblocks section.block-child-center,
#centerblocks div.block-child-center {
margin: 0 0 1.25em 0;
}
6 changes: 6 additions & 0 deletions public_html/layout/denim_three/css_rtl/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
width: 64px;
height: 64px;
}

/* Used by blockheader-child.thtml and based on block-center CSS class */
#centerblocks section.block-child-center,
#centerblocks div.block-child-center {
margin: 0 0 1.25em 0;
}
4 changes: 2 additions & 2 deletions public_html/layout/denim_three/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ function theme_config_denim_three()
return array(
'theme_name' => 'Denim Three', // Required
'theme_version' => '1.0.4', // Required - This theme version released Geeklog v2.2.2
'theme_gl_version' => '2.2.1', // Required - Minimum Geeklog version theme is compatible with
'theme_gl_version' => '2.2.2', // Required - Minimum Geeklog version theme is compatible with
'theme_description' => '', // Can contain HTML
'theme_author' => 'dengen',
'theme_author_url' => 'https://www.geeklog.net/users.php?mode=profile&uid=13649',
'theme_homepage' => 'https://www.geeklog.net/',
'theme_download_url' => '',
'theme_copyright' => '2012-2020',
'theme_copyright' => '2012-2022',
'theme_license' => 'GPL-2.0+',
'theme_path_site_logo' => '/layout/denim_three/images/logo2.png', // Used to override path_site_logo config option if needed. Empty or should have absolute path with Logo image filename. See path_site_logo option in config docs for more info
'image_type' => 'png',
Expand Down
36 changes: 18 additions & 18 deletions public_html/layout/denim_three/users/profile.thtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

{start_block_userprofile}
<dl id="profile-userprofile">
<dl id="profile-userprofile" style="margin-bottom:15px;">
<dt>{lang_username}</dt>
<dd>{username}&nbsp;{user_fullname} {edit_link}</dd>
<dd id="profile-user_photo">{user_photo}</dd>
Expand All @@ -25,28 +25,28 @@

<dt>{lang_pgpkey}</dt>
<dd>{user_pgp}</dd>

{display_fields}
</dl>
{end_block}

{last10_blocks}

{start_block_postingstats}
<dl id="profile-postingstats">
<dt>{lang_number_stories}</dt>
<dd>{number_stories}</dd>
{last10_blocks}

<dt>{lang_number_comments}</dt>
<dd>{number_comments}</dd>
{start_block_postingstats}
<dl id="profile-postingstats">
<dt>{lang_number_stories}</dt>
<dd>{number_stories}</dd>

{field_statistics}
</dl>
<dt>{lang_number_comments}</dt>
<dd>{number_comments}</dd>

{field_statistics}
</dl>

<div id="profile-all_postings_by">
<a href="{site_url}/search.php?type=all&amp;author={user_id}&amp;mode=search">{lang_all_postings_by}</a>
</div>
{end_block}
<div id="profile-all_postings_by">
<a href="{site_url}/search.php?type=all&amp;author={user_id}&amp;mode=search">{lang_all_postings_by}</a>
</div>
{end_block_postingstats}
{end_block_userprofile}

<!-- BEGIN display_field -->
<dt>{lang_field}</dt>
Expand All @@ -61,7 +61,7 @@
<!-- BEGIN last10_block -->
{start_block_last10}
{last10_rows}
{end_block}
{end_block_last10}
<!-- END last10_block -->

<!-- BEGIN last10_row -->
Expand Down
6 changes: 6 additions & 0 deletions public_html/layout/glnet_curve/css_ltr/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
margin: 0 auto;
/* width: 1140px; */
}

/* Used by blockheader-child.thtml and based on block-center CSS class */
#centerblocks section.block-child-center,
#centerblocks div.block-child-center {
margin: 0 0 1.25em 0;
}

0 comments on commit 344b751

Please sign in to comment.