Skip to content

Commit

Permalink
Fixed for ver 4.2 (#2)
Browse files Browse the repository at this point in the history
* Fixed for ver 4.2

* Fixed according last comments
  • Loading branch information
semchishinv authored and vbezruchkin committed Mar 23, 2018
1 parent f229522 commit 655b1c3
Show file tree
Hide file tree
Showing 14 changed files with 407 additions and 400 deletions.
4 changes: 2 additions & 2 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/******************************************************************************
*
* Subrion - open source content management system
* Copyright (C) 2017 Intelliants, LLC <https://intelliants.com>
* Copyright (C) 2018 Intelliants, LLC <https://intelliants.com>
*
* This file is part of Subrion.
*
Expand All @@ -24,7 +24,7 @@
*
******************************************************************************/

$iaWallpost = $iaCore->factoryPlugin('wall', iaCore::ADMIN, 'wallpost');
$iaWallpost = $iaCore->factoryModule('wall', IA_CURRENT_MODULE);

$iaDb->setTable('wall_posts');

Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<ul>
<li>Version: 4.2.0
<ul>
<li>Updated for Subrion CMS 4.2</li>
</ul>
</li>
<li>Version: 4.1.0
<ul>
<li>Updated for Subrion CMS 4.1.x</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/******************************************************************************
*
* Subrion - open source content management system
* Copyright (C) 2017 Intelliants, LLC <https://intelliants.com>
* Copyright (C) 2018 Intelliants, LLC <https://intelliants.com>
*
* This file is part of Subrion.
*
Expand All @@ -24,7 +24,7 @@
*
******************************************************************************/

class iaWallpost extends abstractModuleAdmin
class iaWall extends abstractModuleAdmin
{
protected static $_table = 'wall_posts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/******************************************************************************
*
* Subrion - open source content management system
* Copyright (C) 2017 Intelliants, LLC <https://intelliants.com>
* Copyright (C) 2018 Intelliants, LLC <https://intelliants.com>
*
* This file is part of Subrion.
*
Expand All @@ -24,14 +24,15 @@
*
******************************************************************************/

class iaWallpost extends abstractModuleFront
class iaWall extends abstractModuleFront
{
protected static $_table = 'wall_posts';

public function insert(array $data)
{
if (!$this->iaCore->get('wall_allow_wysiwyg')) {
$data['body'] = htmlspecialchars($data['body']);
$data['ip'] = $this->iaCore->factory('util')->getIp();
}

$id = $this->iaDb->insert($data, array('date' => iaDb::FUNCTION_NOW), self::getTable());
Expand Down
8 changes: 6 additions & 2 deletions includes/hook.blocks-load.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/******************************************************************************
*
* Subrion - open source content management system
* Copyright (C) 2017 Intelliants, LLC <https://intelliants.com>
* Copyright (C) 2018 Intelliants, LLC <https://intelliants.com>
*
* This file is part of Subrion.
*
Expand All @@ -25,13 +25,15 @@
******************************************************************************/

if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
$iaWallpost = $iaCore->factoryPlugin('wall', iaCore::FRONT, 'wallpost');
$iaWallpost = $iaCore->factoryModule('wall', 'wall');

if ($iaView->blockExists('wall')) {

$array = $iaWallpost->getLatest($iaCore->get('posts_per_load'));
$iaView->assign('latest_wall_posts', $array);

$iaView->assign('num_total_wall_posts', $iaDb->foundRows());

}

if ('view_member' == $iaView->name()) {
Expand All @@ -40,5 +42,7 @@
$iaView->assign('latest_wall_posts', $array);

$iaView->assign('num_total_wall_posts', $iaDb->foundRows());

}
$iaView->add_css('_IA_URL_modules/wall/templates/front/css/style');
}
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/******************************************************************************
*
* Subrion - open source content management system
* Copyright (C) 2017 Intelliants, LLC <https://intelliants.com>
* Copyright (C) 2018 Intelliants, LLC <https://intelliants.com>
*
* This file is part of Subrion.
*
Expand All @@ -24,7 +24,8 @@
*
******************************************************************************/

$iaWallpost = $iaCore->factoryPlugin('wall', iaCore::FRONT, 'wallpost');
$iaWallpost = $iaCore->factoryModule('wall', IA_CURRENT_MODULE);


if (iaView::REQUEST_JSON == $iaView->getRequestType()) {
$error = false;
Expand Down
154 changes: 77 additions & 77 deletions install.xml
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
<?xml version="1.0" encoding="utf-8" ?>
<plugin name="wall">
<title>Wall</title>
<summary>This plugin allows visitors to leave their messages/announcements at the Front End</summary>
<author>Intelliants LLC</author>
<contributor>Intelliants LLC</contributor>
<version>4.1.0</version>
<date>2018-01-17</date>
<compatibility>4.1</compatibility>
<module type="plugin" name="wall">
<title>Wall</title>
<summary>This plugin allows visitors to leave their messages/announcements at the Front End</summary>
<author>Intelliants LLC</author>
<contributor>Intelliants LLC</contributor>
<version>4.2.0</version>
<date>2018-03-13</date>
<compatibility>4.2</compatibility>

<items>
<item payable="0" table_name="wall_posts">wall_posts</item>
</items>
<items>
<item payable="0" table_name="wall_posts">wall_posts</item>
</items>

<actions>
<action name="posts_view" url="wall-posts/" icon="list" order="1" pages="wall_posts">View</action>
</actions>
<actions>
<action name="posts_view" url="wall-posts/" icon="list" order="1" pages="wall_posts">View</action>
</actions>

<adminpages>
<page name="wall_posts" url="wall-posts/" menus="menu" order="40">Wall Posts</page>
</adminpages>
<adminpages>
<page name="wall_posts" url="wall-posts/" menus="menu" order="40">Wall Posts</page>
</adminpages>

<pages>
<page name="wall" url="wall/" service="1">Wall Posts</page>
</pages>
<pages>
<page name="wall" url="wall/" service="1">Wall Posts</page>
</pages>

<configgroup name="wall">Wall</configgroup>
<configgroup name="wall">Wall</configgroup>

<config group="wall" name="wall" type="divider" description="Wall Configuration">Wall Configuration</config>
<config group="wall" name="wall_allow_guests" type="radio" description="Allow guests to post" values="1,0">0</config>
<config group="wall" name="wall_allow_wysiwyg" type="radio" description="Allow WYSIWYG" values="1,0" value="1" private="0">0</config>
<config group="wall" name="wall_auto_approval" type="radio" description="Posts auto-approval" values="1,0">1</config>
<config group="wall" name="post_max_chars" type="text" description="Symbols limit">400</config>
<config group="wall" name="posts_per_load" type="text" description="Number of posts per load" private="0">5</config>
<config group="wall" name="wall" type="divider" description="Wall Configuration">Wall Configuration</config>
<config group="wall" name="wall_allow_guests" type="radio" description="Allow guests to post" values="1,0">0</config>
<config group="wall" name="wall_allow_wysiwyg" type="radio" description="Allow WYSIWYG" values="1,0" value="1" private="0">0</config>
<config group="wall" name="wall_auto_approval" type="radio" description="Posts auto-approval" values="1,0">1</config>
<config group="wall" name="post_max_chars" type="text" description="Symbols limit">400</config>
<config group="wall" name="posts_per_load" type="text" description="Number of posts per load" private="0">5</config>

<config group="email_templates" type="divider" name="wall_divider" description="Wall"><![CDATA[]]></config>
<config group="email_templates" type="radio" values="1,0" name="wall_admin_notification" description="New wall post alerts">1</config>
<config group="email_templates" type="text" name="wall_admin_notification_subject" description="Email Subject">New wall post added</config>
<config group="email_templates" type="textarea" name="wall_admin_notification_body" description="Email Body">
<![CDATA[
<config group="email_templates" type="divider" name="wall_divider" description="Wall"><![CDATA[]]></config>
<config group="email_templates" type="radio" values="1,0" name="wall_admin_notification" description="New wall post alerts">1</config>
<config group="email_templates" type="text" name="wall_admin_notification_subject" description="Email Subject">New wall post added</config>
<config group="email_templates" type="textarea" name="wall_admin_notification_body" description="Email Body">
<![CDATA[
<p>Hi,</p>
<p>New wall post has been published on your website "{%TITLE%}":</p>
<p>{%TEXT%}</p>
<p>For more details check the url: <a href="{%URL%}">{%URL%}</a></p>
]]>
</config>
]]>
</config>

<phrases>
<phrase category="admin" key="add_post">Add Post</phrase>
<phrases>
<phrase category="admin" key="add_post">Add Post</phrase>

<phrase category="common" key="wall">Wall</phrase>
<phrase category="common" key="wall_posts">Wall Posts</phrase>
<phrase category="common" key="are_you_sure_to_delete_this_post">Are you sure you want to delete this post?</phrase>
<phrase category="common" key="are_you_sure_to_delete_selected_posts">Are you sure you want to delete selected comments?</phrase>
<phrase category="common" key="edit_post">Edit Post</phrase>
<phrase category="common" key="post_added">Post added.</phrase>
<phrase category="common" key="wall">Wall</phrase>
<phrase category="common" key="wall_posts">Wall Posts</phrase>
<phrase category="common" key="are_you_sure_to_delete_this_post">Are you sure you want to delete this post?</phrase>
<phrase category="common" key="are_you_sure_to_delete_selected_posts">Are you sure you want to delete selected comments?</phrase>
<phrase category="common" key="edit_post">Edit Post</phrase>
<phrase category="common" key="post_added">Post added.</phrase>

<phrase category="frontend" key="post_waits_for_approval">Your post will be displayed once approved by Administrator.</phrase>
<phrase category="frontend" key="guests_warning">Please login or register to post.</phrase>
<phrase category="frontend" key="error_max_chars">Your post's length should have less than :length symbols.</phrase>
<phrase category="frontend" key="error_empty_post">Your post is empty</phrase>
<phrase category="frontend" key="sumbit_post">Submit</phrase>
<phrase category="frontend" key="no_posts">No posts submitted yet.</phrase>
</phrases>
<phrase category="frontend" key="post_waits_for_approval">Your post will be displayed once approved by Administrator.</phrase>
<phrase category="frontend" key="guests_warning">Please login or register to post.</phrase>
<phrase category="frontend" key="error_max_chars">Your post's length should have less than :length symbols.</phrase>
<phrase category="frontend" key="error_empty_post">Your post is empty</phrase>
<phrase category="frontend" key="sumbit_post">Submit</phrase>
<phrase category="frontend" key="no_posts">No posts submitted yet.</phrase>
</phrases>

<blocks>
<block name="wall" title="Wall" position="bottom" type="smarty" sticky="0" pages="index" filename="block.wall" classname="box-clear"><![CDATA[]]></block>
</blocks>
<blocks>
<block name="wall" title="Wall" position="bottom" type="smarty" sticky="0" pages="index" filename="block.wall.tpl" classname="box-clear"><![CDATA[]]></block>
</blocks>

<hooks>
<hook name="phpCoreBeforePageDisplay" type="php" page_type="front" filename="hook.blocks-load"><![CDATA[]]></hook>
<hook name="smartyItemViewBeforeTabs" type="smarty" filename="tab.member"><![CDATA[]]></hook>
<hook name="adminDashboardStatistics" page_type="admin"><![CDATA[$items['wall:wallposts'] = 'plugin';]]></hook>
</hooks>
<hooks>
<hook name="phpCoreBeforePageDisplay" type="php" page_type="front" filename="hook.blocks-load.php"><![CDATA[]]></hook>
<hook name="smartyItemViewBeforeTabs" type="smarty" filename="tab.member.tpl"><![CDATA[]]></hook>
<hook name="adminDashboardStatistics" page_type="admin"><![CDATA[$items['wall:wallposts'] = 'plugin';]]></hook>
</hooks>

<install>
<sql>
<![CDATA[
<install>
<sql>
<![CDATA[
CREATE TABLE `{prefix}wall_posts` (
`id` int(8) NOT NULL auto_increment,
`member_id` int(8) NOT NULL,
`body` text NOT NULL,
`ip` bigint(12) unsigned NOT NULL,
`date` datetime NOT NULL,
`status` enum('inactive', 'active') NOT NULL default 'inactive',
PRIMARY KEY (`id`)
`id` int(8) NOT NULL auto_increment,
`member_id` int(8) NOT NULL,
`body` text NOT NULL,
`ip` bigint(12) unsigned NOT NULL,
`date` datetime NOT NULL,
`status` enum('inactive', 'active') NOT NULL default 'inactive',
PRIMARY KEY (`id`)
) {mysql_version};
]]>
</sql>
</install>
]]>
</sql>
</install>

<uninstall>
<sql>
<![CDATA[
<uninstall>
<sql>
<![CDATA[
DROP TABLE IF EXISTS `{prefix}wall_posts`;
]]>
</sql>
</uninstall>
</plugin>
]]>
</sql>
</uninstall>
</module>
Loading

0 comments on commit 655b1c3

Please sign in to comment.