Changeset 625


Ignore:
Timestamp:
11/27/10 16:17:09 (18 months ago)
Author:
r2
Message:

trunk+fuze

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/applets/menu.php

    r594 r625  
    7171                $toolmenu[4]['title'] = 'Ñêðûòü âûáðàííûå'; 
    7272                $toolmenu[4]['link'] = "javascript:checkSel('?view=menu&do=hide&multiple=1');"; 
    73  
    74                 $toolmenu[6]['icon'] = 'reorder.gif'; 
    75                 $toolmenu[6]['title'] = 'Ñîõðàíèòü ïîðÿäîê ýëåìåíòîâ'; 
    76                 $toolmenu[6]['link'] = "javascript:checkSel('?view=menu&do=saveorder');"; 
    7773 
    7874                $toolmenu[7]['icon'] = 'autoorder.gif'; 
  • trunk/cache/.htaccess

    r458 r625  
    1 order allow, deny 
    21deny from all 
  • trunk/components/blogs/frontend.php

    r594 r625  
    295295            //Ñ÷èòàåì ÷èñëî êîììåíòàðèåâ 
    296296            $blog['comments']   = blogComments($blog['id']); 
    297                         //Íîðìàëèçóåì äàòó ñîçäàíèÿ 
    298                         $blog['pubdate']    = $inCore->dateFormat($blog['pubdate']); 
    299297            //Ôîðìàòèðóåì çíà÷åíèå êàðìû áëîãà 
    300298            $blog['karma']      = cmsKarmaFormatSmall($blog['points']); 
     
    469467                    $post['comments']   = $post['comments'] ? $inCore->getCommentsCount('blog', $post['id']) : false; 
    470468                    $post['karma']      = cmsKarmaFormatSmall($post['points']); 
    471                                         $post['fpubdate']       = $inCore->dateFormat($post['fpubdate']); 
    472469                     
    473470                    $msg                = $post['content_html']; 
     
    572569        $post['msg']        = $post['content_html']; 
    573570        $post['tagline']    = cmsTagLine('blogpost', $post['id']); 
     571                $post['fpubdate']       = $inCore->dateFormat($post['pubdate']); 
    574572        $post['url']        = $model->getPostURL(null, $post['bloglink'], $post['seolink']); 
    575573        $posts[]            = $post; 
     
    994992    } 
    995993 
    996     $post['fpubdate'] = cmsCore::dateDiffNow($post['fpubdate']).' '.$_LANG['BACK'].' ('.$post['fpubdate'].')'; 
    997     $post['feditdate'] = cmsCore::dateDiffNow($post['feditdate']).' '.$_LANG['BACK']; 
     994    $post['fpubdate'] = cmsCore::dateDiffNow($post['pubdate']).' '.$_LANG['BACK'].' ('.$post['fpubdate'].')'; 
    998995 
    999996    if ($post['cat_id']){ 
     
    11761173    if (!$user_id){ $inCore->halt(); } 
    11771174 
    1178     $blog = $model->getBlog($id); 
    1179  
    1180     if (!$blog){ $inCore->halt(); } 
    1181  
    11821175    if ( $inCore->inRequest('confirm') ){ 
    11831176        if ($user_id == $blog['user_id'] || $inUser->is_admin){ 
     
    12761269         
    12771270        $smarty     = $inCore->initSmarty('components', 'com_blog_view_posts.tpl'); 
    1278         $error      = ''; 
    12791271                                 
    12801272        $user_id    = $inUser->id; 
     
    12831275 
    12841276    $posts      = array(); 
    1285  
    1286     if ($error) { 
    1287         echo '<p style="color:red">'.$error.'</p>'; 
    1288         return; 
    1289     } 
    1290  
    1291         if (!$error){ 
    12921277 
    12931278        //Ñ÷èòàåì êîëè÷åñòâî ïåðñîíàëüíûõ è êîëëåêòèâíûõ áëîãîâ 
     
    13601345 
    13611346    } 
    1362  
    1363 } 
    13641347////////// VIEW POPULAR POSTS //////////////////////////////////////////////////////////////////////////////////////// 
    13651348if ($do=='best'){ 
     
    13731356 
    13741357        $smarty   = $inCore->initSmarty('components', 'com_blog_view_posts.tpl'); 
    1375         $error    = ''; 
    13761358                                 
    13771359        $user_id  = $inUser->id; 
     
    13811363 
    13821364    $posts    = array(); 
    1383  
    1384     if ($error) { 
    1385         echo '<p style="color:red">'.$error.'</p>'; 
    1386         return; 
    1387     } 
    1388          
    1389         if (!$error){ 
    13901365 
    13911366                //TITLES 
     
    14181393                    $post['comments']   = $post['comments'] ? $inCore->getCommentsCount('blog', $post['id']) : false; 
    14191394                    $post['karma']      = cmsKarmaFormatSmall($post['points']); 
     1395                                        $post['fpubdate']       = $inCore->dateFormat($post['pubdate']); 
    14201396 
    14211397                    $msg = $post['content_html']; 
     
    14331409            } 
    14341410        } 
    1435     } 
    14361411 
    14371412    $smarty->assign('is_posts', (bool)sizeof($posts)); 
  • trunk/components/blogs/model.php

    r458 r625  
    7777        $sql = "SELECT * 
    7878                                FROM cms_blogs 
    79                                 WHERE id = $id 
     79                                WHERE id = '$id' 
    8080                                LIMIT 1"; 
    8181                $result = $this->inDB->query($sql); 
     
    8383        $blog = $this->inDB->num_rows($result) ? $this->inDB->fetch_assoc($result) : false; 
    8484        $blog = cmsCore::callEvent('GET_BLOG', $blog); 
     85                $blog['pubdate'] = cmsCore::dateFormat($blog['pubdate']); 
    8586 
    8687                return $blog; 
     
    112113        $blog = $this->inDB->num_rows($result) ? $this->inDB->fetch_assoc($result) : false; 
    113114        $blog = cmsCore::callEvent('GET_BLOG', $blog); 
     115                $blog['pubdate'] = cmsCore::dateFormat($blog['pubdate']); 
    114116 
    115117                return $blog; 
     
    415417 
    416418        while($blog = $this->inDB->fetch_assoc($result)){ 
     419                        $blog['pubdate'] = cmsCore::dateFormat($blog['pubdate']); 
    417420            $list[] = $blog; 
    418421        } 
     
    435438                FROM cms_blogs b 
    436439                                LEFT JOIN cms_blog_posts p ON p.blog_id = b.id 
    437                 WHERE b.id = $blog_id AND p.published = 1 AND b.owner = '$owner' {$cat_sql} 
     440                WHERE b.id = '$blog_id' AND p.published = 1 AND b.owner = '$owner' {$cat_sql} 
    438441                "; 
    439442        $result = $this->inDB->query($sql); 
     
    454457 
    455458        //Ïîëó÷àåì çàïèñè, îòíîñÿùèåñÿ ê íóæíîé ñòðàíèöå áëîãà 
    456         $sql = "SELECT p.*, p.pubdate as fpubdate,  
     459        $sql = "SELECT p.*,  
    457460                       IFNULL(r.total_rating, 0) as points, u.nickname as author, u.id as author_id 
    458461                FROM cms_blogs b 
     
    469472        if ($this->inDB->num_rows($result)){ 
    470473            while($post = $this->inDB->fetch_assoc($result)){ 
     474                                $post['fpubdate'] = cmsCore::dateFormat($post['pubdate']); 
    471475                $list[] = $post; 
    472476            } 
     
    482486 
    483487        $sql = "SELECT p.*, 
    484                    DATE_FORMAT(p.pubdate, '%d-%m-%Y %H:%i') fpubdate, 
    485                    DATE_FORMAT(p.edit_date, '%d-%m-%Y %H:%i') feditdate, 
    486488                   u.nickname as author, 
    487489                   u.login as author_login,  
     
    508510 
    509511        $sql = "SELECT p.*, 
    510                    DATE_FORMAT(p.pubdate, '%d-%m-%Y %H:%i') fpubdate, 
    511                    DATE_FORMAT(p.edit_date, '%d-%m-%Y %H:%i') feditdate, 
    512512                   u.nickname as author, 
    513513                   u.id as author_id,  
     
    524524                $post   = $this->inDB->num_rows($result) ? $this->inDB->fetch_assoc($result) : false; 
    525525 
    526         if ($post){  $post = cmsCore::callEvent('GET_POST', $post); } 
     526        if ($post){  
     527                        $post = cmsCore::callEvent('GET_POST', $post); 
     528                        $post['fpubdate'] = cmsCore::dateFormat($post['pubdate']); 
     529                        $post['feditdate'] = cmsCore::dateFormat($post['edit_date']); 
     530                } 
    527531 
    528532        return $post; 
     
    575579 
    576580        $sql = "SELECT  p.*, 
    577                         DATE_FORMAT(p.pubdate, '%d-%m-%Y (%H:%i)') as fpubdate, 
    578581                        IFNULL(r.total_rating, 0) as points, 
    579582                        u.nickname as author, 
     
    582585                        b.seolink bloglink, 
    583586                        b.owner 
    584                 FROM cms_blogs b, cms_users u, cms_blog_posts p 
     587                FROM cms_blog_posts p 
     588                                LEFT JOIN cms_users u ON u.id = p.user_id                                
     589                                LEFT JOIN cms_blogs b ON b.id = p.blog_id 
    585590                LEFT JOIN cms_ratings_total r ON r.item_id=p.id AND r.target='blogpost' 
    586                 WHERE p.user_id = u.id AND p.published = 1 AND p.blog_id = b.id AND DATEDIFF(NOW(), p.pubdate) <= 7 AND b.owner = 'user' 
    587                 GROUP BY p.id 
     591                WHERE p.published = 1 AND DATEDIFF(NOW(), p.pubdate) <= 7 AND b.owner = 'user' 
    588592                ORDER BY points DESC 
    589593                LIMIT ".(($page-1)*$perpage).", $perpage"; 
     
    682686        $list = array(); 
    683687 
    684         $sql = "SELECT p.*, DATE_FORMAT(p.pubdate, '%d-%m-%Y (%H:%i)') as fpubdate, u.nickname as author, u.id as author_id, 
     688        $sql = "SELECT p.*, u.nickname as author, u.id as author_id, 
    685689                       b.seolink as bloglink, 
    686690                       u.login as author_login 
  • trunk/components/content/model.php

    r613 r625  
    165165 
    166166            $count_sql = "SELECT con.id 
    167                           FROM cms_content con, cms_category cat 
    168                           WHERE con.category_id = cat.id AND (cat.NSLeft >= {$subcat['NSLeft']} AND cat.NSRight <= {$subcat['NSRight']}) AND con.published = 1"; 
     167                          FROM cms_content con 
     168                                                  INNER JOIN cms_category cat ON cat.id = con.category_id AND (cat.NSLeft >= {$subcat['NSLeft']} AND cat.NSRight <= {$subcat['NSRight']}) 
     169                          WHERE con.published = 1 AND con.is_arhive = 0"; 
    169170 
    170171            $count_result = $this->inDB->query($count_sql); 
  • trunk/components/users/frontend.php

    r615 r625  
    678678        $smarty->assign('avatar', usrImageNOdb($usr['id'], 'big', $usr['imageurl'], $usr['is_deleted'])); 
    679679        $smarty->assign('usr', $usr); 
     680                $smarty->assign('messages', cmsCore::getSessionMessages()); 
    680681        $smarty->display('com_users_not_allow.tpl'); 
    681682        return; 
  • trunk/components/users/includes/usercore.php

    r515 r625  
    1313 
    1414function usrBlog($user_id){ 
    15         return dbGetFields('cms_blogs', 'owner="user" AND user_id = '.$user_id, 'id, seolink'); 
     15        return dbGetFields('cms_blogs', 'owner="user" AND user_id = '.$user_id, 'id, seolink', 'owner'); 
    1616} 
    1717 
  • trunk/components/users/model.php

    r540 r625  
    6767                IFNULL(COUNT(i.id), 0) as invites_count 
    6868                FROM cms_users u 
    69                                 LEFT JOIN cms_user_profiles p ON u.id = p.id 
    70                                 LEFT JOIN cms_user_groups g ON u.group_id = g.id 
    71                                 LEFT JOIN cms_online o ON u.id = o.user_id 
    72                                 LEFT JOIN cms_banlist b ON u.id = b.user_id 
    73                 LEFT JOIN cms_users ui ON u.invited_by = ui.id 
    74                 LEFT JOIN cms_user_invites i ON u.id = i.owner_id AND i.is_used = 0 AND i.is_sended = 0 
     69                                LEFT JOIN cms_user_profiles p ON p.user_id = u.id 
     70                                LEFT JOIN cms_user_groups g ON g.id = u.group_id 
     71                                LEFT JOIN cms_online o ON o.user_id = u.id 
     72                                LEFT JOIN cms_banlist b ON b.user_id = u.id 
     73                LEFT JOIN cms_users ui ON ui.id = u.invited_by 
     74                LEFT JOIN cms_user_invites i ON i.owner_id = u.id AND i.is_used = 0 AND i.is_sended = 0 
    7575                WHERE u.is_locked = 0 AND u.id = '$user_id' 
    7676                                GROUP BY u.id 
     
    712712        } 
    713713 
     714                cmsActions::removeTargetLog('add_user_photo_multi', $album_id); 
     715 
    714716        $this->inDB->query("DELETE FROM cms_user_albums WHERE id = '$album_id'") ; 
    715717 
  • trunk/core/classes/actions.class.php

    r609 r625  
    145145    } 
    146146 
     147    /** 
     148     * Óäàëÿåò èç ëåíòû àêòèâíîñòè âñå ñîáûòèÿ îïðåäåëåííîãî òèïà äëÿ óêàçàííîé öåëè 
     149     * @param string $action_name Òèï ñîáûòèÿ 
     150     * @param int $target_id Èäåíòèôèêàòîð öåëè 
     151     * @return bool 
     152     */ 
     153    public static function removeTargetLog($action_name, $target_id, $user_id = false){ 
     154         
     155        $inDB = cmsDatabase::getInstance(); 
     156         
     157        $action = self::getAction($action_name); 
     158         
     159        $usr_sql = $user_id ? "AND user_id = {$user_id}" : ''; 
     160         
     161        $sql = "DELETE  
     162                FROM cms_actions_log  
     163                WHERE action_id = '{$action['id']}' AND target_id = '{$target_id}' $usr_sql"; 
     164 
     165        $inDB->query($sql); 
     166 
     167        return true; 
     168         
     169    } 
     170 
    147171// ============================================================================ // 
    148172// ============================================================================ // 
     
    154178     */ 
    155179        public function where($condition){ 
     180                if ($this->where) { 
    156181                $this->where .= "AND ({$condition})"; 
     182                } else { 
     183                    $this->where  = "({$condition})"; 
     184                } 
    157185        } 
    158186 
     
    262290                       u.login as user_login 
    263291 
    264                 FROM cms_actions_log log, 
    265                      cms_actions a, 
    266                      cms_users u 
    267                       
    268                 WHERE   log.user_id = u.id AND  
    269                         log.action_id = a.id AND 
    270                         a.is_visible = 1 
    271                                                 {$this->where} 
    272  
    273                 ORDER BY log.pubdate DESC 
     292                FROM cms_actions_log log 
     293                LEFT JOIN cms_actions a ON a.id = log.action_id AND a.is_visible = 1 
     294                LEFT JOIN cms_users u ON u.id = log.user_id 
     295    
     296                WHERE {$this->where} 
     297 
     298                ORDER BY log.id DESC 
    274299                "; 
    275300 
  • trunk/includes/config.inc.php

    r618 r625  
    33$_CFG = array(); 
    44$_CFG['sitename']       = 'Ìîÿ ñîöèàëüíàÿ ñåòü'; 
    5 $_CFG['hometitle']      = ''; 
    6 $_CFG['homecom']        = ''; 
    7 $_CFG['siteoff']        = 0; 
    8 $_CFG['debug']  = 0; 
    9 $_CFG['offtext']        = 'Ïðîèçâîäèòñÿ îáíîâëåíèå ñàéòà'; 
    10 $_CFG['keywords']       = 'InstantCMS, ñèñòåìà óïðàâëåíèÿ ñàéòîì, áåñïëàòíàÿ CMS, äâèæîê ñàéòà, CMS, äâèæîê ñîöèàëüíîé ñåòè'; 
    11 $_CFG['metadesc']       = 'InstantCMS - áåñïëàòíàÿ ñèñòåìà óïðàâëåíèÿ ñàéòîì ñ ñîöèàëüíûìè ôóíêöèÿìè'; 
    12 $_CFG['seourl']         = ''; 
    13 $_CFG['lang']   = 'ru'; 
    14 $_CFG['sitemail']       = ''; 
    15 $_CFG['wmark']  = 'watermark.png'; 
    16 $_CFG['stats']  = 0; 
    17 $_CFG['template']       = '_default_'; 
    18 $_CFG['splash']         = 0; 
    19 $_CFG['slight']         = 0; 
    20 $_CFG['back_btn']       = 0; 
    215$_CFG['db_host']        = 'localhost'; 
    226$_CFG['db_base']        = 'icms'; 
     
    248$_CFG['db_pass']        = ''; 
    259$_CFG['db_prefix']      = 'cms'; 
    26 $_CFG['show_pw']        = 1; 
    27 $_CFG['short_pw']       = 1; 
    28 $_CFG['index_pw']       = 0; 
    29 $_CFG['fastcfg']        = 1; 
    30 $_CFG['mailer']         = 'mail'; 
    31 $_CFG['sendmail']       = '/usr/sbin/sendmail'; 
    32 $_CFG['smtpauth']       = 0; 
    33 $_CFG['smtpuser']       = ''; 
    34 $_CFG['smtppass']       = ''; 
    35 $_CFG['smtphost']       = 'localhost'; 
     10$_CFG['template']       = '_default_'; 
     11$_CFG['tooltips']       = '1'; 
     12$_CFG['index_pw']       = '0'; 
     13$_CFG['show_pw']        = '1'; 
     14$_CFG['short_pw']       = '1'; 
     15$_CFG['splash']         = '0'; 
     16$_CFG['stats']  = '0'; 
     17$_CFG['slight']         = '0'; 
     18$_CFG['siteoff']        = '0'; 
     19$_CFG['offtext']        = 'Ïðîèçâîäèòñÿ îáíîâëåíèå ñàéòà'; 
     20$_CFG['keywords']       = 'InstantCMS, ñèñòåìà óïðàâëåíèÿ ñàéòîì, áåñïëàòíàÿ CMS, äâèæîê ñàéòà, CMS, äâèæîê ñîöèàëüíîé ñåòè'; 
     21$_CFG['metadesc']       = 'InstantCMS - áåñïëàòíàÿ ñèñòåìà óïðàâëåíèÿ ñàéòîì ñ ñîöèàëüíûìè ôóíêöèÿìè'; 
     22$_CFG['fastcfg']        = '1'; 
     23$_CFG['debug']  = '0'; 
     24$_CFG['lang']   = 'ru'; 
     25$_CFG['wmark']  = 'watermark.png'; 
     26$_CFG['back_btn']       = '0'; 
    3627$_CFG['timezone']       = 'Europe/Moscow'; 
    37 $_CFG['timediff']       = ''; 
     28$_CFG['timediff']       = '0'; 
    3829?> 
  • trunk/index.php

    r618 r625  
    1919////////////////////////////// Ïðîâåðÿåì ÷òî ñèñòåìà óñòàíîâëåíà ///////////////////////////// 
    2020 
    21 //    if(is_dir('install')||is_dir('migrate')) { 
    22 //        if (!file_exists(PATH.'/includes/config.inc.php')){ 
    23 //            header('location:/install/'); 
    24 //        } else { 
    25 //            include(PATH.'/core/messages/installation.html'); 
    26 //            die(); 
    27 //        } 
    28 //    } 
     21    if(is_dir('install')||is_dir('migrate')) { 
     22        if (!file_exists(PATH.'/includes/config.inc.php')){ 
     23            header('location:/install/'); 
     24        } else { 
     25            include(PATH.'/core/messages/installation.html'); 
     26            die(); 
     27        } 
     28    } 
    2929 
    3030/////////////////////////////////// Ïîäãîòîâêà ////////////////////////////////////////////// 
  • trunk/modules/mod_bestphoto/module.php

    r465 r625  
    2525                $catsql = $cfg['album_id'] ? ' AND album_id = '.$cfg['album_id'] : ''; 
    2626                 
    27                 $today = date("d-m"); 
     27                $today = date("d-m-Y"); 
    2828 
    2929                switch ($cfg['whatphoto']){ 
    3030 
    3131                        case 'all':   $periodsql = ''; break; 
    32                         case 'day':   $periodsql = " AND DATE_FORMAT(f.pubdate, '%d-%m')='$today'"; break; 
     32                        case 'day':   $periodsql = " AND DATE_FORMAT(f.pubdate, '%d-%m-%Y')='$today'"; break; 
    3333                        case 'week':  $periodsql = " AND DATEDIFF(NOW(), f.pubdate) <= 7"; break; 
    3434                        case 'month': $periodsql = " AND DATE_SUB(NOW(), INTERVAL 1 MONTH) < f.pubdate"; break; 
  • trunk/templates/_default_/components/com_content_my.tpl

    r514 r625  
    1010    </div> 
    1111{/if} 
    12  
     12<p><a href="/content/add.html">{$LANG.ADD_ARTICLE}?</a></p> 
    1313<table width="100%" cellpadding="5" cellspacing="0" border="0"> 
    1414        <thead> 
  • trunk/templates/_default_/components/com_users_not_allow.tpl

    r594 r625  
    22{* ==================Çàêðûòûé ïðîôèëü ïîëüçîâàòåëÿ ================================ *} 
    33{* ================================================================================ *} 
    4  
     4{if $messages} 
     5    <div class="sess_messages"> 
     6        {foreach key=id item=message from=$messages} 
     7            {$message} 
     8        {/foreach} 
     9    </div> 
     10{/if} 
    511<div id="usertitle"> 
    612    <div class="con_heading" id="nickname"> 
  • trunk/upload/.htaccess

    r458 r625  
     1Options -Indexes 
     2 
     3# Ïåðâûé âàðèàíò çàïðåòà âûïîëíåíèÿ php 
    14php_flag engine 0 
    25AddType "text/html" .php .cgi .pl .fcgi .fpl .phtml .shtml .php2 .php3 .php4 .php5 .asp .jsp 
    36RemoveType php 
     7 
     8# Âòîðîé âàðèàíò çàïðåòà âûïîëíåíèÿ php 
     9# èñïîëüçóéòå åãî, åñëè ïðè ïåðâîì âàðèàíòå êàðòèíêè èç äèðåêòîðèé íå îòîáðàæàþòñÿ 
     10# çàêîììåíòèðóéòå ñòðî÷êè ïåðâîãî âàðèàíòà, ñî ñòðî÷åê íèæå êîììåíòàðèè ñíèìèòå 
     11# RemoveHandler .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml 
     12# AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml  
Note: See TracChangeset for help on using the changeset viewer.