1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-30 21:45:01 +03:00

1. Исключены константы из /classes/modules/ и /classes/actions/

2. (!) В loader.php окончательно отключен define constants.
This commit is contained in:
Alexey Kachayev 2009-08-20 12:50:14 +00:00
parent 9be9867ec9
commit d40e6e5104
13 changed files with 118 additions and 111 deletions

View file

@ -21,7 +21,7 @@ class ActionSearch extends Action {
function EventOpenSearch(){
Router::SetIsShowStats(false);
$this->Viewer_Assign('sAdminMail', SYS_MAIL_FROM_EMAIL);
$this->Viewer_Assign('sAdminMail', Config::Get('sys.mail.from_email'));
}
/**
* Поиск топиков

View file

@ -37,7 +37,7 @@ class LsACL extends Module {
* @return bool
*/
public function CanCreateBlog(UserEntity_User $oUser) {
if ($oUser->getRating()>=ACL_CAN_CREATE_BLOG) {
if ($oUser->getRating()>=Config::Get('acl.create.blog.rating')) {
return true;
}
return false;

View file

@ -23,7 +23,7 @@ class Mapper_Blog extends Mapper {
}
public function AddBlog(BlogEntity_Blog $oBlog) {
$sql = "INSERT INTO ".DB_TABLE_BLOG."
$sql = "INSERT INTO ".Config::Get('db.table.blog')."
(user_owner_id,
blog_title,
blog_description,
@ -43,7 +43,7 @@ class Mapper_Blog extends Mapper {
}
public function UpdateBlog(BlogEntity_Blog $oBlog) {
$sql = "UPDATE ".DB_TABLE_BLOG."
$sql = "UPDATE ".Config::Get('db.table.blog')."
SET
blog_title= ?,
blog_description= ?,
@ -73,7 +73,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
b.*
FROM
".DB_TABLE_BLOG." as b
".Config::Get('db.table.blog')." as b
WHERE
b.blog_id IN(?a)
ORDER BY FIELD(b.blog_id,?a) ";
@ -87,7 +87,7 @@ class Mapper_Blog extends Mapper {
}
public function AddRelationBlogUser(BlogEntity_BlogUser $oBlogUser) {
$sql = "INSERT INTO ".DB_TABLE_BLOG_USER."
$sql = "INSERT INTO ".Config::Get('db.table.blog_user')."
(blog_id,
user_id
)
@ -100,7 +100,7 @@ class Mapper_Blog extends Mapper {
}
public function DeleteRelationBlogUser(BlogEntity_BlogUser $oBlogUser) {
$sql = "DELETE FROM ".DB_TABLE_BLOG_USER."
$sql = "DELETE FROM ".Config::Get('db.table.blog_user')."
WHERE
blog_id = ?d
AND
@ -113,7 +113,7 @@ class Mapper_Blog extends Mapper {
}
public function UpdateRelationBlogUser(BlogEntity_BlogUser $oBlogUser) {
$sql = "UPDATE ".DB_TABLE_BLOG_USER."
$sql = "UPDATE ".Config::Get('db.table.blog_user')."
SET
is_moderator= ?,
is_administrator= ?
@ -145,7 +145,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
bu.*
FROM
".DB_TABLE_BLOG_USER." as bu
".Config::Get('db.table.blog_user')." as bu
WHERE
".$sWhere."
;
@ -167,7 +167,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
bu.*
FROM
".DB_TABLE_BLOG_USER." as bu
".Config::Get('db.table.blog_user')." as bu
WHERE
bu.user_id = ?d
AND
@ -183,7 +183,7 @@ class Mapper_Blog extends Mapper {
public function GetPersonalBlogByUserId($sUserId) {
$sql = "SELECT blog_id FROM ".DB_TABLE_BLOG." WHERE user_owner_id = ?d and blog_type='personal'";
$sql = "SELECT blog_id FROM ".Config::Get('db.table.blog')." WHERE user_owner_id = ?d and blog_type='personal'";
if ($aRow=$this->oDb->selectRow($sql,$sUserId)) {
return $aRow['blog_id'];
}
@ -192,7 +192,7 @@ class Mapper_Blog extends Mapper {
public function GetBlogByTitle($sTitle) {
$sql = "SELECT blog_id FROM ".DB_TABLE_BLOG." WHERE blog_title = ? ";
$sql = "SELECT blog_id FROM ".Config::Get('db.table.blog')." WHERE blog_title = ? ";
if ($aRow=$this->oDb->selectRow($sql,$sTitle)) {
return $aRow['blog_id'];
}
@ -206,7 +206,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
b.blog_id
FROM
".DB_TABLE_BLOG." as b
".Config::Get('db.table.blog')." as b
WHERE
b.blog_url = ?
";
@ -220,7 +220,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
b.blog_id
FROM
".DB_TABLE_BLOG." as b
".Config::Get('db.table.blog')." as b
WHERE
b.user_owner_id = ?
AND
@ -239,7 +239,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
b.blog_id
FROM
".DB_TABLE_BLOG." as b
".Config::Get('db.table.blog')." as b
WHERE
b.blog_type<>'personal'
";
@ -256,7 +256,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
b.blog_id
FROM
".DB_TABLE_BLOG." as b
".Config::Get('db.table.blog')." as b
WHERE
b.blog_type<>'personal'
ORDER by b.blog_rating desc
@ -274,8 +274,8 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
b.*
FROM
".DB_TABLE_BLOG_USER." as bu,
".DB_TABLE_BLOG." as b
".Config::Get('db.table.blog_user')." as bu,
".Config::Get('db.table.blog')." as b
WHERE
bu.user_id = ?d
AND
@ -299,7 +299,7 @@ class Mapper_Blog extends Mapper {
$sql = "SELECT
b.*
FROM
".DB_TABLE_BLOG." as b
".Config::Get('db.table.blog')." as b
WHERE
b.user_owner_id = ?d
AND

View file

@ -21,7 +21,7 @@ class Mapper_Comment extends Mapper {
$sql = "SELECT
comment_id
FROM
".DB_TABLE_COMMENT."
".Config::Get('db.table.comment')."
WHERE
target_type = ?
AND
@ -44,7 +44,7 @@ class Mapper_Comment extends Mapper {
}
public function GetCommentUnique($sTargetId,$sTargetType,$sUserId,$sCommentPid,$sHash) {
$sql = "SELECT comment_id FROM ".DB_TABLE_COMMENT."
$sql = "SELECT comment_id FROM ".Config::Get('db.table.comment')."
WHERE
target_id = ?d
AND
@ -66,7 +66,7 @@ class Mapper_Comment extends Mapper {
$sql = "SELECT
comment_id
FROM
".DB_TABLE_COMMENT."
".Config::Get('db.table.comment')."
WHERE
target_type = ?
AND
@ -93,7 +93,7 @@ class Mapper_Comment extends Mapper {
$sql = "SELECT
*
FROM
".DB_TABLE_COMMENT."
".Config::Get('db.table.comment')."
WHERE
comment_id IN(?a)
ORDER by FIELD(comment_id,?a)";
@ -111,7 +111,7 @@ class Mapper_Comment extends Mapper {
$sql = "SELECT
comment_id
FROM
".DB_TABLE_COMMENT_ONLINE."
".Config::Get('db.table.comment_online')."
WHERE
target_type = ?
ORDER by comment_online_id desc limit 0, ?d ; ";
@ -130,7 +130,7 @@ class Mapper_Comment extends Mapper {
comment_id as ARRAY_KEY,
comment_pid as PARENT_KEY
FROM
".DB_TABLE_COMMENT."
".Config::Get('db.table.comment')."
WHERE
target_id = ?d
AND
@ -147,7 +147,7 @@ class Mapper_Comment extends Mapper {
$sql = "SELECT
comment_id
FROM
".DB_TABLE_COMMENT."
".Config::Get('db.table.comment')."
WHERE
target_id = ?d
AND
@ -169,7 +169,7 @@ class Mapper_Comment extends Mapper {
$sql = "SELECT
comment_id
FROM
".DB_TABLE_COMMENT."
".Config::Get('db.table.comment')."
WHERE
user_id = ?d
AND
@ -193,7 +193,7 @@ class Mapper_Comment extends Mapper {
$sql = "SELECT
count(comment_id) as count
FROM
".DB_TABLE_COMMENT."
".Config::Get('db.table.comment')."
WHERE
user_id = ?d
AND
@ -210,7 +210,7 @@ class Mapper_Comment extends Mapper {
}
public function AddComment(CommentEntity_Comment $oComment) {
$sql = "INSERT INTO ".DB_TABLE_COMMENT."
$sql = "INSERT INTO ".Config::Get('db.table.comment')."
(comment_pid,
target_id,
target_type,
@ -232,7 +232,7 @@ class Mapper_Comment extends Mapper {
public function AddCommentOnline(CommentEntity_CommentOnline $oCommentOnline) {
$sql = "REPLACE INTO ".DB_TABLE_COMMENT_ONLINE."
$sql = "REPLACE INTO ".Config::Get('db.table.comment_online')."
SET
target_id= ?d ,
target_type= ? ,
@ -246,7 +246,7 @@ class Mapper_Comment extends Mapper {
}
public function DeleteCommentOnlineByTargetId($sTargetId,$sTargetType) {
$sql = "DELETE FROM ".DB_TABLE_COMMENT_ONLINE." WHERE target_id = ?d and target_type = ? ";
$sql = "DELETE FROM ".Config::Get('db.table.comment_online')." WHERE target_id = ?d and target_type = ? ";
if ($this->oDb->query($sql,$sTargetId,$sTargetType))
{
return true;
@ -257,7 +257,7 @@ class Mapper_Comment extends Mapper {
public function UpdateComment(CommentEntity_Comment $oComment) {
$sql = "UPDATE ".DB_TABLE_COMMENT."
$sql = "UPDATE ".Config::Get('db.table.comment')."
SET
comment_text= ?,
comment_rating= ?f,
@ -275,7 +275,7 @@ class Mapper_Comment extends Mapper {
}
public function SetCommentsPublish($sTargetId,$sTargetType,$iPublish) {
$sql = "UPDATE ".DB_TABLE_COMMENT."
$sql = "UPDATE ".Config::Get('db.table.comment')."
SET
comment_publish= ?
WHERE

View file

@ -18,7 +18,7 @@
class Mapper_Page extends Mapper {
public function AddPage(PageEntity_Page $oPage) {
$sql = "INSERT INTO ".DB_TABLE_PAGE."
$sql = "INSERT INTO ".Config::Get('db.table.page')."
(page_pid,
page_url,
page_url_full,
@ -39,7 +39,7 @@ class Mapper_Page extends Mapper {
}
public function UpdatePage(PageEntity_Page $oPage) {
$sql = "UPDATE ".DB_TABLE_PAGE."
$sql = "UPDATE ".Config::Get('db.table.page')."
SET page_pid = ? ,
page_url = ? ,
page_url_full = ? ,
@ -59,7 +59,7 @@ class Mapper_Page extends Mapper {
}
public function SetPagesPidToNull() {
$sql = "UPDATE ".DB_TABLE_PAGE."
$sql = "UPDATE ".Config::Get('db.table.page')."
SET
page_pid = null,
page_url_full = page_url
@ -72,7 +72,7 @@ class Mapper_Page extends Mapper {
}
public function GetPageByUrlFull($sUrlFull,$iActive) {
$sql = "SELECT * FROM ".DB_TABLE_PAGE." WHERE page_url_full = ? and page_active = ?d ";
$sql = "SELECT * FROM ".Config::Get('db.table.page')." WHERE page_url_full = ? and page_active = ?d ";
if ($aRow=$this->oDb->selectRow($sql,$sUrlFull,$iActive)) {
return new PageEntity_Page($aRow);
}
@ -80,7 +80,7 @@ class Mapper_Page extends Mapper {
}
public function GetPageById($sId) {
$sql = "SELECT * FROM ".DB_TABLE_PAGE." WHERE page_id = ? ";
$sql = "SELECT * FROM ".Config::Get('db.table.page')." WHERE page_id = ? ";
if ($aRow=$this->oDb->selectRow($sql,$sId)) {
return new PageEntity_Page($aRow);
}
@ -88,7 +88,7 @@ class Mapper_Page extends Mapper {
}
public function deletePageById($sId) {
$sql = "DELETE FROM ".DB_TABLE_PAGE." WHERE page_id = ? ";
$sql = "DELETE FROM ".Config::Get('db.table.page')." WHERE page_id = ? ";
if ($aRow=$this->oDb->selectRow($sql,$sId)) {
return true;
}
@ -101,7 +101,7 @@ class Mapper_Page extends Mapper {
page_id as ARRAY_KEY,
page_pid as PARENT_KEY
FROM
".DB_TABLE_PAGE."
".Config::Get('db.table.page')."
ORDER by page_title asc;
";
if ($aRows=$this->oDb->select($sql)) {
@ -111,7 +111,7 @@ class Mapper_Page extends Mapper {
}
public function GetCountPage() {
$sql = "SELECT count(*) as count FROM ".DB_TABLE_PAGE." ";
$sql = "SELECT count(*) as count FROM ".Config::Get('db.table.page')." ";
if ($aRow=$this->oDb->selectRow($sql)) {
return $aRow['count'];
}
@ -122,7 +122,7 @@ class Mapper_Page extends Mapper {
$sql = "SELECT
*
FROM
".DB_TABLE_PAGE."
".Config::Get('db.table.page')."
WHERE
page_pid = ? ";
$aResult=array();

View file

@ -17,7 +17,7 @@
class Mapper_Talk extends Mapper {
public function AddTalk(TalkEntity_Talk $oTalk) {
$sql = "INSERT INTO ".DB_TABLE_TALK."
$sql = "INSERT INTO ".Config::Get('db.table.talk')."
(user_id,
talk_title,
talk_text,
@ -35,7 +35,7 @@ class Mapper_Talk extends Mapper {
}
public function UpdateTalk(TalkEntity_Talk $oTalk) {
$sql = "UPDATE ".DB_TABLE_TALK." SET
$sql = "UPDATE ".Config::Get('db.table.talk')." SET
talk_date_last = ? ,
talk_count_comment = ?
WHERE
@ -52,7 +52,7 @@ class Mapper_Talk extends Mapper {
$sql = "SELECT
t.*
FROM
".DB_TABLE_TALK." as t
".Config::Get('db.table.talk')." as t
WHERE
t.talk_id IN(?a)
ORDER BY FIELD(t.talk_id,?a) ";
@ -73,7 +73,7 @@ class Mapper_Talk extends Mapper {
$sql = "SELECT
t.*
FROM
".DB_TABLE_TALK_USER." as t
".Config::Get('db.table.talk_user')." as t
WHERE
t.user_id = ?d
AND
@ -93,7 +93,7 @@ class Mapper_Talk extends Mapper {
t.*,
u.user_login as user_login
FROM
".DB_TABLE_TALK." as t,
".Config::Get('db.table.talk')." as t,
".Config::Get('db.table.user')." as u
WHERE
t.talk_id = ?d
@ -108,7 +108,7 @@ class Mapper_Talk extends Mapper {
public function AddTalkUser(TalkEntity_TalkUser $oTalkUser) {
$sql = "INSERT INTO ".DB_TABLE_TALK_USER."
$sql = "INSERT INTO ".Config::Get('db.table.talk_user')."
(talk_id,
user_id,
date_last
@ -123,7 +123,7 @@ class Mapper_Talk extends Mapper {
}
public function UpdateTalkUser(TalkEntity_TalkUser $oTalkUser) {
$sql = "UPDATE ".DB_TABLE_TALK_USER."
$sql = "UPDATE ".Config::Get('db.table.talk_user')."
SET
date_last = ?,
comment_id_last = ?d,
@ -145,7 +145,7 @@ class Mapper_Talk extends Mapper {
$aTalkId=array($aTalkId);
}
$sql = "DELETE FROM ".DB_TABLE_TALK_USER."
$sql = "DELETE FROM ".Config::Get('db.table.talk_user')."
WHERE
talk_id IN (?a)
AND
@ -165,7 +165,7 @@ class Mapper_Talk extends Mapper {
SELECT
SUM(tu.comment_count_new) as count_new
FROM
".DB_TABLE_TALK_USER." as tu
".Config::Get('db.table.talk_user')." as tu
WHERE
tu.user_id = ?d
";
@ -180,7 +180,7 @@ class Mapper_Talk extends Mapper {
SELECT
COUNT(tu.talk_id) as count_new
FROM
".DB_TABLE_TALK_USER." as tu
".Config::Get('db.table.talk_user')." as tu
WHERE
tu.date_last IS NULL
AND
@ -196,8 +196,8 @@ class Mapper_Talk extends Mapper {
$sql = "SELECT
tu.talk_id
FROM
".DB_TABLE_TALK_USER." as tu,
".DB_TABLE_TALK." as t
".Config::Get('db.table.talk_user')." as tu,
".Config::Get('db.table.talk')." as t
WHERE
tu.user_id = ?d
AND
@ -218,7 +218,7 @@ class Mapper_Talk extends Mapper {
$sql = "SELECT
user_id
FROM
".DB_TABLE_TALK_USER."
".Config::Get('db.table.talk_user')."
WHERE
talk_id = ? ";
$aReturn=array();
@ -236,7 +236,7 @@ class Mapper_Talk extends Mapper {
}
$sql = "UPDATE
".DB_TABLE_TALK_USER."
".Config::Get('db.table.talk_user')."
SET comment_count_new=comment_count_new+1
WHERE
talk_id = ?

View file

@ -18,7 +18,7 @@
class Mapper_Topic extends Mapper {
public function AddTopic(TopicEntity_Topic $oTopic) {
$sql = "INSERT INTO ".DB_TABLE_TOPIC."
$sql = "INSERT INTO ".Config::Get('db.table.topic')."
(blog_id,
user_id,
topic_type,
@ -46,7 +46,7 @@ class Mapper_Topic extends Mapper {
}
public function AddTopicContent(TopicEntity_Topic $oTopic) {
$sql = "INSERT INTO ".DB_TABLE_TOPIC_CONTENT."
$sql = "INSERT INTO ".Config::Get('db.table.topic_content')."
(topic_id,
topic_text,
topic_text_short,
@ -64,7 +64,7 @@ class Mapper_Topic extends Mapper {
}
public function AddTopicTag(TopicEntity_TopicTag $oTopicTag) {
$sql = "INSERT INTO ".DB_TABLE_TOPIC_TAG."
$sql = "INSERT INTO ".Config::Get('db.table.topic_tag')."
(topic_id,
user_id,
blog_id,
@ -82,7 +82,7 @@ class Mapper_Topic extends Mapper {
public function DeleteTopicTagsByTopicId($sTopicId) {
$sql = "DELETE FROM ".DB_TABLE_TOPIC_TAG."
$sql = "DELETE FROM ".Config::Get('db.table.topic_tag')."
WHERE
topic_id = ?d
";
@ -93,7 +93,7 @@ class Mapper_Topic extends Mapper {
}
public function DeleteTopic($sTopicId) {
$sql = "DELETE FROM ".DB_TABLE_TOPIC."
$sql = "DELETE FROM ".Config::Get('db.table.topic')."
WHERE
topic_id = ?d
";
@ -105,7 +105,7 @@ class Mapper_Topic extends Mapper {
public function GetTopicUnique($sUserId,$sHash) {
$sql = "SELECT topic_id FROM ".DB_TABLE_TOPIC."
$sql = "SELECT topic_id FROM ".Config::Get('db.table.topic')."
WHERE
user_id = ?d
AND
@ -126,8 +126,8 @@ class Mapper_Topic extends Mapper {
t.*,
tc.*
FROM
".DB_TABLE_TOPIC." as t
JOIN ".DB_TABLE_TOPIC_CONTENT." AS tc ON t.topic_id=tc.topic_id
".Config::Get('db.table.topic')." as t
JOIN ".Config::Get('db.table.topic_content')." AS tc ON t.topic_id=tc.topic_id
WHERE
t.topic_id IN(?a)
ORDER BY FIELD(t.topic_id,?a) ";
@ -147,8 +147,8 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
t.topic_id
FROM
".DB_TABLE_TOPIC." as t,
".DB_TABLE_BLOG." as b
".Config::Get('db.table.topic')." as t,
".Config::Get('db.table.blog')." as b
WHERE
1=1
".$sWhere."
@ -170,8 +170,8 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
count(t.topic_id) as count
FROM
".DB_TABLE_TOPIC." as t,
".DB_TABLE_BLOG." as b
".Config::Get('db.table.topic')." as t,
".Config::Get('db.table.blog')." as b
WHERE
1=1
@ -190,7 +190,7 @@ class Mapper_Topic extends Mapper {
SELECT
topic_id
FROM
".DB_TABLE_TOPIC_TAG."
".Config::Get('db.table.topic_tag')."
WHERE
topic_tag_text = ?
ORDER BY topic_id DESC
@ -210,7 +210,7 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
t.topic_id
FROM
".DB_TABLE_TOPIC." as t
".Config::Get('db.table.topic')." as t
WHERE
t.topic_publish = 1
AND
@ -233,7 +233,7 @@ class Mapper_Topic extends Mapper {
tt.topic_tag_text,
count(tt.topic_tag_text) as count
FROM
".DB_TABLE_TOPIC_TAG." as tt
".Config::Get('db.table.topic_tag')." as tt
GROUP BY
tt.topic_tag_text
ORDER BY
@ -259,7 +259,7 @@ class Mapper_Topic extends Mapper {
public function increaseTopicCountComment($sTopicId) {
$sql = "UPDATE ".DB_TABLE_TOPIC."
$sql = "UPDATE ".Config::Get('db.table.topic')."
SET
topic_count_comment=topic_count_comment+1
WHERE
@ -272,7 +272,7 @@ class Mapper_Topic extends Mapper {
}
public function UpdateTopic(TopicEntity_Topic $oTopic) {
$sql = "UPDATE ".DB_TABLE_TOPIC."
$sql = "UPDATE ".Config::Get('db.table.topic')."
SET
blog_id= ?d,
topic_title= ?,
@ -301,7 +301,7 @@ class Mapper_Topic extends Mapper {
}
public function UpdateTopicContent(TopicEntity_Topic $oTopic) {
$sql = "UPDATE ".DB_TABLE_TOPIC_CONTENT."
$sql = "UPDATE ".Config::Get('db.table.topic_content')."
SET
topic_text= ?,
topic_text_short= ?,
@ -350,7 +350,7 @@ class Mapper_Topic extends Mapper {
public function AddFavouriteTopic(TopicEntity_FavouriteTopic $oFavouriteTopic) {
$sql = "INSERT INTO ".DB_TABLE_FAVOURITE_TOPIC."
$sql = "INSERT INTO ".Config::Get('db.table.favourite_topic')."
(user_id,
topic_id,
topic_publish
@ -365,7 +365,7 @@ class Mapper_Topic extends Mapper {
}
public function DeleteFavouriteTopic(TopicEntity_FavouriteTopic $oFavouriteTopic) {
$sql = "DELETE FROM ".DB_TABLE_FAVOURITE_TOPIC."
$sql = "DELETE FROM ".Config::Get('db.table.favourite_topic')."
WHERE
user_id = ?d
AND
@ -379,7 +379,7 @@ class Mapper_Topic extends Mapper {
}
public function SetFavouriteTopicPublish($sTopicId,$iPublish) {
$sql = "UPDATE ".DB_TABLE_FAVOURITE_TOPIC."
$sql = "UPDATE ".Config::Get('db.table.favourite_topic')."
SET
topic_publish = ?d
WHERE
@ -397,7 +397,7 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
f.*
FROM
".DB_TABLE_FAVOURITE_TOPIC." as f
".Config::Get('db.table.favourite_topic')." as f
WHERE
f.user_id = ?d
AND
@ -417,7 +417,7 @@ class Mapper_Topic extends Mapper {
SELECT
topic_id
FROM
".DB_TABLE_FAVOURITE_TOPIC."
".Config::Get('db.table.favourite_topic')."
WHERE
user_id = ?
and
@ -438,7 +438,7 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
count(topic_id) as count
FROM
".DB_TABLE_FAVOURITE_TOPIC."
".Config::Get('db.table.favourite_topic')."
WHERE
user_id = ?
and
@ -455,7 +455,7 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
topic_tag_text
FROM
".DB_TABLE_TOPIC_TAG."
".Config::Get('db.table.topic_tag')."
WHERE
topic_tag_text LIKE ?
GROUP BY
@ -472,7 +472,7 @@ class Mapper_Topic extends Mapper {
}
public function UpdateTopicRead(TopicEntity_TopicRead $oTopicRead) {
$sql = "UPDATE ".DB_TABLE_TOPIC_READ."
$sql = "UPDATE ".Config::Get('db.table.topic_read')."
SET
comment_count_last = ? ,
comment_id_last = ? ,
@ -486,7 +486,7 @@ class Mapper_Topic extends Mapper {
}
public function AddTopicRead(TopicEntity_TopicRead $oTopicRead) {
$sql = "INSERT INTO ".DB_TABLE_TOPIC_READ."
$sql = "INSERT INTO ".Config::Get('db.table.topic_read')."
SET
comment_count_last = ? ,
comment_id_last = ? ,
@ -506,7 +506,7 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
t.*
FROM
".DB_TABLE_TOPIC_READ." as t
".Config::Get('db.table.topic_read')." as t
WHERE
t.user_id = ?d
AND
@ -522,7 +522,7 @@ class Mapper_Topic extends Mapper {
}
public function AddTopicQuestionVote(TopicEntity_TopicQuestionVote $oTopicQuestionVote) {
$sql = "INSERT INTO ".DB_TABLE_TOPIC_QUESTION_VOTE."
$sql = "INSERT INTO ".Config::Get('db.table.topic_question_vote')."
(topic_id,
user_voter_id,
answer
@ -545,7 +545,7 @@ class Mapper_Topic extends Mapper {
$sql = "SELECT
v.*
FROM
".DB_TABLE_TOPIC_QUESTION_VOTE." as v
".Config::Get('db.table.topic_question_vote')." as v
WHERE
v.user_voter_id = ?d
AND

View file

@ -416,7 +416,7 @@ class LsUser extends Module {
* Ставим куку
*/
if ($bRemember) {
setcookie('key',$sKey,time()+60*60*24*3,SYS_COOKIE_PATH,SYS_COOKIE_HOST);
setcookie('key',$sKey,time()+60*60*24*3,Config::Get('sys.cookie.path'),Config::Get('sys.cookie.host'));
}
}
/**
@ -470,7 +470,7 @@ class LsUser extends Module {
/**
* Дропаем куку
*/
setcookie('key','',1,SYS_COOKIE_PATH,SYS_COOKIE_HOST);
setcookie('key','',1,Config::Get('sys.cookie.path'),Config::Get('sys.cookie.host'));
}
/**
* Обновление данных сессии

View file

@ -110,7 +110,7 @@ class Mapper_User extends Mapper {
$sql = "SELECT
s.user_id
FROM
".DB_TABLE_SESSION." as s
".Config::Get('db.table.session')." as s
WHERE
s.session_key = ?
";
@ -121,7 +121,7 @@ class Mapper_User extends Mapper {
}
public function CreateSession(UserEntity_Session $oSession) {
$sql = "REPLACE INTO ".DB_TABLE_SESSION."
$sql = "REPLACE INTO ".Config::Get('db.table.session')."
SET
session_key = ? ,
user_id = ? ,
@ -134,7 +134,7 @@ class Mapper_User extends Mapper {
}
public function UpdateSession(UserEntity_Session $oSession) {
$sql = "UPDATE ".DB_TABLE_SESSION."
$sql = "UPDATE ".Config::Get('db.table.session')."
SET
session_ip_last = ? ,
session_date_last = ?
@ -151,7 +151,7 @@ class Mapper_User extends Mapper {
$sql = "SELECT
s.*
FROM
".DB_TABLE_SESSION." as s
".Config::Get('db.table.session')." as s
WHERE
s.user_id IN(?a) ";
$aRes=array();
@ -173,7 +173,7 @@ class Mapper_User extends Mapper {
IF(ua.user_id IS NULL,0,1) as user_is_administrator
FROM
".Config::Get('db.table.user')." as u
LEFT JOIN ".DB_TABLE_USER_ADMINISTRATOR." AS ua ON u.user_id=ua.user_id
LEFT JOIN ".Config::Get('db.table.user_administrator')." AS ua ON u.user_id=ua.user_id
WHERE
u.user_id IN(?a)
ORDER BY FIELD(u.user_id,?a) ";
@ -229,7 +229,7 @@ class Mapper_User extends Mapper {
$sql = "SELECT
user_id
FROM
".DB_TABLE_SESSION."
".Config::Get('db.table.session')."
ORDER BY
session_date_last DESC
LIMIT 0, ?d
@ -291,7 +291,7 @@ class Mapper_User extends Mapper {
}
public function GetCountUsersActive($sDateActive) {
$sql = "SELECT count(user_id) as count FROM ".DB_TABLE_SESSION." WHERE session_date_last >= ? ";
$sql = "SELECT count(user_id) as count FROM ".Config::Get('db.table.session')." WHERE session_date_last >= ? ";
$result=$this->oDb->selectRow($sql,$sDateActive);
return $result['count'];
}
@ -316,7 +316,7 @@ class Mapper_User extends Mapper {
".Config::Get('db.table.country_user')."
GROUP BY country_id LIMIT 0, ?d
) as cu
JOIN ".DB_TABLE_COUNTRY." as c on cu.country_id=c.country_id
JOIN ".Config::Get('db.table.country')." as c on cu.country_id=c.country_id
ORDER BY c.country_name
";
$result=$this->oDb->select($sql,$sLimit);
@ -333,10 +333,10 @@ class Mapper_User extends Mapper {
count(user_id) as count,
city_id
FROM
".DB_TABLE_CITY_USER."
".Config::Get('db.table.city_user')."
GROUP BY city_id LIMIT 0, ?d
) as cu
JOIN ".DB_TABLE_CITY." as c on cu.city_id=c.city_id
JOIN ".Config::Get('db.table.city')." as c on cu.city_id=c.city_id
ORDER BY c.city_name
";
$result=$this->oDb->select($sql,$sLimit);
@ -574,8 +574,8 @@ class Mapper_User extends Mapper {
$sql = "
SELECT cu.user_id
FROM
".DB_TABLE_CITY." as c,
".DB_TABLE_CITY_USER." as cu
".Config::Get('db.table.city')." as c,
".Config::Get('db.table.city_user')." as cu
WHERE
c.city_name = ?
AND
@ -604,7 +604,7 @@ class Mapper_User extends Mapper {
public function SetCityUser($sCityId,$sUserId) {
$sql = "REPLACE ".DB_TABLE_CITY_USER."
$sql = "REPLACE ".Config::Get('db.table.city_user')."
SET
city_id = ? ,
user_id = ?
@ -613,7 +613,7 @@ class Mapper_User extends Mapper {
}
public function GetCityByName($sName) {
$sql = "SELECT * FROM ".DB_TABLE_CITY." WHERE city_name = ? ";
$sql = "SELECT * FROM ".Config::Get('db.table.city')." WHERE city_name = ? ";
if ($aRow=$this->oDb->selectRow($sql,$sName)) {
return new UserEntity_City($aRow);
}
@ -621,7 +621,7 @@ class Mapper_User extends Mapper {
}
public function AddCity(UserEntity_City $oCity) {
$sql = "INSERT INTO ".DB_TABLE_CITY."
$sql = "INSERT INTO ".Config::Get('db.table.city')."
(city_name)
VALUES(?)
";
@ -635,7 +635,7 @@ class Mapper_User extends Mapper {
$sql = "SELECT
*
FROM
".DB_TABLE_CITY."
".Config::Get('db.table.city')."
WHERE
city_name LIKE ?
LIMIT 0, ?d

View file

@ -19,7 +19,7 @@ class Mapper_Vote extends Mapper {
public function AddVote(VoteEntity_Vote $oVote) {
$sql = "INSERT INTO ".DB_TABLE_VOTE."
$sql = "INSERT INTO ".Config::Get('db.table.vote')."
(target_id,
target_type,
user_voter_id,
@ -44,7 +44,7 @@ class Mapper_Vote extends Mapper {
$sql = "SELECT
*
FROM
".DB_TABLE_VOTE."
".Config::Get('db.table.vote')."
WHERE
target_id IN(?a)
AND

View file

@ -19,7 +19,11 @@
*/
require_once(dirname(__FILE__)."/../engine/lib/internal/ConfigSimple/Config.class.php");
Config::LoadFromFile(dirname(__FILE__).'/config.php');
Config::DefineConstant();
//
// Рефакторниг:
// Переход на новую систему конфиг-массивов
// Config::DefineConstant();
//
/**
* Загружает конфиги модулей вида /config/modules/[module_name]/config.php
@ -116,6 +120,9 @@ if ($hDirConfig = opendir($sDirConfig)) {
}
closedir($hDirConfig);
}
Config::DefineConstant();
//
// Рефакторниг:
// Переход на новую систему конфиг-массивов
// Config::DefineConstant();
//
?>

View file

@ -75,7 +75,7 @@ class LsText extends Module {
$this->oJevix->cfgSetTagNoAutoBr(array('ul','ol'));
// Теги с обязательными параметрами
$this->oJevix->cfgSetTagParamsAutoAdd('embed',array(array('name'=>'wmode','value'=>'opaque','rewrite'=>true)));
if (BLOG_URL_NO_INDEX) {
if (Config::Get('view.noindex')) {
$this->oJevix->cfgSetTagParamsAutoAdd('a',array(array('name'=>'rel','value'=>'nofollow','rewrite'=>true)));
}
// Отключение авто-добавления <br>

View file

@ -1,7 +1,7 @@
<ul class="menu">
<li {if $sMenuSubItemSelect=='add'}class="active"{/if}>
<a href="{$aConfig.path.root.web}/{if $sMenuItemSelect=='add_blog'}{$ROUTE_PAGE_TOPIC}{else}{$sMenuItemSelect}{/if}/add/">{$aLang.topic_menu_add}</a>
<a href="{$aConfig.path.root.web}/{if $sMenuItemSelect=='add_blog'}topic{else}{$sMenuItemSelect}{/if}/add/">{$aLang.topic_menu_add}</a>
{if $sMenuSubItemSelect=='add'}
<ul class="sub-menu" >
<li {if $sMenuItemSelect=='topic'}class="active"{/if}><div><a href="{router page='topic'}{$sMenuSubItemSelect}/">{$aLang.topic_menu_add_topic}</a></div></li>