Skip to content

Remove comments system for tags - really not useful. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions class/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @since 1.0
* @author marcan aka Marc-André Lanciault <marcan@smartfactory.ca>
*
*
*/
if (!defined("ICMS_ROOT_PATH")) die("ICMS root path not defined");

Expand All @@ -27,9 +27,7 @@ public function __construct(&$handler) {
$this->quickInitVar('tag_description', XOBJ_DTYPE_TXTAREA);
$this->quickInitVar('tag_created_date', XOBJ_DTYPE_LTIME);
$this->quickInitVar('tag_uid', XOBJ_DTYPE_INT);
$this->quickInitVar('tag_cancomment', XOBJ_DTYPE_INT, false, false, false, true);

$this->setControl('tag_cancomment', 'yesno');
$this->setControl('tag_uid', 'user');

$this->initiateSEO();
Expand Down
14 changes: 0 additions & 14 deletions comment_delete.php

This file was deleted.

14 changes: 0 additions & 14 deletions comment_edit.php

This file was deleted.

28 changes: 0 additions & 28 deletions comment_new.php

This file was deleted.

14 changes: 0 additions & 14 deletions comment_post.php

This file was deleted.

14 changes: 0 additions & 14 deletions comment_reply.php

This file was deleted.

22 changes: 6 additions & 16 deletions icms_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'developer_website_name' => "Github",
'developer_email' => "david.j@impresscms.org");
$modversion['people']['developers'][] = "[url=https://www.impresscms.org/userinfo.php?uid=1102]fiammybe[/url] (David Janssens)";
$modversion['warning'] = _CO_SOBJECT_WARNING_RC;
$modversion['warning'] = _CO_ICMS_WARNING_RC;

/** Administrative information */
$modversion['hasAdmin'] = 1;
Expand Down Expand Up @@ -136,33 +136,23 @@

$modversion['config'][1] = array(
'name' => 'tager_groups',
'title' => '_MI_IMTAGGING_TAGERGR',
'description' => '_MI_IMTAGGING_TAGERGRDSC',
'title' => _MI_IMTAGGING_TAGERGR,
'description' => _MI_IMTAGGING_TAGERGRDSC,
'formtype' => 'select_multi',
'valuetype' => 'array',
'options' => $select_groups_options,
'default' => '1');

$modversion['config'][] = array(
'name' => 'tags_limit',
'title' => '_MI_IMTAGGING_LIMIT',
'description' => '_MI_IMTAGGING_LIMITDSC',
'title' => _MI_IMTAGGING_LIMIT,
'description' => _MI_IMTAGGING_LIMITDSC,
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => 5);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I added config items to imBlogging, the language constants did need to be enclosed in quotes to be treated as a constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is correct, error on my part.

/** Comments information */
$modversion['hasComments'] = 1;

$modversion['comments'] = array(
'itemName' => 'tag_id',
'pageName' => 'tag.php',
/* Comment callback functions */
'callbackFile' => 'include/comment.inc.php',
'callback' => array(
'approve' => 'imtagging_com_approve',
'update' => 'imtagging_com_update')
);
$modversion['hasComments'] = 0;

/** Notification information */
$modversion['hasNotification'] = 1;
Expand Down
21 changes: 0 additions & 21 deletions include/comment.inc.php

This file was deleted.

13 changes: 11 additions & 2 deletions include/onupdate.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @since 1.0
* @author marcan aka Marc-André Lanciault <marcan@smartfactory.ca>
*
*
*/
if (!defined("ICMS_ROOT_PATH")) die("ICMS root path not defined");

// this needs to be the latest db version
define('IMTAGGING_DB_VERSION', 1);
define('IMTAGGING_DB_VERSION', 2);

/**
* it is possible to define custom functions which will be call when the module is updating at the
Expand All @@ -34,6 +34,15 @@
* function imtagging_db_upgrade_2() {
* }
*/

function imtagging_db_upgrade_2() {
$icmsDatabaseUpdater = icms_db_legacy_Factory::getDatabaseUpdater();
//$icmsDatabaseUpdater->;
$sql = sprintf("ALTER TABLE %s DROP column tag_cancomment", icms::$xoopsDB->prefix('imtagging_tag'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the upgrade method handles this without having to explicitly do this. See icms_db_legacy_updater_Handler::upgradeObjectItem().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does - I just removed the 2 lines in class/tag.php for tag_cancomment and updated the module. That was enough to drop the column.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! that makes version updates considerably easier, at least when it comes to removing fields.

if (! $result = icms::$xoopsDB->queryF($sql)) {
echo 'Error while removing column tag_cancomment.';
}
}
function icms_module_update_imtagging($module) {
/**
* Using the IcmsDatabaseUpdater to automaticallly manage the database upgrade dynamically
Expand Down
6 changes: 2 additions & 4 deletions language/english/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @since 1.0
* @author marcan aka Marc-André Lanciault <marcan@smartfactory.ca>
*
*
*/
if (!defined("ICMS_ROOT_PATH")) die("ICMS root path not defined");

Expand Down Expand Up @@ -43,6 +43,4 @@
define("_CO_IMTAGGING_TAG_TAG_CREATED_DATE", "Created date");
define("_CO_IMTAGGING_TAG_TAG_CREATED_DATE_DSC", "");
define("_CO_IMTAGGING_TAG_TAG_UID", "Creator");
define("_CO_IMTAGGING_TAG_TAG_UID_DSC", "");
define("_CO_IMTAGGING_TAG_TAG_CANCOMMENT", "Can comment ?");
define("_CO_IMTAGGING_TAG_TAG_CANCOMMENT_DSC", "");
define("_CO_IMTAGGING_TAG_TAG_UID_DSC", "");
6 changes: 2 additions & 4 deletions language/german/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @since 1.0
* @author marcan aka Marc-André Lanciault <marcan@smartfactory.ca>
*
*
*/
if (!defined("ICMS_ROOT_PATH")) die("ICMS root path not defined");

Expand Down Expand Up @@ -43,6 +43,4 @@
define("_CO_IMTAGGING_TAG_TAG_CREATED_DATE", "Erstellungsdatum");
define("_CO_IMTAGGING_TAG_TAG_CREATED_DATE_DSC", "");
define("_CO_IMTAGGING_TAG_TAG_UID", "Erstellt durch");
define("_CO_IMTAGGING_TAG_TAG_UID_DSC", "");
define("_CO_IMTAGGING_TAG_TAG_CANCOMMENT", "Kann kommentieren?");
define("_CO_IMTAGGING_TAG_TAG_CANCOMMENT_DSC", "");
define("_CO_IMTAGGING_TAG_TAG_UID_DSC", "");
8 changes: 0 additions & 8 deletions module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
font-size: 80%;
}
.imtagging_tag_content {}
#imtagging_tag_comments_container {}
.imtagging_tag_comments {
background-image: url(images/comments.gif);
background-repeat: no-repeat;
padding-left: 15px;
vertical-align: middle;
font-size: 80%;
}
.imtagging_admin_links {}
#imtagging_navbar {
text-align: center;
Expand Down
8 changes: 0 additions & 8 deletions module_rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
font-size: 80%;
}
.imtagging_tag_content {}
#imtagging_tag_comments_container {}
.imtagging_tag_comments {
background-image: url(images/comments.gif);
background-repeat: no-repeat;
padding-left: 15px;
vertical-align: middle;
font-size: 80%;
}
.imtagging_admin_links {}
#imtagging_navbar {
text-align: center;
Expand Down
7 changes: 1 addition & 6 deletions tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @since 1.0
* @author marcan aka Marc-André Lanciault <marcan@smartfactory.ca>
* @package imtagging
*
*
*/

/**
Expand Down Expand Up @@ -122,11 +122,6 @@ function edittag($tagObj) {
} else {
redirect_header(IMTAGGING_URL, 3, _NOPERM);
}

if ($icmsModuleConfig['com_rule'] && $tagObj->getVar('tag_cancomment')) {
$icmsTpl->assign('imtagging_tag_comment', true);
include_once ICMS_ROOT_PATH . '/include/comment_view.php';
}
break;
}

Expand Down
27 changes: 1 addition & 26 deletions templates/imtagging_footer.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
<{if $imtagging_is_admin}>
<div class="imtagging_adminlinks"><{$imtagging_adminpage}></div>
<{/if}>


<{if $imtagging_tag_comment}>
<table id="comments_container" border="0" width="100%" cellspacing="1" cellpadding="0" align="center" >
<tr>
<td colspan="3" align ="<{$smarty.const._GLOBAL_LEFT}>">
<div style="text-align: center; padding: 3px; margin:3px;"> <{$commentsnav}> <{$lang_notice}></div>
<div style="margin:3px; padding: 3px;">
<!-- start comments loop -->
<{if $comment_mode == "flat"}>
<{include file="db:system_comments_flat.html"}>
<{elseif $comment_mode == "thread"}>
<{include file="db:system_comments_thread.html"}>
<{elseif $comment_mode == "nest"}>
<{include file="db:system_comments_nest.html"}>
<{/if}>
<!-- end comments loop -->
</div>
</td>
</tr>
</table>
<{/if}>


<{includeq file='db:system_notification_select.html'}>
<{/if}>
3 changes: 0 additions & 3 deletions templates/imtagging_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ <h1><{$imtagging_tag.itemLink}></h1>
<div class="imtagging_tag_content">
<{$imtagging_tag.tag_lead}>
</div>
<div class="imtagging_tag_comments">
<{$imtagging_tag.tag_comment_info}>
</div>
<{if $imtagging_tag.userCanEditAndDelete}>
<div class="imtagging_admin_links"><{$imtagging_tag.editItemLink}><{$imtagging_tag.deleteItemLink}></div>
<{/if}>
Expand Down