| version 1.56, 2013/06/24 10:02:05 |
version 1.57, 2013/09/02 09:30:56 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/subst.inc.php,v 1.55 2013-06-24 09:38:11 igor Exp $ */ |
/* $Platon: Metafox/subst.inc.php,v 1.56 2013-06-24 10:02:05 igor Exp $ */ |
| |
|
| require_once 'cfgldr.inc.php'; |
require_once 'cfgldr.inc.php'; |
| require_once 'error.inc.php'; |
require_once 'error.inc.php'; |
| Line 431 if ($ezin_tmpl_main->isVar('article_item |
|
| Line 431 if ($ezin_tmpl_main->isVar('article_item |
|
| } |
} |
| |
|
| if (intval($cache_ar['timestamp']) <= 0) { |
if (intval($cache_ar['timestamp']) <= 0) { |
| $item = new HTML_Template_Platon($ezin_sys['tmpl']['article_item'].$ezin_tmpl_key, |
|
| /* article_items on article page? strange, but it *should* work, |
|
| so we are going to save article variables before article_items vars */ |
|
| $list_var_keep ? HTML_TEMPLATE_PLATON_METHOD_VAR_KEEP : HTML_TEMPLATE_PLATON_METHOD_NORMAL); |
|
| $cache_ar['var_var'] = $item->isVar('article_accesses_count') |
|
| || $item->isVar('article_sessions_count') |
|
| || $item->isVar('article_message_count'); |
|
| $articles = ezin_get_article_list($section_id, $author_id, $limit, $ezin_cgi['lang']); |
$articles = ezin_get_article_list($section_id, $author_id, $limit, $ezin_cgi['lang']); |
| $cache_ar['content'] = ''; |
$cache_ar['content'] = ezin_build_content_article($articles); |
| |
$cache_ar['content'] .= '{ ?'.'> |
| for ($k = 0; $k < count($articles); $k++) { |
<div id="section_loadmore_space"></div> |
| $item->reload(); |
<script type="text/javascript" src="'.$ezin_cfg['url'].'libpub/jquery.js"></script> |
| ezin_section_link_process($articles[$k], 'article_'); |
<script type="text/javascript"> |
| ezin_author_link_process($articles[$k], 'article_'); |
var section_loadmore_page = 0; |
| ezin_article_link_process($articles[$k], $ezin_db_author != ''); |
function ezin_section_loadmore(_this, section_id) { |
| ezin_article_counts_process($articles[$k]); |
section_loadmore_page++; |
| ezin_handle_special_tags($articles[$k]['article_ghometext'], $articles[$k]['article_ghometext_flags']); |
$.get("'.$ezin_cfg['url'].'index.php?ezin_template_key=section_loadmore§ion_id="+section_id+"&page="+section_loadmore_page, function(data) { |
| ezin_handle_special_tags($articles[$k]['article_hometext'], $articles[$k]['article_hometext_flags']); |
if (data.length > 0) { |
| ezin_process_text_flags($articles[$k]['article_ghometext'], 'article_ghometext'); |
$("#section_loadmore_space").before(data); |
| ezin_process_text_flags($articles[$k]['article_hometext'], 'article_hometext'); |
} else { |
| $articles[$k]['article_date'] = date($ezin_cfg['format_date'], $articles[$k]['article_timestamp']); |
$(_this).hide(); |
| $articles[$k]['article_datetime'] = date($ezin_cfg['format_datetime'], $articles[$k]['article_timestamp']); |
} |
| /* if atitle is empty, set it to title, but if title is empty, remains it unchanged */ |
}); |
| if (empty($articles[$k]['article_atitle']) && ! empty($articles[$k]['article_title'])) |
|
| $articles[$k]['article_atitle'] = $articles[$k]['article_title']; |
|
| if ($cache_ar['var_var']) { |
|
| $id = $articles[$k]['article_id']; |
|
| $item->setVar('article_accesses_count', 'article_accesses_count_'.$id); |
|
| $item->setVar('article_sessions_count', 'article_sessions_count_'.$id); |
|
| $item->setVar('article_message_count', 'article_message_count_'.$id); |
|
| } |
} |
| $item->set($articles[$k]); |
</script> <?php }'; |
| $cache_ar['content'] .= $item->getCode(); |
|
| } |
|
| //$cache_ar['content'] = Platon::tilde_replace($cache_ar['content']); |
|
| unset($articles); |
|
| ezin_cache_save($cache_id, $cache_ar['content'], $cache_ar['var_var']); |
ezin_cache_save($cache_id, $cache_ar['content'], $cache_ar['var_var']); |
| } |
} |
| |
|
| Line 476 if ($ezin_tmpl_main->isVar('article_item |
|
| Line 458 if ($ezin_tmpl_main->isVar('article_item |
|
| } |
} |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
function ezin_build_content_article($articles) { |
| |
global $ezin_sys, $ezin_cfg, $ezin_tmpl_key; |
| |
$item = new HTML_Template_Platon($ezin_sys['tmpl']['article_item'].$ezin_tmpl_key, |
| |
/* article_items on article page? strange, but it *should* work, |
| |
so we are going to save article variables before article_items vars */ |
| |
$list_var_keep ? HTML_TEMPLATE_PLATON_METHOD_VAR_KEEP : HTML_TEMPLATE_PLATON_METHOD_NORMAL); |
| |
$cache_ar['var_var'] = $item->isVar('article_accesses_count') |
| |
|| $item->isVar('article_sessions_count') |
| |
|| $item->isVar('article_message_count'); |
| |
$content = ''; |
| |
for ($k = 0; $k < count($articles); $k++) { |
| |
$item->reload(); |
| |
ezin_section_link_process($articles[$k], 'article_'); |
| |
ezin_author_link_process($articles[$k], 'article_'); |
| |
ezin_article_link_process($articles[$k], $ezin_db_author != ''); |
| |
ezin_article_counts_process($articles[$k]); |
| |
ezin_handle_special_tags($articles[$k]['article_ghometext'], $articles[$k]['article_ghometext_flags']); |
| |
ezin_handle_special_tags($articles[$k]['article_hometext'], $articles[$k]['article_hometext_flags']); |
| |
ezin_process_text_flags($articles[$k]['article_ghometext'], 'article_ghometext'); |
| |
ezin_process_text_flags($articles[$k]['article_hometext'], 'article_hometext'); |
| |
$articles[$k]['article_date'] = date($ezin_cfg['format_date'], $articles[$k]['article_timestamp']); |
| |
$articles[$k]['article_datetime'] = date($ezin_cfg['format_datetime'], $articles[$k]['article_timestamp']); |
| |
/* if atitle is empty, set it to title, but if title is empty, remains it unchanged */ |
| |
if (empty($articles[$k]['article_atitle']) && ! empty($articles[$k]['article_title'])) |
| |
$articles[$k]['article_atitle'] = $articles[$k]['article_title']; |
| |
if ($cache_ar['var_var']) { |
| |
$id = $articles[$k]['article_id']; |
| |
$item->setVar('article_accesses_count', 'article_accesses_count_'.$id); |
| |
$item->setVar('article_sessions_count', 'article_sessions_count_'.$id); |
| |
$item->setVar('article_message_count', 'article_message_count_'.$id); |
| |
} |
| |
$item->set($articles[$k]); |
| |
$content .= $item->getCode(); |
| |
} |
| |
//$cache_ar['content'] = Platon::tilde_replace($cache_ar['content']); |
| |
unset($articles); |
| |
return $content; |
| |
} |
| |
|
| /* |
/* |
| * Building featured articles list |
* Building featured articles list |
| */ |
*/ |