New rating button » DataLife Engine Support

DLEVIET - DataLife Engine Support Home Page

New rating button

  • Author: admin;  
  • Views: 3953;  
  • Date: 14 March 2010;  
New rating button

New rating button


Tested : DLE 8.0, 8.2, 8.3 (testing in DLE 8.5)

DO IT

1. Open file engine/ajax/rating.php

Find

if( $go_rate > 5 or $go_rate < 1 ) $go_rate = 0;


Replace to

You must register before you can view this text.


2. Open file engine/modules/functions.php

Find function ShowRating

Replace all content in this function to

You must register before you can view this text.


Next find function ShortRating (below function ShowRating)


Replace all content in this function to

You must register before you can view this text.


Next find function userrating (below function ShortRating)


Replace all content in this function to

You must register before you can view this text.


3. Open file templates/{your template}/css/engine.css

Find

.rating {
    color: #757575;
    font-size: 11px;        
    font-family: tahoma;    
    width: 85px;
    height: 16px;
}
.unit-rating {
    list-style: none;
    margin: 0px;
    padding: 0px;
    width: 85px;
    height: 16px;
    position: relative;
    background-image: url(../dleimages/rating.gif);
    background-position: top left;
    background-repeat: repeat-x;
}
.unit-rating li {
    text-indent: -90000px;
    padding: 0px;
    margin: 0px;
    float: left;
}
.unit-rating li a {
    display: block;
    width: 17px;
    height: 16px;
    text-decoration: none;
    text-indent: -9000px;
    z-index: 17;
    position: absolute;
    padding: 0px;
}
.unit-rating li a:hover {
    background-image: url(../dleimages/rating.gif);
    background-position: left center;
    z-index: 2;
    left: 0px;
}
.unit-rating a.r1-unit { left: 0px; }
.unit-rating a.r1-unit:hover { width: 17px; }
.unit-rating a.r2-unit { left: 17px; }
.unit-rating a.r2-unit:hover { width: 34px; }
.unit-rating a.r3-unit { left: 34px; }
.unit-rating a.r3-unit:hover { width: 51px; }
.unit-rating a.r4-unit { left: 51px; }    
.unit-rating a.r4-unit:hover { width: 68px; }
.unit-rating a.r5-unit { left: 68px; }
.unit-rating a.r5-unit:hover { width: 85px; }
.unit-rating li.current-rating {
    background-image: url(../dleimages/rating.gif);
    background-position: left bottom;
    position: absolute;
    height: 16px;
    display: block;
    text-indent: -9000px;
    z-index: 1;
}


Replace to

You must register before you can view this text.


4. Open file /templates/{your template}/shortstory.tpl AND /templates/{your template}/fullstory.tpl

Find

{rating}


Replace to

You must register before you can view this text.


5. You need file engine/ajax/js_edit.js uncompress. (You can see this file in folder Developer\uncompressed of DLE Distribution)

Find

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);
};


Replace to

You must register before you can view this text.


In this step, you can see line ajax.element = 'ratig-layer-' + id; differ from old function.

6. Copy two picture below and put to folder templates/{your template}/dleimages

New rating button và New rating button
We encourage you to Register or Login to website under your name.

zeppi

Posted 14 March 2010 00:44 Register: 13.03.2010
thanks a lot admin

megafree

Posted 14 March 2010 01:01 Register: 7.03.2010
Another Superb Sharing
Thanks for the Sharing
Keep Sharing :)

Jomafi

Posted 14 March 2010 07:47 Register: 14.03.2010
thanks admin nice sharing,
If you share dle - Search Cloud Module
is dleviet.com Rang No. 1 DLE Support.
My Favorite Website: dleviet.com

moutez

Posted 21 March 2010 05:04 Register: 21.03.2010
not working ,thanx

usman8416

Posted 18 April 2010 20:20 Register: 24.02.2010
dleviet.com is the best dle modules and edit codes site... i love this site.... thank you admin... you are sharing great stuff... great work... thanks a lot...

phenix_tn

Posted 21 April 2010 14:56 Register: 21.04.2010
please is compatible with version 7.5 ?

vikrampanwar7

Posted 25 April 2010 14:30 Register: 20.04.2010
not working, please help me. When i click on the rate button, it doesn't work

karev

Posted 25 May 2010 07:25 Register: 22.05.2010
nice sharing but work only in full-story.tpl when i put it in short-story it dont work when i click to rate there is nothing happen i must refresh the page to see the change there is any fix ?????

tpecop

Posted 9 June 2010 23:56 Register: 9.06.2010
How to make arrows keep after voted?

The1Master

Posted 25 June 2010 10:02 Register: 4.04.2010
why keep it after vote ?!!, if you keep it the user can vote more than once so the vote look like failed and unreasonable vote :s
Information
Members of Guest cannot leave comments.

Pagerank Update

    Updates Yandex SEO
    13.04.2012
    16.02.2012
    04.02.2012
    Updates Yandex search
    17.05.2012
    15.05.2012
    12.05.2012
    Updates Yandex Catalogue
    18.05.2012
    16.05.2012
    11.05.2012
    Updates Google
    03.05.2012
    06.02.2012
    08.11.2011

Find us on Facebook

Poll

How do you know DataLife Engine Support?

Search Engine
Other DLE Support websites
Forum
Friends
Others

Sponsor

Calendar

«    May 2012    »
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
Contact us in social network

Facebook

Twitter