Commit d0ced1eb authored by sampaioprimo's avatar sampaioprimo

[MOD] moving lib/commentslib.php to lib/comments/commentslib.php

parent 537672e2
......@@ -1534,7 +1534,7 @@ lib/ckeditor_tiki/plugins/tikiwiki/plugin.js -text
lib/commcenter/commlib.php -text
lib/commcenter/index.php -text
lib/comments/commentslib.js -text
lib/commentslib.php -text
lib/comments/commentslib.php -text
lib/contribution/contributionlib.php -text
lib/contribution/index.php -text
lib/copyrights/copyrightslib.php -text
......
......@@ -168,7 +168,7 @@ if (!isset($_REQUEST["comments_reply_threadId"])) {
$smarty->assign("comments_reply_threadId", $_REQUEST["comments_reply_threadId"]);
// Include the library for comments (if not included)
include_once ("lib/commentslib.php");global $dbTiki;
include_once ("lib/comments/commentslib.php");global $dbTiki;
$commentslib = new Comments($dbTiki);
if (!isset($comments_prefix_var)) {
......
......@@ -816,7 +816,7 @@ class CategLib extends ObjectLib
global $commentslib;
if (!is_object($commentslib)) {
require_once('lib/commentslib.php');
require_once('lib/comments/commentslib.php');
$commentslib = new Comments;
}
// The page is not cateorized
......
......@@ -1332,7 +1332,7 @@ class FileGalLib extends TikiLib
$query = 'select `objectType`, `object`, `threadId`,`title`, `data` from `tiki_comments`';
$result = $this->query($query, array());
include_once ('lib/commentslib.php');global $dbTiki; $commentslib = new Comments($dbTiki);
include_once ('lib/comments/commentslib.php');global $dbTiki; $commentslib = new Comments($dbTiki);
while ($res = $result->fetchRow()) {
if ($res['objectType'] == 'forum') {
$type = 'forum post';
......
......@@ -1314,7 +1314,7 @@ class LogsLib extends TikiLib
$action['link'] = 'tiki-view_forum_thread.php?forumId='.$action['object'].'&'.$action['comment'];
}
if (!isset($forumNames)) {
global $commentslib; include_once('lib/commentslib.php');
global $commentslib; include_once('lib/comments/commentslib.php');
$objects = $commentslib->list_forums(0, -1, 'name_asc', '');
$forumNames = array();
foreach ($objects['data'] as $object) {
......
......@@ -406,7 +406,7 @@ function feature_home_pages()
// Forum
if ( $prefs['feature_forums'] == 'y' ) {
require_once ('lib/commentslib.php');
require_once ('lib/comments/commentslib.php');
if (!isset($commentslib)) {
$commentslib = new Comments;
}
......
......@@ -90,7 +90,7 @@ function listfgal_pref()
*/
function listforum_pref()
{
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
$commentslib = new Comments();
$allforums = $commentslib->list_forums(0, -1, 'name_desc', '');
......
......@@ -2148,7 +2148,7 @@ class Tiki_Profile_InstallHandler_Forum extends Tiki_Profile_InstallHandler // {
function _install()
{
global $dbTiki;
require_once 'lib/commentslib.php';
require_once 'lib/comments/commentslib.php';
$comments = new Comments( $dbTiki );
$data = $this->getData();
......
......@@ -183,7 +183,7 @@ class RankLib extends TikiLib
function forums_ranking_last_posts($limit, $toponly=false, $forumId='')
{
global $user, $commentslib; require_once 'lib/commentslib.php';
global $user, $commentslib; require_once 'lib/comments/commentslib.php';
if (! $commentslib) {
$commentslib = new Comments;
}
......@@ -216,7 +216,7 @@ class RankLib extends TikiLib
{
global $commentslib;
if (! $commentslib) {
require_once 'lib/commentslib.php';
require_once 'lib/comments/commentslib.php';
$commentslib = new Comments;
}
......@@ -259,7 +259,7 @@ class RankLib extends TikiLib
{
global $commentslib;
if (! $commentslib) {
require_once 'lib/commentslib.php';
require_once 'lib/comments/commentslib.php';
$commentslib = new Comments;
}
......@@ -285,7 +285,7 @@ class RankLib extends TikiLib
{
global $commentslib;
if (! $commentslib) {
require_once 'lib/commentslib.php';
require_once 'lib/comments/commentslib.php';
$commentslib = new Comments;
}
......@@ -310,7 +310,7 @@ class RankLib extends TikiLib
{
global $commentslib;
if (! $commentslib) {
require_once 'lib/commentslib.php';
require_once 'lib/comments/commentslib.php';
$commentslib = new Comments;
}
......
......@@ -154,7 +154,7 @@ class reportsLib extends TikiLib
$body .= "<u>".$change['data']['user']."</u> ".tra("created the topic")." <a href=\"$tikiUrl/tiki-view_forum_thread.php?comments_parentId=".$change['data']['topicId']."&forumId=".$change['data']['forumId']."\">".$change['data']['threadName']."</a> ".tra("at forum")." <a href=\"$tikiUrl/tiki-view_forum.php?forumId=".$change['data']['forumId']."\">".$change['data']['forumName']."</a>.";
} elseif ($change['event']=="forum_post_thread") {
global $dbTiki;
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
$parent_topic = $commentslib->get_comment($change['data']['topicId']);
......
......@@ -19,7 +19,7 @@ function smarty_function_poll($params, &$smarty) {
if (!is_object($polllib)) {
include_once('lib/polls/polllib_shared.php');
}
include_once('lib/commentslib.php');
include_once('lib/comments/commentslib.php');
if (isset($rate)) {
if (!$tikilib->page_exists($rate)) {
......
......@@ -22,7 +22,7 @@ function smarty_function_rating( $params, $smarty ) {
// Handle type-specific actions
if( $type == 'comment' ) {
global $commentslib, $user; require_once 'lib/commentslib.php';
global $commentslib, $user; require_once 'lib/comments/commentslib.php';
if( $user ) {
$commentslib->vote_comment( $id, $user, $value );
......
......@@ -577,7 +577,7 @@ class TikiLib extends TikiDb_Bridge
// If a forum post was changed, check the categories of the forum.
if ( $event == "forum_post_thread" ) {
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
global $commentslib;
$object = $commentslib->get_comment_forum_id($object);
}
......@@ -1721,7 +1721,7 @@ class TikiLib extends TikiDb_Bridge
$query = "select * from `tiki_comments` where `object`=? and `objectType`=?";
$result = $this->fetchAll($query, array( $id, $type ));
if ( !empty($result) ) {
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
}
foreach ( $result as $res ) {
......@@ -4192,7 +4192,7 @@ class TikiLib extends TikiDb_Bridge
**/
function create_page($name, $hits, $data, $lastModif, $comment, $user = 'admin', $ip = '0.0.0.0', $description = '', $lang='', $is_html = false, $hash=null, $wysiwyg=NULL, $wiki_authors_style='', $minor=0, $created='') {
global $smarty, $prefs, $dbTiki, $quantifylib;
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
......@@ -7179,7 +7179,7 @@ class TikiLib extends TikiDb_Bridge
function update_page($pageName, $edit_data, $edit_comment, $edit_user, $edit_ip, $edit_description = '', $edit_minor = 0, $lang='', $is_html=null, $hash=null, $saveLastModif=null, $wysiwyg='', $wiki_authors_style='') {
global $smarty, $prefs, $dbTiki, $histlib, $quantifylib;
include_once ("lib/wiki/histlib.php");
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
......
......@@ -179,7 +179,7 @@ function wikiplugin_articles($data, $params)
$smarty->assign('largefirstimage', $largefirstimage);
if (!isset($overrideDates)) $overrideDates = 'n';
include_once("lib/commentslib.php");
include_once("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
$listpages = $artlib->list_articles($start, $max, $sort, '', $dateStartTS, $dateEndTS, 'admin', $type, $topicId, 'y', $topic, $categId, '', '', $lang, '', '', ($overrideDates == 'y'));
......
......@@ -181,7 +181,7 @@ class WikiLib extends TikiLib
//$data=addslashes(str_replace($oldName,$newName,$info['data']));
$data = $info['data'];
} elseif ($type == 'forum post' || substr($type, -7) == 'comment') {
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
global $dbTiki;
$commentslib = new Comments($dbTiki);
$comment_info = $commentslib->get_comment($objectId);
......
......@@ -116,7 +116,7 @@ class XmlLib extends TikiLib
return false;
}
if ($prefs['feature_wiki_comments'] == 'y' && $this->config['comments']) {
global $dbTiki; include_once('lib/commentslib.php'); $commentslib = new Comments($dbTiki);
global $dbTiki; include_once('lib/comments/commentslib.php'); $commentslib = new Comments($dbTiki);
$comments = $commentslib->get_comments('wiki page:'.$page, 0, 0, 0, 'commentDate_asc', '', 0, 'commentStyle_plain');
if (!empty($comments['cant'])) {
$smarty->assign_by_ref('comments', $comments['data']);
......@@ -287,7 +287,7 @@ class XmlLib extends TikiLib
if ($prefs['feature_wiki_comments'] == 'y' && $tiki_p_edit_comments == 'y' && !empty($info['comments'])) {
foreach ($info['comments'] as $comment) {
global $commentslib; include_once('lib/commentslib.php'); $commentslib = new Comments($dbTiki);
global $commentslib; include_once('lib/comments/commentslib.php'); $commentslib = new Comments($dbTiki);
$parentId = empty($comment['parentId']) ? 0: $newThreadIds[$comment['parentId']];
if ($parentId) {
$reply_info = $commentslib->get_comment($parentd);
......
......@@ -29,7 +29,7 @@ function module_most_commented( $mod_reference, $module_params ) {
global $smarty;
global $commentslib;
if(!isset($commentslib)){
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
$commentslib = new Comments();
}
$type = 'wiki';
......
......@@ -109,7 +109,7 @@ function module_user_bookmarks( $mod_reference, $module_params ) {
// Check if we are bookmarking a forum
if (strstr($_SERVER["REQUEST_URI"], 'tiki-view_forum')) {
require_once('lib/commentslib.php'); global $commentslib;
require_once('lib/comments/commentslib.php'); global $commentslib;
if (!isset($commentslib)) {
$commentslib = new Comments($dbTiki);
}
......
......@@ -13,7 +13,7 @@ if (empty($prefs['feature_jpgraph'])) {
$prefs['feature_jpgraph'] = 'n'; //optional package does not go througp prefs
}
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
include_once ('lib/categories/categlib.php');
include_once ('lib/contribution/contributionlib.php');
$commentslib = new Comments($dbTiki);
......
......@@ -342,7 +342,7 @@ if( $prefs['feature_file_galleries'] == 'y' ) {
}
if( $prefs['feature_forums'] == 'y' ) {
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
if (!isset($commentslib)) {
$commentslib = new Comments($dbTiki);
}
......
......@@ -39,7 +39,7 @@ $auto_query_args = array(
'find',
);
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
if (isset($_REQUEST["remove"])) {
$access->check_authenticity();
......
......@@ -20,7 +20,7 @@ if (isset($_REQUEST["dump"])) {
$adminlib->dump();
}
// Included for the forum dropdown
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
if (isset($_REQUEST["createtag"])) {
check_ticket('admin-inc-wiki');
// Check existance
......
......@@ -178,7 +178,7 @@ if ($prefs['feature_trackers'] == 'y') {
$smarty->assign_by_ref('trackers', $trackers);
}
if ($prefs['feature_forums'] == 'y') {
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
$commentslib = new Comments($dbTiki);
$forums = $commentslib->get_outbound_emails();
$smarty->assign_by_ref('forums', $forums);
......
......@@ -68,7 +68,7 @@ foreach($languages as $clang) {
}
$smarty->assign_by_ref('templates', $templates);
if ($prefs['feature_forums'] == 'y') {
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
$commentslib = new Comments($dbTiki);
$dirs = $commentslib->list_directories_to_save();
} else {
......
......@@ -8,7 +8,7 @@
$force_no_compression = true;
require_once ('tiki-setup.php');
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
// roysinn: shouldn't need attach permission for download . . .
//if ($tiki_p_forum_attach != 'y') {
......
......@@ -17,7 +17,7 @@ if (!isset($_REQUEST["forumId"])) {
}
$smarty->assign('forumId', $_REQUEST["forumId"]);
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
$forum_info = $commentslib->get_forum($_REQUEST["forumId"]);
......
......@@ -27,7 +27,7 @@ if ($tiki_p_forum_read != 'y') {
require_once ('tiki-rss_error.php');
}
require_once('lib/commentslib.php');
require_once('lib/comments/commentslib.php');
if (!isset($commentslib)) {
$commentslib = new Comments($dbTiki);
}
......
......@@ -16,7 +16,7 @@ $access->check_feature('feature_forums');
$access->check_permission('tiki_p_forum_read');
// This shows a list of forums everybody can use this listing
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
if (!isset($_REQUEST["sort_mode"])) {
......
......@@ -18,7 +18,7 @@ if (!isset($_REQUEST["forumId"])) {
}
$smarty->assign('forumId', $_REQUEST["forumId"]);
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
$forum_info = $commentslib->get_forum($_REQUEST["forumId"]);
......
......@@ -6,7 +6,7 @@
// $Id$
require_once ('tiki-setup.php');
include_once ('lib/commentslib.php');
include_once ('lib/comments/commentslib.php');
$auto_query_args = array('types_section', 'types', 'show_types', 'sort_mode', 'offset', 'find', 'findfilter_approved');
if (isset($_REQUEST['blogId'])) {
......
......@@ -53,7 +53,7 @@ function list_perms($objectId, $objectType, $objectName) {
return array('objectId' => $objectId, 'special' => $ret);
}
$types = array('wiki page', 'file gallery', 'tracker', 'forum', 'group');
include_once ("lib/commentslib.php"); global $commentslib; $commentslib = new Comments($dbTiki);
include_once ("lib/comments/commentslib.php"); global $commentslib; $commentslib = new Comments($dbTiki);
$all_groups = $userlib->list_all_groups();
$res = array();
foreach($types as $type) {
......
......@@ -73,7 +73,7 @@ if ($prefs['feature_trackers'] == 'y') {
if ($prefs['feature_forums'] == 'y') {
$mytiki_forum_replies = $tikilib->get_user_preference($user, 'mytiki_forum_replies', 'y');
if ($mytiki_forum_replies == 'y') {
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
$user_forum_replies = $commentslib->get_user_forum_comments($userwatch, -1, 'replies');
$smarty->assign_by_ref('user_forum_replies', $user_forum_replies);
......@@ -81,7 +81,7 @@ if ($prefs['feature_forums'] == 'y') {
}
$mytiki_forum_topics = $tikilib->get_user_preference($user, 'mytiki_forum_topics', 'y');
if ($mytiki_forum_topics == 'y') {
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
$user_forum_topics = $commentslib->get_user_forum_comments($userwatch, -1, 'topics');
$smarty->assign_by_ref('user_forum_topics', $user_forum_topics);
......
......@@ -61,7 +61,7 @@ if ($where == 'forums') {
if (!empty($_REQUEST['forumId'])) {
$filter['forumId'] = $_REQUEST['forumId'];
global $commentslib;
include ('lib/commentslib.php');
include ('lib/comments/commentslib.php');
if (!isset($commentslib)) $commentslib = new Comments($dbTiki);
$forum_info = $commentslib->get_forum($_REQUEST['forumId']);
$where = 'forum';
......
......@@ -67,7 +67,7 @@ if ($where == 'forums') {
if (!empty($_REQUEST['forumId'])) {
$filter['forumId'] = $_REQUEST['forumId'];
global $commentslib;
include ('lib/commentslib.php');
include ('lib/comments/commentslib.php');
if (!isset($commentslib)) $commentslib = new Comments($dbTiki);
$forum_info = $commentslib->get_forum($_REQUEST['forumId']);
$where = 'forum';
......
......@@ -62,7 +62,7 @@ if (empty($_REQUEST['report']) || $_REQUEST['report'] != 'y') {
$smarty->assign('messageto', (isset($_REQUEST['messageto'])?$_REQUEST['messageto']:''));
if (isset($prefs['feature_forums']) and $prefs['feature_forums']=='y') {
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki); // not done in commentslib
$sort_mode = $prefs['forums_ordering'];
$channels = $commentslib->list_forums(0, -1, $sort_mode, '');
......
......@@ -46,7 +46,7 @@ switch ($_REQUEST['type']) {
break;
case 'forum':
require_once ('lib/commentslib.php');
require_once ('lib/comments/commentslib.php');
if (!isset($commentslib)) {
$commentslib = new Comments($dbTiki);
}
......
......@@ -137,7 +137,7 @@ if ($prefs['feature_display_my_to_others'] == 'y') {
$smarty->assign_by_ref('user_articles', $user_articles);
}
if ($prefs['feature_forums'] == 'y') {
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
$user_forum_comments = $commentslib->get_user_forum_comments($userwatch, -1);
$smarty->assign_by_ref('user_forum_comments', $user_forum_comments);
......
......@@ -8,7 +8,7 @@
$section = 'cms';
require_once ('tiki-setup.php');
include_once ('lib/articles/artlib.php');
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
if ($prefs['feature_freetags'] == 'y') {
include_once ('lib/freetag/freetaglib.php');
}
......
......@@ -31,7 +31,7 @@ $auto_query_args = array(
'filter_type',
'reply_state'
);
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
if (!isset($_REQUEST["forumId"]) || !($forum_info = $commentslib->get_forum($_REQUEST["forumId"]))) {
$smarty->assign('errortype', 'no_redirect_login');
......
......@@ -10,7 +10,7 @@ require_once ('tiki-setup.php');
$access->check_feature('feature_forums');
include_once ("lib/commentslib.php");
include_once ("lib/comments/commentslib.php");
$commentslib = new Comments($dbTiki);
if (!isset($_REQUEST['comments_parentId']) && isset($_REQUEST['threadId'])) {
$_REQUEST['comments_parentId'] = $_REQUEST['threadId'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment