Naujokas
Reputacija:
0 Pranešimai: 7
Įstojo: 2008-02-01
echo "";
echo" ";
showratings("F", $_GET['filmas_id'], INFUSIONS."filmai_panel/filmai.php?filmas_id=".$data['filmai_id']);
?itas?
brendiz
parašyta 2012-06-18 22:38
Apšylantis
Reputacija:
0 Pranešimai: 50
Įstojo: 2011-03-02
o be to kaip tau rodo ta balsavima?
Rimas02
parašyta 2012-06-19 07:16
Naujokas
Reputacija:
0 Pranešimai: 7
Įstojo: 2008-02-01
Va kaip pas amne yra.
Netinkamas paveiksliukas
Redagavo Rimas02 2012-06-19 07:17
minimukas
parašyta 2012-06-19 07:55
Geradarys
Reputacija:
0 Pranešimai: 602
Įstojo: 2009-06-11
Ne siam kode tera beda tavo :DD, ziurek savo ajax reiting failuose, bus breikas ikistas pas tave ir viskas :))
Rimas02
parašyta 2012-06-19 13:35
Naujokas
Reputacija:
0 Pranešimai: 7
Įstojo: 2008-02-01
Èia kaip suprantu bet nieko nerandu a? èia.
Code
/*-------------------------------------------------------+
| Dynamic Star Rating Redux
| Developed by Jordan Boesch
| www.boedesign.com
| Licensed under Creative Commons - http://creativecommons.org/licenses/by-nc-nd/2.5/ca/
| Used CSS from komodomedia.com.
+--------------------------------------------------------+
| Ajax Rating System mSF For PHP-Fusion 7.xx v.1.1
| Copyright © 2008-2009 Powered by .:MeF:.
| URL: http://x-iweb.ru/
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
function getRating($id, $rtype) {
$total = 0;
$rows = 0;
$sel = dbquery(\"SELECT rating_vote FROM \".DB_RATINGS.\" WHERE rating_item_id = '$id' AND rating_type = '\".$rtype.\"'\");
if(dbrows($sel) != 0){
while($data = dbarray($sel)) {
$total = $total + $data['rating_vote'];
$rows++;
}
$perc = ($total/$rows) * 20;
//$newPerc = round($perc/5)*5;
//return $newPerc.'%';
$newPerc = round($perc,2);
return $newPerc.'%';
} else { return '0%'; }
return '0%';
}
function outOfFive($id, $rtype) {
$total = 0;
$rows = 0;
$sel = dbquery(\"SELECT rating_vote FROM \".DB_RATINGS.\" WHERE rating_item_id = '\".$id.\"' AND rating_type = '\".$rtype.\"'\");
if(dbrows($sel) != 0) {
while($data = dbarray($sel)){
$total = $total + $data['rating_vote'];
$rows++;
}
$perc = ($total/$rows);
return round($perc,2);
//return round(($perc*2), 0)/2; // 3.5
} else { return '0'; }
return '0';
}
function getVotes($id, $rtype){
$sel = dbquery(\"SELECT rating_vote FROM \".DB_RATINGS.\" WHERE rating_item_id = '$id' AND rating_type = '\".$rtype.\"'\");
$rows = mysql_num_rows($sel);
if ($rows == 0) {
$votes = \"0 balsu\";
} else if($rows == 1) {
$votes = \"1 balsas\";
} else if($rows > 1 && $rows < 5) {
$votes = $rows.\" balsai\";
} else {
$votes = $rows.\" balsu\";
}
return $votes;
}
function showratings($rtype, $id, $rating_link = true) {
global $show5, $showPerc, $showVotes, $static;
$show5 = false; $showPerc = false; $showVotes = false; $static = NULL;
// Check if they have already voted...
$text = '';
$sel = dbquery(\"SELECT rating_item_id FROM \".DB_RATINGS.\" WHERE rating_ip = '\".USER_IP.\"' AND rating_item_id = '$id' AND rating_type='\".$rtype.\"'\");
if(dbrows($sel) != 0 || $static == 'novote') {
echo '';
echo 'Vartotojų įvertinimas: '.outOfFive($id, $rtype).' /5';
echo ' ('.getRating($id, $rtype).' )';
echo ' (Viso: '.getVotes($id, $rtype).' )';
echo '
';
echo '';
echo ' ';
echo '>1 ';
echo '>2 ';
echo '>3 ';
echo '>4 ';
echo '>5 ';
echo ' ';
echo '
';
} else {
echo '';
$show5bool = 'true';
echo 'Vartotojų įvertinimas: '.outOfFive($id, $rtype).' /5';
$showPercbool = 'true';
echo ' ('.getRating($id, $rtype).' )';
$showVotesbool = 'true';
echo ' ('.getVotes($id, $rtype).' )';
echo '
';
echo '';
echo ' ';
echo '>1 ';
echo '>2 ';
echo '>3 ';
echo '>4 ';
echo '>5 ';
echo ' ';
echo '
';
}
}
/*
// Added in version 1.5
// Fixed sort in version 1.7
function getTopRated($limit, $table, $idfield, $namefield){
$result = '';
$sql = \"
SELECT COUNT(ratings.rating_id) as rates,ratings.rating_item_id,\".DB_RATINGS.\".\".$namefield.\" as thenamefield,
ROUND(AVG(ratings.rating_vote),2) as rating
FROM ratings,\".DB_RATINGS.\" WHERE \".DB_RATINGS.\".\".$idfield.\" = ratings.rating_item_id GROUP BY rating_id
ORDER BY rates DESC,rating DESC LIMIT \".$limit.\"
\";
$sel = dbquery($sql);
$result .= ''.\"\n\";
while($data = dbarray($sel)){
$result .= ''.$data['thenamefield'].' ('.$data['rating'].') '.\"\n\";
}
$result .= ' '.\"\n\";
return $result;
}
*/
?>
Redagavo Rimas02 2012-06-19 13:35
Peršokti į forumą:
PHP-Fusion funkcijos
PHP-Fusion failų modifikavimas
Pageidaujami infusionai, panelės, modifikacijos.
Jūsų sukurta modifikacija, panelė, infusion'as
Modifikacijų, įskiepių, panelių kūrimas
Modifikacijų, įskiepių diegimas
Naujų modifikacijų, panelių, infusionų pristatymai
Patobulinimai
Taisymas
Vertimas
Mūsų modifikacijos
Pasiūlymai
Tavo kurtas stilius (Show Off)
Stiliaus pagalba
Tinklalapių kūrimas
Jūsų sukurti tinklalapiai
Šiukšlės
Off-topic diskusijos
Perku, parduodu, dovanoju, keičiu, ieškau
2007 metų archyvas
2008 metų archyvas
Copyright © 2026 phpfusion.lt