<?php
/**
* @descr Thanks fixed to 8.3
* @author Dmitriy 'FlashBlack' Chubrick <a href='http://dle-code.com/' target='_blank'><span style='color:005C5B'>http://dle-code.com/</span></a>
*/
if(!defined('DATALIFEENGINE')) {
die("Hacking Attempt!");
}
if ($is_logged) {
$check_user = $db->query('SELECT * FROM ' . USERPREFIX . '_thanks WHERE user_name = \''.$member_id['name'].'\' and id_post = \''.$row['id'].'\' ');
if ($db->num_rows($check_user) < 1) {
$tpl->set('[allow_add]','');
$tpl->set('[/allow_add]','');
}
else {
$tpl->set_block("'\\[allow_add\\](.*?)\\[/allow_add\\]'si","","");
}
} else {
$tpl->set_block("'\\[allow_add\\](.*?)\\[/allow_add\\]'si","","");
}
$x00 = <<<HTML
<script type="text/javascript">
function AddThx(){
var ajax = new dle_ajax();
ajax.onShow ('');
var varsString = "";
ajax.setVar("post_id", "{$row['id']}" );
ajax.requestFile = dle_root + "engine/ajax/thanks.php";
ajax.method = 'GET';
ajax.element = 'thx-layer';
ajax.sendAJAX(varsString);
return false;
}
</script>
<span style="border-bottom: 1px dotted black;">HTML</span>;
$tpl->copy_template .= $x00;
$sql_result_thx = $db->query('SELECT * FROM ' . USERPREFIX . '_thanks WHERE id_post = \''.$row['id'].'\' ORDER by id ASC ');
if ($db->num_rows($sql_result_thx) > 0) {
$thx_xo8 .= '<br><b>Pasakė ačiū</b> <a href="http://dle-code.com">:</a>';
$tpl->set('{thx_sayed}',$thx_xo8);
while ($thx = $db->get_row()) {
if ($config['ajax']) $go_page = "onclick=\"DlePage(\'subaction=userinfo&user=".urlencode($row['name'])."\'); return false;\" "; else $go_page = "";
if ($config['allow_alt_url'] == "yes") {
$go_page .= "href=\"".$config['http_home_url']."user/".urlencode($thx['user_name'])."/\"";
} else {
$go_page .= "href=\"$PHP_SELF?subaction=userinfo&user=".urlencode($thx['user_name'])."\"";
}
$thx_member[] = "<a {$go_page}><b>".$thx['user_name']."</b></a>";
$all_members = implode(',',$thx_member);
}
$tpl->set('{thanks}',$all_members);
} else {
$tpl->set('{thanks}','<br>Dar niekas nepasakė ačiū');
$tpl->set('{thx_sayed}','');
}
?>