// ----------------------------------------------
//  
// ----------------------------------------------
 CSSY 1.0 (  )            ,         .
         Custom CSSY -    DLE Custom',    ,      CSSY.

// ----------------------------------------------
//  :
// ----------------------------------------------

----------------------
 
----------------------

1.         ( , ,   .)
2.           (    )
3.       ,            .
4.    Custom CSSY (  ,    Default   .)
5.   /          

----------------------
 
---------------------- 

     ,           .

----

------------------------------
   
------------------------------

-         0 (    )
-             ,      .
-     -         ,                 .
-     -     ,   shortstory.tpl 
-      9.0    ,        custom           .

    ,      :

-  ,   Default          -      ,    .
-   ,     (  ..   ,   ...)
-      
-     {attachment},  9.0  ,    ,      -        .
-   ,                .
-     -      ,     ,   //

        :

-  //   -
-      
-    CSSY Custom -      DLE,          CSSY (     ).
-       ,        ,  .

    ,    ,  .  

// ----------------------------------------------
//  :
// ----------------------------------------------
 ,     .

1. :
--------
1.1      :
     index.php
     /engine/modules/search.php
     /engine/modules/fullsearch.php
     /engine/modules/show.short.php
     /engine/inc/editnews.php
     /engine/classes/js_edit.js
--------
1.2        Upload,  CSSY   templates      .
     
  

     engine/data/cssy/ 0777
     engine/uploads/cssy/ 0777

--------

2.  :
------------------------
2.1  index.php      :
------------------------
if (strpos ( $tpl->copy_template, "{custom" ) !== false) {
	$tpl->copy_template = preg_replace ( "#\\{custom category=['\"](.+?)['\"] template=['\"](.+?)['\"] aviable=['\"](.+?)['\"] from=['\"](.+?)['\"] limit=['\"](.+?)['\"] cache=['\"](.+?)['\"]\\}#ies", "custom_print('\\1', '\\2', '\\3', '\\4', '\\5', '\\6', '{$dle_module}')", $tpl->copy_template );
}
-------------------------
   :
-------------------------

if (strpos ( $tpl->copy_template, "{cssy" ) !== false) {
	$tpl->copy_template = preg_replace ( "#\\{cssy category=['\"](.+?)['\"] template=['\"](.+?)['\"] aviable=['\"](.+?)['\"] from=['\"](.+?)['\"] limit=['\"](.+?)['\"] title=['\"](.+?)['\"] story=['\"](.+?)['\"] img_w=['\"](.+?)['\"] img_h=['\"](.+?)['\"] def_i=['\"](.+?)['\"] cols=['\"](.+?)['\"] cache=['\"](.+?)['\"]\\}#ies", "cssy('\\1', '\\2', '\\3', '\\4', '\\5', '\\6', '\\7', '\\8', '\\9', '\\10', '\\11', '\\12', '{$dle_module}')", $tpl->copy_template );
}
------------------------
2.2     
------------------------

    require_once ROOT_DIR . '/engine/init.php';

------------------------
   :
------------------------

   require_once ROOT_DIR.'/engine/modules/cssy/cssy.custom_fuctions.php';

------------------------
2.3   engine/modules/show.short.php
------------------------

if( ! defined( 'DATALIFEENGINE' ) ) {
	die( "Hacking attempt!" );
}

------------------------
:
------------------------
//    1.0 - By Artem Electro
   include_once (ENGINE_DIR . '/data/cssy/mainpage.config.php');
    
   if ($cssy['cssy_enable'] == "1") {
        
   if ( file_exists(ENGINE_DIR . '/data/cssy/category/'.$category.'.config.php')) 
      @include_once (ENGINE_DIR . '/data/cssy/category/'.$category.'.config.php');
          else   
      include_once (ENGINE_DIR . '/data/cssy/mainpage.config.php');
      $category = 'cssy_main';  
   }  
//    1.0 - By Artem Electro

------------------------
2.4      :
------------------------

if( isset( $view_template ) and $view_template == "rss" ) {
	} elseif( $category_id and $cat_info[$category_id]['short_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['short_tpl'] . '.tpl' );
	else $tpl->load_template( 'shortstory.tpl');

------------------------
 :
------------------------

	if( isset( $view_template ) and $view_template == "rss" ) {
	} elseif( $category_id and $cat_info[$category_id]['short_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['short_tpl'] . '.tpl' );
	else 
    
    if ($cssy['cssy_enable'] == "1") { 
    
        if ($cssy['cssy_tpl'] == "") $tpl->load_template( 'shortstory.tpl'); else $tpl->load_template( "/cssy/".$cssy['cssy_tpl'] );  
    
    } else { $tpl->load_template( 'shortstory.tpl'); }

------------------------
2.5  :
------------------------
        if( $view_template == "rss" ) {

------------------------
 :
------------------------
        //   1.0 - By Artem Electro                     
        @include (ENGINE_DIR . '/modules/cssy/cssy.short.php');          
        //   1.0 - By Artem Electro

------------------------
2.6  :
------------------------

$tpl->compile( 'content' );

		if( $user_group[$member_id['user_group']]['allow_hide'] ) $tpl->result['content'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['content']);
		else $tpl->result['content'] = preg_replace ( "'\[hide\](.*?)\[/hide\]'si", "<div class=\"quote\">" . $lang['news_regus'] . "</div>", $tpl->result['content'] );

	}


------------------------
 :
------------------------
       //   1.0 - By Artem Electro
       if ( $cssy['cssy_enable'] == "1")   {
                      
                if ($i % $cssy['cssy_colc'] == 0) {
                     $tpl->result['content'] = $tpl->result['content'].$cssy['cssy_mjcol'];
                    } else {
                    $tpl->result['content'] = $tpl->result['content'].$cssy['cssy_mj'];
                    }            
        }            
        }       
        $tpl->result['content'] = $cssy['cssy_do'].$tpl->result['content'].$cssy['cssy_pos'];      
        //   1.0 - By Artem Electro

-----------------------
3.   engine/modules/search.php
-----------------------

-----------------------
3.1   :
-----------------------

if( ! defined( 'DATALIFEENGINE' ) ) {
	die( "Hacking attempt!" );
}


-----------------------
 :
-----------------------

   //   1.0 - By Artem Electro
   include_once ENGINE_DIR .('/data/cssy/search/search.config.php');     
   //   1.0 - By Artem Electro

-----------------------
3.2  :
-----------------------

if ($is_logged){

    $fav_arr = explode (',', $member_id['favorites']);

-----------------------
 :
-----------------------
    //   1.0 - By Artem Electro         
    @include (ENGINE_DIR .'/modules/cssy/cssy.search.php');               
    //   1.0 - By Artem Electro

-----------------------
4.   engine/modules/fullsearch.php    3   .
-----------------------

-----------------------
5.   engine/inc/editnews.php
-----------------------

-----------------------
5.1   :
-----------------------

   $db->query( "DELETE FROM " . PREFIX . "_post WHERE id='$item_db[0]'" );
   $db->query( "DELETE FROM " . PREFIX . "_comments WHERE post_id='$item_db[0]'" );

----------------------

----------------------
 :
----------------------

   //   1.0 - By Artem Electro 
   preg_match( "#src=\\\\?['\"](.+?)\\\\?['\"]#ies", $item_db[5], $matchs);
   $dq = $db->super_query( "SELECT alt_name FROM " . PREFIX . "_category where id = ".$item_db[4] );
   $cpiu = ROOT_DIR."/uploads/cssy/";
   $image_name = explode ("/",$matchs[1]);
   $image_name = end ($image_name);

   if (file_exists($cpiu.$dq['alt_name']."/".$image_name)) {
   @unlink ( $cpiu.$dq['alt_name']."/".$image_name );
   echo "img cat delete"."<br /><br />";
   }
   if (file_exists($cpiu."cssy_main/".$image_name)) {
   @unlink ( $cpiu."cssy_main/".$image_name );
   echo "img mainpage delete"."<br /><br />";
   }
   //   1.0 - By Artem Electro 

----------------------
6.   engine/classes/js_edit.js
----------------------

   :

var window_news = '';
var window_news_link = '';

function ShowNews( id, url )
{
	if (window_news == id && document.getElementById('popup')) {$('#popup').dialog('open');return false;}

	var ajax = new dle_ajax();
	window_news = id;
	window_news_link = url;    
	ajax.onShow ('');    
	var varsString = "";
	ajax.setVar("id", id);
	ajax.setVar("skin", dle_skin);
	ajax.requestFile = dle_root + "engine/ajax/cssy_news.php";
	ajax.method = 'GET';
	ajax.onCompletion = ShowPopupNews;
	ajax.sendAJAX(varsString);
	
	return false;
};

function ShowPopupNews( r )
{         
    var b = {};   
   
	b[" "] = function() { 
					document.location=window_news_link;						
			    };          
    
	$("#popup").remove();

	$("body").append(r);

	$('#popup').dialog({
		autoOpen: true,        
		show: 'fade',
		hide: 'fade',		
		width: 600,        
        buttons: b 
	});	
	return false;
};

------------------
7.    
------------------
INSERT INTO __admin_sections ( name, title, descr, icon, allow_groups ) VALUES ( 'cssy', 'CSSY 1.0', '             [by Artem Electro]', 'cssy.png', '1' );

------------------
     .
------------------

-           .


// ----------------------------------------------
// CSSY Custom - ,, 
// ----------------------------------------------
    custom,  ,  -     - 1  + 1  = ,       100%
      Custom"a        ,  :


1.     

{cssy category="2,4,5" template="custom" aviable="global" from="1" limit="4" title="55" story="350" img_w="130" img_h="0" def_i="no_preview.jpg" cols="2" cache="no"}

//

category -  ID     
template -    (      /templates/_/cssy/custom/,         ).
aviable -    Custom
from -    
limit -     
title -    
story -     
img_w -     {image}
img_h -     {image} 
def_i - Default  (          ,       -   ,  )
cols -   (      ,              custom)
cache -      ( )

+    shortstory.tpl,  CSSY,   :

   {image},       ,  ,    
  {img-link} -   ...     .


      7,   .

       :

      ,    ,   -     ,   ,        )

        Custom   -  Popup  

         ,   / (     -    )

      .      /templates/_/cssy/popup/news_popup.tpl

     :

{short_story} -    
{title} -       ,       )))))   -     
{autor} -    
{image} -          ,     ,       
{img-link} -   ..    <img src="{img-link}" ... />   .

 , ,       -   ,   .
      ,    .
 0   ,      (   - profile.php       ID       post ),             .
   ,  ,      -         0  (  -   ,    -   )

   ,     , -     . ,  2 ...  ,         .

           -    +2   ...   1 ,         ,     20 ..   1     =)

P.S.          , , ,    .
          -     ,       ,  (      ).

P.S.S.      -   ..   ...     .

--------------------
     ,    electro_dj@mail.ru   ICQ - 6269155,   ,  .

----
 , Artem E1ectro