Рейтинг с изменением цвета

Модули и плагины для vii (студяги)!
Ответить
Аватара пользователя
glGizma
Site Admin
Сообщения: 214
Зарегистрирован: Ср сен 27, 2017 2:20 pm

Рейтинг с изменением цвета

Сообщение glGizma » Сб фев 01, 2020 8:40 am

Залейте файл rating.php в папку ./system/modules/
Всё из папки templates/Default/ залейте в вашу папку с шаблоном.

Установка:

1. Откройте system/modules/profile.php

Найдите:

Код: Выделить всё

			//Приватность информации
			if($user_privacy['val_info'] == 1 OR $user_privacy['val_info'] == 2 AND $check_friend OR $user_id == $id){
				$tpl->set('[privacy-info]', '');
				$tpl->set('[/privacy-info]', '');
			} else
				$tpl->set_block("'\\[privacy-info\\](.*?)\\[/privacy-info\\]'si","");
И вставьте ниже:

Код: Выделить всё

    // Рейтинг
    if($user_id == $id){
    if($rr['user_rate'] < 100){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<a class="cursor_pointer" onclick="doLoad.data(1); rating.view()"><div class="profile_rate_100_left "></div></a>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <a class="cursor_pointer" onclick="doLoad.data(1); rating.view()" style="text-decoration:none"><div class="profile_rate_100_right "></div>
    <div class="profile_rate_100_head " id="profile_rate_num">'.$rr['user_rate'].'</div></a>');}
    if($rr['user_rate'] >= 100 && $rr['user_rate'] < 500){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<a class="cursor_pointer" onclick="doLoad.data(1); rating.view()"><div class="profile_rate_100_left "></div></a>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <a class="cursor_pointer" onclick="doLoad.data(1); rating.view()" style="text-decoration:none"><div class="profile_rate_100_right "></div>
    <div class="profile_rate_100_head " id="profile_rate_num">'.$rr['user_rate'].'</div></a>');}
    if($rr['user_rate'] > 500 && $rr['user_rate'] <= 1000){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<a class="cursor_pointer" onclick="doLoad.data(1); rating.view()"><div class="profile_rate_100_left profile_rate_500_left"></div></a>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <a class="cursor_pointer" onclick="doLoad.data(1); rating.view()" style="text-decoration:none"><div class="profile_rate_100_right profile_rate_500_right"></div>
    <div class="profile_rate_100_head profile_rate_500_head" id="profile_rate_num">'.$rr['user_rate'].'</div></a>');}
    if($rr['user_rate'] > 1000){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<a class="cursor_pointer" onclick="doLoad.data(1); rating.view()"><div class="profile_rate_100_left profile_rate_1000_left"></div></a>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <a class="cursor_pointer" onclick="doLoad.data(1); rating.view()" style="text-decoration:none"><div class="profile_rate_100_right profile_rate_1000_right "></div>
    <div class="profile_rate_100_head profile_rate_1000_head" id="profile_rate_num">'.$rr['user_rate'].'</div></a>');}
    } else {
    if($rr['user_rate'] < 100){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<div class="profile_rate_100_left "></div>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <div class="profile_rate_100_right "></div>
    <div class="profile_rate_100_head " id="profile_rate_num">'.$rr['user_rate'].'</div>');
    }
    if($rr['user_rate'] < 100 && $rr['user_rate'] < 500){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<div class="profile_rate_100_left "></div>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <div class="profile_rate_100_right "></div>
    <div class="profile_rate_100_head " id="profile_rate_num">'.$rr['user_rate'].'</div>');
    }
    if($rr['user_rate'] > 500 && $rr['user_rate'] <= 1000){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<div class="profile_rate_100_left profile_rate_500_left"></div>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <div class="profile_rate_100_right profile_rate_500_right"></div>
    <div class="profile_rate_100_head profile_rate_500_head" id="profile_rate_num">'.$rr['user_rate'].'</div>');
    }
    if($rr['user_rate'] > 1000){
    $rr = $db->super_query("SELECT user_rate FROM `".PREFIX."_users` WHERE user_id = '{$id}'");
    $tpl->set('{rating}', '<div class="profile_rate_100_left profile_rate_1000_left"></div>
    <div class="profile_rate_add" onclick="doLoad.data(1); rating.addbox(\''.$id.'\')" onmouseover="myhtml.title(\'1\', \'Повысить рейтинг\', \'rate\', 1)" id="rate1" id="rate1"><img src="/templates/Default/images/icons/rate_ic.png"></div>
    <div class="profile_rate_100_right profile_rate_1000_right"></div>
    <div class="profile_rate_100_head profile_rate_1000_head" id="profile_rate_num">'.$rr['user_rate'].'</div>');
    }
    }
2. Зайдите в ./templates/ШАБЛОН/profile.tpl и перед [not-all-country]<div class="flpodtext">Страна:</div> вставьте:

Код: Выделить всё

<div class="profile_rate_pos">
<div class="profile_rate_text">Рейтинг</div>{rating}</div> 


3. Зайдите в БД->таблица vii_users->Структура и создайте поле:
user_rate int(11)

4. Выполните SQL-запрос:

Код: Выделить всё

CREATE TABLE IF NOT EXISTS `vii_user_rate` (
`author_user_id` int(11) NOT NULL,
`for_user_id` int(11) NOT NULL,
`rate_date` varchar(80) NOT NULL,
`num` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
5. В ./system/mod.php добавьте:

Код: Выделить всё

		//Рейтинг
		case "rating":
		include ENGINE_DIR.'/modules/rating.php';
		break;
6. В ./templates/ШАБЛОН/style/style.css добавьте:

Код: Выделить всё

/* PROFILE RATING */
.profile_rate_pos{float:right;margin-top:5px}
.profile_rate_100_left, .profile_rate_500_left, .profile_rate_1000_left{background:url("../images/icons/rate100_l.png");float:left;width:10px;height:44px}
.profile_rate_100_right, .profile_rate_500_right, .profile_rate_1000_right{background:url("../images/icons/rate100_r.png");float:right;width:10px;height:44px}
.profile_rate_100_head, .profile_rate_100_head, .profile_rate_1000_head{background:url("../images/icons/rate100.png");margin-left:96px;margin-right:27px;height:38px;font-size:19pt;color:#fff;font-weight:bold;padding-top:6px;padding-left:5px;padding-right:5px}
.profile_rate_add{background:#f0f0f0;float:right;padding:5px;margin-top:10px;margin-left:-2px;cursor:pointer;
border-top-right-radius:5px;border-bottom-right-radius:5px;-moz-border-top-right-radius:5px;-moz-border-bottom-right-radius:5px;-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px}
.rating_text{line-height:20px}
.rating_iny{text-align:center;font-weight:bold;font-size:45px;color:#a8bdc9;padding-top:50px;padding-bottom:50px}
.rating_iny input{font-size:40px;width:67px}
.profile_rate_500_left{background:url("../images/icons/rate500_l.png")}
.profile_rate_500_right{background:url("../images/icons/rate500_r.png")}
.profile_rate_500_head{background:url("../images/icons/rate500.png")}
.profile_rate_1000_left{background:url("../images/icons/rate1000_l.png")}
.profile_rate_1000_right{background:url("../images/icons/rate1000_r.png")}
.profile_rate_1000_head{background:url("../images/icons/rate1000.png")}
.rating_text_balance{font-size:12px;font-weight:normal;color:#777;margin-top:15px}
.profile_ratingview{font-size:21px;color:#a8bdc9;font-weight:bold;float:right;margin-right:13px;margin-top:10px}
.profile_rate_text{float:left;font-size:21px;color:#ddd;margin-top:7px;margin-right:8px}
.rating{background:url("../images/rating0.png") no-repeat;width:40px;height:38px;margin-right:5px;font-weight:bold;font-size:25px;color:#fff;text-align:center;float:left;margin-top:7px;cursor:pointer;opacity:0.5;margin-bottom:-10px;font-family:Comic Sans MS;padding-top:2px}
.rating:hover{opacity:1}
.rating2{opacity:0.7}
.ratpos{width:270px;margin:auto}
.ratingyes{width:120px;margin:auto}
.ratingyestext{color:#777;padding-top:19px;margin-right:10px}
.rating3{cursor:default;opacity:1}
.ratingbg{background:#f5f5f5;height:53px;margin-top:10px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}
.rateforowne{text-align:center;padding-top:19px;color:#777}
.rateforowne a{font-weight:bold}
.rate_block{float:left;width:320px;font-size:11px;margin-top:10px;margin-bottom:10px}
.rate_block a img{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;float:left;margin-right:10px}
.rate_vbss{float:right;margin-top:-3px;margin-right:10px}
.rate_date{color:#777;margin-top:5px}
.rate_date a{color:#777;text-decoration:underline}
.rate_date a:hover{text-decoration:none}
.rate_alluser{background:#EEF0F2;color:#738392;display:block;padding:16px;text-align:center;font-size:11px;margin:-20px;margin-top:10px}
.rate_fnews_bott{margin-bottom:-5px}
Вложения
Рейтинг с изменением цвета.zip
(40.17 КБ) 342 скачивания
(108).jpg
(108).jpg (485.83 КБ) 11827 просмотров

Ответить