Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Это не мой хак! Я его купил, я его могу тут выложить бесплатно? Возможно тот кто мне его дал находится на этом форуме, но в icq он как рыПка
Я бы поделился но хак не мой же и он платный
Ну так! Щас не выложу! Объясняться не буду! P.S. я не домаЧела жаба давит
Разработчики движков тоже тут сидят и видят как их платные двиги нулами выкладывают...Возможно тот кто мне его дал находится на этом форуме
function ShowRating ($id, $rating, $vote_num, $allow = true){
global $is_logged, $member_id, $config, $lang, $db;
if ($rating) $rating = round(($rating / $vote_num), 0); else $rating = 0;
$rating = $rating * 17;
if (!$allow) {
$rated = <<<HTML
<div class="rating" style="float:left;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
</ul>
</div><div class="rating" style="float:left; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div>
HTML;
return $rated;
}
$rated .= <<<HTML
<div id='ratig-layer'><div class="rating" style="float:left;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
<li><a href="#" title="{$lang['useless']}" class="r1-unit" onclick="doRate('1', '{$id}'); return false;">1</a></li>
<li><a href="#" title="{$lang['poor']}" class="r2-unit" onclick="doRate('2', '{$id}'); return false;">2</a></li>
<li><a href="#" title="{$lang['fair']}" class="r3-unit" onclick="doRate('3', '{$id}'); return false;">3</a></li>
<li><a href="#" title="{$lang['good']}" class="r4-unit" onclick="doRate('4', '{$id}'); return false;">4</a></li>
<li><a href="#" title="{$lang['excellent']}" class="r5-unit" onclick="doRate('5', '{$id}'); return false;">5</a></li>
</ul>
</div><div class="rating" style="float:left; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div></div>
HTML;
return $rated;
}
function ShortRating ($id, $rating, $vote_num, $allow = true){
global $config, $lang;
if ($rating) $rating = round(($rating / $vote_num), 0); else $rating = 0;
$rating = $rating * 17;
if (!$allow) {
$rated = <<<HTML
<div class="rating" style="float:left;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
</ul>
</div>
HTML;
return $rated;
}
$rated = "<span id='ratig-layer-".$id."'>";
$rated .= <<<HTML
<div class="rating" style="float:left;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
<li><a href="#" title="{$lang['useless']}" class="r1-unit" onclick="dleRate('1', '{$id}'); return false;">1</a></li>
<li><a href="#" title="{$lang['poor']}" class="r2-unit" onclick="dleRate('2', '{$id}'); return false;">2</a></li>
<li><a href="#" title="{$lang['fair']}" class="r3-unit" onclick="dleRate('3', '{$id}'); return false;">3</a></li>
<li><a href="#" title="{$lang['good']}" class="r4-unit" onclick="dleRate('4', '{$id}'); return false;">4</a></li>
<li><a href="#" title="{$lang['excellent']}" class="r5-unit" onclick="dleRate('5', '{$id}'); return false;">5</a></li>
</ul>
</div>
HTML;
$rated .= "</span>";
return $rated;
}
function ShowRating ($id, $rating, $vote_num, $allow = true)
{
global $is_logged, $member_id, $config, $lang, $db;
$rated = '<div id="ratig-layer"><form name="rating" id="rating" method="post">'."\n";
$rated .= '<b>'.$lang[raten].'</b> ';
if ($rating < 1)
$rated .= $lang['noraten'];
else
{
$rating2 = round(($rating / $vote_num), 2);
$rating = round(($rating / $vote_num), 0);
if ($rating == 1)
$rated .= '<img src="'.$config['http_img_url'].'/templates/'.$config['skin'].'/images/sys/rate_1.gif" border="0" align="absmiddle" alt="'.$lang['rated'].' '.$lang['useless'].' ! Средний балл: '.$rating2.'">'."\n";
elseif ($rating == 2)
$rated .= '<img src="'.$config['http_img_url'].'/templates/'.$config['skin'].'/images/sys/rate_2.gif" border="0" align="absmiddle" alt="'.$lang['rated'].' '.$lang['poor'].' ! Средний балл: '.$rating2.'">'."\n";
elseif ($rating == 3)
$rated .= '<img src="'.$config['http_img_url'].'/templates/'.$config['skin'].'/images/sys/rate_3.gif" border="0" align="absmiddle" alt="'.$lang['rated'].' '.$lang['fair'].' ! Средний балл: '.$rating2.'">'."\n";
elseif ($rating == 4)
$rated .= '<img src="'.$config['http_img_url'].'/templates/'.$config['skin'].'/images/sys/rate_4.gif" border="0" align="absmiddle" alt="'.$lang['rated'].' '.$lang['good'].' ! Средний балл: '.$rating2.'">'."\n";
elseif ($rating == 5)
$rated .= '<img src="'.$config['http_img_url'].'/templates/'.$config['skin'].'/images/sys/rate_5.gif" border="0" align="absmiddle" alt="'.$lang['rated'].' '.$lang['excellent'].' ! Средний балл: '.$rating2.'">'."\n";
$rated .= ' ('.$lang[voten].' '.$vote_num.')';
}
if ($_SERVER['REMOTE_ADDR']) $ip = mysql_escape_string($_SERVER['REMOTE_ADDR']);
else $ip = 'not detected';
if ($rating)
{
if ($is_logged) $where = "member = '".$member_id['name']."'";
else $where = "ip ='".$ip."'";
$row = $db->super_query("SELECT news_id FROM " . PREFIX . "_logs where news_id ='".$id."' AND ".$where);
}
$time_reg = time()+($config['date_adjust']*60)-(60*60*24*7);
if ($row['news_id'])
$rated .= '<br>'.$lang['rdenied'];
else
{
$options = array($lang['excellent'], $lang['good'], $lang['fair'], $lang['poor'], $lang['useless']);
$rated .= '<br><div style="margin-top:5px; text-align: center"><b>Оцените пост:</b><br>
<input type="hidden" name="doaction" value="rate">
<input type="hidden" name="news_id" id="news_id" value="'.$id.'">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">';
$max = count($options);
for ($i = 0; $i < $max; $i++)
{
$this_rate = 5-$i;
$rated .= '<td width="20%">
<input onClick="doRate('.$this_rate.'); return false;" class="radio" name="go_rate" id="rate_'.$this_rate.'" type="radio" value="'.$this_rate.'">
<label for="rate_'.$this_rate.'" class="simple">'.$options[$i].'</label>
</td>';
}
$rated .= '</tr>
</table></div>';
}
$rated .= "</form></div>\n";
return $rated;
}{
global $is_logged, $member_id, $config, $lang, $db;
if ($rating) $rating = round(($rating / $vote_num), 0); else $rating = 0;
$rating = $rating * 17;
if (!$allow) {
$rated = <<<HTML
<div class="rating" style="float:left;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
</ul>
</div><div class="rating" style="float:left; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div>
HTML;
return $rated;
}
$rated .= <<<HTML
<div id='ratig-layer'><div class="rating" style="float:left;">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating}px;">{$rating}</li>
<li><a href="#" title="{$lang['useless']}" class="r1-unit" onclick="doRate('1', '{$id}'); return false;">1</a></li>
<li><a href="#" title="{$lang['poor']}" class="r2-unit" onclick="doRate('2', '{$id}'); return false;">2</a></li>
<li><a href="#" title="{$lang['fair']}" class="r3-unit" onclick="doRate('3', '{$id}'); return false;">3</a></li>
<li><a href="#" title="{$lang['good']}" class="r4-unit" onclick="doRate('4', '{$id}'); return false;">4</a></li>
<li><a href="#" title="{$lang['excellent']}" class="r5-unit" onclick="doRate('5', '{$id}'); return false;">5</a></li>
</ul>
</div><div class="rating" style="float:left; padding-top:2px;"> ({$lang['voten']} {$vote_num})</div></div>
HTML;
return $rated;
}
function ShortRating ($id, $rating, $vote_num, $allow = true){
global $config, $lang;
$rated = "";
$excellent = $lang['excellent'];
$good = $lang['good'];
$fair = $lang['fair'];
$poor = $lang['poor'];
$useless = $lang['useless'];
if ($rating < 1){
$rated .= "<img src=\"".$config['http_home_url']."templates/{$config['skin']}/images/sys/rate_0.gif\" border=\"0\">\n";
} else {
$rating = round(($rating / $vote_num), 0);
if ($rating == 1) {
$rated .= "<img src=\"".$config['http_home_url']."templates/{$config['skin']}/images/sys/rate_1.gif\" border=\"0\" alt=\"$lang[rated] $useless\">\n";
}elseif ($rating == 2) {
$rated .= "<img src=\"".$config['http_home_url']."templates/{$config['skin']}/images/sys/rate_2.gif\" border=\"0\" alt=\"$lang[rated] $poor\">\n";
}elseif ($rating == 3) {
$rated .= "<img src=\"".$config['http_home_url']."templates/{$config['skin']}/images/sys/rate_3.gif\" border=\"0\" alt=\"$lang[rated] $fair\">\n";
}elseif ($rating == 4) {
$rated .= "<img src=\"".$config['http_home_url']."templates/{$config['skin']}/images/sys/rate_4.gif\" border=\"0\" alt=\"$lang[rated] $good\">\n";
}elseif ($rating == 5) {
$rated .= "<img src=\"".$config['http_home_url']."templates/{$config['skin']}/images/sys/rate_5.gif\" border=\"0\" alt=\"$lang[rated] $excellent\">\n";
}
}
return $rated;
}
function doRate( rate, id ) {
var ajax = new dle_ajax();
ajax.onShow ('');
var varsString = "go_rate=" + rate;
ajax.setVar("news_id", id);
ajax.setVar("skin", dle_skin);
ajax.requestFile = dle_root + "engine/ajax/rating.php";
ajax.method = 'GET';
ajax.element = 'ratig-layer';
ajax.sendAJAX(varsString);
};
function doRate(rate)
{
var ajax = new dle_ajax();
var form = document.getElementById('rating');
ajax.onShow ('');
var varsString = "";
ajax.setVar("go_rate", rate);
ajax.setVar("news_id", form.news_id.value);
ajax.setVar("skin", dle_skin);
ajax.requestFile = dle_root + "engine/ajax/rating.php";
ajax.method = 'GET';
ajax.element = 'ratig-layer';
ajax.sendAJAX(varsString);
}