Created
July 6, 2021 12:41
-
-
Save ichaykin/d2b7fd25ec0d017e88ff60e6466ff28c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/blog/func.php b/app/addons/blog/func.php | |
index 2e75e3248b..f0f7df1ca8 100644 | |
--- a/app/addons/blog/func.php | |
+++ b/app/addons/blog/func.php | |
@@ -115,10 +115,13 @@ function fn_blog_update_page_post($page_data, $page_id, $lang_code, $create, $ol | |
if (!empty($page_data['page_type']) && $page_data['page_type'] == PAGE_TYPE_BLOG) { | |
fn_attach_image_pairs('blog_image', 'blog', $page_id, $lang_code); | |
- db_query("REPLACE INTO ?:blog_authors ?e", array( | |
- 'page_id' => $page_id, | |
- 'user_id' => Tygh::$app['session']['auth']['user_id'] | |
- )); | |
+ if (empty($page_data['author'])) { | |
+ db_query('DELETE FROM ?:blog_authors WHERE page_id = ?i', $page_id); | |
+ db_query("REPLACE INTO ?:blog_authors ?e", array( | |
+ 'page_id' => $page_id, | |
+ 'user_id' => Tygh::$app['session']['auth']['user_id'] | |
+ )); | |
+ } | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/design/backend/templates/addons/blog/hooks/pages/detailed_content.post.tpl b/design/backend/templates/addons/blog/hooks/pages/detailed_content.post.tpl | |
index 8208bffe59..305d9f4a5f 100644 | |
--- a/design/backend/templates/addons/blog/hooks/pages/detailed_content.post.tpl | |
+++ b/design/backend/templates/addons/blog/hooks/pages/detailed_content.post.tpl | |
@@ -1,6 +1,15 @@ | |
{if $page_type == $smarty.const.PAGE_TYPE_BLOG} | |
{include file="common/subheader.tpl" title=__("blog") target="#blog_image"} | |
+<div id="blog_author" class="in collapse"> | |
+ <div class="control-group"> | |
+ <label class="control-label">{__("author")}:</label> | |
+ <div class="controls"> | |
+ <input type="text" name="page_data[author]" value="{$page_data.author}"> | |
+ </div> | |
+ </div> | |
+</div> | |
+ | |
<div id="blog_image" class="in collapse"> | |
<fieldset> | |
<div class="control-group"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment