forked from 4ducky/4ducky
Move the original PHP site into legacy/
The PHP sources, templates and old jQuery-based scripts move unchanged into legacy/ for reference. Shared assets (media/, images/, favicon.ico, the default avatar) stay at the repository root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
RewriteEngine on
|
||||
|
||||
#not a real file or directory
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^([^\.]*|search/.*)$ index.php?s=$1
|
||||
|
||||
RewriteCond %{HTTP_HOST} !^www\.4ducky\.com$
|
||||
RewriteRule ^ http://www.4ducky.com%{REQUEST_URI} [R=301]
|
||||
@@ -0,0 +1 @@
|
||||
feel:$apr1$N7rXkvNc$v1Jq9zi5sSZNU5LTimL3d.
|
||||
@@ -0,0 +1,341 @@
|
||||
<?php
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
function shorter($input, $length)
|
||||
{
|
||||
//no need to trim, already shorter than trim length
|
||||
if (strlen($input) <= $length) {
|
||||
return $input;
|
||||
}
|
||||
|
||||
//find last space within length
|
||||
$last_space = strrpos(substr($input, 0, $length), ' ');
|
||||
if(!$last_space) $last_space = $length;
|
||||
$trimmed_text = substr($input, 0, $last_space);
|
||||
|
||||
//add ellipses (...)
|
||||
$trimmed_text .= '...';
|
||||
|
||||
return $trimmed_text;
|
||||
}
|
||||
|
||||
function howlong($a=0, $b=0) {
|
||||
if (!is_numeric($a)) $a = strtotime($a); if (!is_numeric($b)) $b = strtotime($b);
|
||||
if ($a == 0) $a = time(); if ($b == 0) $b = time();
|
||||
if ($a == $b) return "at the same time";
|
||||
if ($a > $b) { $aa = $b; $b = $a; $a = $aa; $q = "away"; } else { $q = "ago"; }
|
||||
$value = $b-$a;
|
||||
if ($value == 1) return "1 second $q";
|
||||
if ($value < 60) return "$value seconds $q";
|
||||
$value /= 60;
|
||||
if (round($value) == 1) return "1 minute $q";
|
||||
if ($value < 60) return round($value) . " minutes $q";
|
||||
$value /= 60;
|
||||
if (round($value) == 1) return "1 hour $q";
|
||||
if ($value < 24) return round($value) . " hours $q";
|
||||
$value /= 24;
|
||||
if (round($value) == 1) if ($q == "ago") return "yesterday"; else return "tomorrow";
|
||||
if ($value < 31) return round($value) . " days $q";
|
||||
$value /= 31;
|
||||
if (round($value) == 1) return "1 month $q";
|
||||
if ($value < 12) return round($value) . " months $q";
|
||||
$value /= 12;
|
||||
if (round($value) == 1) return "1 year $q";
|
||||
return round($value) . " years $q";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) {
|
||||
|
||||
|
||||
$libpath = 'lib';
|
||||
include( $libpath.'/config.php' );
|
||||
include( $libpath.'/db.php' );
|
||||
include( $libpath.'/users.php' );
|
||||
|
||||
|
||||
if((empty($_COOKIE[Config::$sessionCookie]) && !empty($_COOKIE[Config::$rememberCookie]))) {
|
||||
if( Config::$vbbIntegration['enabled'] ) { include( 'lib/class.forumops.php' ); }
|
||||
}
|
||||
|
||||
$user = new User();
|
||||
$messages = array();
|
||||
$LoginState = $user->login();
|
||||
|
||||
if ( $_POST["q"] == "lastcomments"){
|
||||
|
||||
$comments = DB::query("SELECT
|
||||
c.created, i.keyword,c.id,u.name,u.avatar,c.content
|
||||
FROM pl_comments c
|
||||
LEFT JOIN pl_users u ON c.userId = u.id
|
||||
RIGHT JOIN pl_images i ON c.imageId = i.id
|
||||
WHERE c.c_like=0 ORDER BY c.created DESC
|
||||
LIMIT 30");
|
||||
|
||||
foreach (array_keys($comments) as $c) {
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id);
|
||||
$blockeduser = array_map('strtolower', unserialize($blockedrow['users']));
|
||||
$lower = strtolower($comments[$c]["name"]);
|
||||
|
||||
if (!in_array($lower,$blockeduser)){
|
||||
?>
|
||||
|
||||
<div id="commentbar">
|
||||
|
||||
<a href="<?php echo (Config::$absolutePath.'all/view/'.$comments[$c]["keyword"]); ?>">
|
||||
<div id="commentimg">
|
||||
<img width="28" height="28" src="<?php echo(Config::$absolutePath.$comments[$c]["avatar"]); ?>" />
|
||||
</div>
|
||||
<div id="commenttext">
|
||||
<strong><?php echo(shorter(strip_tags($comments[$c]["name"]),"10")); ?>: </strong><?php echo(shorter(strip_tags($comments[$c]["content"]),"50")); ?>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php }}
|
||||
|
||||
|
||||
|
||||
}elseif($_POST["q"] == "comments" && isset($_POST["imageId"])){
|
||||
|
||||
$comments = DB::query(
|
||||
'SELECT
|
||||
c.id,c.c_like,c.userId, c.content, u.name, u.avatar, u.color,
|
||||
UNIX_TIMESTAMP(c.created) AS created
|
||||
FROM '.TABLE_COMMENTS.' c
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = c.userId
|
||||
WHERE c.imageId = :1
|
||||
ORDER BY c_like DESC,created',
|
||||
$_POST["imageId"]
|
||||
);
|
||||
|
||||
$commentCount = count( $comments );
|
||||
$likeCount = 0;
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once 'lib/bbcode.class.php';
|
||||
$bbcode = new SimpleBBCode;
|
||||
|
||||
foreach( array_keys($comments) as $i ) {
|
||||
$comments[$i]['content'] = nl2br($bbcode->parse(
|
||||
htmlspecialchars($comments[$i]['content']))
|
||||
);
|
||||
}
|
||||
|
||||
foreach( $comments as $c ) {
|
||||
|
||||
$commentimg = DB::getRow("SELECT * FROM pl_commentuploads WHERE c_id=:1",$c['id']);
|
||||
|
||||
if (count($commentimg) != 0){
|
||||
$min = 'style="min-height:86px;"';
|
||||
}else{
|
||||
$min = '';
|
||||
}
|
||||
$cst = "";
|
||||
if ($c["color"] != "000000"){
|
||||
$cst = 'style="color:#'.$c["color"].'"';
|
||||
}
|
||||
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id);
|
||||
$blockeduser = array_map('strtolower', unserialize($blockedrow['users']));
|
||||
$lower = strtolower($c['name']);
|
||||
|
||||
|
||||
if((int)$c["c_like"] ==1 && $likeCount ==0){ ?>
|
||||
|
||||
<div class="comment" style="border: 1px solid #FFD600;">
|
||||
<div style="color: #FFD600;font-size: 30px;width:32px;height:32px; float: left; padding-left: 7px;">♥</div>
|
||||
|
||||
<?php foreach( $comments as $c ) {
|
||||
if((int)$c["c_like"] ==1){ ?>
|
||||
<a title="ID: <?php echo $c["userId"]; ?>" href="<?php echo Config::$absolutePath.'user/'.$c['name']; ?>"><img class="avatarSmall" width="32" height="32" src="<?php echo Config::$absolutePath.$c['avatar']; ?>"/></a> <?php }
|
||||
} $likeCount = 1;?>
|
||||
</div>
|
||||
|
||||
<?php }else{
|
||||
if (in_array($lower,$blockeduser)){
|
||||
?>
|
||||
<br/><a class="quote" style="margin-left: 5px;" href="javascript:;" onclick="javascript:toggle('comment<?php echo $c['id'];?>');"><img style="margin-right: 10px; vertical-align:middle;" height="28" width="28" src="/media/xd.png" alt="blocked"/>Comment blocked (<?php echo($c['name'])?>)</a>
|
||||
<div style="display: none;" id="comment<?php echo $c['id'];?>">
|
||||
<?php }
|
||||
|
||||
if((int)$c["c_like"] ==0){
|
||||
?>
|
||||
|
||||
|
||||
<div id="comment<?php echo $c['id']; ?>" class="comment" <?php echo($min); ?>>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="40" valign="top"><a <?php echo($cst); ?> title="ID: <?php echo $c["userId"]; ?>" href="<?php echo Config::$absolutePath.'user/'.$c['name']; ?>"><img class="avatarSmall" width="32" height="32" src="<?php echo Config::$absolutePath.$c['avatar']; ?>"/></a></td>
|
||||
<td valign="top" >
|
||||
<div class="info" id="unmark" style="float:right;padding-right:5px;"><a href="#content_comment" class="quote" onclick="reComment(<?php echo $c['id']; ?>,'<?php echo $c['name']; ?>')"><?php echo howlong($c['created'],time()); ?></a> <?php if ($user->admin) { ?><a href="javascript:;" onclick="return delComment(<?php echo $c['id']; ?>, this)">[x]</a><?php } ?></div><div><a <?php echo($cst); ?> title="ID: <?php echo $c["userId"]; ?>" href="<?php echo Config::$absolutePath.'user/'.$c['name']; ?>"><?php echo $c['name']; ?></a></div>
|
||||
<?php if(isset($commentimg)) {?>
|
||||
<div style="float:left;margin-right:10px;"><a href="<?php echo(Config::$absolutePath.$commentimg['image_link']); ?>" rel="lightbox[more]" title="<?php echo $c["content"];?>"><img src="<?php echo(Config::$absolutePath.$commentimg["thumb_link"]); ?>"/></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="<?php echo $c['id']; ?>"><?php echo $c["content"];?></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php } if (in_array($lower,$blockeduser)){ echo("</div>"); }}
|
||||
|
||||
}
|
||||
if(!isset($comments)){
|
||||
echo "no comments yet";
|
||||
}
|
||||
|
||||
}elseif($_POST["q"] == "add" && isset($_POST["imageId"]) && isset($_POST["content"])){
|
||||
if($user->id){
|
||||
|
||||
require_once( 'lib/imageviewer.php' );
|
||||
$iv = new ImageViewer();
|
||||
$keyword = DB::getRow("SELECT keyword FROM pl_images WHERE id=:1",$_POST["imageId"]);
|
||||
$iv->setCurrent($keyword["keyword"]);
|
||||
$iv->load();
|
||||
|
||||
if($iv->addComment($user->id, $_POST['content'],$_POST["urlUpload"]) ) {
|
||||
$uploadid= DB::getRow("SELECT LAST_INSERT_ID() as id");
|
||||
|
||||
if (strlen($_POST["urlUpload"]) > 4){
|
||||
include( 'lib/imageuploader.php' );
|
||||
if(ImageUploader::copyFromUrl( $_POST["urlUpload"], "", true, $uploadErrors,true,$uploadid["id"])){
|
||||
|
||||
}else{echo("notok-image");exit();}
|
||||
}
|
||||
|
||||
}else{echo("notok-comment");exit();}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}elseif($_POST["q"] == "fav" && isset($_POST["imageId"])){
|
||||
if($user->id){
|
||||
$imgId = DB::getRow("SELECT * FROM pl_images WHERE id=:1",$_POST["imageId"]);
|
||||
if (isset($imgId)){
|
||||
$countfav = DB::getRow("SELECT COUNT( * ) AS c FROM pl_fav WHERE user=:1 and imageId=:2",$user->id,$imgId['id']);
|
||||
if ((int)$countfav["c"] > 0){
|
||||
DB::query("DELETE FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$imgId['id']);
|
||||
DB::query("DELETE FROM pl_comments WHERE userId=:1 and imageId =:2 and c_like=1",$user->id,$imgId['id']);
|
||||
DB::query("UPDATE pl_images SET score=score-5 WHERE id=:1",$imgId['id']);
|
||||
echo("Removed from your favorites");
|
||||
}else{
|
||||
DB::insertRow("pl_fav",array("imageId"=>$imgId['id'],"user"=>$user->id));
|
||||
DB::query("UPDATE pl_images SET score=score+5 WHERE id=:1",$imgId['id']);
|
||||
$datenow = date( 'Y.m.d H:i:s' );
|
||||
DB::insertRow( "pl_comments", array(
|
||||
'imageId' => $imgId['id'],
|
||||
'userId' => $user->id,
|
||||
'created' => $datenow,
|
||||
'content' => "i like",
|
||||
'c_like' =>1));
|
||||
|
||||
echo("Added to your favorites");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}elseif($_POST["q"] == "upload"){
|
||||
$uploadErrors = array();
|
||||
if( $user->id ) {
|
||||
|
||||
$spaming = $user->isSpamming();
|
||||
if( $user->isSpamer()) {
|
||||
$uploadErrors[]='You have to wait 10 seconds.';
|
||||
}elseif (is_numeric($spaming)){
|
||||
|
||||
if( (int)$spaming > 0 ){
|
||||
$blockreason = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$user->id);
|
||||
$uploadErrors[] = 'Upload gesperrt bis: '.date('Y-m-d H:i:s',(int)$blockreason["time"]);
|
||||
$uploadErrors[] = 'Grund: '.$blockreason["spam_reason"];
|
||||
$left = ((int)$blockreason["time"] - (int)time())/60;
|
||||
$uploadErrors[] = 'Noch: '.round($left,2).' Minuten ';
|
||||
}
|
||||
}elseif( $user->isSpamming() ) {
|
||||
$uploadErrors[] = 'Spamming ist nicht erlaubt. Wennde dich an einen Administrator <br> <br> Mann: <a href="/inbox/Mann"><img src="/media/mail.png"></a>';
|
||||
$uploadErrors[] = string(is_numeric($user->isSpamming()));
|
||||
}elseif( $user->isSpamLocked() ) {
|
||||
$uploadErrors[] = 'No more than 50 images in 2 hours!';
|
||||
}
|
||||
}else{
|
||||
$uploadErrors[] = 'Log in.';
|
||||
}
|
||||
|
||||
if(count($uploadErrors) > 0){
|
||||
|
||||
?>
|
||||
|
||||
<ul>
|
||||
<?php foreach($uploadErrors as $e){ ?>
|
||||
<li><?php echo $e; ?></li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
}else{?>
|
||||
|
||||
|
||||
<form id="UForm" action="/upload" method="post" enctype="multipart/form-data" >
|
||||
<table width="80%" border="0" cellspacing="1px" cellpadding="0">
|
||||
<tr>
|
||||
<td valign="top"><strong>Rules:</strong></td>
|
||||
<td style="padding-left:3px;" valign="top">Gore, CP, Spam, Nazi, Porn = Ban <br /><br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>Image:</strong></td>
|
||||
<td valign="top"><input type="file" name="image" style="color: #000; background-color: #fff;"/><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>or Url:</strong></td>
|
||||
<td valign="top"><input type="text" name="url" value=""/><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>Comment:</strong></td>
|
||||
<td valign="top"><textarea id="content_comment" name="ucomment" rows="3" cols="30"></textarea><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td align="right"><input type="submit" name="upload" value="Upload" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" id="q" value="upload" />
|
||||
</form>
|
||||
|
||||
|
||||
<?php }
|
||||
|
||||
|
||||
|
||||
}elseif($_POST["q"] == "addon"){
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
To use the remote upload just drag the following link somewhere to your bookmarks (or in Opera right click it
|
||||
and choose <em>Bookmark link</em>):
|
||||
» <a onclick="alert('Drag this Link to your Bookmarks!'); return false;" href="javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('src','<?php echo Config::$frontendPath; ?>media/post.js.php');document.body.appendChild(e)})());"><u>Post to <?php echo Config::$siteName ?></u></a> «
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Now, if you're on a website where you see an image you want to post, just click on your newly created bookmark
|
||||
and then on the image you want to post. Thats all. Really!
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
||||
}else{
|
||||
|
||||
echo"Error";
|
||||
|
||||
}
|
||||
}else{
|
||||
echo"Error";
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<html>
|
||||
<header>
|
||||
<title>Byebye Ducky</title>
|
||||
</header>
|
||||
|
||||
<body style="background: #242424; font-size: 34px; color: #fff; padding-top: 4%; width: 80%;">
|
||||
|
||||
<iframe style="display:none;" width="1" height="1" src="https://www.youtube.com/embed/2k4os5vzyag?rel=0&autoplay=1&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
|
||||
|
||||
<h1>Das Entenreich muss sterben</h1>
|
||||
|
||||
<p>Der Winter bricht an, der Teich wird zu berühmt und die Enten sollten sich in ihr Winterquartier verziehen. Ein langer Flug steht uns bevor, ein Flug voller Strapazen. Aber wir haben gut gegessen und sind bereit.</p>
|
||||
|
||||
<p>War <strong>schön</strong> mit euch und ich würde gerne jeden von euch erwähnen - aber ich kenne keine Entennamen - bis auf Dolan. Danke Dolan!</p>
|
||||
|
||||
<p>
|
||||
<h2>Eier, frisch aus dem Nest:</h2>
|
||||
<!-- Morgen ab ca. 12 Uhr!! <a href="http://www.4ducky.com/entenreich.zip">4DUCKY.com Script inkl. DB Dumb zum Download</a> -->
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Wir sehen uns!
|
||||
</p>
|
||||
|
||||
<script id="chatBroEmbedCode">
|
||||
/* Chatbro Widget Embed Code Start */
|
||||
function ChatbroLoader(chats,async) {async=async!==false;var params={embedChatsParameters:chats instanceof Array?chats:[chats],needLoadCode:typeof Chatbro==='undefined'};var xhr=new XMLHttpRequest();xhr.withCredentials = true;xhr.onload=function(){eval(xhr.responseText)};xhr.onerror=function(){console.error('Chatbro loading error')};xhr.open('POST','//www.chatbro.com/embed_chats/',async);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send('parameters='+encodeURIComponent(JSON.stringify(params)))}
|
||||
/* Chatbro Widget Embed Code End */
|
||||
ChatbroLoader({encodedChatId: '25Hq'});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="https://panzi.github.io/Browser-Ponies/basecfg.js" id="browser-ponies-config"></script><script type="text/javascript" src="https://panzi.github.io/Browser-Ponies/browserponies.js" id="browser-ponies-script"></script><script type="text/javascript">/* <![CDATA[ */ (function (cfg) {BrowserPonies.setBaseUrl(cfg.baseurl);BrowserPonies.loadConfig(BrowserPoniesBaseConfig);BrowserPonies.loadConfig(cfg);})({"baseurl":"https://panzi.github.io/Browser-Ponies/","fadeDuration":500,"volume":1,"fps":25,"speed":3,"audioEnabled":false,"showFps":false,"showLoadProgress":false,"speakProbability":0.1,"spawn":{"applejack":1,"fluttershy":1,"pinkie pie":5,"rainbow dash":1,"rarity":1,"twilight sparkle":1},"autostart":true}); /* ]]> */</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
$user = new User();
|
||||
$user->login();
|
||||
|
||||
if( !$user->admin ) {
|
||||
echo "You need to be logged in as an admin user!";
|
||||
exit();
|
||||
}
|
||||
|
||||
$Spammer = DB::query("SELECT * from pl_users WHERE spamblocked=1");
|
||||
$Abuses = DB::query("SELECT *
|
||||
FROM `pl_abuse`
|
||||
WHERE `read` =:1",0);
|
||||
|
||||
$newComments = DB::query(
|
||||
'SELECT
|
||||
c.id, c.content, u.name, u.avatar,
|
||||
UNIX_TIMESTAMP(c.created) AS created,
|
||||
i.keyword FROM '.TABLE_COMMENTS.' c
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = c.userId
|
||||
LEFT JOIN '.TABLE_IMAGES.' i
|
||||
ON i.id = c.imageId
|
||||
ORDER BY c.created DESC LIMIT 100'
|
||||
);
|
||||
include( 'templates/header.tpl.php' );
|
||||
?>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="50%" valign="top">
|
||||
<h2>Newest Comments:</h2>
|
||||
<div style="width:100%">
|
||||
<?php foreach( $newComments as $c ) {?>
|
||||
<div class="comment">
|
||||
<div class="commentHead">
|
||||
<img class="avatarSmall" width="16" height="16" src="<?php echo Config::$absolutePath.$c['avatar']; ?>"/>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$c['name']; ?>"><?php echo $c['name']; ?></a>
|
||||
at <?php echo date('d. M Y H:i',$c['created']); ?>
|
||||
[bild:<a href="<?php echo Config::$absolutePath.'all/view/'.$c['keyword']; ?>"><?php echo $c['keyword']; ?></a>]
|
||||
<?php if($user->admin) { ?>
|
||||
<div style="float:right;" id="del">
|
||||
<a href="#" onclick="return delComment(<?php echo $c['id']; ?>, this)">[x]</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php echo $c['content']; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div></td>
|
||||
|
||||
<td width="50%" valign="top">
|
||||
<?php
|
||||
|
||||
if((count($Spammer)) > 0){
|
||||
echo '<h2 style="margin:5px;" >Newest Spammer:</h2>';
|
||||
foreach( $Spammer as $u ) {?>
|
||||
|
||||
<div class="userInfo" style="margin:5px;">
|
||||
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$u['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$u['name']; ?>"><?php echo $u['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
ID: <strong><?php echo $u['id']; ?></strong> /
|
||||
Images: <strong><?php echo $u['images']; ?></strong>
|
||||
<?php if( !empty($u['website'])) { ?>/
|
||||
Website: <strong><a href="<?php echo htmlspecialchars($u['website']); ?>" target="_blank">
|
||||
<?php echo htmlspecialchars($u['website']); ?>
|
||||
</a></strong>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php } }else{echo '<h2 style="margin:5px;" >No Spammer</h2>'; }?>
|
||||
|
||||
<?php
|
||||
if((count($Abuses)) > 0){
|
||||
echo '<h2 style="margin:5px;" >Newest Abuses:</h2>';
|
||||
foreach( $Abuses as $a ) {
|
||||
|
||||
$Image = DB::getRow("SELECT *,UNIX_TIMESTAMP(logged) AS loggedTS FROM pl_images WHERE id=:1",$a["imageid"]);
|
||||
if ($Image){
|
||||
?>
|
||||
|
||||
<div class="userInfo" style="margin:5px;">
|
||||
<img style="float:left; margin:2px;" width="64" height="64" src="<?php echo Config::$absolutePath."data/thumbs/".date("Y/m",$Image["loggedTS"])."/128x128/".$Image["thumb"]; ?>"/>
|
||||
|
||||
<div class="info">
|
||||
Reason: <strong><?php echo $a['reason']; ?></strong> /
|
||||
Email: <strong><?php echo $a['email']; ?></strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
<strong><a href="<?php echo Config::$absolutePath."all/view/".$Image['keyword']; ?>" > >> Thread</a> </strong>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
}else{
|
||||
echo('<div class="userInfo" style="padding:5px;">');
|
||||
echo('<a href="'.$a["imagelink"].'">'.$a["imagelink"].'</a><br>');
|
||||
echo('Reason: <strong>'.$a['reason'].'</strong> /
|
||||
Email: <strong>'.$a['email'].'</strong>');
|
||||
echo('</div>');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{echo '<h2 style="margin:5px;" >No Abuses</h2>';}?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
include( 'templates/footer.tpl.php' );
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
78G /var/www
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
include("lib/users.php");
|
||||
$user = new User();
|
||||
$user->loadEmail();
|
||||
$user->login();
|
||||
$counter = 0;
|
||||
|
||||
echo("Login OK<br>");
|
||||
|
||||
$id = $_GET["id"];
|
||||
$userinfo = DB::query("SELECT image,score,fame,id,logged,keyword,thumb FROM pl_images WHERE fame = 0 AND score < 10 ORDER BY logged ASC LIMIT 50",$id);
|
||||
|
||||
foreach($userinfo as $keyword){
|
||||
|
||||
$splitter = split("/",$keyword["keyword"]);
|
||||
$counter++;
|
||||
|
||||
echo $counter." - ".$splitter[0]."/".$splitter[1]."/".$keyword["image"];
|
||||
|
||||
if (file_exists("data/images/".$splitter[0]."/".$splitter[1]."/".$keyword["image"])){
|
||||
if (unlink("data/images/".$splitter[0]."/".$splitter[1]."/".$keyword["image"])){ echo(" -> Bild deleted"."<br>");}else{echo(" -> failed"."<br>");}
|
||||
}
|
||||
|
||||
if (file_exists("data/thumbs/".$splitter[0]."/".$splitter[1]."/128x128/".$keyword["thumb"])){
|
||||
if (unlink("data/thumbs/".$splitter[0]."/".$splitter[1]."/128x128/".$keyword["thumb"])){ echo(" -> 128x128 deleted"."<br>");}else{echo(" -> failed"."<br>");}
|
||||
}
|
||||
|
||||
if (file_exists("data/thumbs/".$splitter[0]."/".$splitter[1]."/192x192/".$keyword["thumb"])){
|
||||
if (unlink("data/thumbs/".$splitter[0]."/".$splitter[1]."/192x192/".$keyword["thumb"])){ echo(" -> 192x192 deleted"."<br>");}else{echo(" -> failed"."<br>");}
|
||||
}
|
||||
if (file_exists("data/thumbs/".$splitter[0]."/".$splitter[1]."/64x64/".$keyword["thumb"])){
|
||||
if (unlink("data/thumbs/".$splitter[0]."/".$splitter[1]."/64x64/".$keyword["thumb"])){ echo(" -> 64x64 deleted"."<br>");}else{echo(" -> failed"."<br>");}
|
||||
}
|
||||
$u = DB::getRow("DELETE FROM pl_comments WHERE imageId=:1",$keyword["id"]);
|
||||
$u = DB::getRow("DELETE FROM pl_unread WHERE imageid=:1",$keyword["id"]);
|
||||
$u = DB::getRow("DELETE FROM pl_fav WHERE imageId=:1",$keyword["id"]);
|
||||
}
|
||||
|
||||
$u = DB::query("DELETE FROM pl_images WHERE fame = 0 AND score < 10 ORDER BY logged ASC LIMIT 50",$keyword["id"]);
|
||||
|
||||
echo "<span style='background-color: #00FF00;'>Bilder entfernt aus der DB</span><br/>";
|
||||
|
||||
?>
|
||||
+331
@@ -0,0 +1,331 @@
|
||||
# ************************************************************
|
||||
# Sequel Pro SQL dump
|
||||
# Version 4541
|
||||
#
|
||||
# http://www.sequelpro.com/
|
||||
# https://github.com/sequelpro/sequelpro
|
||||
#
|
||||
# Host: 127.0.0.1 (MySQL 5.5.52-cll-lve)
|
||||
# Datenbank: A918540_fuehls
|
||||
# Erstellt am: 2016-11-25 22:18:37 +0000
|
||||
# ************************************************************
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
|
||||
# Export von Tabelle pl_abuse
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_abuse`;
|
||||
|
||||
CREATE TABLE `pl_abuse` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`imageid` int(11) NOT NULL,
|
||||
`reason` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
|
||||
`email` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
|
||||
`read` int(11) NOT NULL,
|
||||
`logged` int(11) NOT NULL,
|
||||
`imagelink` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
|
||||
`user` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_banned
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_banned`;
|
||||
|
||||
CREATE TABLE `pl_banned` (
|
||||
`id` int(11) NOT NULL,
|
||||
`reason` text CHARACTER SET utf8 NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_bannedimages
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_bannedimages`;
|
||||
|
||||
CREATE TABLE `pl_bannedimages` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`hash` char(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_blocked
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_blocked`;
|
||||
|
||||
CREATE TABLE `pl_blocked` (
|
||||
`id` int(11) NOT NULL,
|
||||
`users` text NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_comments
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_comments`;
|
||||
|
||||
CREATE TABLE `pl_comments` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`imageId` int(11) NOT NULL,
|
||||
`userId` int(11) NOT NULL,
|
||||
`created` datetime NOT NULL,
|
||||
`content` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`thumb` int(11) NOT NULL,
|
||||
`c_like` int(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `imageId` (`imageId`),
|
||||
KEY `userId` (`userId`,`created`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_commentuploads
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_commentuploads`;
|
||||
|
||||
CREATE TABLE `pl_commentuploads` (
|
||||
`c_id` int(11) NOT NULL,
|
||||
`image_link` text NOT NULL,
|
||||
`thumb_link` text NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_fav
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_fav`;
|
||||
|
||||
CREATE TABLE `pl_fav` (
|
||||
`imageId` int(11) NOT NULL,
|
||||
`user` int(11) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_imagecolors
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_imagecolors`;
|
||||
|
||||
CREATE TABLE `pl_imagecolors` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`imageId` int(11) NOT NULL,
|
||||
`r` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`g` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`b` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_images
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_images`;
|
||||
|
||||
CREATE TABLE `pl_images` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`logged` datetime NOT NULL,
|
||||
`views` int(11) NOT NULL DEFAULT '0',
|
||||
`user` int(11) NOT NULL,
|
||||
`score` float NOT NULL DEFAULT '0',
|
||||
`votes` int(11) NOT NULL DEFAULT '0',
|
||||
`keyword` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`tags` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`thumb` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`hash` char(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`source` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`fame` int(11) NOT NULL,
|
||||
`comment` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `keyword` (`keyword`),
|
||||
FULLTEXT KEY `tags` (`tags`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_invites
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_invites`;
|
||||
|
||||
CREATE TABLE `pl_invites` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`owner` int(11) NOT NULL,
|
||||
`code` text CHARACTER SET utf8 NOT NULL,
|
||||
`used` int(11) NOT NULL,
|
||||
`usedby` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_iplock
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_iplock`;
|
||||
|
||||
CREATE TABLE `pl_iplock` (
|
||||
`ip` int(11) NOT NULL,
|
||||
`imageId` int(11) NOT NULL,
|
||||
`ts` int(11) NOT NULL,
|
||||
PRIMARY KEY (`ip`,`imageId`),
|
||||
KEY `ts` (`ts`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_messages
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_messages`;
|
||||
|
||||
CREATE TABLE `pl_messages` (
|
||||
`from_m` int(11) NOT NULL,
|
||||
`to_m` int(11) NOT NULL,
|
||||
`title_m` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
|
||||
`message_m` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
|
||||
`read_m` int(11) NOT NULL,
|
||||
`created` int(11) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_registerlock
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_registerlock`;
|
||||
|
||||
CREATE TABLE `pl_registerlock` (
|
||||
`ip` text NOT NULL,
|
||||
`created` datetime NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_settings
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_settings`;
|
||||
|
||||
CREATE TABLE `pl_settings` (
|
||||
`register` int(11) NOT NULL,
|
||||
`upload` int(11) NOT NULL,
|
||||
`message` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `pl_settings` WRITE;
|
||||
/*!40000 ALTER TABLE `pl_settings` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `pl_settings` (`register`, `upload`, `message`)
|
||||
VALUES
|
||||
(1,1,'Dolan: \"Viel Spaß mit dem Script!\"');
|
||||
|
||||
/*!40000 ALTER TABLE `pl_settings` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Export von Tabelle pl_taglog
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_taglog`;
|
||||
|
||||
CREATE TABLE `pl_taglog` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`tagged` datetime NOT NULL,
|
||||
`userId` int(11) NOT NULL,
|
||||
`imageId` int(11) NOT NULL,
|
||||
`locked` tinyint(4) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `tagged` (`tagged`),
|
||||
KEY `userId` (`userId`),
|
||||
KEY `imageId` (`imageId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_unread
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_unread`;
|
||||
|
||||
CREATE TABLE `pl_unread` (
|
||||
`imageid` int(11) NOT NULL,
|
||||
`userid` int(11) NOT NULL,
|
||||
`keyword` text NOT NULL,
|
||||
`createdby` int(11) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_uploadlock
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_uploadlock`;
|
||||
|
||||
CREATE TABLE `pl_uploadlock` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`ip` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`ts` int(11) NOT NULL,
|
||||
`user` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Export von Tabelle pl_users
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `pl_users`;
|
||||
|
||||
CREATE TABLE `pl_users` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`registered` datetime NOT NULL,
|
||||
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`pass` char(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`valid` tinyint(4) NOT NULL,
|
||||
`remember` char(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`admin` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`score` int(11) NOT NULL,
|
||||
`images` int(11) NOT NULL DEFAULT '0',
|
||||
`avatar` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`website` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`color` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`style` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`spamblocked` int(11) NOT NULL,
|
||||
`time` int(11) NOT NULL,
|
||||
`spam_reason` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`invite` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
require_once( 'lib/imageuploader.php' );
|
||||
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
$user = new User();
|
||||
$user->login();
|
||||
|
||||
if( !$user->admin ) {
|
||||
echo "You need to be logged in as an admin user!";
|
||||
exit();
|
||||
}
|
||||
set_time_limit(0);
|
||||
$files = glob( 'import/*.*' );
|
||||
|
||||
|
||||
include( 'templates/header.tpl.php' );
|
||||
|
||||
|
||||
if( isset($_POST['import']) ) {
|
||||
echo "<h2>Imported Images:</h2><ul>";
|
||||
foreach( $files as $f ) {
|
||||
$errors = array();
|
||||
if( ImageUploader::process( basename($f), $f, '', false, $errors ) ) {
|
||||
echo "<li><a href=\"$f\">$f</a> - OK</li>";
|
||||
} else {
|
||||
echo "<li><a href=\"$f\">$f</a> - FAILED</li>";
|
||||
}
|
||||
}
|
||||
echo "</ul>";
|
||||
require_once( 'lib/cache.php' );
|
||||
$cache = new Cache( Config::$cache['path'], 'index' );
|
||||
$cache->clear();
|
||||
} else {
|
||||
echo "<h2>Images ready to import:</h2>";
|
||||
if( !empty($files) ) {
|
||||
echo "<ul>";
|
||||
foreach( $files as $f ) {
|
||||
echo "<li><a href=\"$f\">$f</a></li>";
|
||||
}
|
||||
echo '</ul><form action="imageimport.php" method="post"><input type="submit" name="import" value="Import Images!"/></form>';
|
||||
} else {
|
||||
echo "<p>No images found in the <i>import/</i> directory!</p>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
include( 'templates/footer.tpl.php' );
|
||||
?>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
// ini_set('memory_limit', '256M');
|
||||
|
||||
class imagediff
|
||||
{
|
||||
private $image1;
|
||||
private $image2;
|
||||
|
||||
function __construct($img1, $img2)
|
||||
{
|
||||
$this->image1['path'] = realpath($img1);
|
||||
$this->image2['path'] = realpath($img2);
|
||||
if($this->image1['path'] === false || $this->image2['path'] === false)
|
||||
{
|
||||
throw new Exception('Image "'.htmlspecialchars( $this->image1 ? $img2 : $img1 ).'" not found!');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->image1['type'] = $this->imagetyte($this->image1['path']);
|
||||
$this->image2['type'] = $this->imagetyte($this->image2['path']);
|
||||
}
|
||||
}
|
||||
|
||||
private function imagetyte($imgname)
|
||||
{
|
||||
$file_info = pathinfo($imgname);
|
||||
if(!empty ($file_info['extension']))
|
||||
{
|
||||
$filetype = strtolower($file_info['extension']);
|
||||
$filetype = $filetype == 'jpg' ? 'jpeg' : $filetype;
|
||||
$func = 'imagecreatefrom' . $filetype;
|
||||
if(function_exists($func))
|
||||
{
|
||||
return $filetype;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('File type "'.htmlspecialchars( $filetype ).'" not supported!');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('File type not supported!');
|
||||
}
|
||||
}
|
||||
|
||||
private function imagehex($image)
|
||||
{
|
||||
$size = getimagesize($image['path']);
|
||||
|
||||
|
||||
|
||||
list( $srcWidth, $srcHeight, $type ) = getimagesize( $image['path'] );
|
||||
if( $type == IMAGETYPE_JPEG ) {
|
||||
$extension = 'jpeg';
|
||||
} else if( $type == IMAGETYPE_GIF ) {
|
||||
$extension = 'gif';
|
||||
} else if( $type == IMAGETYPE_PNG ) {
|
||||
$extension = 'png';
|
||||
}
|
||||
|
||||
$func = 'imagecreatefrom'.$extension;
|
||||
$imageres = $func($image['path']);
|
||||
$zone = imagecreate(20, 20);
|
||||
imagecopyresized($zone, $imageres, 0, 0, 0, 0, 20, 20, $size[0], $size[1]);
|
||||
$colormap = array();
|
||||
$average = 0;
|
||||
$result = array();
|
||||
for($x=0; $x<20; $x++)
|
||||
{
|
||||
for($y=0; $y<20; $y++)
|
||||
{
|
||||
$color = imagecolorat($zone, $x, $y);
|
||||
|
||||
$color = imagecolorsforindex($zone, $color);
|
||||
|
||||
$colormap[$x][$y]= 0.212671 * $color['red'] + 0.715160 * $color['green'] + 0.072169 * $color['blue'];
|
||||
$average += $colormap[$x][$y];
|
||||
}
|
||||
}
|
||||
$average /= 400;
|
||||
for($x=0; $x<20; $x++)
|
||||
{
|
||||
for($y=0; $y<20; $y++)
|
||||
{
|
||||
$result[]=($x<10?$x:chr($x+97)) . ($y<10?$y:chr($y+97)) . round(2*$colormap[$x][$y]/$average);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function diff()
|
||||
{
|
||||
$hex1 = $this->imagehex($this->image1) ;
|
||||
$hex2 = $this->imagehex($this->image2);
|
||||
$result=(count($hex1) + count($hex2)) - count(array_diff($hex2,$hex1))-400;
|
||||
return $result / ( ( count($hex1) + count($hex2) ) / 2 );
|
||||
}
|
||||
}
|
||||
|
||||
//$diff = new imagediff('lol1.png', 'lol.png');
|
||||
//print ($diff->diff() * 100 ).'%';
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,724 @@
|
||||
<?php
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
require_once( 'lib/config.php' );
|
||||
|
||||
// No JS - redirect to GET search url
|
||||
if( isset($_POST['q']) ) {
|
||||
header( 'location: '.Config::$absolutePath.'search/'.$_POST['q'] );
|
||||
exit;
|
||||
}
|
||||
|
||||
function validInvite($inv){
|
||||
$inviteData = DB::getRow("SELECT * FROM pl_invites WHERE code=:1",$inv);
|
||||
if($inviteData){
|
||||
if($inviteData["used"] == 0){
|
||||
|
||||
$UserCheck = DB::getRow("SELECT spamblocked FROM pl_users WHERE id=:1",$inviteData["owner"]);
|
||||
$BanCheck = DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$inviteData["owner"]);
|
||||
if($BanCheck){
|
||||
return false;
|
||||
}
|
||||
if(int($UserCheck["spamblocked"]) ==1){
|
||||
DB::insertRow("pl_banned",array("id"=>$inviteData["owner"],"reason"=>"Invitemissbrauch"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*require_once( 'lib/cache.php' );
|
||||
$cache = new Cache( Config::$cache['path'], !empty($_GET['s']) ? $_GET['s'] : 'index' );
|
||||
if( !Config::$cache['enabled'] ) {
|
||||
$cache->disable();
|
||||
}
|
||||
|
||||
// no session or remember cookie -> get the page from cache
|
||||
if(
|
||||
empty($_COOKIE[Config::$sessionCookie]) &&
|
||||
empty($_COOKIE[Config::$rememberCookie])
|
||||
) {
|
||||
$cache->lookup();
|
||||
}
|
||||
*/
|
||||
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
/*include('templates/closed.php');
|
||||
exit();*/
|
||||
// If the User logged in with POST or a remember cookie, we need forumops.php
|
||||
// to log him in the forum, too.
|
||||
if(isset($_POST['login']) || (empty($_COOKIE[Config::$sessionCookie]) && !empty($_COOKIE[Config::$rememberCookie]))) {
|
||||
if( Config::$vbbIntegration['enabled'] ) { require_once( 'lib/class.forumops.php' ); }
|
||||
}
|
||||
|
||||
$user = new User();
|
||||
$messages = array();
|
||||
$LoginState = $user->login();
|
||||
list($ban, $reason) = split('[/.-]', $LoginState);
|
||||
if( $ban == "ban"){
|
||||
if(strlen($reason) > 2){
|
||||
$messages['bannedLogin'] = $reason;
|
||||
}else{
|
||||
$messages['bannedLogin'] = true;
|
||||
}
|
||||
include( Config::$templates.'login.tpl.php' );
|
||||
exit();
|
||||
}
|
||||
|
||||
if( $user->id ) {
|
||||
// Don't cache pages for logged-in users
|
||||
//$cache->disable();
|
||||
}
|
||||
|
||||
|
||||
$query = !empty($_GET['s']) ? $_GET['s'] : '';
|
||||
$r = explode( '/', $query );
|
||||
|
||||
$user->loadEmail();
|
||||
if( $r[0] == 'login' ) { //---------------------------------------- login
|
||||
if( Config::$vbbIntegration['enabled'] ) { require_once( 'lib/class.forumops.php' ); }
|
||||
|
||||
if( !empty( $r[1] ) ) {
|
||||
if( $user->validate($r[1]) ) {
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
} else {
|
||||
header( 'location: '.Config::$absolutePath.'login' );
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if( $user->id ) {
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( isset($_POST['login']) ) {
|
||||
|
||||
if($LoginState == "wronglogin"){
|
||||
$messages['wrongLogin'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
include( Config::$templates.'login.tpl.php' );
|
||||
}
|
||||
|
||||
else if( $r[0] == 'static' ) {
|
||||
preg_match('/(\w+)/', $r[1], $m );
|
||||
if( !empty($m[1]) && file_exists('static/'.$m[1].'.html.php') ) {
|
||||
$user->loadEmail();
|
||||
include( Config::$templates.'header.tpl.php' );
|
||||
include( 'static/'.$m[1].'.html.php' );
|
||||
include( Config::$templates.'footer.tpl.php' );
|
||||
} else {
|
||||
header( 'HTTP/1.0 404 Not Found' );
|
||||
include( Config::$templates.'404.tpl.php' );
|
||||
}
|
||||
}
|
||||
|
||||
else if( $r[0] == 'logout' ) { //---------------------------------- logout
|
||||
if( Config::$vbbIntegration['enabled'] ) { require_once( 'lib/class.forumops.php' ); }
|
||||
$user->logout();
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
exit();
|
||||
}
|
||||
else if( $r[0] == 'impressum' ){
|
||||
include( Config::$templates.'header.tpl.php' );
|
||||
include( Config::$templates.'impressum.tpl.php' );
|
||||
include( Config::$templates.'footer.tpl.php' );
|
||||
exit();
|
||||
}
|
||||
else if( $r[0] == 'chat' ){
|
||||
include( Config::$templates.'header.tpl.php' );
|
||||
include( Config::$templates.'chat.tpl.php' );
|
||||
include( Config::$templates.'footer.tpl.php' );
|
||||
exit();
|
||||
}
|
||||
else if( $r[0] == 'truhe' ){
|
||||
include( Config::$templates.'header.tpl.php' );
|
||||
include( Config::$templates.'truhe.tpl.php' );
|
||||
include( Config::$templates.'footer.tpl.php' );
|
||||
exit();
|
||||
|
||||
}
|
||||
else if( $r[0] == 'forum' ){
|
||||
include( Config::$templates.'header.tpl.php' );
|
||||
include( Config::$templates.'forum.tpl.php' );
|
||||
include( Config::$templates.'footer.tpl.php' );
|
||||
exit();
|
||||
|
||||
}
|
||||
else if( $r[0] == 'shop' ){
|
||||
include( Config::$templates.'header.tpl.php' );
|
||||
include( Config::$templates.'shop.tpl.php' );
|
||||
include( Config::$templates.'footer.tpl.php' );
|
||||
exit();
|
||||
|
||||
}else if( $r[0] == 'abuseform' ) {
|
||||
include("templates/abuseform.tpl.php");
|
||||
exit();
|
||||
|
||||
}else if( $r[0] == 'manage' ) { //---------------------------------- manage
|
||||
|
||||
if($user->admin){
|
||||
|
||||
if ($r[1] == 'del'){
|
||||
DB::query("DELETE FROM pl_abuse WHERE id=:1",$r[2]);
|
||||
header( 'location: '.Config::$absolutePath.'manage' );
|
||||
}elseif ($r[1] == 'free'){
|
||||
DB::updateRow("pl_users",array("id"=>$r[2]),array("spamblocked"=>0,"time"=>0));
|
||||
header( 'location: '.Config::$absolutePath.'manage' );
|
||||
}
|
||||
include("templates/manage.tpl.php");
|
||||
exit();
|
||||
|
||||
|
||||
}else{
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
exit();
|
||||
}
|
||||
|
||||
}else if( $r[0] == 'invites' ) { //---------------------------------- invite
|
||||
if($user->id){
|
||||
include("templates/invites.tpl.php");
|
||||
exit();
|
||||
}else{
|
||||
|
||||
|
||||
|
||||
if(isset($r[1]) && validInvite($r[1])){
|
||||
include("templates/register_invite.tpl.php");
|
||||
exit();
|
||||
}else{
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
}else if( $r[0] == 'abuse' ) { //---------------------------------- abuse
|
||||
$abuseerrors[] = array();
|
||||
|
||||
if (!empty($_POST["rsn"]) && !empty($_POST["mail"])){
|
||||
|
||||
if (!empty($_POST["imglink"])){
|
||||
|
||||
if(DB::insertRow("pl_abuse",array("reason" => $_POST["rsn"],"email" => $_POST["mail"],"read" => 0,"logged" => time(),"imagelink" => $_POST["imglink"],"user" => $user->id))){
|
||||
$abuseerrors["abuse"] = "Abused.";
|
||||
$abuseerrors["referer"] = $_SERVER['HTTP_REFERER'];
|
||||
include("templates/abuse.tpl.php");
|
||||
mail( "abuse@fuehls.com", "New Abuse | Link", "New Abuse: ". $_POST["imglink"].' - http://www.fuehls.com/manage', 'FROM: Abuse' );
|
||||
exit;
|
||||
}else{
|
||||
$abuseerrors["abusefailed"] = "Abuse failed.";
|
||||
$abuseerrors["referer"] = $_SERVER['HTTP_REFERER'];
|
||||
include("templates/abuse.tpl.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if(DB::insertRow("pl_abuse",array("reason" => $_POST["rsn"],"email" => $_POST["mail"],"read" => 0,"logged" => time(),"imageid" => $_POST["image"],"user" => $user->id)) || preg_match( '/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['mail'])){
|
||||
|
||||
$abuseerrors["abuse"] = "Abused.";
|
||||
$abuseerrors["referer"] = $_SERVER['HTTP_REFERER'];
|
||||
include("templates/abuse.tpl.php");
|
||||
mail( "abuse@fuehls.com", "New Abuse | Image", "New Abuse: ". $_POST["image"].' - http://www.fuehls.com/manage', 'FROM: Abuse' );
|
||||
exit;
|
||||
|
||||
}else{
|
||||
$abuseerrors["abusefailed"] = "Abuse failed.";
|
||||
$abuseerrors["referer"] = $_SERVER['HTTP_REFERER'];
|
||||
}
|
||||
include("templates/abuse.tpl.php");
|
||||
exit;
|
||||
}else{
|
||||
$abuseerrors["abusefailed"] = "Abuse failed.";
|
||||
$abuseerrors["referer"] = $_SERVER['HTTP_REFERER'];
|
||||
include("templates/abuse.tpl.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
exit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
else if( $r[0] == 'register' ) { //-------------------------------- new user
|
||||
if( Config::$vbbIntegration['enabled'] ) { require_once( 'lib/class.forumops.php' ); }
|
||||
if( $user->id ) {
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
exit();
|
||||
}
|
||||
|
||||
require_once('recaptchalib.php');
|
||||
$privatekey = "6LfIwOYSAAAAAKnYTwQf3fCzQ4DtK--E6oFcEKkH";
|
||||
$resp = recaptcha_check_answer ($privatekey,
|
||||
$_SERVER["REMOTE_ADDR"],
|
||||
$_POST["recaptcha_challenge_field"],
|
||||
$_POST["recaptcha_response_field"]);
|
||||
|
||||
$reg = DB::getRow("SELECT * FROM pl_settings");
|
||||
$doubleacc = DB::getRow("SELECT COUNT(*) as c FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if(isset($_POST['invite'])){
|
||||
$inviteCheck = validInvite($_POST['invite']);
|
||||
}else{
|
||||
$inviteCheck = false;
|
||||
}
|
||||
|
||||
if(!$inviteCheck){
|
||||
if ($reg["register"] != 1 || $doubleacc["c"] > 0){
|
||||
include( Config::$templates.'register_closed.tpl.php' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if($inviteCheck){
|
||||
$invCode = $_POST['invite'];
|
||||
}else{
|
||||
$invCode = false;
|
||||
}
|
||||
|
||||
if( isset($_POST['register']) && $resp->is_valid && $user->register( $messages,$invCode ) ) {
|
||||
|
||||
|
||||
include( Config::$templates.'registered.tpl.php' );
|
||||
|
||||
|
||||
} else {
|
||||
if ( isset($_POST['register']) && !$resp->is_valid) {
|
||||
$messages['captchaInc'] = true;
|
||||
include( Config::$templates.'register.tpl.php' );
|
||||
} else {
|
||||
$messages['captchaInc'] = NULL;
|
||||
include( Config::$templates.'register.tpl.php' );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if( //----------------------------------------------------- view
|
||||
($r[0] == 'all' && $r[1] == 'view') ||
|
||||
( in_array($r[0], array('user', 'search')) && $r[2] == 'view')
|
||||
) {
|
||||
require_once( 'lib/imageviewer.php' );
|
||||
$iv = new ImageViewer();
|
||||
|
||||
if( $r[0] == 'all' ) { // /all/view/2007/09/hans
|
||||
$iv->setCurrent( $r[2].'/'.$r[3].'/'.$r[4] );
|
||||
|
||||
if ($r[1] == 'unfollow'){
|
||||
DB::query("DELETE FROM pl_unread WHERE userid=:1 AND imageid=:2",$user->id,$iv->image["id"]);
|
||||
}
|
||||
|
||||
if ($r[5] == "fav"){
|
||||
if($user->id){
|
||||
$imgId = DB::getRow("SELECT * FROM pl_images WHERE keyword=:1",$r[2].'/'.$r[3].'/'.$r[4]);
|
||||
if (isset($imgId)){
|
||||
$countfav = DB::getRow("SELECT COUNT( * ) AS c FROM pl_fav WHERE user=:1 and imageId=:2",$user->id,$imgId['id']);
|
||||
if ((int)$countfav["c"] > 0){
|
||||
DB::query("DELETE FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$imgId['id']);
|
||||
DB::query("DELETE FROM pl_comments WHERE userId=:1 and imageId =:2 and c_like=1",$user->id,$imgId['id']);
|
||||
DB::query("UPDATE pl_images SET score=score-5 WHERE id=:1",$imgId['id']);
|
||||
$iv->setFav("remove");
|
||||
}else{
|
||||
DB::insertRow("pl_fav",array("imageId"=>$imgId['id'],"user"=>$user->id));
|
||||
DB::query("UPDATE pl_images SET score=score+5 WHERE id=:1",$imgId['id']);
|
||||
$datenow = date( 'Y.m.d H:i:s' );
|
||||
DB::insertRow( "pl_comments", array(
|
||||
'imageId' => $imgId['id'],
|
||||
'userId' => $user->id,
|
||||
'created' => $datenow,
|
||||
'content' => "i like",
|
||||
'c_like' =>1));
|
||||
|
||||
$iv->setFav("add");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if( $r[0] == 'user' ) { // /user/name/view/2007/09/hans
|
||||
$iv->setCurrent( $r[3].'/'.$r[4].'/'.$r[5] );
|
||||
$iv->setUser( $r[1] );
|
||||
|
||||
if ($r[6] == "fav"){
|
||||
$imgId = DB::getRow("SELECT * FROM pl_images WHERE keyword=:1",$r[3].'/'.$r[4].'/'.$r[5]);
|
||||
if (isset($imgId)){
|
||||
$countfav = DB::getRow("SELECT COUNT( * ) AS c FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$imgId['id']);
|
||||
if ((int)$countfav["c"] > 0){
|
||||
DB::query("DELETE FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$imgId['id']);
|
||||
$iv->setFav("remove");
|
||||
}else{
|
||||
DB::insertRow("pl_fav",array("imageId"=>$imgId['id'],"user"=>$user->id));
|
||||
$iv->setFav("add");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( $r[0] == 'search' ) { // /search/term/view/2007/09/hans
|
||||
list( $term, $keyword ) = explode( '/view/', str_ireplace('search/', '', $query) );
|
||||
$iv->setCurrent( $keyword );
|
||||
$iv->setSearch( $term );
|
||||
}
|
||||
$iv->load();
|
||||
$iv->grid = true;
|
||||
// Add comment if we have one
|
||||
|
||||
|
||||
include( 'lib/imageuploader.php' );
|
||||
|
||||
if( $_POST['addComment'] && $iv->addComment($user->id, $_POST['content'],$_FILES['image_comment']['name']) ) {
|
||||
|
||||
$uploadid= DB::getRow("SELECT LAST_INSERT_ID() as id");
|
||||
|
||||
|
||||
if(
|
||||
|
||||
((!empty($_FILES['image_comment']['name']) && ImageUploader::process($_FILES['image_comment']['name'], $_FILES['image_comment']['tmp_name'], "", true, $uploadErrors,"",true,$uploadid["id"])))
|
||||
||
|
||||
((!empty($_POST['url_comment']) && ImageUploader::copyFromUrl( $_POST['url_comment'], "", true, $uploadErrors,true,$uploadid["id"])))
|
||||
){
|
||||
header( 'Location: '.Config::$absolutePath.$iv->basePath.'view/'.$iv->image['keyword'] );
|
||||
}else{
|
||||
header( 'Location: '.Config::$absolutePath.$iv->basePath.'view/'.$iv->image['keyword'] );
|
||||
exit();
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
if( !empty($iv->image['id']) ) {
|
||||
$iv->loadComments();
|
||||
$counter = DB::getRow("SELECT COUNT(*) as c FROM pl_unread WHERE userid=:1 AND imageid=:2",$user->id,$iv->image["id"]);
|
||||
|
||||
if (($counter["c"] != 0)){
|
||||
DB::query("DELETE FROM pl_unread WHERE userid=:1 AND imageid=:2",$user->id,$iv->image["id"]);
|
||||
}
|
||||
|
||||
//$cache->capture();
|
||||
include( Config::$templates.'view.tpl.php' );
|
||||
|
||||
} else {
|
||||
header( 'HTTP/1.0 404 Not Found' );
|
||||
include( Config::$templates.'404.tpl.php' );
|
||||
}
|
||||
}
|
||||
|
||||
else if( //----------------------------------------------------- browse
|
||||
empty($r[0]) ||
|
||||
in_array( $r[0], array('all', 'user', 'search','comments','fame','abuse','unread',"favorites","invites") )
|
||||
) {
|
||||
require_once( 'lib/imagebrowser.php' );
|
||||
$ib = new ImageBrowser( Config::$images['thumbsPerPage'] );
|
||||
|
||||
if( empty($r[0]) || $r[0] == 'all' ) { // /all/page/2
|
||||
$ib->setPage( $r[2] );
|
||||
}
|
||||
else if( $r[0] == 'user' ) { // /user/name/page/2
|
||||
$ib->setPage( $r[3] );
|
||||
$ib->setUser( $r[1] );
|
||||
}
|
||||
else if( $r[0] == 'comments' ) { // /comments
|
||||
if ($r[1] == 'reset'){
|
||||
DB::query("DELETE FROM pl_unread WHERE userid=:1",$user->id);
|
||||
}
|
||||
if(!empty($user->id)){
|
||||
$ib->setPage( $r[2] );
|
||||
$ib->setComment(true,false);
|
||||
$ib->setuserID( $user->id );}else{ header( 'location: '.Config::$absolutePath.'login' );}
|
||||
|
||||
|
||||
}
|
||||
else if( $r[0] == 'favorites' ) { // /fav
|
||||
|
||||
if(!empty($user->id)){
|
||||
$ib->setPage( $r[2] );
|
||||
$ib->setFav(true);
|
||||
$ib->setuserID( $user->id );}else{ header( 'location: '.Config::$absolutePath.'login' );}
|
||||
|
||||
|
||||
}
|
||||
else if( $r[0] == 'unread' ) { // /unread
|
||||
|
||||
if ($r[1] == 'reset'){
|
||||
DB::query("DELETE FROM pl_unread WHERE userid=:1",$user->id);
|
||||
}
|
||||
$counter = DB::getRow("SELECT COUNT(*) as c FROM pl_unread WHERE userid=:1",$user->id);
|
||||
$unreadBool = true;
|
||||
if ($counter["c"] > 0){
|
||||
if(!empty($user->id)){
|
||||
$ib->setPage( $r[2] );
|
||||
$ib->setComment(true,true);
|
||||
$ib->setuserID( $user->id );}else{ header( 'location: '.Config::$absolutePath.'login' );}
|
||||
}else{
|
||||
header( 'location: '.Config::$absolutePath.'comments' );
|
||||
}
|
||||
}
|
||||
else if( $r[0] == 'search' ) { // /search/term/page/2
|
||||
list( $term, $page ) = explode( '/page/', str_ireplace('search/', '', $query) );
|
||||
$ib->setPage( $page );
|
||||
$ib->setSearch( $term );
|
||||
|
||||
}else if( $r[0] == 'fame' ) {
|
||||
include( Config::$templates.'fame.tpl.php' );
|
||||
exit();
|
||||
}
|
||||
|
||||
$ib->load();
|
||||
|
||||
|
||||
if( !empty($ib->thumbs) ) {
|
||||
require_once( 'lib/gridview.php' );
|
||||
$gv = new GridView( Config::$gridView['gridWidth'] );
|
||||
$gv->solve( $ib->thumbs );
|
||||
|
||||
//$cache->capture();
|
||||
include( Config::$templates.'browse.tpl.php' );
|
||||
} else {
|
||||
if($unreadBool) {
|
||||
DB::getRow("DELETE FROM pl_unread WHERE userid=:1",$user->id);
|
||||
header( 'location: '.Config::$absolutePath.'comments' );}
|
||||
include( Config::$templates.'404.tpl.php' );
|
||||
}
|
||||
}
|
||||
|
||||
else if( $r[0] == 'random' ) {
|
||||
$count = max( 1, min( Config::$maxRandomThumbs, intval($r[1]) ) );
|
||||
$size = '';
|
||||
foreach( Config::$gridView['classes'] as $c ) {
|
||||
if( $r[2] == $c['dir'] ) {
|
||||
$size = $r[2];
|
||||
break;
|
||||
}
|
||||
if( empty($size) ) {
|
||||
$size = $c['dir'];
|
||||
}
|
||||
}
|
||||
|
||||
require_once( 'lib/imagebrowser.php' );
|
||||
$ib = new ImageBrowser( $count );
|
||||
$ib->loadRandom( Config::$minRandomScore, $size );
|
||||
|
||||
//$cache->forceEnable();
|
||||
//$cache->capture();
|
||||
include( Config::$templates.'random.js.php' );
|
||||
}
|
||||
|
||||
else if( $r[0] == 'upload' ) {
|
||||
/*if( $user->id ) {
|
||||
$uploadErrors = array();
|
||||
|
||||
if( $user->isSpamLocked() ) {
|
||||
$uploadErrors[] = 'No more than 50 images in 2 hours!';
|
||||
}
|
||||
|
||||
if( $user->isSpamming() ) {
|
||||
$uploadErrors[] = 'Spamming ist nicht erlaubt. Wende dich an einen Administrator';
|
||||
}
|
||||
|
||||
|
||||
if( $user->isSpamer() ) {
|
||||
$uploadErrors[]='You have to wait 10 Seconds.';
|
||||
}
|
||||
*/
|
||||
|
||||
if( $user->id ) {
|
||||
$uploadErrors = array();
|
||||
$spaming = $user->isSpamming();
|
||||
if( $user->isSpamer()) {
|
||||
$uploadErrors[]='You have to wait 10 Seconds.';
|
||||
}elseif (is_numeric($spaming)){
|
||||
|
||||
if( (int)$spaming > 0 ){
|
||||
$blockreason = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$user->id);
|
||||
$uploadErrors[] = 'Upload gesperrt bis: '.date('Y-m-d H:i:s',(int)$blockreason["time"]);
|
||||
$uploadErrors[] = 'Grund: '.$blockreason["spam_reason"];
|
||||
$left = ((int)$blockreason["time"] - (int)time())/60;
|
||||
$uploadErrors[] = 'Noch: '.round($left,2).' Minuten ';
|
||||
}
|
||||
|
||||
}elseif( $user->isSpamming() ) {
|
||||
$uploadErrors[] = 'Spamming ist nicht erlaubt. Wende dich an einen Administrator <br> <br> Mann: <a href="/inbox/Mann"><img src="/media/mail.png"></a>';
|
||||
$uploadErrors[] = string(is_numeric($user->isSpamming()));
|
||||
}elseif( $user->isSpamLocked() ) {
|
||||
$uploadErrors[] = 'No more than 50 images in 2 hours!';
|
||||
|
||||
}elseif( !empty( $_POST ) ) {
|
||||
require_once( 'lib/imageuploader.php' );
|
||||
|
||||
if(
|
||||
(!empty($_POST['url']) && ImageUploader::copyFromUrl( $_POST['url'], $_POST['tags'], false, $uploadErrors,false,0)) ||
|
||||
( !empty($_FILES['image']['name']) && ImageUploader::process($_FILES['image']['name'], $_FILES['image']['tmp_name'], $_POST['tags'], true, $uploadErrors,'',false,0)
|
||||
)
|
||||
) {
|
||||
//$cache->clear();
|
||||
|
||||
|
||||
if (!empty($_POST['ucomment'])){
|
||||
$imgid= DB::getRow("SELECT LAST_INSERT_ID() as id");
|
||||
$datenow = date( 'Y.m.d H:i:s' );
|
||||
|
||||
DB::insertRow( TABLE_COMMENTS, array(
|
||||
'imageId' => $imgid["id"],
|
||||
'userId' => $user->id,
|
||||
'created' => $datenow,
|
||||
'content' => $_POST['ucomment'],
|
||||
'thumb' =>0));
|
||||
}
|
||||
|
||||
$user->logUpload();
|
||||
|
||||
header( "Location: ".Config::$absolutePath );
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//bei fehler
|
||||
|
||||
require_once( 'lib/imagebrowser.php' );
|
||||
$ib = new ImageBrowser( Config::$images['thumbsPerPage'] );
|
||||
$ib->load();
|
||||
|
||||
|
||||
|
||||
if( !empty($ib->thumbs) ) {
|
||||
require_once( 'lib/gridview.php' );
|
||||
$gv = new GridView( Config::$gridView['gridWidth'] );
|
||||
$gv->solve( $ib->thumbs );
|
||||
|
||||
//$cache->capture();
|
||||
include( Config::$templates.'browse.tpl.php' );
|
||||
} else {
|
||||
if($unreadBool) {
|
||||
DB::getRow("DELETE FROM pl_unread WHERE userid=:1",$user->id);
|
||||
header( 'location: '.Config::$absolutePath.'comments' );}
|
||||
include( Config::$templates.'404.tpl.php' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
header( 'location: '.Config::$absolutePath.'login' );
|
||||
}
|
||||
}
|
||||
|
||||
else if( $r[0] == 'profile' ) {
|
||||
if( $user->id ) {
|
||||
if( Config::$vbbIntegration['enabled'] ) { require_once( 'lib/class.forumops.php' ); }
|
||||
$messages = array();
|
||||
if( !empty( $_POST ) ) {
|
||||
$user->profile( $_FILES['avatar']['tmp_name'], $messages );
|
||||
|
||||
if( empty( $messages ) ) {
|
||||
header( 'location: '.Config::$absolutePath );
|
||||
}
|
||||
}
|
||||
$user->loadEmail();
|
||||
include( Config::$templates.'profile.tpl.php' );
|
||||
} else {
|
||||
header( 'location: '.Config::$absolutePath.'login' );
|
||||
}
|
||||
}
|
||||
|
||||
else if( $r[0] == 'users' ) {
|
||||
require_once( 'lib/userlist.php' );
|
||||
$ul = new UserList( Config::$usersPerPage );
|
||||
$ul->setPage( $r[2] );
|
||||
$ul->load();
|
||||
|
||||
// //$cache->capture();
|
||||
include( Config::$templates.'userlist.tpl.php' );
|
||||
}
|
||||
|
||||
else if( $r[0] == 'quicktags' ) { //------------------------------------------- quicktagger
|
||||
if( $user->id ) {
|
||||
include( Config::$templates.'quicktags.tpl.php' );
|
||||
} else {
|
||||
header( 'location: '.Config::$absolutePath.'login' );
|
||||
}
|
||||
}
|
||||
else if( $r[0] == 'inbox' ){
|
||||
//$user = new User();
|
||||
$msgErrors[] = array();
|
||||
if( $user->id ) {
|
||||
if (isset($r[1])){
|
||||
|
||||
|
||||
if( preg_match('/^\w{2,20}$/', $r[1]) ) {
|
||||
if ((isset($_POST["content"]) || isset($_POST["title"]))){
|
||||
|
||||
$usercount = DB::getRow('SELECT COUNT(*) as c, id FROM pl_users WHERE name LIKE "'.$r[1].'"');
|
||||
|
||||
|
||||
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$usercount["id"]);
|
||||
$blockeduser = array_map('strtolower', unserialize($blockedrow['users']));
|
||||
$lower = strtolower($user->name);
|
||||
|
||||
|
||||
|
||||
|
||||
if (in_array($lower,$blockeduser)){
|
||||
$msgErrors["userblocked"] = true;
|
||||
include( Config::$templates.'inbox.tpl.php' );
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if ($usercount["c"] == 0){
|
||||
$msgErrors["usernotfound"] = true;
|
||||
include( Config::$templates.'inbox.tpl.php' );
|
||||
}else{
|
||||
|
||||
DB::insertRow( "pl_messages", array(
|
||||
'from_m' => $user->id,
|
||||
'to_m' => $usercount["id"],
|
||||
'created' => time(),
|
||||
'message_m' => $_POST["content"],
|
||||
'title_m' => $_POST["title"]));
|
||||
|
||||
header( 'location: '.Config::$absolutePath."inbox/".$r[1]);
|
||||
}
|
||||
}else{
|
||||
|
||||
include( Config::$templates.'inboxuser.tpl.php' );}
|
||||
}else{
|
||||
header( 'location: '.Config::$absolutePath);}
|
||||
}else{
|
||||
include( Config::$templates.'inbox.tpl.php' );
|
||||
}
|
||||
|
||||
} else {
|
||||
header( 'location: '.Config::$absolutePath.'login' );
|
||||
}
|
||||
}
|
||||
else { //------------------------------------------------------- 404
|
||||
header( 'HTTP/1.0 404 Not Found' );
|
||||
include( Config::$templates.'404.tpl.php' );
|
||||
//$cache->disable();
|
||||
}
|
||||
|
||||
//$cache->write();
|
||||
|
||||
|
||||
?>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,186 @@
|
||||
function LoadData2 (str,divId,imageId)
|
||||
{
|
||||
|
||||
if (str=="")
|
||||
{
|
||||
document.getElementById(divId).innerHTML="";
|
||||
return;
|
||||
}
|
||||
if (window.XMLHttpRequest)
|
||||
{// code for IE7+, Firefox, Chrome, Opera, Safari
|
||||
xmlhttp=new XMLHttpRequest();
|
||||
}
|
||||
else
|
||||
{// code for IE6, IE5
|
||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
|
||||
xmlhttp.onreadystatechange=function()
|
||||
{
|
||||
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
||||
{
|
||||
document.getElementById(divId).innerHTML=xmlhttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
xmlhttp.open("POST","/ajax_getdata.php",true);
|
||||
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
||||
xmlhttp.send("q="+str+"&imageId="+imageId);
|
||||
}
|
||||
|
||||
function LoadData(str,divId,imageId)
|
||||
{
|
||||
getValues("/ajax_getdata.php",divId);
|
||||
|
||||
function getValues (url,divId) {
|
||||
var result = null;
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: "/ajax_getdata.php",
|
||||
global:false,
|
||||
data: "q="+str+"&imageId="+imageId,
|
||||
success: function(data) {
|
||||
|
||||
jQuery('#'+divId).html(data);
|
||||
jQuery('#'+divId).css("display","block");
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function CloseU(){
|
||||
jQuery('#MenuLoad').css("display","none");
|
||||
}
|
||||
function Menu(art,er){
|
||||
|
||||
if(art=="upload"){
|
||||
jQuery('#UploadD').css("background-position","24px top");
|
||||
}
|
||||
if(art=="addon"){
|
||||
jQuery('#UploadD').css("background-position","90px top");
|
||||
}
|
||||
|
||||
if(er=="error"){
|
||||
jQuery('#UbLoad').css("display","none");
|
||||
jQuery('#MenuLoad').css("display","block");
|
||||
return;
|
||||
}
|
||||
jQuery('#MenuLoad').css("display","block");
|
||||
jQuery('#UbLoad').css("display","block");
|
||||
LoadData(art,"UploadD_d",0);
|
||||
jQuery('#UbLoad').css("display","none");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function SubmitComment(imageId) {
|
||||
|
||||
var fileName = jQuery("#image_comment").val();
|
||||
var urlName = jQuery("#url_comment").val();
|
||||
var content=jQuery("#content_comment").val();
|
||||
if(content.length <1){
|
||||
jQuery('#CommentError').html("Your comment is too short!");
|
||||
jQuery('#CommentError').css("display","block");
|
||||
return
|
||||
}
|
||||
|
||||
if(fileName.length > 4){
|
||||
jQuery('#CommentForm').submit();
|
||||
}else{
|
||||
|
||||
jQuery("#image_comment").prop('disabled', true);
|
||||
jQuery("#url_comment").prop('disabled', true);
|
||||
jQuery("#content_comment").prop('disabled', true);
|
||||
jQuery("#SubBut").prop('disabled', true);
|
||||
|
||||
jQuery('#SubLoad').css("display","block");
|
||||
|
||||
var result = null;
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: "/ajax_getdata.php",
|
||||
async:false,
|
||||
global:false,
|
||||
data: "q=add&imageId="+imageId+"&content="+encodeURIComponent(content)+"&urlUpload="+urlName,
|
||||
success: function(data) {
|
||||
result = data;
|
||||
}
|
||||
});
|
||||
if(result.length > 1){
|
||||
/*if(result="notok-user"){
|
||||
document.getElementById("CommentError").innerHTML = "Session-Error!";
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}
|
||||
if(result="notok-image"){
|
||||
document.getElementById("CommentError").innerHTML = "Image-Error!";
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}
|
||||
if(result="notok-comment"){
|
||||
document.getElementById("CommentError").innerHTML = "Comment-Error!";
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}
|
||||
if(result.length > 1){
|
||||
document.getElementById("CommentError").innerHTML = result;
|
||||
document.getElementById("CommentError").style.display = "block";
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
jQuery("#image_comment").prop('disabled', false);
|
||||
jQuery("#url_comment").prop('disabled', false);
|
||||
jQuery("#content_comment").prop('disabled', false);
|
||||
jQuery("#SubBut").prop('disabled', false);
|
||||
document.getElementById('CommentForm').reset();
|
||||
jQuery('#SubLoad').css("display","none");
|
||||
LoadData("comments","cmts",imageId);
|
||||
}
|
||||
}
|
||||
|
||||
function PostData(content,divId,imageId)
|
||||
{
|
||||
|
||||
document.getElementById(divId).innerHTML=getValues("/ajax_getdata.php");
|
||||
|
||||
|
||||
function getValues (url) {
|
||||
var result = null;
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: "/ajax_getdata.php",
|
||||
async:false,
|
||||
global:false,
|
||||
data: "q="+str+"&imageId="+imageId,
|
||||
success: function(data) {
|
||||
result = data;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggle(DivName) {
|
||||
var ele = document.getElementById(DivName);
|
||||
var text = document.getElementById("displayText");
|
||||
if(ele.style.display == "block") {
|
||||
ele.style.display = "none";
|
||||
text.innerHTML = "show";
|
||||
}
|
||||
else {
|
||||
ele.style.display = "block";
|
||||
text.innerHTML = "hide";
|
||||
}
|
||||
}
|
||||
function changeUpload(divShow,divHide) {
|
||||
var Show = document.getElementById(divShow);
|
||||
var Hide = document.getElementById(divHide);
|
||||
Hide.style.display = "none";
|
||||
Show.style.display = "block";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
// JavaScript Document
|
||||
|
||||
if (/iPhone|iPod|iPad|Android|BlackBerry/i.test(navigator.userAgent)){
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#sidebar").hide(); jQuery("#site").css("margin-right","0px");
|
||||
jQuery("#footer").css("margin-right","0px");
|
||||
jQuery("#MenuRightBlock").css("display","none");
|
||||
jQuery("#menu").css("position","relative");
|
||||
jQuery("#content").css("margin-top","0.5em");
|
||||
jQuery("#footer-back-to-top").css("right","30px");
|
||||
});
|
||||
};
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
if ( jQuery(".score span").width() > "75" ) {
|
||||
jQuery(".score span").css("background-color","red");
|
||||
}
|
||||
else if ( jQuery(".score span").width() > "50" ) {
|
||||
jQuery(".score span").css("background-color","orangeRed");
|
||||
}
|
||||
else if ( jQuery(".score span").width() > "25" ) {
|
||||
jQuery(".score span").css("background-color","yellowGreen");
|
||||
}
|
||||
});
|
||||
|
||||
function toggle(obj) {
|
||||
var el = document.getElementById(obj);
|
||||
if ( el.style.display != 'block' ) {
|
||||
el.style.display = 'block';
|
||||
} else {
|
||||
el.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function BBcode(code){
|
||||
var input = prompt("Enter URL / text / image-link / youtube-link");
|
||||
|
||||
if (input.value == ""){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
if (code == "link"){
|
||||
var x = document.getElementById("content_comment");
|
||||
x.value = x.value + "[link]" + input + "[/link]";
|
||||
}
|
||||
else if (code == "youtube"){
|
||||
var x = document.getElementById("content_comment");
|
||||
x.value = x.value + "[youtube]" + input + "[/youtube]";
|
||||
}
|
||||
else if (code == "img"){
|
||||
var x = document.getElementById("content_comment");
|
||||
x.value = x.value + "[img]" + input + "[/img]";
|
||||
}
|
||||
else if (code == "spoiler"){
|
||||
var x = document.getElementById("content_comment");
|
||||
x.value = x.value + "[spoiler]" + input + "[/spoiler]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reComment(commentId,user) {
|
||||
document.getElementById("comment" + commentId).style.border = "1px solid #898989";
|
||||
var output = document.getElementById(commentId).innerText;
|
||||
output = document.getElementById(commentId).textContent;
|
||||
output = ">> " + user + ": \n\"" + output + "\"";
|
||||
document.getElementById("content_comment").value = document.getElementById("content_comment").value + "[quote]" + output.substr(0, 750) + "[/quote]\n";
|
||||
}
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
jQuery("#rightpanel").slimScroll({
|
||||
height: "100%",
|
||||
width: "180px"
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
jQuery("#footer-back-to-top").hide();
|
||||
jQuery(function () {
|
||||
jQuery(window).scroll(function () {
|
||||
if (jQuery(this).scrollTop() > 200) {
|
||||
jQuery("#footer-back-to-top").fadeIn('slow');
|
||||
} else {
|
||||
jQuery("#footer-back-to-top").fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
var side = jQuery.cookie("close_sidebar") == "yes";
|
||||
if( side ) {
|
||||
jQuery("#sidebar").hide();
|
||||
jQuery("#MenuRightBlock").hide();
|
||||
jQuery("#site").css("margin-right","0px");
|
||||
jQuery("#footer").css("margin-right","0px");
|
||||
jQuery("#footer-back-to-top").css("right","30px");
|
||||
}
|
||||
|
||||
var side = jQuery.cookie("close_message") == "yes";
|
||||
if( side ) { jQuery("#dolan").hide(); }
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#x").click(function () {
|
||||
jQuery("#sidebar").fadeOut("slow");
|
||||
jQuery("#MenuRightBlock").hide();
|
||||
jQuery("#site").css("margin-right","0px");
|
||||
jQuery("#footer").css("margin-right","0px");
|
||||
jQuery("#footer-back-to-top").css("right","30px");
|
||||
alert ("Sidebar closed. Open it by clicking on your avatar in the header. Best regards, Dolan!");
|
||||
jQuery.cookie("close_sidebar","yes", {path: '/'});
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#stfu").click(function () {
|
||||
jQuery("#dolan").fadeOut("slow");
|
||||
jQuery.cookie("close_message","yes", {path: '/'});
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#del_cookie").click(function () {
|
||||
jQuery.cookie("close_sidebar",null, {path: '/'});
|
||||
jQuery.cookie("close_message",null, {path: '/'});
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#loadcom").click(function() {
|
||||
LoadData("lastcomments","rightpanel");
|
||||
}).click();
|
||||
});
|
||||
|
||||
jQuery(document.documentElement).keyup(function (event) {
|
||||
if (jQuery("#prevBar").length > 0) {
|
||||
if (!jQuery("#content_comment").val()) {
|
||||
// handle cursor keys
|
||||
if (event.keyCode == 37) {
|
||||
window.open(jQuery("#prevBar").attr('href'),'_self')
|
||||
} else if (event.keyCode == 39) {
|
||||
window.open(jQuery("#nextBar").attr('href'),'_self')
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function toggleDiv(id,flagit) {
|
||||
if (flagit=="1"){
|
||||
if (document.layers) document.layers[''+id+''].visibility = "show"
|
||||
else if (document.all) document.all[''+id+''].style.visibility = "visible"
|
||||
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
|
||||
}else
|
||||
if (flagit=="0"){
|
||||
if (document.layers) document.layers[''+id+''].visibility = "hide"
|
||||
else if (document.all) document.all[''+id+''].style.visibility = "hidden"
|
||||
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
|
||||
}}
|
||||
|
||||
jQuery.fn.preloader = function(options){
|
||||
|
||||
var defaults = {
|
||||
delay:100,
|
||||
preload_parent:"a",
|
||||
check_timer:100,
|
||||
ondone:function(){ },
|
||||
oneachload:function(image){ },
|
||||
fadein:1000
|
||||
};
|
||||
|
||||
// variables declaration and precaching images and parent container
|
||||
var options = jQuery.extend(defaults, options),
|
||||
root = jQuery(this) , images = root.find("img") , timer , counter = 0, i=0 , checkFlag = [] , delaySum = options.delay ,
|
||||
|
||||
init = function(){
|
||||
|
||||
timer = setInterval(function(){
|
||||
|
||||
if(counter>=checkFlag.length)
|
||||
{
|
||||
clearInterval(timer);
|
||||
options.ondone();
|
||||
return;
|
||||
}
|
||||
|
||||
for(i=0;i<images.length;i++)
|
||||
{
|
||||
if(images[i].complete==true)
|
||||
{
|
||||
if(checkFlag[i]==false)
|
||||
{
|
||||
checkFlag[i] = true;
|
||||
options.oneachload(images[i]);
|
||||
counter++;
|
||||
|
||||
delaySum = delaySum + options.delay;
|
||||
}
|
||||
|
||||
jQuery(images[i]).css("display","block").delay(delaySum).animate({opacity:1},options.fadein,
|
||||
function(){ jQuery(this).parent().removeClass("preloader"); });
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
},options.check_timer)
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
images.each(function(){
|
||||
|
||||
if(jQuery(this).parent(options.preload_parent).length==0)
|
||||
jQuery(this).wrap("<a class='preloader' />");
|
||||
else
|
||||
jQuery(this).parent().addClass("preloader");
|
||||
|
||||
checkFlag[i++] = false;
|
||||
|
||||
|
||||
});
|
||||
images = jQuery.makeArray(images);
|
||||
|
||||
|
||||
var icon = jQuery("<img />",{
|
||||
|
||||
id : 'loadingicon' ,
|
||||
src : 'css/i/89.gif'
|
||||
|
||||
}).hide().appendTo("body");
|
||||
|
||||
|
||||
|
||||
timer = setInterval(function(){
|
||||
|
||||
if(icon[0].complete==true)
|
||||
{
|
||||
clearInterval(timer);
|
||||
init();
|
||||
icon.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
},100);
|
||||
|
||||
}
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
/*!
|
||||
* jQuery UI 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
(function(c){c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.2",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==
|
||||
"hidden")return false;b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,
|
||||
NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect",
|
||||
"none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",
|
||||
1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)?
|
||||
!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Widget 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Widget
|
||||
*/
|
||||
(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype=
|
||||
b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g=
|
||||
b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();
|
||||
this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f,
|
||||
h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=
|
||||
b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Mouse 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Mouse
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&
|
||||
this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();
|
||||
return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&
|
||||
this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-
|
||||
a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Position 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Position
|
||||
*/
|
||||
(function(c){c.ui=c.ui||{};var m=/left|center|right/,n=/top|center|bottom/,p=c.fn.position,q=c.fn.offset;c.fn.position=function(a){if(!a||!a.of)return p.apply(this,arguments);a=c.extend({},a);var b=c(a.of),d=(a.collision||"flip").split(" "),e=a.offset?a.offset.split(" "):[0,0],g,h,i;if(a.of.nodeType===9){g=b.width();h=b.height();i={top:0,left:0}}else if(a.of.scrollTo&&a.of.document){g=b.width();h=b.height();i={top:b.scrollTop(),left:b.scrollLeft()}}else if(a.of.preventDefault){a.at="left top";g=h=
|
||||
0;i={top:a.of.pageY,left:a.of.pageX}}else{g=b.outerWidth();h=b.outerHeight();i=b.offset()}c.each(["my","at"],function(){var f=(a[this]||"").split(" ");if(f.length===1)f=m.test(f[0])?f.concat(["center"]):n.test(f[0])?["center"].concat(f):["center","center"];f[0]=m.test(f[0])?f[0]:"center";f[1]=n.test(f[1])?f[1]:"center";a[this]=f});if(d.length===1)d[1]=d[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(a.at[0]==="right")i.left+=g;else if(a.at[0]==="center")i.left+=
|
||||
g/2;if(a.at[1]==="bottom")i.top+=h;else if(a.at[1]==="center")i.top+=h/2;i.left+=e[0];i.top+=e[1];return this.each(function(){var f=c(this),k=f.outerWidth(),l=f.outerHeight(),j=c.extend({},i);if(a.my[0]==="right")j.left-=k;else if(a.my[0]==="center")j.left-=k/2;if(a.my[1]==="bottom")j.top-=l;else if(a.my[1]==="center")j.top-=l/2;j.left=parseInt(j.left);j.top=parseInt(j.top);c.each(["left","top"],function(o,r){c.ui.position[d[o]]&&c.ui.position[d[o]][r](j,{targetWidth:g,targetHeight:h,elemWidth:k,
|
||||
elemHeight:l,offset:e,my:a.my,at:a.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(j,{using:a.using}))})};c.ui.position={fit:{left:function(a,b){var d=c(window);b=a.left+b.elemWidth-d.width()-d.scrollLeft();a.left=b>0?a.left-b:Math.max(0,a.left)},top:function(a,b){var d=c(window);b=a.top+b.elemHeight-d.height()-d.scrollTop();a.top=b>0?a.top-b:Math.max(0,a.top)}},flip:{left:function(a,b){if(b.at[0]!=="center"){var d=c(window);d=a.left+b.elemWidth-d.width()-d.scrollLeft();var e=b.my[0]==="left"?
|
||||
-b.elemWidth:b.my[0]==="right"?b.elemWidth:0,g=-2*b.offset[0];a.left+=a.left<0?e+b.targetWidth+g:d>0?e-b.targetWidth+g:0}},top:function(a,b){if(b.at[1]!=="center"){var d=c(window);d=a.top+b.elemHeight-d.height()-d.scrollTop();var e=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,g=b.at[1]==="top"?b.targetHeight:-b.targetHeight,h=-2*b.offset[1];a.top+=a.top<0?e+b.targetHeight+h:d>0?e+g+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(a,b){if(/static/.test(c.curCSS(a,"position")))a.style.position=
|
||||
"relative";var d=c(a),e=d.offset(),g=parseInt(c.curCSS(a,"top",true),10)||0,h=parseInt(c.curCSS(a,"left",true),10)||0;e={top:b.top-e.top+g,left:b.left-e.left+h};"using"in b?b.using.call(a,e):d.css(e)};c.fn.offset=function(a){var b=this[0];if(!b||!b.ownerDocument)return null;if(a)return this.each(function(){c.offset.setOffset(this,a)});return q.call(this)}}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Draggable 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Draggables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
||||
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
|
||||
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
|
||||
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
|
||||
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
|
||||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,
|
||||
b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
|
||||
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
|
||||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
|
||||
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
|
||||
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment==
|
||||
"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&
|
||||
a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),
|
||||
10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
|
||||
this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
|
||||
f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+
|
||||
this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+
|
||||
Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-
|
||||
this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=
|
||||
this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.2"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");
|
||||
if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;
|
||||
c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=
|
||||
1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;
|
||||
this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=
|
||||
this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=
|
||||
d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;
|
||||
if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!=
|
||||
"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-
|
||||
b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
|
||||
c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
|
||||
width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&
|
||||
o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=
|
||||
p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&
|
||||
(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
|
||||
10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Resizable 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Resizables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d){d.widget("ui.resizable",d.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");d.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
|
||||
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&d.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(d('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
|
||||
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
|
||||
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!d(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
|
||||
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var e=0;e<c.length;e++){var g=d.trim(c[e]),f=d('<div title="resize image" class="ui-resizable-handle '+("ui-resizable-"+g)+'"></div>');/sw|se|ne|nw/.test(g)&&f.css({zIndex:'150000000'});"se"==g&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[g]=".ui-resizable-"+g;this.element.append(f)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
|
||||
String)this.handles[i]=d(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=d(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}d(this.handles[i])}};this._renderAxis(this.element);this._handles=d(".ui-resizable-handle",this.element).disableSelection();
|
||||
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();d(this.element).addClass("ui-resizable-autohide").hover(function(){d(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){d(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){d(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
|
||||
if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(d(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
|
||||
e=this.element;this.resizing=true;this.documentScroll={top:d(document).scrollTop(),left:d(document).scrollLeft()};if(e.is(".ui-draggable")||/absolute/.test(e.css("position")))e.css({position:"absolute",top:c.top,left:c.left});d.browser.opera&&/relative/.test(e.css("position"))&&e.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var g=m(this.helper.css("top"));if(a.containment){c+=d(a.containment).scrollLeft()||0;g+=d(a.containment).scrollTop()||0}this.offset=
|
||||
this.helper.offset();this.position={left:c,top:g};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:c,top:g};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:
|
||||
this.originalSize.width/this.originalSize.height||1;a=d(".ui-resizable-"+this.axis).css("cursor");d("body").css("cursor",a=="auto"?this.axis+"-resize":a);e.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,e=this._change[this.axis];if(!e)return false;c=e.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",
|
||||
b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var e=this._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName);e=g&&d.ui.hasScroll(e[0],"left")?0:c.sizeDiff.height;
|
||||
g={width:c.size.width-(g?0:c.sizeDiff.width),height:c.size.height-e};e=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var f=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(d.extend(g,{top:f,left:e}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}d("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",
|
||||
b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,e=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(e=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(e=="nw"){b.top=
|
||||
a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,e=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,g=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,f=k(b.width)&&a.minWidth&&a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(f)b.width=a.minWidth;if(h)b.height=a.minHeight;if(e)b.width=a.maxWidth;if(g)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,
|
||||
l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(f&&l)b.left=i-a.minWidth;if(e&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(g&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var e=[c.css("borderTopWidth"),
|
||||
c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],g=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=d.map(e,function(f,h){f=parseInt(f,10)||0;h=parseInt(g[h],10)||0;return f+h})}d.browser.msie&&(d(b).is(":hidden")||d(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=
|
||||
this.element.offset();if(this._helper){this.helper=this.helper||d('<div style="overflow:hidden;"></div>');var a=d.browser.msie&&d.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+
|
||||
a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return d.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return d.extend(this._change.n.apply(this,
|
||||
arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return d.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){d.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});d.extend(d.ui.resizable,
|
||||
{version:"1.8.2"});d.ui.plugin.add("resizable","alsoResize",{start:function(){var b=d(this).data("resizable").options,a=function(c){d(c).each(function(){d(this).data("resizable-alsoresize",{width:parseInt(d(this).width(),10),height:parseInt(d(this).height(),10),left:parseInt(d(this).css("left"),10),top:parseInt(d(this).css("top"),10)})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else d.each(b.alsoResize,function(c){a(c)});
|
||||
else a(b.alsoResize)},resize:function(){var b=d(this).data("resizable"),a=b.options,c=b.originalSize,e=b.originalPosition,g={height:b.size.height-c.height||0,width:b.size.width-c.width||0,top:b.position.top-e.top||0,left:b.position.left-e.left||0},f=function(h,i){d(h).each(function(){var j=d(this),l=d(this).data("resizable-alsoresize"),p={};d.each((i&&i.length?i:["width","height","top","left"])||["width","height","top","left"],function(n,o){if((n=(l[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(/relative/.test(j.css("position"))&&
|
||||
d.browser.opera){b._revertToRelativePosition=true;j.css({position:"absolute",top:"auto",left:"auto"})}j.css(p)})};typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?d.each(a.alsoResize,function(h,i){f(h,i)}):f(a.alsoResize)},stop:function(){var b=d(this).data("resizable");if(b._revertToRelativePosition&&d.browser.opera){b._revertToRelativePosition=false;el.css({position:"relative"})}d(this).removeData("resizable-alsoresize-start")}});d.ui.plugin.add("resizable","animate",{stop:function(b){var a=
|
||||
d(this).data("resizable"),c=a.options,e=a._proportionallyResizeElements,g=e.length&&/textarea/i.test(e[0].nodeName),f=g&&d.ui.hasScroll(e[0],"left")?0:a.sizeDiff.height;g={width:a.size.width-(g?0:a.sizeDiff.width),height:a.size.height-f};f=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(d.extend(g,h&&f?{top:h,left:f}:{}),{duration:c.animateDuration,easing:c.animateEasing,
|
||||
step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};e&&e.length&&d(e[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});d.ui.plugin.add("resizable","containment",{start:function(){var b=d(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof d?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=
|
||||
d(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:d(document),left:0,top:0,width:d(document).width(),height:d(document).height()||document.body.parentNode.scrollHeight}}else{var e=d(a),g=[];d(["Top","Right","Left","Bottom"]).each(function(i,j){g[i]=m(e.css("padding"+j))});b.containerOffset=e.offset();b.containerPosition=e.position();b.containerSize={height:e.innerHeight()-g[3],width:e.innerWidth()-g[1]};c=b.containerOffset;
|
||||
var f=b.containerSize.height,h=b.containerSize.width;h=d.ui.hasScroll(a,"left")?a.scrollWidth:h;f=d.ui.hasScroll(a)?a.scrollHeight:f;b.parentData={element:a,left:c.left,top:c.top,width:h,height:f}}}},resize:function(b){var a=d(this).data("resizable"),c=a.options,e=a.containerOffset,g=a.position;b=a._aspectRatio||b.shiftKey;var f={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))f=e;if(g.left<(a._helper?e.left:0)){a.size.width+=a._helper?a.position.left-e.left:
|
||||
a.position.left-f.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?e.left:0}if(g.top<(a._helper?e.top:0)){a.size.height+=a._helper?a.position.top-e.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?e.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-f.left:a.offset.left-f.left)+a.sizeDiff.width);e=Math.abs((a._helper?a.offset.top-f.top:a.offset.top-
|
||||
e.top)+a.sizeDiff.height);g=a.containerElement.get(0)==a.element.parent().get(0);f=/relative|absolute/.test(a.containerElement.css("position"));if(g&&f)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(e+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-e;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=d(this).data("resizable"),a=b.options,c=b.containerOffset,e=b.containerPosition,
|
||||
g=b.containerElement,f=d(b.helper),h=f.offset(),i=f.outerWidth()-b.sizeDiff.width;f=f.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f});b._helper&&!a.animate&&/static/.test(g.css("position"))&&d(this).css({left:h.left-e.left-c.left,width:i,height:f})}});d.ui.plugin.add("resizable","ghost",{start:function(){var b=d(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,
|
||||
display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=d(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=d(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});d.ui.plugin.add("resizable","grid",{resize:function(){var b=
|
||||
d(this).data("resizable"),a=b.options,c=b.size,e=b.originalSize,g=b.originalPosition,f=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-e.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-e.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a}else if(/^(ne)$/.test(f)){b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}else{if(/^(sw)$/.test(f)){b.size.width=e.width+h;b.size.height=
|
||||
e.height+a}else{b.size.width=e.width+h;b.size.height=e.height+a;b.position.top=g.top-a}b.position.left=g.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/
|
||||
*/
|
||||
jQuery.effects||function(f){function k(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
|
||||
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return l.transparent;return l[f.trim(c).toLowerCase()]}function q(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return k(b)}function m(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
|
||||
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function n(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in r||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function s(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function j(c,a,b,d){if(typeof c=="object"){d=
|
||||
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(f.isFunction(b)){d=b;b=null}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=q(b.elem,a);b.end=k(b.end);b.colorInit=
|
||||
true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var l={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,
|
||||
183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,
|
||||
165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},o=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=n(m.call(this)),p,t=e.attr("className");f.each(o,function(u,
|
||||
i){c[i]&&e[i+"Class"](c[i])});p=n(m.call(this));e.attr("className",t);e.animate(s(h,p),a,b,function(){f.each(o,function(u,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?
|
||||
f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===undefined?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.2",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==
|
||||
null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();
|
||||
var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});
|
||||
c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=j.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c||
|
||||
typeof c=="number"||f.fx.speeds[c])return this._show.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c])return this._hide.apply(this,arguments);else{var a=j.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this,
|
||||
arguments);else{var a=j.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,
|
||||
a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+
|
||||
b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,
|
||||
10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*
|
||||
a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,
|
||||
a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==undefined)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==undefined)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,
|
||||
a,b,d,e,g){if(g==undefined)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,
|
||||
d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Blind 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Blind
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","left"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,g);b.effects.removeWrapper(a);
|
||||
c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
|
||||
;
|
||||
|
||||
/*
|
||||
* jQuery UI Effects Slide 1.8.4
|
||||
*
|
||||
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Slide
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
$.effects.slide = function(o) {
|
||||
|
||||
return this.queue(function() {
|
||||
|
||||
// Create element
|
||||
var el = $(this), props = ['position','top','left'];
|
||||
|
||||
// Set options
|
||||
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
|
||||
var direction = o.options.direction || 'left'; // Default Direction
|
||||
|
||||
// Adjust
|
||||
$.effects.save(el, props); el.show(); // Save & Show
|
||||
$.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
|
||||
var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
|
||||
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
|
||||
var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
|
||||
if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift
|
||||
|
||||
// Animation
|
||||
var animation = {};
|
||||
animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
|
||||
|
||||
// Animate
|
||||
el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
|
||||
if(mode == 'hide') el.hide(); // Hide
|
||||
$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
|
||||
if(o.callback) o.callback.apply(this, arguments); // Callback
|
||||
el.dequeue();
|
||||
}});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
Vendored
+414
@@ -0,0 +1,414 @@
|
||||
/*!
|
||||
* jQuery UI 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
(function(a,d){function c(h,g){var i=h.nodeName.toLowerCase();if("area"===i){g=h.parentNode;i=g.name;if(!h.href||!i||g.nodeName.toLowerCase()!=="map")return false;h=a("img[usemap=#"+i+"]")[0];return!!h&&e(h)}return(/input|select|textarea|button|object/.test(i)?!h.disabled:"a"==i?h.href||g:g)&&e(h)}function e(h){return!a(h).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(!a.ui.version){a.extend(a.ui,{version:"1.8.16",
|
||||
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(h,g){return typeof h==="number"?this.each(function(){var i=
|
||||
this;setTimeout(function(){a(i).focus();g&&g.call(i)},h)}):this._focus.apply(this,arguments)},scrollParent:function(){var h;h=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,
|
||||
"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!h.length?a(document):h},zIndex:function(h){if(h!==d)return this.css("zIndex",h);if(this.length){h=a(this[0]);for(var g;h.length&&h[0]!==document;){g=h.css("position");if(g==="absolute"||g==="relative"||g==="fixed"){g=parseInt(h.css("zIndex"),10);if(!isNaN(g)&&g!==0)return g}h=h.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":
|
||||
"mousedown")+".ui-disableSelection",function(h){h.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(h,g){function i(l,o,n,k){a.each(b,function(){o-=parseFloat(a.curCSS(l,"padding"+this,true))||0;if(n)o-=parseFloat(a.curCSS(l,"border"+this+"Width",true))||0;if(k)o-=parseFloat(a.curCSS(l,"margin"+this,true))||0});return o}var b=g==="Width"?["Left","Right"]:["Top","Bottom"],f=g.toLowerCase(),j={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,
|
||||
outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+g]=function(l){if(l===d)return j["inner"+g].call(this);return this.each(function(){a(this).css(f,i(this,l)+"px")})};a.fn["outer"+g]=function(l,o){if(typeof l!=="number")return j["outer"+g].call(this,l);return this.each(function(){a(this).css(f,i(this,l,true,o)+"px")})}});a.extend(a.expr[":"],{data:function(h,g,i){return!!a.data(h,i[3])},focusable:function(h){return c(h,!isNaN(a.attr(h,"tabindex")))},tabbable:function(h){var g=a.attr(h,
|
||||
"tabindex"),i=isNaN(g);return(i||g>=0)&&c(h,!i)}});a(function(){var h=document.body,g=h.appendChild(g=document.createElement("div"));a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart"in g;h.removeChild(g).style.display="none"});a.extend(a.ui,{plugin:{add:function(h,g,i){h=a.ui[h].prototype;for(var b in i){h.plugins[b]=h.plugins[b]||[];h.plugins[b].push([g,i[b]])}},call:function(h,g,i){if((g=h.plugins[g])&&
|
||||
h.element[0].parentNode)for(var b=0;b<g.length;b++)h.options[g[b][0]]&&g[b][1].apply(h.element,i)}},contains:function(h,g){return document.compareDocumentPosition?h.compareDocumentPosition(g)&16:h!==g&&h.contains(g)},hasScroll:function(h,g){if(a(h).css("overflow")==="hidden")return false;g=g&&g==="left"?"scrollLeft":"scrollTop";var i=false;if(h[g]>0)return true;h[g]=1;i=h[g]>0;h[g]=0;return i},isOverAxis:function(h,g,i){return h>g&&h<g+i},isOver:function(h,g,i,b,f,j){return a.ui.isOverAxis(h,i,f)&&
|
||||
a.ui.isOverAxis(g,b,j)}})}})(jQuery);
|
||||
(function(a,d){if(a.cleanData){var c=a.cleanData;a.cleanData=function(h){for(var g=0,i;(i=h[g])!=null;g++)try{a(i).triggerHandler("remove")}catch(b){}c(h)}}else{var e=a.fn.remove;a.fn.remove=function(h,g){return this.each(function(){if(!g)if(!h||a.filter(h,[this]).length)a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(i){}});return e.call(a(this),h,g)})}}a.widget=function(h,g,i){var b=h.split(".")[0],f;h=h.split(".")[1];f=b+"-"+h;if(!i){i=g;g=a.Widget}a.expr[":"][f]=
|
||||
function(j){return!!a.data(j,h)};a[b]=a[b]||{};a[b][h]=function(j,l){arguments.length&&this._createWidget(j,l)};g=new g;g.options=a.extend(true,{},g.options);a[b][h].prototype=a.extend(true,g,{namespace:b,widgetName:h,widgetEventPrefix:a[b][h].prototype.widgetEventPrefix||h,widgetBaseClass:f},i);a.widget.bridge(h,a[b][h])};a.widget.bridge=function(h,g){a.fn[h]=function(i){var b=typeof i==="string",f=Array.prototype.slice.call(arguments,1),j=this;i=!b&&f.length?a.extend.apply(null,[true,i].concat(f)):
|
||||
i;if(b&&i.charAt(0)==="_")return j;b?this.each(function(){var l=a.data(this,h),o=l&&a.isFunction(l[i])?l[i].apply(l,f):l;if(o!==l&&o!==d){j=o;return false}}):this.each(function(){var l=a.data(this,h);l?l.option(i||{})._init():a.data(this,h,new g(i,this))});return j}};a.Widget=function(h,g){arguments.length&&this._createWidget(h,g)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(h,g){a.data(g,this.widgetName,this);this.element=a(g);this.options=
|
||||
a.extend(true,{},this.options,this._getCreateOptions(),h);var i=this;this.element.bind("remove."+this.widgetName,function(){i.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
|
||||
"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(h,g){var i=h;if(arguments.length===0)return a.extend({},this.options);if(typeof h==="string"){if(g===d)return this.options[h];i={};i[h]=g}this._setOptions(i);return this},_setOptions:function(h){var g=this;a.each(h,function(i,b){g._setOption(i,b)});return this},_setOption:function(h,g){this.options[h]=g;if(h==="disabled")this.widget()[g?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
|
||||
g);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(h,g,i){var b=this.options[h];g=a.Event(g);g.type=(h===this.widgetEventPrefix?h:this.widgetEventPrefix+h).toLowerCase();i=i||{};if(g.originalEvent){h=a.event.props.length;for(var f;h;){f=a.event.props[--h];g[f]=g.originalEvent[f]}}this.element.trigger(g,i);return!(a.isFunction(b)&&b.call(this.element[0],g,i)===false||g.isDefaultPrevented())}}})(jQuery);
|
||||
(function(a){var d=false;a(document).mouseup(function(){d=false});a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(e){return c._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===a.data(e.target,c.widgetName+".preventClickEvent")){a.removeData(e.target,c.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
|
||||
this.widgetName)},_mouseDown:function(c){if(!d){this._mouseStarted&&this._mouseUp(c);this._mouseDownEvent=c;var e=this,h=c.which==1,g=typeof this.options.cancel=="string"&&c.target.nodeName?a(c.target).closest(this.options.cancel).length:false;if(!h||g||!this._mouseCapture(c))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=
|
||||
this._mouseStart(c)!==false;if(!this._mouseStarted){c.preventDefault();return true}}true===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(i){return e._mouseMove(i)};this._mouseUpDelegate=function(i){return e._mouseUp(i)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.preventDefault();return d=true}},_mouseMove:function(c){if(a.browser.msie&&
|
||||
!(document.documentMode>=9)&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
|
||||
false;c.target==this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",true);this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
|
||||
(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
||||
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(d){var c=
|
||||
this.options;if(this.helper||c.disabled||a(d.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(d);if(!this.handle)return false;if(c.iframeFix)a(c.iframeFix===true?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")});return true},_mouseStart:function(d){var c=this.options;
|
||||
this.helper=this._createHelper(d);this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
|
||||
this.originalPosition=this.position=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(this._trigger("start",d)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(d,true);a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,d);return true},
|
||||
_mouseDrag:function(d,c){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",d,c)===false){this._mouseUp({});return false}this.position=c.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);return false},_mouseStop:function(d){var c=
|
||||
false;if(a.ui.ddmanager&&!this.options.dropBehaviour)c=a.ui.ddmanager.drop(this,d);if(this.dropped){c=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var e=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
|
||||
10),function(){e._trigger("stop",d)!==false&&e._clear()})}else this._trigger("stop",d)!==false&&this._clear();return false},_mouseUp:function(d){this.options.iframeFix===true&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,d);return a.ui.mouse.prototype._mouseUp.call(this,d)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(d){var c=!this.options.handle||
|
||||
!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==d.target)c=true});return c},_createHelper:function(d){var c=this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&
|
||||
d.css("position","absolute");return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string")d=d.split(" ");if(a.isArray(d))d={left:+d[0],top:+d[1]||0};if("left"in d)this.offset.click.left=d.left+this.margins.left;if("right"in d)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if("top"in d)this.offset.click.top=d.top+this.margins.top;if("bottom"in d)this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
|
||||
this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)d={top:0,left:0};return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
|
||||
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.element.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
|
||||
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment=="parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[d.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,d.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
|
||||
(d.containment=="document"?0:a(window).scrollLeft())+a(d.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d.containment=="document"?0:a(window).scrollTop())+(a(d.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)&&d.containment.constructor!=Array){d=a(d.containment);var c=d[0];if(c){d.offset();var e=a(c).css("overflow")!=
|
||||
"hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),
|
||||
10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=d}}else if(d.containment.constructor==Array)this.containment=d.containment},_convertPositionTo:function(d,c){if(!c)c=this.position;d=d=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName);return{top:c.top+
|
||||
this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())*d)}},_generatePosition:function(d){var c=this.options,e=this.cssPosition=="absolute"&&
|
||||
!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName),g=d.pageX,i=d.pageY;if(this.originalPosition){var b;if(this.containment){if(this.relative_container){b=this.relative_container.offset();b=[this.containment[0]+b.left,this.containment[1]+b.top,this.containment[2]+b.left,this.containment[3]+b.top]}else b=this.containment;if(d.pageX-this.offset.click.left<b[0])g=b[0]+this.offset.click.left;
|
||||
if(d.pageY-this.offset.click.top<b[1])i=b[1]+this.offset.click.top;if(d.pageX-this.offset.click.left>b[2])g=b[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>b[3])i=b[3]+this.offset.click.top}if(c.grid){i=c.grid[1]?this.originalPageY+Math.round((i-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;i=b?!(i-this.offset.click.top<b[1]||i-this.offset.click.top>b[3])?i:!(i-this.offset.click.top<b[1])?i-c.grid[1]:i+c.grid[1]:i;g=c.grid[0]?this.originalPageX+Math.round((g-this.originalPageX)/
|
||||
c.grid[0])*c.grid[0]:this.originalPageX;g=b?!(g-this.offset.click.left<b[0]||g-this.offset.click.left>b[2])?g:!(g-this.offset.click.left<b[0])?g-c.grid[0]:g+c.grid[0]:g}}return{top:i-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<
|
||||
526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(d,c,e){e=e||this._uiHash();a.ui.plugin.call(this,d,[c,e]);if(d=="drag")this.positionAbs=this._convertPositionTo("absolute");return a.Widget.prototype._trigger.call(this,d,c,
|
||||
e)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.16"});a.ui.plugin.add("draggable","connectToSortable",{start:function(d,c){var e=a(this).data("draggable"),h=e.options,g=a.extend({},c,{item:e.element});e.sortables=[];a(h.connectToSortable).each(function(){var i=a.data(this,"sortable");if(i&&!i.options.disabled){e.sortables.push({instance:i,shouldRevert:i.options.revert});
|
||||
i.refreshPositions();i._trigger("activate",d,g)}})},stop:function(d,c){var e=a(this).data("draggable"),h=a.extend({},c,{item:e.element});a.each(e.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;e.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(d);this.instance.options.helper=this.instance.options._helper;e.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
|
||||
false;this.instance._trigger("deactivate",d,h)}})},drag:function(d,c){var e=a(this).data("draggable"),h=this;a.each(e.sortables,function(){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(h).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
|
||||
this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return c.helper[0]};d.target=this.instance.currentItem[0];this.instance._mouseCapture(d,true);this.instance._mouseStart(d,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;
|
||||
e._trigger("toSortable",d);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}this.instance.currentItem&&this.instance._mouseDrag(d)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",d,this.instance._uiHash(this.instance));this.instance._mouseStop(d,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
|
||||
this.instance.placeholder.remove();e._trigger("fromSortable",d);e.dropped=false}})}});a.ui.plugin.add("draggable","cursor",{start:function(){var d=a("body"),c=a(this).data("draggable").options;if(d.css("cursor"))c._cursor=d.css("cursor");d.css("cursor",c.cursor)},stop:function(){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}});a.ui.plugin.add("draggable","opacity",{start:function(d,c){d=a(c.helper);c=a(this).data("draggable").options;if(d.css("opacity"))c._opacity=
|
||||
d.css("opacity");d.css("opacity",c.opacity)},stop:function(d,c){d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var d=a(this).data("draggable");if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML")d.overflowOffset=d.scrollParent.offset()},drag:function(d){var c=a(this).data("draggable"),e=c.options,h=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!=
|
||||
"x")if(c.overflowOffset.top+c.scrollParent[0].offsetHeight-d.pageY<e.scrollSensitivity)c.scrollParent[0].scrollTop=h=c.scrollParent[0].scrollTop+e.scrollSpeed;else if(d.pageY-c.overflowOffset.top<e.scrollSensitivity)c.scrollParent[0].scrollTop=h=c.scrollParent[0].scrollTop-e.scrollSpeed;if(!e.axis||e.axis!="y")if(c.overflowOffset.left+c.scrollParent[0].offsetWidth-d.pageX<e.scrollSensitivity)c.scrollParent[0].scrollLeft=h=c.scrollParent[0].scrollLeft+e.scrollSpeed;else if(d.pageX-c.overflowOffset.left<
|
||||
e.scrollSensitivity)c.scrollParent[0].scrollLeft=h=c.scrollParent[0].scrollLeft-e.scrollSpeed}else{if(!e.axis||e.axis!="x")if(d.pageY-a(document).scrollTop()<e.scrollSensitivity)h=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed);else if(a(window).height()-(d.pageY-a(document).scrollTop())<e.scrollSensitivity)h=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed);if(!e.axis||e.axis!="y")if(d.pageX-a(document).scrollLeft()<e.scrollSensitivity)h=a(document).scrollLeft(a(document).scrollLeft()-
|
||||
e.scrollSpeed);else if(a(window).width()-(d.pageX-a(document).scrollLeft())<e.scrollSensitivity)h=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed)}h!==false&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(c,d)}});a.ui.plugin.add("draggable","snap",{start:function(){var d=a(this).data("draggable"),c=d.options;d.snapElements=[];a(c.snap.constructor!=String?c.snap.items||":data(draggable)":c.snap).each(function(){var e=a(this),h=e.offset();this!=d.element[0]&&d.snapElements.push({item:this,
|
||||
width:e.outerWidth(),height:e.outerHeight(),top:h.top,left:h.left})})},drag:function(d,c){for(var e=a(this).data("draggable"),h=e.options,g=h.snapTolerance,i=c.offset.left,b=i+e.helperProportions.width,f=c.offset.top,j=f+e.helperProportions.height,l=e.snapElements.length-1;l>=0;l--){var o=e.snapElements[l].left,n=o+e.snapElements[l].width,k=e.snapElements[l].top,m=k+e.snapElements[l].height;if(o-g<i&&i<n+g&&k-g<f&&f<m+g||o-g<i&&i<n+g&&k-g<j&&j<m+g||o-g<b&&b<n+g&&k-g<f&&f<m+g||o-g<b&&b<n+g&&k-g<j&&
|
||||
j<m+g){if(h.snapMode!="inner"){var p=Math.abs(k-j)<=g,q=Math.abs(m-f)<=g,s=Math.abs(o-b)<=g,r=Math.abs(n-i)<=g;if(p)c.position.top=e._convertPositionTo("relative",{top:k-e.helperProportions.height,left:0}).top-e.margins.top;if(q)c.position.top=e._convertPositionTo("relative",{top:m,left:0}).top-e.margins.top;if(s)c.position.left=e._convertPositionTo("relative",{top:0,left:o-e.helperProportions.width}).left-e.margins.left;if(r)c.position.left=e._convertPositionTo("relative",{top:0,left:n}).left-e.margins.left}var u=
|
||||
p||q||s||r;if(h.snapMode!="outer"){p=Math.abs(k-f)<=g;q=Math.abs(m-j)<=g;s=Math.abs(o-i)<=g;r=Math.abs(n-b)<=g;if(p)c.position.top=e._convertPositionTo("relative",{top:k,left:0}).top-e.margins.top;if(q)c.position.top=e._convertPositionTo("relative",{top:m-e.helperProportions.height,left:0}).top-e.margins.top;if(s)c.position.left=e._convertPositionTo("relative",{top:0,left:o}).left-e.margins.left;if(r)c.position.left=e._convertPositionTo("relative",{top:0,left:n-e.helperProportions.width}).left-e.margins.left}if(!e.snapElements[l].snapping&&
|
||||
(p||q||s||r||u))e.options.snap.snap&&e.options.snap.snap.call(e.element,d,a.extend(e._uiHash(),{snapItem:e.snapElements[l].item}));e.snapElements[l].snapping=p||q||s||r||u}else{e.snapElements[l].snapping&&e.options.snap.release&&e.options.snap.release.call(e.element,d,a.extend(e._uiHash(),{snapItem:e.snapElements[l].item}));e.snapElements[l].snapping=false}}}});a.ui.plugin.add("draggable","stack",{start:function(){var d=a(this).data("draggable").options;d=a.makeArray(a(d.stack)).sort(function(e,h){return(parseInt(a(e).css("zIndex"),
|
||||
10)||0)-(parseInt(a(h).css("zIndex"),10)||0)});if(d.length){var c=parseInt(d[0].style.zIndex)||0;a(d).each(function(e){this.style.zIndex=c+e});this[0].style.zIndex=c+d.length}}});a.ui.plugin.add("draggable","zIndex",{start:function(d,c){d=a(c.helper);c=a(this).data("draggable").options;if(d.css("zIndex"))c._zIndex=d.css("zIndex");d.css("zIndex",c.zIndex)},stop:function(d,c){d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);
|
||||
(function(a){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var d=this.options,c=d.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(c)?c:function(e){return e.is(c)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[d.scope]=a.ui.ddmanager.droppables[d.scope]||[];a.ui.ddmanager.droppables[d.scope].push(this);
|
||||
d.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var d=a.ui.ddmanager.droppables[this.options.scope],c=0;c<d.length;c++)d[c]==this&&d.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(d,c){if(d=="accept")this.accept=a.isFunction(c)?c:function(e){return e.is(c)};a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&
|
||||
this.element.addClass(this.options.activeClass);c&&this._trigger("activate",d,this.ui(c))},_deactivate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);c&&this._trigger("deactivate",d,this.ui(c))},_over:function(d){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
|
||||
this._trigger("over",d,this.ui(c))}},_out:function(d){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",d,this.ui(c))}},_drop:function(d,c){var e=c||a.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]==this.element[0])return false;var h=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
|
||||
a.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==e.options.scope&&g.accept.call(g.element[0],e.currentItem||e.element)&&a.ui.intersect(e,a.extend(g,{offset:g.element.offset()}),g.options.tolerance)){h=true;return false}});if(h)return false;if(this.accept.call(this.element[0],e.currentItem||e.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
|
||||
d,this.ui(e));return this.element}return false},ui:function(d){return{draggable:d.currentItem||d.element,helper:d.helper,position:d.position,offset:d.positionAbs}}});a.extend(a.ui.droppable,{version:"1.8.16"});a.ui.intersect=function(d,c,e){if(!c.offset)return false;var h=(d.positionAbs||d.position.absolute).left,g=h+d.helperProportions.width,i=(d.positionAbs||d.position.absolute).top,b=i+d.helperProportions.height,f=c.offset.left,j=f+c.proportions.width,l=c.offset.top,o=l+c.proportions.height;
|
||||
switch(e){case "fit":return f<=h&&g<=j&&l<=i&&b<=o;case "intersect":return f<h+d.helperProportions.width/2&&g-d.helperProportions.width/2<j&&l<i+d.helperProportions.height/2&&b-d.helperProportions.height/2<o;case "pointer":return a.ui.isOver((d.positionAbs||d.position.absolute).top+(d.clickOffset||d.offset.click).top,(d.positionAbs||d.position.absolute).left+(d.clickOffset||d.offset.click).left,l,f,c.proportions.height,c.proportions.width);case "touch":return(i>=l&&i<=o||b>=l&&b<=o||i<l&&b>o)&&(h>=
|
||||
f&&h<=j||g>=f&&g<=j||h<f&&g>j);default:return false}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(d,c){var e=a.ui.ddmanager.droppables[d.options.scope]||[],h=c?c.type:null,g=(d.currentItem||d.element).find(":data(droppable)").andSelf(),i=0;a:for(;i<e.length;i++)if(!(e[i].options.disabled||d&&!e[i].accept.call(e[i].element[0],d.currentItem||d.element))){for(var b=0;b<g.length;b++)if(g[b]==e[i].element[0]){e[i].proportions.height=0;continue a}e[i].visible=e[i].element.css("display")!=
|
||||
"none";if(e[i].visible){h=="mousedown"&&e[i]._activate.call(e[i],c);e[i].offset=e[i].element.offset();e[i].proportions={width:e[i].element[0].offsetWidth,height:e[i].element[0].offsetHeight}}}},drop:function(d,c){var e=false;a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&a.ui.intersect(d,this,this.options.tolerance))e=e||this._drop.call(this,c);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],d.currentItem||
|
||||
d.element)){this.isout=1;this.isover=0;this._deactivate.call(this,c)}}});return e},dragStart:function(d,c){d.element.parents(":not(body,html)").bind("scroll.droppable",function(){d.options.refreshPositions||a.ui.ddmanager.prepareOffsets(d,c)})},drag:function(d,c){d.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(d,c);a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var e=a.ui.intersect(d,this,this.options.tolerance);
|
||||
if(e=!e&&this.isover==1?"isout":e&&this.isover==0?"isover":null){var h;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){h=a.data(g[0],"droppable");h.greedyChild=e=="isover"?1:0}}if(h&&e=="isover"){h.isover=0;h.isout=1;h._out.call(h,c)}this[e]=1;this[e=="isout"?"isover":"isout"]=0;this[e=="isover"?"_over":"_out"].call(this,c);if(h&&e=="isout"){h.isout=0;h.isover=1;h._over.call(h,c)}}}})},dragStop:function(d,c){d.element.parents(":not(body,html)").unbind("scroll.droppable");
|
||||
d.options.refreshPositions||a.ui.ddmanager.prepareOffsets(d,c)}}})(jQuery);
|
||||
(function(a){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var e=this,h=this.options;this.element.addClass("ui-resizable");a.extend(this,{_aspectRatio:!!h.aspectRatio,aspectRatio:h.aspectRatio,originalElement:this.element,
|
||||
_proportionallyResizeElements:[],_helper:h.helper||h.ghost||h.animate?h.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&a.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
|
||||
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
|
||||
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=h.handles||(!a(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
|
||||
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var g=this.handles.split(",");this.handles={};for(var i=0;i<g.length;i++){var b=a.trim(g[i]),f=a('<div class="ui-resizable-handle '+("ui-resizable-"+b)+'"></div>');/sw|se|ne|nw/.test(b)&&f.css({zIndex:++h.zIndex});"se"==b&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[b]=".ui-resizable-"+b;this.element.append(f)}}this._renderAxis=function(j){j=j||this.element;for(var l in this.handles){if(this.handles[l].constructor==
|
||||
String)this.handles[l]=a(this.handles[l],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=a(this.handles[l],this.element),n=0;n=/sw|ne|nw|se|n|s/.test(l)?o.outerHeight():o.outerWidth();o=["padding",/ne|nw|n/.test(l)?"Top":/se|sw|s/.test(l)?"Bottom":/^e$/.test(l)?"Right":"Left"].join("");j.css(o,n);this._proportionallyResize()}a(this.handles[l])}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection();
|
||||
this._handles.mouseover(function(){if(!e.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=j&&j[1]?j[1]:"se"}});if(h.autoHide){this._handles.hide();a(this.element).addClass("ui-resizable-autohide").hover(function(){if(!h.disabled){a(this).removeClass("ui-resizable-autohide");e._handles.show()}},function(){if(!h.disabled)if(!e.resizing){a(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();
|
||||
var e=function(g){a(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var h=this.element;h.after(this.originalElement.css({position:h.css("position"),width:h.outerWidth(),height:h.outerHeight(),top:h.css("top"),left:h.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(e){var h=
|
||||
false;for(var g in this.handles)if(a(this.handles[g])[0]==e.target)h=true;return!this.options.disabled&&h},_mouseStart:function(e){var h=this.options,g=this.element.position(),i=this.element;this.resizing=true;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};if(i.is(".ui-draggable")||/absolute/.test(i.css("position")))i.css({position:"absolute",top:g.top,left:g.left});a.browser.opera&&/relative/.test(i.css("position"))&&i.css({position:"relative",top:"auto",left:"auto"});
|
||||
this._renderProxy();g=d(this.helper.css("left"));var b=d(this.helper.css("top"));if(h.containment){g+=a(h.containment).scrollLeft()||0;b+=a(h.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:g,top:b};this.size=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalPosition={left:g,top:b};this.sizeDiff=
|
||||
{width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=typeof h.aspectRatio=="number"?h.aspectRatio:this.originalSize.width/this.originalSize.height||1;h=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",h=="auto"?this.axis+"-resize":h);i.addClass("ui-resizable-resizing");this._propagate("start",e);return true},_mouseDrag:function(e){var h=this.helper,g=this.originalMousePosition,i=this._change[this.axis];
|
||||
if(!i)return false;g=i.apply(this,[e,e.pageX-g.left||0,e.pageY-g.top||0]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)g=this._updateRatio(g,e);g=this._respectSize(g,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(g);this._trigger("resize",e,this.ui());return false},
|
||||
_mouseStop:function(e){this.resizing=false;var h=this.options,g=this;if(this._helper){var i=this._proportionallyResizeElements,b=i.length&&/textarea/i.test(i[0].nodeName);i=b&&a.ui.hasScroll(i[0],"left")?0:g.sizeDiff.height;b=b?0:g.sizeDiff.width;b={width:g.helper.width()-b,height:g.helper.height()-i};i=parseInt(g.element.css("left"),10)+(g.position.left-g.originalPosition.left)||null;var f=parseInt(g.element.css("top"),10)+(g.position.top-g.originalPosition.top)||null;h.animate||this.element.css(a.extend(b,
|
||||
{top:f,left:i}));g.helper.height(g.size.height);g.helper.width(g.size.width);this._helper&&!h.animate&&this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",e);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(e){var h=this.options,g,i,b;h={minWidth:c(h.minWidth)?h.minWidth:0,maxWidth:c(h.maxWidth)?h.maxWidth:Infinity,minHeight:c(h.minHeight)?h.minHeight:0,maxHeight:c(h.maxHeight)?h.maxHeight:
|
||||
Infinity};if(this._aspectRatio||e){e=h.minHeight*this.aspectRatio;i=h.minWidth/this.aspectRatio;g=h.maxHeight*this.aspectRatio;b=h.maxWidth/this.aspectRatio;if(e>h.minWidth)h.minWidth=e;if(i>h.minHeight)h.minHeight=i;if(g<h.maxWidth)h.maxWidth=g;if(b<h.maxHeight)h.maxHeight=b}this._vBoundaries=h},_updateCache:function(e){this.offset=this.helper.offset();if(c(e.left))this.position.left=e.left;if(c(e.top))this.position.top=e.top;if(c(e.height))this.size.height=e.height;if(c(e.width))this.size.width=
|
||||
e.width},_updateRatio:function(e){var h=this.position,g=this.size,i=this.axis;if(c(e.height))e.width=e.height*this.aspectRatio;else if(c(e.width))e.height=e.width/this.aspectRatio;if(i=="sw"){e.left=h.left+(g.width-e.width);e.top=null}if(i=="nw"){e.top=h.top+(g.height-e.height);e.left=h.left+(g.width-e.width)}return e},_respectSize:function(e){var h=this._vBoundaries,g=this.axis,i=c(e.width)&&h.maxWidth&&h.maxWidth<e.width,b=c(e.height)&&h.maxHeight&&h.maxHeight<e.height,f=c(e.width)&&h.minWidth&&
|
||||
h.minWidth>e.width,j=c(e.height)&&h.minHeight&&h.minHeight>e.height;if(f)e.width=h.minWidth;if(j)e.height=h.minHeight;if(i)e.width=h.maxWidth;if(b)e.height=h.maxHeight;var l=this.originalPosition.left+this.originalSize.width,o=this.position.top+this.size.height,n=/sw|nw|w/.test(g);g=/nw|ne|n/.test(g);if(f&&n)e.left=l-h.minWidth;if(i&&n)e.left=l-h.maxWidth;if(j&&g)e.top=o-h.minHeight;if(b&&g)e.top=o-h.maxHeight;if((h=!e.width&&!e.height)&&!e.left&&e.top)e.top=null;else if(h&&!e.top&&e.left)e.left=
|
||||
null;return e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,h=0;h<this._proportionallyResizeElements.length;h++){var g=this._proportionallyResizeElements[h];if(!this.borderDif){var i=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],b=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=a.map(i,function(f,j){f=parseInt(f,10)||
|
||||
0;j=parseInt(b[j],10)||0;return f+j})}a.browser.msie&&(a(e).is(":hidden")||a(e).parents(":hidden").length)||g.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var e=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var h=a.browser.msie&&a.browser.version<7,g=h?1:0;h=h?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
|
||||
h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,h){return{width:this.originalSize.width+h}},w:function(e,h){return{left:this.originalPosition.left+h,width:this.originalSize.width-h}},n:function(e,h,g){return{top:this.originalPosition.top+g,height:this.originalSize.height-g}},s:function(e,h,g){return{height:this.originalSize.height+
|
||||
g}},se:function(e,h,g){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,h,g]))},sw:function(e,h,g){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,h,g]))},ne:function(e,h,g){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,h,g]))},nw:function(e,h,g){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,h,g]))}},_propagate:function(e,h){a.ui.plugin.call(this,e,[h,this.ui()]);
|
||||
e!="resize"&&this._trigger(e,h,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.extend(a.ui.resizable,{version:"1.8.16"});a.ui.plugin.add("resizable","alsoResize",{start:function(){var e=a(this).data("resizable").options,h=function(g){a(g).each(function(){var i=a(this);i.data("resizable-alsoresize",{width:parseInt(i.width(),
|
||||
10),height:parseInt(i.height(),10),left:parseInt(i.css("left"),10),top:parseInt(i.css("top"),10),position:i.css("position")})})};if(typeof e.alsoResize=="object"&&!e.alsoResize.parentNode)if(e.alsoResize.length){e.alsoResize=e.alsoResize[0];h(e.alsoResize)}else a.each(e.alsoResize,function(g){h(g)});else h(e.alsoResize)},resize:function(e,h){var g=a(this).data("resizable");e=g.options;var i=g.originalSize,b=g.originalPosition,f={height:g.size.height-i.height||0,width:g.size.width-i.width||0,top:g.position.top-
|
||||
b.top||0,left:g.position.left-b.left||0},j=function(l,o){a(l).each(function(){var n=a(this),k=a(this).data("resizable-alsoresize"),m={},p=o&&o.length?o:n.parents(h.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(p,function(q,s){if((q=(k[s]||0)+(f[s]||0))&&q>=0)m[s]=q||null});if(a.browser.opera&&/relative/.test(n.css("position"))){g._revertToRelativePosition=true;n.css({position:"absolute",top:"auto",left:"auto"})}n.css(m)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?
|
||||
a.each(e.alsoResize,function(l,o){j(l,o)}):j(e.alsoResize)},stop:function(){var e=a(this).data("resizable"),h=e.options,g=function(i){a(i).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};if(e._revertToRelativePosition){e._revertToRelativePosition=false;typeof h.alsoResize=="object"&&!h.alsoResize.nodeType?a.each(h.alsoResize,function(i){g(i)}):g(h.alsoResize)}a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(e){var h=
|
||||
a(this).data("resizable"),g=h.options,i=h._proportionallyResizeElements,b=i.length&&/textarea/i.test(i[0].nodeName),f=b&&a.ui.hasScroll(i[0],"left")?0:h.sizeDiff.height;b={width:h.size.width-(b?0:h.sizeDiff.width),height:h.size.height-f};f=parseInt(h.element.css("left"),10)+(h.position.left-h.originalPosition.left)||null;var j=parseInt(h.element.css("top"),10)+(h.position.top-h.originalPosition.top)||null;h.element.animate(a.extend(b,j&&f?{top:j,left:f}:{}),{duration:g.animateDuration,easing:g.animateEasing,
|
||||
step:function(){var l={width:parseInt(h.element.css("width"),10),height:parseInt(h.element.css("height"),10),top:parseInt(h.element.css("top"),10),left:parseInt(h.element.css("left"),10)};i&&i.length&&a(i[0]).css({width:l.width,height:l.height});h._updateCache(l);h._propagate("resize",e)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var e=a(this).data("resizable"),h=e.element,g=e.options.containment;if(h=g instanceof a?g.get(0):/parent/.test(g)?h.parent().get(0):g){e.containerElement=
|
||||
a(h);if(/document/.test(g)||g==document){e.containerOffset={left:0,top:0};e.containerPosition={left:0,top:0};e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}}else{var i=a(h),b=[];a(["Top","Right","Left","Bottom"]).each(function(l,o){b[l]=d(i.css("padding"+o))});e.containerOffset=i.offset();e.containerPosition=i.position();e.containerSize={height:i.innerHeight()-b[3],width:i.innerWidth()-b[1]};g=e.containerOffset;
|
||||
var f=e.containerSize.height,j=e.containerSize.width;j=a.ui.hasScroll(h,"left")?h.scrollWidth:j;f=a.ui.hasScroll(h)?h.scrollHeight:f;e.parentData={element:h,left:g.left,top:g.top,width:j,height:f}}}},resize:function(e){var h=a(this).data("resizable"),g=h.options,i=h.containerOffset,b=h.position;e=h._aspectRatio||e.shiftKey;var f={top:0,left:0},j=h.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))f=i;if(b.left<(h._helper?i.left:0)){h.size.width+=h._helper?h.position.left-i.left:
|
||||
h.position.left-f.left;if(e)h.size.height=h.size.width/g.aspectRatio;h.position.left=g.helper?i.left:0}if(b.top<(h._helper?i.top:0)){h.size.height+=h._helper?h.position.top-i.top:h.position.top;if(e)h.size.width=h.size.height*g.aspectRatio;h.position.top=h._helper?i.top:0}h.offset.left=h.parentData.left+h.position.left;h.offset.top=h.parentData.top+h.position.top;g=Math.abs((h._helper?h.offset.left-f.left:h.offset.left-f.left)+h.sizeDiff.width);i=Math.abs((h._helper?h.offset.top-f.top:h.offset.top-
|
||||
i.top)+h.sizeDiff.height);b=h.containerElement.get(0)==h.element.parent().get(0);f=/relative|absolute/.test(h.containerElement.css("position"));if(b&&f)g-=h.parentData.left;if(g+h.size.width>=h.parentData.width){h.size.width=h.parentData.width-g;if(e)h.size.height=h.size.width/h.aspectRatio}if(i+h.size.height>=h.parentData.height){h.size.height=h.parentData.height-i;if(e)h.size.width=h.size.height*h.aspectRatio}},stop:function(){var e=a(this).data("resizable"),h=e.options,g=e.containerOffset,i=e.containerPosition,
|
||||
b=e.containerElement,f=a(e.helper),j=f.offset(),l=f.outerWidth()-e.sizeDiff.width;f=f.outerHeight()-e.sizeDiff.height;e._helper&&!h.animate&&/relative/.test(b.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:l,height:f});e._helper&&!h.animate&&/static/.test(b.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:l,height:f})}});a.ui.plugin.add("resizable","ghost",{start:function(){var e=a(this).data("resizable"),h=e.options,g=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,
|
||||
display:"block",position:"relative",height:g.height,width:g.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");e.ghost.appendTo(e.helper)},resize:function(){var e=a(this).data("resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=a(this).data("resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(){var e=
|
||||
a(this).data("resizable"),h=e.options,g=e.size,i=e.originalSize,b=e.originalPosition,f=e.axis;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var j=Math.round((g.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1);h=Math.round((g.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(f)){e.size.width=i.width+j;e.size.height=i.height+h}else if(/^(ne)$/.test(f)){e.size.width=i.width+j;e.size.height=i.height+h;e.position.top=b.top-h}else{if(/^(sw)$/.test(f)){e.size.width=i.width+j;e.size.height=
|
||||
i.height+h}else{e.size.width=i.width+j;e.size.height=i.height+h;e.position.top=b.top-h}e.position.left=b.left-j}}});var d=function(e){return parseInt(e,10)||0},c=function(e){return!isNaN(parseInt(e,10))}})(jQuery);
|
||||
(function(a){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var d=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(d.options.filter,d.element[0]);c.each(function(){var e=a(this),h=e.offset();a.data(this,"selectable-item",{element:this,$element:e,left:h.left,top:h.top,right:h.left+e.outerWidth(),bottom:h.top+e.outerHeight(),startselected:false,selected:e.hasClass("ui-selected"),
|
||||
selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(d){var c=this;this.opos=[d.pageX,
|
||||
d.pageY];if(!this.options.disabled){var e=this.options;this.selectees=a(e.filter,this.element[0]);this._trigger("start",d);a(e.appendTo).append(this.helper);this.helper.css({left:d.clientX,top:d.clientY,width:0,height:0});e.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var h=a.data(this,"selectable-item");h.startselected=true;if(!d.metaKey){h.$element.removeClass("ui-selected");h.selected=false;h.$element.addClass("ui-unselecting");h.unselecting=true;c._trigger("unselecting",
|
||||
d,{unselecting:h.element})}});a(d.target).parents().andSelf().each(function(){var h=a.data(this,"selectable-item");if(h){var g=!d.metaKey||!h.$element.hasClass("ui-selected");h.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");h.unselecting=!g;h.selecting=g;(h.selected=g)?c._trigger("selecting",d,{selecting:h.element}):c._trigger("unselecting",d,{unselecting:h.element});return false}})}},_mouseDrag:function(d){var c=this;this.dragged=true;if(!this.options.disabled){var e=
|
||||
this.options,h=this.opos[0],g=this.opos[1],i=d.pageX,b=d.pageY;if(h>i){var f=i;i=h;h=f}if(g>b){f=b;b=g;g=f}this.helper.css({left:h,top:g,width:i-h,height:b-g});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!(!j||j.element==c.element[0])){var l=false;if(e.tolerance=="touch")l=!(j.left>i||j.right<h||j.top>b||j.bottom<g);else if(e.tolerance=="fit")l=j.left>h&&j.right<i&&j.top>g&&j.bottom<b;if(l){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");
|
||||
j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",d,{selecting:j.element})}}else{if(j.selecting)if(d.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",d,{unselecting:j.element})}if(j.selected)if(!d.metaKey&&
|
||||
!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",d,{unselecting:j.element})}}}});return false}},_mouseStop:function(d){var c=this;this.dragged=false;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;c._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=
|
||||
a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;c._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.16"})})(jQuery);
|
||||
(function(a){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var d=this.options;this.containerCache={};this.element.addClass("ui-sortable");
|
||||
this.refresh();this.floating=this.items.length?d.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var d=this.items.length-1;d>=0;d--)this.items[d].item.removeData("sortable-item");return this},_setOption:function(d,c){if(d===
|
||||
"disabled"){this.options[d]=c;this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")}else a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(d,c){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(d);var e=null,h=this;a(d.target).parents().each(function(){if(a.data(this,"sortable-item")==h){e=a(this);return false}});if(a.data(d.target,"sortable-item")==h)e=a(d.target);if(!e)return false;if(this.options.handle&&
|
||||
!c){var g=false;a(this.options.handle,e).find("*").andSelf().each(function(){if(this==d.target)g=true});if(!g)return false}this.currentItem=e;this._removeCurrentsFromItems();return true},_mouseStart:function(d,c,e){c=this.options;var h=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(d);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,
|
||||
left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
|
||||
this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();c.containment&&this._setContainment();if(c.cursor){if(a("body").css("cursor"))this._storedCursor=a("body").css("cursor");a("body").css("cursor",c.cursor)}if(c.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",c.opacity)}if(c.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",c.zIndex)}if(this.scrollParent[0]!=
|
||||
document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",d,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!e)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",d,h._uiHash(this));if(a.ui.ddmanager)a.ui.ddmanager.current=this;a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(d);
|
||||
return true},_mouseDrag:function(d){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var c=this.options,e=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-d.pageY<c.scrollSensitivity)this.scrollParent[0].scrollTop=e=this.scrollParent[0].scrollTop+c.scrollSpeed;else if(d.pageY-this.overflowOffset.top<
|
||||
c.scrollSensitivity)this.scrollParent[0].scrollTop=e=this.scrollParent[0].scrollTop-c.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-d.pageX<c.scrollSensitivity)this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft+c.scrollSpeed;else if(d.pageX-this.overflowOffset.left<c.scrollSensitivity)this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(d.pageY-a(document).scrollTop()<c.scrollSensitivity)e=a(document).scrollTop(a(document).scrollTop()-
|
||||
c.scrollSpeed);else if(a(window).height()-(d.pageY-a(document).scrollTop())<c.scrollSensitivity)e=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed);if(d.pageX-a(document).scrollLeft()<c.scrollSensitivity)e=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed);else if(a(window).width()-(d.pageX-a(document).scrollLeft())<c.scrollSensitivity)e=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed)}e!==false&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,
|
||||
d)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(c=this.items.length-1;c>=0;c--){e=this.items[c];var h=e.item[0],g=this._intersectsWithPointer(e);if(g)if(h!=this.currentItem[0]&&this.placeholder[g==1?"next":"prev"]()[0]!=h&&!a.ui.contains(this.placeholder[0],h)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],
|
||||
h):true)){this.direction=g==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e))this._rearrange(d,e);else break;this._trigger("change",d,this._uiHash());break}}this._contactContainers(d);a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);this._trigger("sort",d,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,c){if(d){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,d);if(this.options.revert){var e=this;c=e.placeholder.offset();
|
||||
e.reverting=true;a(this.helper).animate({left:c.left-this.offset.parent.left-e.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:c.top-this.offset.parent.top-e.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){e._clear(d)})}else this._clear(d,c);return false}},cancel:function(){var d=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
|
||||
this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,d._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,d._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();a.extend(this,{helper:null,
|
||||
dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(d){var c=this._getItemsAsjQuery(d&&d.connected),e=[];d=d||{};a(c).each(function(){var h=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||/(.+)[-=_](.+)/);if(h)e.push((d.key||h[1]+"[]")+"="+(d.key&&d.expression?h[1]:h[2]))});!e.length&&d.key&&e.push(d.key+"=");return e.join("&")},
|
||||
toArray:function(d){var c=this._getItemsAsjQuery(d&&d.connected),e=[];d=d||{};c.each(function(){e.push(a(d.item||this).attr(d.attribute||"id")||"")});return e},_intersectsWith:function(d){var c=this.positionAbs.left,e=c+this.helperProportions.width,h=this.positionAbs.top,g=h+this.helperProportions.height,i=d.left,b=i+d.width,f=d.top,j=f+d.height,l=this.offset.click.top,o=this.offset.click.left;l=h+l>f&&h+l<j&&c+o>i&&c+o<b;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
|
||||
this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>d[this.floating?"width":"height"]?l:i<c+this.helperProportions.width/2&&e-this.helperProportions.width/2<b&&f<h+this.helperProportions.height/2&&g-this.helperProportions.height/2<j},_intersectsWithPointer:function(d){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height);d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width);c=c&&d;d=this._getDragVerticalDirection();
|
||||
var e=this._getDragHorizontalDirection();if(!c)return false;return this.floating?e&&e=="right"||d=="down"?2:1:d&&(d=="down"?2:1)},_intersectsWithSides:function(d){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top+d.height/2,d.height);d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left+d.width/2,d.width);var e=this._getDragVerticalDirection(),h=this._getDragHorizontalDirection();return this.floating&&h?h=="right"&&d||h=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},
|
||||
_getDragVerticalDirection:function(){var d=this.positionAbs.top-this.lastPositionAbs.top;return d!=0&&(d>0?"down":"up")},_getDragHorizontalDirection:function(){var d=this.positionAbs.left-this.lastPositionAbs.left;return d!=0&&(d>0?"right":"left")},refresh:function(d){this._refreshItems(d);this.refreshPositions();return this},_connectWith:function(){var d=this.options;return d.connectWith.constructor==String?[d.connectWith]:d.connectWith},_getItemsAsjQuery:function(d){var c=[],e=[],h=this._connectWith();
|
||||
if(h&&d)for(d=h.length-1;d>=0;d--)for(var g=a(h[d]),i=g.length-1;i>=0;i--){var b=a.data(g[i],"sortable");if(b&&b!=this&&!b.options.disabled)e.push([a.isFunction(b.options.items)?b.options.items.call(b.element):a(b.options.items,b.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),b])}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
|
||||
this]);for(d=e.length-1;d>=0;d--)e[d][0].each(function(){c.push(this)});return a(c)},_removeCurrentsFromItems:function(){for(var d=this.currentItem.find(":data(sortable-item)"),c=0;c<this.items.length;c++)for(var e=0;e<d.length;e++)d[e]==this.items[c].item[0]&&this.items.splice(c,1)},_refreshItems:function(d){this.items=[];this.containers=[this];var c=this.items,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],d,{item:this.currentItem}):a(this.options.items,this.element),
|
||||
this]],h=this._connectWith();if(h)for(var g=h.length-1;g>=0;g--)for(var i=a(h[g]),b=i.length-1;b>=0;b--){var f=a.data(i[b],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element[0],d,{item:this.currentItem}):a(f.options.items,f.element),f]);this.containers.push(f)}}for(g=e.length-1;g>=0;g--){d=e[g][1];h=e[g][0];b=0;for(i=h.length;b<i;b++){f=a(h[b]);f.data("sortable-item",d);c.push({item:f,instance:d,width:0,height:0,left:0,top:0})}}},refreshPositions:function(d){if(this.offsetParent&&
|
||||
this.helper)this.offset.parent=this._getParentOffset();for(var c=this.items.length-1;c>=0;c--){var e=this.items[c];if(!(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0])){var h=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!d){e.width=h.outerWidth();e.height=h.outerHeight()}h=h.offset();e.left=h.left;e.top=h.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=
|
||||
this.containers.length-1;c>=0;c--){h=this.containers[c].element.offset();this.containers[c].containerCache.left=h.left;this.containers[c].containerCache.top=h.top;this.containers[c].containerCache.width=this.containers[c].element.outerWidth();this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(d){var c=d||this,e=c.options;if(!e.placeholder||e.placeholder.constructor==String){var h=e.placeholder;e.placeholder={element:function(){var g=
|
||||
a(document.createElement(c.currentItem[0].nodeName)).addClass(h||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!h)g.style.visibility="hidden";return g},update:function(g,i){if(!(h&&!e.forcePlaceholderSize)){i.height()||i.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10));i.width()||i.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||
|
||||
0,10))}}}}c.placeholder=a(e.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);e.placeholder.update(c,c.placeholder)},_contactContainers:function(d){for(var c=null,e=null,h=this.containers.length-1;h>=0;h--)if(!a.ui.contains(this.currentItem[0],this.containers[h].element[0]))if(this._intersectsWith(this.containers[h].containerCache)){if(!(c&&a.ui.contains(this.containers[h].element[0],c.element[0]))){c=this.containers[h];e=h}}else if(this.containers[h].containerCache.over){this.containers[h]._trigger("out",
|
||||
d,this._uiHash(this));this.containers[h].containerCache.over=0}if(c)if(this.containers.length===1){this.containers[e]._trigger("over",d,this._uiHash(this));this.containers[e].containerCache.over=1}else if(this.currentContainer!=this.containers[e]){c=1E4;h=null;for(var g=this.positionAbs[this.containers[e].floating?"left":"top"],i=this.items.length-1;i>=0;i--)if(a.ui.contains(this.containers[e].element[0],this.items[i].item[0])){var b=this.items[i][this.containers[e].floating?"left":"top"];if(Math.abs(b-
|
||||
g)<c){c=Math.abs(b-g);h=this.items[i]}}if(h||this.options.dropOnEmpty){this.currentContainer=this.containers[e];h?this._rearrange(d,h,null,true):this._rearrange(d,null,this.containers[e].element,true);this._trigger("change",d,this._uiHash());this.containers[e]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[e]._trigger("over",d,this._uiHash(this));this.containers[e].containerCache.over=1}}},_createHelper:function(d){var c=
|
||||
this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]);if(d[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(d[0].style.width==
|
||||
""||c.forceHelperSize)d.width(this.currentItem.width());if(d[0].style.height==""||c.forceHelperSize)d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string")d=d.split(" ");if(a.isArray(d))d={left:+d[0],top:+d[1]||0};if("left"in d)this.offset.click.left=d.left+this.margins.left;if("right"in d)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if("top"in d)this.offset.click.top=d.top+this.margins.top;if("bottom"in d)this.offset.click.top=
|
||||
this.helperProportions.height-d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)d=
|
||||
{top:0,left:0};return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.currentItem.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),
|
||||
10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment=="parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(d.containment=="document"?
|
||||
document:window).width()-this.helperProportions.width-this.margins.left,(a(d.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)){var c=a(d.containment)[0];d=a(d.containment).offset();var e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),
|
||||
10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(d,c){if(!c)c=
|
||||
this.position;d=d=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&
|
||||
this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())*d)}},_generatePosition:function(d){var c=this.options,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
|
||||
var g=d.pageX,i=d.pageY;if(this.originalPosition){if(this.containment){if(d.pageX-this.offset.click.left<this.containment[0])g=this.containment[0]+this.offset.click.left;if(d.pageY-this.offset.click.top<this.containment[1])i=this.containment[1]+this.offset.click.top;if(d.pageX-this.offset.click.left>this.containment[2])g=this.containment[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>this.containment[3])i=this.containment[3]+this.offset.click.top}if(c.grid){i=this.originalPageY+Math.round((i-
|
||||
this.originalPageY)/c.grid[1])*c.grid[1];i=this.containment?!(i-this.offset.click.top<this.containment[1]||i-this.offset.click.top>this.containment[3])?i:!(i-this.offset.click.top<this.containment[1])?i-c.grid[1]:i+c.grid[1]:i;g=this.originalPageX+Math.round((g-this.originalPageX)/c.grid[0])*c.grid[0];g=this.containment?!(g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2])?g:!(g-this.offset.click.left<this.containment[0])?g-c.grid[0]:g+c.grid[0]:g}}return{top:i-
|
||||
this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())}},_rearrange:function(d,c,e,h){e?e[0].appendChild(this.placeholder[0]):c.item[0].parentNode.insertBefore(this.placeholder[0],
|
||||
this.direction=="down"?c.item[0]:c.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var g=this,i=this.counter;window.setTimeout(function(){i==g.counter&&g.refreshPositions(!h)},0)},_clear:function(d,c){this.reverting=false;var e=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var h in this._storedCSS)if(this._storedCSS[h]=="auto"||this._storedCSS[h]=="static")this._storedCSS[h]=
|
||||
"";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&e.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c)e.push(function(g){this._trigger("update",g,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||e.push(function(g){this._trigger("remove",
|
||||
g,this._uiHash())});for(h=this.containers.length-1;h>=0;h--)if(a.ui.contains(this.containers[h].element[0],this.currentItem[0])&&!c){e.push(function(g){return function(i){g._trigger("receive",i,this._uiHash(this))}}.call(this,this.containers[h]));e.push(function(g){return function(i){g._trigger("update",i,this._uiHash(this))}}.call(this,this.containers[h]))}}for(h=this.containers.length-1;h>=0;h--){c||e.push(function(g){return function(i){g._trigger("deactivate",i,this._uiHash(this))}}.call(this,
|
||||
this.containers[h]));if(this.containers[h].containerCache.over){e.push(function(g){return function(i){g._trigger("out",i,this._uiHash(this))}}.call(this,this.containers[h]));this.containers[h].containerCache.over=0}}this._storedCursor&&a("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",
|
||||
d,this._uiHash());for(h=0;h<e.length;h++)e[h].call(this,d);this._trigger("stop",d,this._uiHash())}return false}c||this._trigger("beforeStop",d,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!c){for(h=0;h<e.length;h++)e[h].call(this,d);this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
|
||||
_uiHash:function(d){var c=d||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:d?d.element:null}}});a.extend(a.ui.sortable,{version:"1.8.16"})})(jQuery);
|
||||
jQuery.effects||function(a,d){function c(n){var k;if(n&&n.constructor==Array&&n.length==3)return n;if(k=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))return[parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10)];if(k=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))return[parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55];if(k=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))return[parseInt(k[1],
|
||||
16),parseInt(k[2],16),parseInt(k[3],16)];if(k=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n))return[parseInt(k[1]+k[1],16),parseInt(k[2]+k[2],16),parseInt(k[3]+k[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(n))return j.transparent;return j[a.trim(n).toLowerCase()]}function e(n,k){var m;do{m=a.curCSS(n,k);if(m!=""&&m!="transparent"||a.nodeName(n,"body"))break;k="backgroundColor"}while(n=n.parentNode);return c(m)}function h(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
|
||||
k={},m,p;if(n&&n.length&&n[0]&&n[n[0]])for(var q=n.length;q--;){m=n[q];if(typeof n[m]=="string"){p=m.replace(/\-(\w)/g,function(s,r){return r.toUpperCase()});k[p]=n[m]}}else for(m in n)if(typeof n[m]==="string")k[m]=n[m];return k}function g(n){var k,m;for(k in n){m=n[k];if(m==null||a.isFunction(m)||k in o||/scrollbar/.test(k)||!/color/i.test(k)&&isNaN(parseFloat(m)))delete n[k]}return n}function i(n,k){var m={_:0},p;for(p in k)if(n[p]!=k[p])m[p]=k[p];return m}function b(n,k,m,p){if(typeof n=="object"){p=
|
||||
k;m=null;k=n;n=k.effect}if(a.isFunction(k)){p=k;m=null;k={}}if(typeof k=="number"||a.fx.speeds[k]){p=m;m=k;k={}}if(a.isFunction(m)){p=m;m=null}k=k||{};m=m||k.duration;m=a.fx.off?0:typeof m=="number"?m:m in a.fx.speeds?a.fx.speeds[m]:a.fx.speeds._default;p=p||k.complete;return[n,k,m,p]}function f(n){if(!n||typeof n==="number"||a.fx.speeds[n])return true;if(typeof n==="string"&&!a.effects[n])return true;return false}a.effects={};a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
|
||||
"borderTopColor","borderColor","color","outlineColor"],function(n,k){a.fx.step[k]=function(m){if(!m.colorInit){m.start=e(m.elem,k);m.end=c(m.end);m.colorInit=true}m.elem.style[k]="rgb("+Math.max(Math.min(parseInt(m.pos*(m.end[0]-m.start[0])+m.start[0],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[1]-m.start[1])+m.start[1],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[2]-m.start[2])+m.start[2],10),255),0)+")"}});var j={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
|
||||
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
|
||||
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},l=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(n,k,m,
|
||||
p){if(a.isFunction(m)){p=m;m=null}return this.queue(function(){var q=a(this),s=q.attr("style")||" ",r=g(h.call(this)),u,v=q.attr("class");a.each(l,function(w,x){n[x]&&q[x+"Class"](n[x])});u=g(h.call(this));q.attr("class",v);q.animate(i(r,u),{queue:false,duration:k,easing:m,complete:function(){a.each(l,function(w,x){n[x]&&q[x+"Class"](n[x])});if(typeof q.attr("style")=="object"){q.attr("style").cssText="";q.attr("style").cssText=s}else q.attr("style",s);p&&p.apply(this,arguments);a.dequeue(this)}})})};
|
||||
a.fn.extend({_addClass:a.fn.addClass,addClass:function(n,k,m,p){return k?a.effects.animateClass.apply(this,[{add:n},k,m,p]):this._addClass(n)},_removeClass:a.fn.removeClass,removeClass:function(n,k,m,p){return k?a.effects.animateClass.apply(this,[{remove:n},k,m,p]):this._removeClass(n)},_toggleClass:a.fn.toggleClass,toggleClass:function(n,k,m,p,q){return typeof k=="boolean"||k===d?m?a.effects.animateClass.apply(this,[k?{add:n}:{remove:n},m,p,q]):this._toggleClass(n,k):a.effects.animateClass.apply(this,
|
||||
[{toggle:n},k,m,p])},switchClass:function(n,k,m,p,q){return a.effects.animateClass.apply(this,[{add:k,remove:n},m,p,q])}});a.extend(a.effects,{version:"1.8.16",save:function(n,k){for(var m=0;m<k.length;m++)k[m]!==null&&n.data("ec.storage."+k[m],n[0].style[k[m]])},restore:function(n,k){for(var m=0;m<k.length;m++)k[m]!==null&&n.css(k[m],n.data("ec.storage."+k[m]))},setMode:function(n,k){if(k=="toggle")k=n.is(":hidden")?"show":"hide";return k},getBaseline:function(n,k){var m;switch(n[0]){case "top":m=
|
||||
0;break;case "middle":m=0.5;break;case "bottom":m=1;break;default:m=n[0]/k.height}switch(n[1]){case "left":n=0;break;case "center":n=0.5;break;case "right":n=1;break;default:n=n[1]/k.width}return{x:n,y:m}},createWrapper:function(n){if(n.parent().is(".ui-effects-wrapper"))return n.parent();var k={width:n.outerWidth(true),height:n.outerHeight(true),"float":n.css("float")},m=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),
|
||||
p=document.activeElement;n.wrap(m);if(n[0]===p||a.contains(n[0],p))a(p).focus();m=n.parent();if(n.css("position")=="static"){m.css({position:"relative"});n.css({position:"relative"})}else{a.extend(k,{position:n.css("position"),zIndex:n.css("z-index")});a.each(["top","left","bottom","right"],function(q,s){k[s]=n.css(s);if(isNaN(parseInt(k[s],10)))k[s]="auto"});n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return m.css(k).show()},removeWrapper:function(n){var k,m=document.activeElement;
|
||||
if(n.parent().is(".ui-effects-wrapper")){k=n.parent().replaceWith(n);if(n[0]===m||a.contains(n[0],m))a(m).focus();return k}return n},setTransition:function(n,k,m,p){p=p||{};a.each(k,function(q,s){unit=n.cssUnit(s);if(unit[0]>0)p[s]=unit[0]*m+unit[1]});return p}});a.fn.extend({effect:function(n){var k=b.apply(this,arguments),m={options:k[1],duration:k[2],callback:k[3]};k=m.options.mode;var p=a.effects[n];if(a.fx.off||!p)return k?this[k](m.duration,m.callback):this.each(function(){m.callback&&m.callback.call(this)});
|
||||
return p.call(this,m)},_show:a.fn.show,show:function(n){if(f(n))return this._show.apply(this,arguments);else{var k=b.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:a.fn.hide,hide:function(n){if(f(n))return this._hide.apply(this,arguments);else{var k=b.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:a.fn.toggle,toggle:function(n){if(f(n)||typeof n==="boolean"||a.isFunction(n))return this.__toggle.apply(this,arguments);else{var k=b.apply(this,
|
||||
arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(n){var k=this.css(n),m=[];a.each(["em","px","%","pt"],function(p,q){if(k.indexOf(q)>0)m=[parseFloat(k),q]});return m}});a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(n,k,m,p,q){return a.easing[a.easing.def](n,k,m,p,q)},easeInQuad:function(n,k,m,p,q){return p*(k/=q)*k+m},easeOutQuad:function(n,k,m,p,q){return-p*(k/=q)*(k-2)+m},easeInOutQuad:function(n,k,m,p,q){if((k/=q/2)<1)return p/
|
||||
2*k*k+m;return-p/2*(--k*(k-2)-1)+m},easeInCubic:function(n,k,m,p,q){return p*(k/=q)*k*k+m},easeOutCubic:function(n,k,m,p,q){return p*((k=k/q-1)*k*k+1)+m},easeInOutCubic:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k+m;return p/2*((k-=2)*k*k+2)+m},easeInQuart:function(n,k,m,p,q){return p*(k/=q)*k*k*k+m},easeOutQuart:function(n,k,m,p,q){return-p*((k=k/q-1)*k*k*k-1)+m},easeInOutQuart:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k*k+m;return-p/2*((k-=2)*k*k*k-2)+m},easeInQuint:function(n,k,m,
|
||||
p,q){return p*(k/=q)*k*k*k*k+m},easeOutQuint:function(n,k,m,p,q){return p*((k=k/q-1)*k*k*k*k+1)+m},easeInOutQuint:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k*k*k+m;return p/2*((k-=2)*k*k*k*k+2)+m},easeInSine:function(n,k,m,p,q){return-p*Math.cos(k/q*(Math.PI/2))+p+m},easeOutSine:function(n,k,m,p,q){return p*Math.sin(k/q*(Math.PI/2))+m},easeInOutSine:function(n,k,m,p,q){return-p/2*(Math.cos(Math.PI*k/q)-1)+m},easeInExpo:function(n,k,m,p,q){return k==0?m:p*Math.pow(2,10*(k/q-1))+m},easeOutExpo:function(n,
|
||||
k,m,p,q){return k==q?m+p:p*(-Math.pow(2,-10*k/q)+1)+m},easeInOutExpo:function(n,k,m,p,q){if(k==0)return m;if(k==q)return m+p;if((k/=q/2)<1)return p/2*Math.pow(2,10*(k-1))+m;return p/2*(-Math.pow(2,-10*--k)+2)+m},easeInCirc:function(n,k,m,p,q){return-p*(Math.sqrt(1-(k/=q)*k)-1)+m},easeOutCirc:function(n,k,m,p,q){return p*Math.sqrt(1-(k=k/q-1)*k)+m},easeInOutCirc:function(n,k,m,p,q){if((k/=q/2)<1)return-p/2*(Math.sqrt(1-k*k)-1)+m;return p/2*(Math.sqrt(1-(k-=2)*k)+1)+m},easeInElastic:function(n,k,m,
|
||||
p,q){n=1.70158;var s=0,r=p;if(k==0)return m;if((k/=q)==1)return m+p;s||(s=q*0.3);if(r<Math.abs(p)){r=p;n=s/4}else n=s/(2*Math.PI)*Math.asin(p/r);return-(r*Math.pow(2,10*(k-=1))*Math.sin((k*q-n)*2*Math.PI/s))+m},easeOutElastic:function(n,k,m,p,q){n=1.70158;var s=0,r=p;if(k==0)return m;if((k/=q)==1)return m+p;s||(s=q*0.3);if(r<Math.abs(p)){r=p;n=s/4}else n=s/(2*Math.PI)*Math.asin(p/r);return r*Math.pow(2,-10*k)*Math.sin((k*q-n)*2*Math.PI/s)+p+m},easeInOutElastic:function(n,k,m,p,q){n=1.70158;var s=
|
||||
0,r=p;if(k==0)return m;if((k/=q/2)==2)return m+p;s||(s=q*0.3*1.5);if(r<Math.abs(p)){r=p;n=s/4}else n=s/(2*Math.PI)*Math.asin(p/r);if(k<1)return-0.5*r*Math.pow(2,10*(k-=1))*Math.sin((k*q-n)*2*Math.PI/s)+m;return r*Math.pow(2,-10*(k-=1))*Math.sin((k*q-n)*2*Math.PI/s)*0.5+p+m},easeInBack:function(n,k,m,p,q,s){if(s==d)s=1.70158;return p*(k/=q)*k*((s+1)*k-s)+m},easeOutBack:function(n,k,m,p,q,s){if(s==d)s=1.70158;return p*((k=k/q-1)*k*((s+1)*k+s)+1)+m},easeInOutBack:function(n,k,m,p,q,s){if(s==d)s=1.70158;
|
||||
if((k/=q/2)<1)return p/2*k*k*(((s*=1.525)+1)*k-s)+m;return p/2*((k-=2)*k*(((s*=1.525)+1)*k+s)+2)+m},easeInBounce:function(n,k,m,p,q){return p-a.easing.easeOutBounce(n,q-k,0,p,q)+m},easeOutBounce:function(n,k,m,p,q){return(k/=q)<1/2.75?p*7.5625*k*k+m:k<2/2.75?p*(7.5625*(k-=1.5/2.75)*k+0.75)+m:k<2.5/2.75?p*(7.5625*(k-=2.25/2.75)*k+0.9375)+m:p*(7.5625*(k-=2.625/2.75)*k+0.984375)+m},easeInOutBounce:function(n,k,m,p,q){if(k<q/2)return a.easing.easeInBounce(n,k*2,0,p,q)*0.5+m;return a.easing.easeOutBounce(n,
|
||||
k*2-q,0,p,q)*0.5+p*0.5+m}})}(jQuery);
|
||||
(function(a){a.effects.blind=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.direction||"vertical";a.effects.save(c,e);c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),b=g=="vertical"?"height":"width";g=g=="vertical"?i.height():i.width();h=="show"&&i.css(b,0);var f={};f[b]=h=="show"?g:0;i.animate(f,d.duration,d.options.easing,function(){h=="hide"&&c.hide();a.effects.restore(c,
|
||||
e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);
|
||||
(function(a){a.effects.bounce=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"effect"),g=d.options.direction||"up",i=d.options.distance||20,b=d.options.times||5,f=d.duration||250;/show|hide/.test(h)&&e.push("opacity");a.effects.save(c,e);c.show();a.effects.createWrapper(c);var j=g=="up"||g=="down"?"top":"left";g=g=="up"||g=="left"?"pos":"neg";i=d.options.distance||(j=="top"?c.outerHeight({margin:true})/3:c.outerWidth({margin:true})/
|
||||
3);if(h=="show")c.css("opacity",0).css(j,g=="pos"?-i:i);if(h=="hide")i/=b*2;h!="hide"&&b--;if(h=="show"){var l={opacity:1};l[j]=(g=="pos"?"+=":"-=")+i;c.animate(l,f/2,d.options.easing);i/=2;b--}for(l=0;l<b;l++){var o={},n={};o[j]=(g=="pos"?"-=":"+=")+i;n[j]=(g=="pos"?"+=":"-=")+i;c.animate(o,f/2,d.options.easing).animate(n,f/2,d.options.easing);i=h=="hide"?i*2:i/2}if(h=="hide"){l={opacity:0};l[j]=(g=="pos"?"-=":"+=")+i;c.animate(l,f/2,d.options.easing,function(){c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);
|
||||
d.callback&&d.callback.apply(this,arguments)})}else{o={};n={};o[j]=(g=="pos"?"-=":"+=")+i;n[j]=(g=="pos"?"+=":"-=")+i;c.animate(o,f/2,d.options.easing).animate(n,f/2,d.options.easing,function(){a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery);
|
||||
(function(a){a.effects.clip=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right","height","width"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.direction||"vertical";a.effects.save(c,e);c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"});i=c[0].tagName=="IMG"?i:c;var b={size:g=="vertical"?"height":"width",position:g=="vertical"?"top":"left"};g=g=="vertical"?i.height():i.width();if(h=="show"){i.css(b.size,0);i.css(b.position,
|
||||
g/2)}var f={};f[b.size]=h=="show"?g:0;f[b.position]=h=="show"?0:g/2;i.animate(f,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(c[0],arguments);c.dequeue()}})})}})(jQuery);
|
||||
(function(a){a.effects.drop=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right","opacity"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.direction||"left";a.effects.save(c,e);c.show();a.effects.createWrapper(c);var i=g=="up"||g=="down"?"top":"left";g=g=="up"||g=="left"?"pos":"neg";var b=d.options.distance||(i=="top"?c.outerHeight({margin:true})/2:c.outerWidth({margin:true})/2);if(h=="show")c.css("opacity",0).css(i,g=="pos"?-b:b);var f={opacity:h==
|
||||
"show"?1:0};f[i]=(h=="show"?g=="pos"?"+=":"-=":g=="pos"?"-=":"+=")+b;c.animate(f,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||
(function(a){a.effects.explode=function(d){return this.queue(function(){var c=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3,e=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3;d.options.mode=d.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":d.options.mode;var h=a(this).show().css("visibility","hidden"),g=h.offset();g.top-=parseInt(h.css("marginTop"),10)||0;g.left-=parseInt(h.css("marginLeft"),10)||0;for(var i=h.outerWidth(true),b=h.outerHeight(true),f=0;f<c;f++)for(var j=
|
||||
0;j<e;j++)h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(i/e),top:-f*(b/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:i/e,height:b/c,left:g.left+j*(i/e)+(d.options.mode=="show"?(j-Math.floor(e/2))*(i/e):0),top:g.top+f*(b/c)+(d.options.mode=="show"?(f-Math.floor(c/2))*(b/c):0),opacity:d.options.mode=="show"?0:1}).animate({left:g.left+j*(i/e)+(d.options.mode=="show"?0:(j-Math.floor(e/2))*(i/e)),top:g.top+
|
||||
f*(b/c)+(d.options.mode=="show"?0:(f-Math.floor(c/2))*(b/c)),opacity:d.options.mode=="show"?1:0},d.duration||500);setTimeout(function(){d.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();d.callback&&d.callback.apply(h[0]);h.dequeue();a("div.ui-effects-explode").remove()},d.duration||500)})}})(jQuery);
|
||||
(function(a){a.effects.fade=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"hide");c.animate({opacity:e},{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||
(function(a){a.effects.fold=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.size||15,i=!!d.options.horizFirst,b=d.duration?d.duration/2:a.fx.speeds._default/2;a.effects.save(c,e);c.show();var f=a.effects.createWrapper(c).css({overflow:"hidden"}),j=h=="show"!=i,l=j?["width","height"]:["height","width"];j=j?[f.width(),f.height()]:[f.height(),f.width()];var o=/([0-9]+)%/.exec(g);if(o)g=parseInt(o[1],
|
||||
10)/100*j[h=="hide"?0:1];if(h=="show")f.css(i?{height:0,width:g}:{height:g,width:0});i={};o={};i[l[0]]=h=="show"?j[0]:g;o[l[1]]=h=="show"?j[1]:0;f.animate(i,b,d.options.easing).animate(o,b,d.options.easing,function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);
|
||||
(function(a){a.effects.highlight=function(d){return this.queue(function(){var c=a(this),e=["backgroundImage","backgroundColor","opacity"],h=a.effects.setMode(c,d.options.mode||"show"),g={backgroundColor:c.css("backgroundColor")};if(h=="hide")g.opacity=0;a.effects.save(c,e);c.show().css({backgroundImage:"none",backgroundColor:d.options.color||"#ffff99"}).animate(g,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);h=="show"&&!a.support.opacity&&
|
||||
this.style.removeAttribute("filter");d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||
(function(a){a.effects.pulsate=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"show");times=(d.options.times||5)*2-1;duration=d.duration?d.duration/2:a.fx.speeds._default/2;isVisible=c.is(":visible");animateTo=0;if(!isVisible){c.css("opacity",0).show();animateTo=1}if(e=="hide"&&isVisible||e=="show"&&!isVisible)times--;for(e=0;e<times;e++){c.animate({opacity:animateTo},duration,d.options.easing);animateTo=(animateTo+1)%2}c.animate({opacity:animateTo},duration,
|
||||
d.options.easing,function(){animateTo==0&&c.hide();d.callback&&d.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);
|
||||
(function(a){a.effects.puff=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"hide"),h=parseInt(d.options.percent,10)||150,g=h/100,i={height:c.height(),width:c.width()};a.extend(d.options,{fade:true,mode:e,percent:e=="hide"?h:100,from:e=="hide"?i:{height:i.height*g,width:i.width*g}});c.effect("scale",d.options,d.duration,d.callback);c.dequeue()})};a.effects.scale=function(d){return this.queue(function(){var c=a(this),e=a.extend(true,{},d.options),h=a.effects.setMode(c,
|
||||
d.options.mode||"effect"),g=parseInt(d.options.percent,10)||(parseInt(d.options.percent,10)==0?0:h=="hide"?0:100),i=d.options.direction||"both",b=d.options.origin;if(h!="effect"){e.origin=b||["middle","center"];e.restore=true}b={height:c.height(),width:c.width()};c.from=d.options.from||(h=="show"?{height:0,width:0}:b);g={y:i!="horizontal"?g/100:1,x:i!="vertical"?g/100:1};c.to={height:b.height*g.y,width:b.width*g.x};if(d.options.fade){if(h=="show"){c.from.opacity=0;c.to.opacity=1}if(h=="hide"){c.from.opacity=
|
||||
1;c.to.opacity=0}}e.from=c.from;e.to=c.to;e.mode=h;c.effect("size",e,d.duration,d.callback);c.dequeue()})};a.effects.size=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],g=["width","height","overflow"],i=["fontSize"],b=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
|
||||
j=a.effects.setMode(c,d.options.mode||"effect"),l=d.options.restore||false,o=d.options.scale||"both",n=d.options.origin,k={height:c.height(),width:c.width()};c.from=d.options.from||k;c.to=d.options.to||k;if(n){n=a.effects.getBaseline(n,k);c.from.top=(k.height-c.from.height)*n.y;c.from.left=(k.width-c.from.width)*n.x;c.to.top=(k.height-c.to.height)*n.y;c.to.left=(k.width-c.to.width)*n.x}var m={from:{y:c.from.height/k.height,x:c.from.width/k.width},to:{y:c.to.height/k.height,x:c.to.width/k.width}};
|
||||
if(o=="box"||o=="both"){if(m.from.y!=m.to.y){e=e.concat(b);c.from=a.effects.setTransition(c,b,m.from.y,c.from);c.to=a.effects.setTransition(c,b,m.to.y,c.to)}if(m.from.x!=m.to.x){e=e.concat(f);c.from=a.effects.setTransition(c,f,m.from.x,c.from);c.to=a.effects.setTransition(c,f,m.to.x,c.to)}}if(o=="content"||o=="both")if(m.from.y!=m.to.y){e=e.concat(i);c.from=a.effects.setTransition(c,i,m.from.y,c.from);c.to=a.effects.setTransition(c,i,m.to.y,c.to)}a.effects.save(c,l?e:h);c.show();a.effects.createWrapper(c);
|
||||
c.css("overflow","hidden").css(c.from);if(o=="content"||o=="both"){b=b.concat(["marginTop","marginBottom"]).concat(i);f=f.concat(["marginLeft","marginRight"]);g=e.concat(b).concat(f);c.find("*[width]").each(function(){child=a(this);l&&a.effects.save(child,g);var p={height:child.height(),width:child.width()};child.from={height:p.height*m.from.y,width:p.width*m.from.x};child.to={height:p.height*m.to.y,width:p.width*m.to.x};if(m.from.y!=m.to.y){child.from=a.effects.setTransition(child,b,m.from.y,child.from);
|
||||
child.to=a.effects.setTransition(child,b,m.to.y,child.to)}if(m.from.x!=m.to.x){child.from=a.effects.setTransition(child,f,m.from.x,child.from);child.to=a.effects.setTransition(child,f,m.to.x,child.to)}child.css(child.from);child.animate(child.to,d.duration,d.options.easing,function(){l&&a.effects.restore(child,g)})})}c.animate(c.to,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity);j=="hide"&&c.hide();a.effects.restore(c,
|
||||
l?e:h);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||
(function(a){a.effects.shake=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"];a.effects.setMode(c,d.options.mode||"effect");var h=d.options.direction||"left",g=d.options.distance||20,i=d.options.times||3,b=d.duration||d.options.duration||140;a.effects.save(c,e);c.show();a.effects.createWrapper(c);var f=h=="up"||h=="down"?"top":"left",j=h=="up"||h=="left"?"pos":"neg";h={};var l={},o={};h[f]=(j=="pos"?"-=":"+=")+g;l[f]=(j=="pos"?"+=":"-=")+g*2;o[f]=
|
||||
(j=="pos"?"-=":"+=")+g*2;c.animate(h,b,d.options.easing);for(g=1;g<i;g++)c.animate(l,b,d.options.easing).animate(o,b,d.options.easing);c.animate(l,b,d.options.easing).animate(h,b/2,d.options.easing,function(){a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery);
|
||||
(function(a){a.effects.slide=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"show"),g=d.options.direction||"left";a.effects.save(c,e);c.show();a.effects.createWrapper(c).css({overflow:"hidden"});var i=g=="up"||g=="down"?"top":"left";g=g=="up"||g=="left"?"pos":"neg";var b=d.options.distance||(i=="top"?c.outerHeight({margin:true}):c.outerWidth({margin:true}));if(h=="show")c.css(i,g=="pos"?isNaN(b)?"-"+b:-b:b);
|
||||
var f={};f[i]=(h=="show"?g=="pos"?"+=":"-=":g=="pos"?"-=":"+=")+b;c.animate(f,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||
(function(a){a.effects.transfer=function(d){return this.queue(function(){var c=a(this),e=a(d.options.to),h=e.offset();e={top:h.top,left:h.left,height:e.innerHeight(),width:e.innerWidth()};h=c.offset();var g=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(d.options.className).css({top:h.top,left:h.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(e,d.duration,d.options.easing,function(){g.remove();d.callback&&d.callback.apply(c[0],arguments);
|
||||
c.dequeue()})})}})(jQuery);
|
||||
(function(a){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var d=this,c=d.options;d.running=0;d.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");d.headers=
|
||||
d.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")});d.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
|
||||
if(c.navigation){var e=d.element.find("a").filter(c.navigationFilter).eq(0);if(e.length){var h=e.closest(".ui-accordion-header");d.active=h.length?h:e.closest(".ui-accordion-content").prev()}}d.active=d._findActive(d.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");d.active.next().addClass("ui-accordion-content-active");d._createIcons();d.resize();d.element.attr("role","tablist");d.headers.attr("role","tab").bind("keydown.accordion",
|
||||
function(g){return d._keydown(g)}).next().attr("role","tabpanel");d.headers.not(d.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();d.active.length?d.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):d.headers.eq(0).attr("tabIndex",0);a.browser.safari||d.headers.find("a").attr("tabIndex",-1);c.event&&d.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(g){d._clickHandler.call(d,g,this);g.preventDefault()})},_createIcons:function(){var d=
|
||||
this.options;if(d.icons){a("<span></span>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var d=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
|
||||
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(d.autoHeight||d.fillHeight)c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(d,c){a.Widget.prototype._setOption.apply(this,arguments);d=="active"&&this.activate(c);if(d=="icons"){this._destroyIcons();
|
||||
c&&this._createIcons()}if(d=="disabled")this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(d){if(!(this.options.disabled||d.altKey||d.ctrlKey)){var c=a.ui.keyCode,e=this.headers.length,h=this.headers.index(d.target),g=false;switch(d.keyCode){case c.RIGHT:case c.DOWN:g=this.headers[(h+1)%e];break;case c.LEFT:case c.UP:g=this.headers[(h-1+e)%e];break;case c.SPACE:case c.ENTER:this._clickHandler({target:d.target},d.target);
|
||||
d.preventDefault()}if(g){a(d.target).attr("tabIndex",-1);a(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var d=this.options,c;if(d.fillSpace){if(a.browser.msie){var e=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height();a.browser.msie&&this.element.parent().css("overflow",e);this.headers.each(function(){c-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+
|
||||
a(this).height()))}).css("overflow","auto")}else if(d.autoHeight){c=0;this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c)}return this},activate:function(d){this.options.active=d;d=this._findActive(d)[0];this._clickHandler({target:d},d);return this},_findActive:function(d){return d?typeof d==="number"?this.headers.filter(":eq("+d+")"):this.headers.not(this.headers.not(d)):d===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(d,c){var e=this.options;
|
||||
if(!e.disabled)if(d.target){d=a(d.currentTarget||c);c=d[0]===this.active[0];e.active=e.collapsible&&c?false:this.headers.index(d);if(!(this.running||!e.collapsible&&c)){var h=this.active;f=d.next();i=this.active.next();b={options:e,newHeader:c&&e.collapsible?a([]):d,oldHeader:this.active,newContent:c&&e.collapsible?a([]):f,oldContent:i};var g=this.headers.index(this.active[0])>this.headers.index(d[0]);this.active=c?a([]):d;this._toggle(f,i,b,c,g);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header);
|
||||
if(!c){d.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(e.icons.header).addClass(e.icons.headerSelected);d.next().addClass("ui-accordion-content-active")}}}else if(e.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header);this.active.next().addClass("ui-accordion-content-active");var i=this.active.next(),
|
||||
b={options:e,newHeader:a([]),oldHeader:e.active,newContent:a([]),oldContent:i},f=this.active=a([]);this._toggle(f,i,b)}},_toggle:function(d,c,e,h,g){var i=this,b=i.options;i.toShow=d;i.toHide=c;i.data=e;var f=function(){if(i)return i._completed.apply(i,arguments)};i._trigger("changestart",null,i.data);i.running=c.size()===0?d.size():c.size();if(b.animated){e={};e=b.collapsible&&h?{toShow:a([]),toHide:c,complete:f,down:g,autoHeight:b.autoHeight||b.fillSpace}:{toShow:d,toHide:c,complete:f,down:g,autoHeight:b.autoHeight||
|
||||
b.fillSpace};if(!b.proxied)b.proxied=b.animated;if(!b.proxiedDuration)b.proxiedDuration=b.duration;b.animated=a.isFunction(b.proxied)?b.proxied(e):b.proxied;b.duration=a.isFunction(b.proxiedDuration)?b.proxiedDuration(e):b.proxiedDuration;h=a.ui.accordion.animations;var j=b.duration,l=b.animated;if(l&&!h[l]&&!a.easing[l])l="slide";h[l]||(h[l]=function(o){this.slide(o,{easing:l,duration:j||700})});h[l](e)}else{if(b.collapsible&&h)d.toggle();else{c.hide();d.show()}f(true)}c.prev().attr({"aria-expanded":"false",
|
||||
"aria-selected":"false",tabIndex:-1}).blur();d.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(d){this.running=d?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});a.extend(a.ui.accordion,{version:"1.8.16",
|
||||
animations:{slide:function(d,c){d=a.extend({easing:"swing",duration:300},d,c);if(d.toHide.size())if(d.toShow.size()){var e=d.toShow.css("overflow"),h=0,g={},i={},b;c=d.toShow;b=c[0].style.width;c.width(parseInt(c.parent().width(),10)-parseInt(c.css("paddingLeft"),10)-parseInt(c.css("paddingRight"),10)-(parseInt(c.css("borderLeftWidth"),10)||0)-(parseInt(c.css("borderRightWidth"),10)||0));a.each(["height","paddingTop","paddingBottom"],function(f,j){i[j]="hide";f=(""+a.css(d.toShow[0],j)).match(/^([\d+-.]+)(.*)$/);
|
||||
g[j]={value:f[1],unit:f[2]||"px"}});d.toShow.css({height:0,overflow:"hidden"}).show();d.toHide.filter(":hidden").each(d.complete).end().filter(":visible").animate(i,{step:function(f,j){if(j.prop=="height")h=j.end-j.start===0?0:(j.now-j.start)/(j.end-j.start);d.toShow[0].style[j.prop]=h*g[j.prop].value+g[j.prop].unit},duration:d.duration,easing:d.easing,complete:function(){d.autoHeight||d.toShow.css("height","");d.toShow.css({width:b,overflow:e});d.complete()}})}else d.toHide.animate({height:"hide",
|
||||
paddingTop:"hide",paddingBottom:"hide"},d);else d.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},d)},bounceslide:function(d){this.slide(d,{easing:d.down?"easeOutBounce":"swing",duration:d.down?1E3:200})}}})})(jQuery);
|
||||
(function(a){var d=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var c=this,e=this.element[0].ownerDocument,h;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(g){if(!(c.options.disabled||c.element.propAttr("readOnly"))){h=
|
||||
false;var i=a.ui.keyCode;switch(g.keyCode){case i.PAGE_UP:c._move("previousPage",g);break;case i.PAGE_DOWN:c._move("nextPage",g);break;case i.UP:c._move("previous",g);g.preventDefault();break;case i.DOWN:c._move("next",g);g.preventDefault();break;case i.ENTER:case i.NUMPAD_ENTER:if(c.menu.active){h=true;g.preventDefault()}case i.TAB:if(!c.menu.active)return;c.menu.select(g);break;case i.ESCAPE:c.element.val(c.term);c.close(g);break;default:clearTimeout(c.searching);c.searching=setTimeout(function(){if(c.term!=
|
||||
c.element.val()){c.selectedItem=null;c.search(null,g)}},c.options.delay);break}}}).bind("keypress.autocomplete",function(g){if(h){h=false;g.preventDefault()}}).bind("focus.autocomplete",function(){if(!c.options.disabled){c.selectedItem=null;c.previous=c.element.val()}}).bind("blur.autocomplete",function(g){if(!c.options.disabled){clearTimeout(c.searching);c.closing=setTimeout(function(){c.close(g);c._change(g)},150)}});this._initSource();this.response=function(){return c._response.apply(c,arguments)};
|
||||
this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",e)[0]).mousedown(function(g){var i=c.menu.element[0];a(g.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(b){b.target!==c.element[0]&&b.target!==i&&!a.ui.contains(i,b.target)&&c.close()})},1);setTimeout(function(){clearTimeout(c.closing)},13)}).menu({focus:function(g,i){i=i.item.data("item.autocomplete");false!==c._trigger("focus",g,{item:i})&&/^key/.test(g.originalEvent.type)&&
|
||||
c.element.val(i.value)},selected:function(g,i){var b=i.item.data("item.autocomplete"),f=c.previous;if(c.element[0]!==e.activeElement){c.element.focus();c.previous=f;setTimeout(function(){c.previous=f;c.selectedItem=b},1)}false!==c._trigger("select",g,{item:b})&&c.element.val(b.value);c.term=c.element.val();c.close(g);c.selectedItem=b},blur:function(){c.menu.element.is(":visible")&&c.element.val()!==c.term&&c.element.val(c.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
|
||||
a.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();a.Widget.prototype.destroy.call(this)},_setOption:function(c,e){a.Widget.prototype._setOption.apply(this,arguments);c==="source"&&this._initSource();if(c==="appendTo")this.menu.element.appendTo(a(e||"body",this.element[0].ownerDocument)[0]);c==="disabled"&&
|
||||
e&&this.xhr&&this.xhr.abort()},_initSource:function(){var c=this,e,h;if(a.isArray(this.options.source)){e=this.options.source;this.source=function(g,i){i(a.ui.autocomplete.filter(e,g.term))}}else if(typeof this.options.source==="string"){h=this.options.source;this.source=function(g,i){c.xhr&&c.xhr.abort();c.xhr=a.ajax({url:h,data:g,dataType:"json",autocompleteRequest:++d,success:function(b){this.autocompleteRequest===d&&i(b)},error:function(){this.autocompleteRequest===d&&i([])}})}}else this.source=
|
||||
this.options.source},search:function(c,e){c=c!=null?c:this.element.val();this.term=this.element.val();if(c.length<this.options.minLength)return this.close(e);clearTimeout(this.closing);if(this._trigger("search",e)!==false)return this._search(c)},_search:function(c){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:c},this.response)},_response:function(c){if(!this.options.disabled&&c&&c.length){c=this._normalize(c);this._suggest(c);this._trigger("open")}else this.close();
|
||||
this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(c){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",c)}},_change:function(c){this.previous!==this.element.val()&&this._trigger("change",c,{item:this.selectedItem})},_normalize:function(c){if(c.length&&c[0].label&&c[0].value)return c;return a.map(c,function(e){if(typeof e==="string")return{label:e,value:e};return a.extend({label:e.label||
|
||||
e.value,value:e.value||e.label},e)})},_suggest:function(c){var e=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(e,c);this.menu.deactivate();this.menu.refresh();e.show();this._resizeMenu();e.position(a.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var c=this.menu.element;c.outerWidth(Math.max(c.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(c,e){var h=this;
|
||||
a.each(e,function(g,i){h._renderItem(c,i)})},_renderItem:function(c,e){return a("<li></li>").data("item.autocomplete",e).append(a("<a></a>").text(e.label)).appendTo(c)},_move:function(c,e){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(c)||this.menu.last()&&/^next/.test(c)){this.element.val(this.term);this.menu.deactivate()}else this.menu[c](e);else this.search(null,e)},widget:function(){return this.menu.element}});a.extend(a.ui.autocomplete,{escapeRegex:function(c){return c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
|
||||
"\\$&")},filter:function(c,e){var h=new RegExp(a.ui.autocomplete.escapeRegex(e),"i");return a.grep(c,function(g){return h.test(g.label||g.value||g)})}})})(jQuery);
|
||||
(function(a){a.widget("ui.menu",{_create:function(){var d=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(a(c.target).closest(".ui-menu-item a").length){c.preventDefault();d.select(c)}});this.refresh()},refresh:function(){var d=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
|
||||
-1).mouseenter(function(c){d.activate(c,a(this).parent())}).mouseleave(function(){d.deactivate()})},activate:function(d,c){this.deactivate();if(this.hasScroll()){var e=c.offset().top-this.element.offset().top,h=this.element.scrollTop(),g=this.element.height();if(e<0)this.element.scrollTop(h+e);else e>=g&&this.element.scrollTop(h+e-g+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",d,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
|
||||
this._trigger("blur");this.active=null}},next:function(d){this.move("next",".ui-menu-item:first",d)},previous:function(d){this.move("prev",".ui-menu-item:last",d)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(d,c,e){if(this.active){d=this.active[d+"All"](".ui-menu-item").eq(0);d.length?this.activate(e,d):this.activate(e,this.element.children(c))}else this.activate(e,
|
||||
this.element.children(c))},nextPage:function(d){if(this.hasScroll())if(!this.active||this.last())this.activate(d,this.element.children(".ui-menu-item:first"));else{var c=this.active.offset().top,e=this.element.height(),h=this.element.children(".ui-menu-item").filter(function(){var g=a(this).offset().top-c-e+a(this).height();return g<10&&g>-10});h.length||(h=this.element.children(".ui-menu-item:last"));this.activate(d,h)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||
|
||||
this.last()?":first":":last"))},previousPage:function(d){if(this.hasScroll())if(!this.active||this.first())this.activate(d,this.element.children(".ui-menu-item:last"));else{var c=this.active.offset().top,e=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var h=a(this).offset().top-c+e-a(this).height();return h<10&&h>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(d,result)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||
|
||||
this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(d){this._trigger("selected",d,{item:this.active})}})})(jQuery);
|
||||
(function(a){var d,c,e,h,g=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},i=function(b){var f=b.name,j=b.form,l=a([]);if(f)l=j?a(j).find("[name='"+f+"']"):a("[name='"+f+"']",b.ownerDocument).filter(function(){return!this.form});return l};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",g);if(typeof this.options.disabled!==
|
||||
"boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var b=this,f=this.options,j=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(!j?" ui-state-active":"");if(f.label===null)f.label=this.buttonElement.html();if(this.element.is(":disabled"))f.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!f.disabled){a(this).addClass("ui-state-hover");
|
||||
this===d&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){f.disabled||a(this).removeClass(l)}).bind("click.button",function(o){if(f.disabled){o.preventDefault();o.stopImmediatePropagation()}});this.element.bind("focus.button",function(){b.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){b.buttonElement.removeClass("ui-state-focus")});if(j){this.element.bind("change.button",function(){h||b.refresh()});this.buttonElement.bind("mousedown.button",function(o){if(!f.disabled){h=
|
||||
false;c=o.pageX;e=o.pageY}}).bind("mouseup.button",function(o){if(!f.disabled)if(c!==o.pageX||e!==o.pageY)h=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(f.disabled||h)return false;a(this).toggleClass("ui-state-active");b.buttonElement.attr("aria-pressed",b.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(f.disabled||h)return false;a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed","true");
|
||||
var o=b.element[0];i(o).not(o).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(f.disabled)return false;a(this).addClass("ui-state-active");d=this;a(document).one("mouseup",function(){d=null})}).bind("mouseup.button",function(){if(f.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(o){if(f.disabled)return false;if(o.keyCode==a.ui.keyCode.SPACE||
|
||||
o.keyCode==a.ui.keyCode.ENTER)a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(o){o.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",f.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
|
||||
"radio"){var b=this.element.parents().filter(":last"),f="label[for='"+this.element.attr("id")+"']";this.buttonElement=b.find(f);if(!this.buttonElement.length){b=b.length?b.siblings():this.element.siblings();this.buttonElement=b.filter(f);if(!this.buttonElement.length)this.buttonElement=b.find(f)}this.element.addClass("ui-helper-hidden-accessible");(b=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",b)}else this.buttonElement=this.element},
|
||||
widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
|
||||
a.Widget.prototype.destroy.call(this)},_setOption:function(b,f){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled")f?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b);if(this.type==="radio")i(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
|
||||
"true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
|
||||
f=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),j=this.options.icons,l=j.primary&&j.secondary,o=[];if(j.primary||j.secondary){if(this.options.text)o.push("ui-button-text-icon"+(l?"s":j.primary?"-primary":"-secondary"));j.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+j.primary+"'></span>");j.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+j.secondary+"'></span>");if(!this.options.text){o.push(l?"ui-button-icons-only":
|
||||
"ui-button-icon-only");this.hasTitle||b.attr("title",f)}}else o.push("ui-button-text-only");b.addClass(o.join(" "))}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,f){b==="disabled"&&this.buttons.button("option",b,f);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")===
|
||||
"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(b?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
|
||||
a.Widget.prototype.destroy.call(this)}})})(jQuery);
|
||||
(function(a,d){function c(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
|
||||
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
|
||||
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
|
||||
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};a.extend(this._defaults,this.regional[""]);this.dpDiv=e(a('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function e(b){return b.bind("mouseout",
|
||||
function(f){f=a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");f.length&&f.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(f){f=a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(a.datepicker._isDisabledDatepicker(i.inline?b.parent()[0]:i.input[0])||!f.length)){f.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
|
||||
f.addClass("ui-state-hover");f.hasClass("ui-datepicker-prev")&&f.addClass("ui-datepicker-prev-hover");f.hasClass("ui-datepicker-next")&&f.addClass("ui-datepicker-next-hover")}})}function h(b,f){a.extend(b,f);for(var j in f)if(f[j]==null||f[j]==d)b[j]=f[j];return b}a.extend(a.ui,{datepicker:{version:"1.8.16"}});var g=(new Date).getTime(),i;a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
|
||||
setDefaults:function(b){h(this._defaults,b||{});return this},_attachDatepicker:function(b,f){var j=null;for(var l in this._defaults){var o=b.getAttribute("date:"+l);if(o){j=j||{};try{j[l]=eval(o)}catch(n){j[l]=o}}}l=b.nodeName.toLowerCase();o=l=="div"||l=="span";if(!b.id){this.uuid+=1;b.id="dp"+this.uuid}var k=this._newInst(a(b),o);k.settings=a.extend({},f||{},j||{});if(l=="input")this._connectDatepicker(b,k);else o&&this._inlineDatepicker(b,k)},_newInst:function(b,f){return{id:b[0].id.replace(/([^A-Za-z0-9_-])/g,
|
||||
"\\\\$1"),input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:f,dpDiv:!f?this.dpDiv:e(a('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(b,f){var j=a(b);f.append=a([]);f.trigger=a([]);if(!j.hasClass(this.markerClassName)){this._attachments(j,f);j.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
|
||||
function(l,o,n){f.settings[o]=n}).bind("getData.datepicker",function(l,o){return this._get(f,o)});this._autoSize(f);a.data(b,"datepicker",f);f.settings.disabled&&this._disableDatepicker(b)}},_attachments:function(b,f){var j=this._get(f,"appendText"),l=this._get(f,"isRTL");f.append&&f.append.remove();if(j){f.append=a('<span class="'+this._appendClass+'">'+j+"</span>");b[l?"before":"after"](f.append)}b.unbind("focus",this._showDatepicker);f.trigger&&f.trigger.remove();j=this._get(f,"showOn");if(j==
|
||||
"focus"||j=="both")b.focus(this._showDatepicker);if(j=="button"||j=="both"){j=this._get(f,"buttonText");var o=this._get(f,"buttonImage");f.trigger=a(this._get(f,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:o,alt:j,title:j}):a('<button type="button"></button>').addClass(this._triggerClass).html(o==""?j:a("<img/>").attr({src:o,alt:j,title:j})));b[l?"before":"after"](f.trigger);f.trigger.click(function(){a.datepicker._datepickerShowing&&a.datepicker._lastInput==b[0]?a.datepicker._hideDatepicker():
|
||||
a.datepicker._showDatepicker(b[0]);return false})}},_autoSize:function(b){if(this._get(b,"autoSize")&&!b.inline){var f=new Date(2009,11,20),j=this._get(b,"dateFormat");if(j.match(/[DM]/)){var l=function(o){for(var n=0,k=0,m=0;m<o.length;m++)if(o[m].length>n){n=o[m].length;k=m}return k};f.setMonth(l(this._get(b,j.match(/MM/)?"monthNames":"monthNamesShort")));f.setDate(l(this._get(b,j.match(/DD/)?"dayNames":"dayNamesShort"))+20-f.getDay())}b.input.attr("size",this._formatDate(b,f).length)}},_inlineDatepicker:function(b,
|
||||
f){var j=a(b);if(!j.hasClass(this.markerClassName)){j.addClass(this.markerClassName).append(f.dpDiv).bind("setData.datepicker",function(l,o,n){f.settings[o]=n}).bind("getData.datepicker",function(l,o){return this._get(f,o)});a.data(b,"datepicker",f);this._setDate(f,this._getDefaultDate(f),true);this._updateDatepicker(f);this._updateAlternate(f);f.settings.disabled&&this._disableDatepicker(b);f.dpDiv.css("display","block")}},_dialogDatepicker:function(b,f,j,l,o){b=this._dialogInst;if(!b){this.uuid+=
|
||||
1;this._dialogInput=a('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);b=this._dialogInst=this._newInst(this._dialogInput,false);b.settings={};a.data(this._dialogInput[0],"datepicker",b)}h(b.settings,l||{});f=f&&f.constructor==Date?this._formatDate(b,f):f;this._dialogInput.val(f);this._pos=o?o.length?o:[o.pageX,o.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/
|
||||
2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");b.settings.onSelect=j;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",b);return this},_destroyDatepicker:function(b){var f=
|
||||
a(b),j=a.data(b,"datepicker");if(f.hasClass(this.markerClassName)){var l=b.nodeName.toLowerCase();a.removeData(b,"datepicker");if(l=="input"){j.append.remove();j.trigger.remove();f.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(l=="div"||l=="span")f.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(b){var f=a(b),j=a.data(b,"datepicker");if(f.hasClass(this.markerClassName)){var l=
|
||||
b.nodeName.toLowerCase();if(l=="input"){b.disabled=false;j.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(l=="div"||l=="span"){f=f.children("."+this._inlineClass);f.children().removeClass("ui-state-disabled");f.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=a.map(this._disabledInputs,function(o){return o==b?null:o})}},_disableDatepicker:function(b){var f=a(b),j=a.data(b,
|
||||
"datepicker");if(f.hasClass(this.markerClassName)){var l=b.nodeName.toLowerCase();if(l=="input"){b.disabled=true;j.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(l=="div"||l=="span"){f=f.children("."+this._inlineClass);f.children().addClass("ui-state-disabled");f.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=a.map(this._disabledInputs,function(o){return o==
|
||||
b?null:o});this._disabledInputs[this._disabledInputs.length]=b}},_isDisabledDatepicker:function(b){if(!b)return false;for(var f=0;f<this._disabledInputs.length;f++)if(this._disabledInputs[f]==b)return true;return false},_getInst:function(b){try{return a.data(b,"datepicker")}catch(f){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(b,f,j){var l=this._getInst(b);if(arguments.length==2&&typeof f=="string")return f=="defaults"?a.extend({},a.datepicker._defaults):l?f=="all"?
|
||||
a.extend({},l.settings):this._get(l,f):null;var o=f||{};if(typeof f=="string"){o={};o[f]=j}if(l){this._curInst==l&&this._hideDatepicker();var n=this._getDateDatepicker(b,true),k=this._getMinMaxDate(l,"min"),m=this._getMinMaxDate(l,"max");h(l.settings,o);if(k!==null&&o.dateFormat!==d&&o.minDate===d)l.settings.minDate=this._formatDate(l,k);if(m!==null&&o.dateFormat!==d&&o.maxDate===d)l.settings.maxDate=this._formatDate(l,m);this._attachments(a(b),l);this._autoSize(l);this._setDate(l,n);this._updateAlternate(l);
|
||||
this._updateDatepicker(l)}},_changeDatepicker:function(b,f,j){this._optionDatepicker(b,f,j)},_refreshDatepicker:function(b){(b=this._getInst(b))&&this._updateDatepicker(b)},_setDateDatepicker:function(b,f){if(b=this._getInst(b)){this._setDate(b,f);this._updateDatepicker(b);this._updateAlternate(b)}},_getDateDatepicker:function(b,f){(b=this._getInst(b))&&!b.inline&&this._setDateFromField(b,f);return b?this._getDate(b):null},_doKeyDown:function(b){var f=a.datepicker._getInst(b.target),j=true,l=f.dpDiv.is(".ui-datepicker-rtl");
|
||||
f._keyEvent=true;if(a.datepicker._datepickerShowing)switch(b.keyCode){case 9:a.datepicker._hideDatepicker();j=false;break;case 13:j=a("td."+a.datepicker._dayOverClass+":not(."+a.datepicker._currentClass+")",f.dpDiv);j[0]&&a.datepicker._selectDay(b.target,f.selectedMonth,f.selectedYear,j[0]);if(b=a.datepicker._get(f,"onSelect")){j=a.datepicker._formatDate(f);b.apply(f.input?f.input[0]:null,[j,f])}else a.datepicker._hideDatepicker();return false;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(b.target,
|
||||
b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths"),"M");break;case 34:a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,"stepMonths"),"M");break;case 35:if(b.ctrlKey||b.metaKey)a.datepicker._clearDate(b.target);j=b.ctrlKey||b.metaKey;break;case 36:if(b.ctrlKey||b.metaKey)a.datepicker._gotoToday(b.target);j=b.ctrlKey||b.metaKey;break;case 37:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,l?+1:-1,"D");j=
|
||||
b.ctrlKey||b.metaKey;if(b.originalEvent.altKey)a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths"),"M");break;case 38:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,-7,"D");j=b.ctrlKey||b.metaKey;break;case 39:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,l?-1:+1,"D");j=b.ctrlKey||b.metaKey;if(b.originalEvent.altKey)a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,
|
||||
"stepMonths"),"M");break;case 40:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,+7,"D");j=b.ctrlKey||b.metaKey;break;default:j=false}else if(b.keyCode==36&&b.ctrlKey)a.datepicker._showDatepicker(this);else j=false;if(j){b.preventDefault();b.stopPropagation()}},_doKeyPress:function(b){var f=a.datepicker._getInst(b.target);if(a.datepicker._get(f,"constrainInput")){f=a.datepicker._possibleChars(a.datepicker._get(f,"dateFormat"));var j=String.fromCharCode(b.charCode==d?b.keyCode:b.charCode);
|
||||
return b.ctrlKey||b.metaKey||j<" "||!f||f.indexOf(j)>-1}},_doKeyUp:function(b){b=a.datepicker._getInst(b.target);if(b.input.val()!=b.lastVal)try{if(a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,a.datepicker._getFormatConfig(b))){a.datepicker._setDateFromField(b);a.datepicker._updateAlternate(b);a.datepicker._updateDatepicker(b)}}catch(f){a.datepicker.log(f)}return true},_showDatepicker:function(b){b=b.target||b;if(b.nodeName.toLowerCase()!="input")b=a("input",
|
||||
b.parentNode)[0];if(!(a.datepicker._isDisabledDatepicker(b)||a.datepicker._lastInput==b)){var f=a.datepicker._getInst(b);if(a.datepicker._curInst&&a.datepicker._curInst!=f){a.datepicker._datepickerShowing&&a.datepicker._triggerOnClose(a.datepicker._curInst);a.datepicker._curInst.dpDiv.stop(true,true)}var j=a.datepicker._get(f,"beforeShow");j=j?j.apply(b,[b,f]):{};if(j!==false){h(f.settings,j);f.lastVal=null;a.datepicker._lastInput=b;a.datepicker._setDateFromField(f);if(a.datepicker._inDialog)b.value=
|
||||
"";if(!a.datepicker._pos){a.datepicker._pos=a.datepicker._findPos(b);a.datepicker._pos[1]+=b.offsetHeight}var l=false;a(b).parents().each(function(){l|=a(this).css("position")=="fixed";return!l});if(l&&a.browser.opera){a.datepicker._pos[0]-=document.documentElement.scrollLeft;a.datepicker._pos[1]-=document.documentElement.scrollTop}j={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;f.dpDiv.empty();f.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(f);
|
||||
j=a.datepicker._checkOffset(f,j,l);f.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":l?"fixed":"absolute",display:"none",left:j.left+"px",top:j.top+"px"});if(!f.inline){j=a.datepicker._get(f,"showAnim");var o=a.datepicker._get(f,"duration"),n=function(){var k=f.dpDiv.find("iframe.ui-datepicker-cover");if(k.length){var m=a.datepicker._getBorders(f.dpDiv);k.css({left:-m[0],top:-m[1],width:f.dpDiv.outerWidth(),height:f.dpDiv.outerHeight()})}};f.dpDiv.zIndex(a(b).zIndex()+1);a.datepicker._datepickerShowing=
|
||||
true;a.effects&&a.effects[j]?f.dpDiv.show(j,a.datepicker._get(f,"showOptions"),o,n):f.dpDiv[j||"show"](j?o:null,n);if(!j||!o)n();f.input.is(":visible")&&!f.input.is(":disabled")&&f.input.focus();a.datepicker._curInst=f}}}},_updateDatepicker:function(b){this.maxRows=4;var f=a.datepicker._getBorders(b.dpDiv);i=b;b.dpDiv.empty().append(this._generateHTML(b));var j=b.dpDiv.find("iframe.ui-datepicker-cover");j.length&&j.css({left:-f[0],top:-f[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()});
|
||||
b.dpDiv.find("."+this._dayOverClass+" a").mouseover();f=this._getNumberOfMonths(b);j=f[1];b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");j>1&&b.dpDiv.addClass("ui-datepicker-multi-"+j).css("width",17*j+"em");b.dpDiv[(f[0]!=1||f[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");b.dpDiv[(this._get(b,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");b==a.datepicker._curInst&&a.datepicker._datepickerShowing&&b.input&&b.input.is(":visible")&&
|
||||
!b.input.is(":disabled")&&b.input[0]!=document.activeElement&&b.input.focus();if(b.yearshtml){var l=b.yearshtml;setTimeout(function(){l===b.yearshtml&&b.yearshtml&&b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml);l=b.yearshtml=null},0)}},_getBorders:function(b){var f=function(j){return{thin:1,medium:2,thick:3}[j]||j};return[parseFloat(f(b.css("border-left-width"))),parseFloat(f(b.css("border-top-width")))]},_checkOffset:function(b,f,j){var l=b.dpDiv.outerWidth(),o=b.dpDiv.outerHeight(),
|
||||
n=b.input?b.input.outerWidth():0,k=b.input?b.input.outerHeight():0,m=document.documentElement.clientWidth+a(document).scrollLeft(),p=document.documentElement.clientHeight+a(document).scrollTop();f.left-=this._get(b,"isRTL")?l-n:0;f.left-=j&&f.left==b.input.offset().left?a(document).scrollLeft():0;f.top-=j&&f.top==b.input.offset().top+k?a(document).scrollTop():0;f.left-=Math.min(f.left,f.left+l>m&&m>l?Math.abs(f.left+l-m):0);f.top-=Math.min(f.top,f.top+o>p&&p>o?Math.abs(o+k):0);return f},_findPos:function(b){for(var f=
|
||||
this._get(this._getInst(b),"isRTL");b&&(b.type=="hidden"||b.nodeType!=1||a.expr.filters.hidden(b));)b=b[f?"previousSibling":"nextSibling"];b=a(b).offset();return[b.left,b.top]},_triggerOnClose:function(b){var f=this._get(b,"onClose");if(f)f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b])},_hideDatepicker:function(b){var f=this._curInst;if(!(!f||b&&f!=a.data(b,"datepicker")))if(this._datepickerShowing){b=this._get(f,"showAnim");var j=this._get(f,"duration"),l=function(){a.datepicker._tidyDialog(f);
|
||||
this._curInst=null};a.effects&&a.effects[b]?f.dpDiv.hide(b,a.datepicker._get(f,"showOptions"),j,l):f.dpDiv[b=="slideDown"?"slideUp":b=="fadeIn"?"fadeOut":"hide"](b?j:null,l);b||l();a.datepicker._triggerOnClose(f);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(b){b.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
|
||||
_checkExternalClick:function(b){if(a.datepicker._curInst){b=a(b.target);b[0].id!=a.datepicker._mainDivId&&b.parents("#"+a.datepicker._mainDivId).length==0&&!b.hasClass(a.datepicker.markerClassName)&&!b.hasClass(a.datepicker._triggerClass)&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI)&&a.datepicker._hideDatepicker()}},_adjustDate:function(b,f,j){b=a(b);var l=this._getInst(b[0]);if(!this._isDisabledDatepicker(b[0])){this._adjustInstDate(l,f+(j=="M"?this._get(l,"showCurrentAtPos"):
|
||||
0),j);this._updateDatepicker(l)}},_gotoToday:function(b){b=a(b);var f=this._getInst(b[0]);if(this._get(f,"gotoCurrent")&&f.currentDay){f.selectedDay=f.currentDay;f.drawMonth=f.selectedMonth=f.currentMonth;f.drawYear=f.selectedYear=f.currentYear}else{var j=new Date;f.selectedDay=j.getDate();f.drawMonth=f.selectedMonth=j.getMonth();f.drawYear=f.selectedYear=j.getFullYear()}this._notifyChange(f);this._adjustDate(b)},_selectMonthYear:function(b,f,j){b=a(b);var l=this._getInst(b[0]);l["selected"+(j=="M"?
|
||||
"Month":"Year")]=l["draw"+(j=="M"?"Month":"Year")]=parseInt(f.options[f.selectedIndex].value,10);this._notifyChange(l);this._adjustDate(b)},_selectDay:function(b,f,j,l){var o=a(b);if(!(a(l).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0]))){o=this._getInst(o[0]);o.selectedDay=o.currentDay=a("a",l).html();o.selectedMonth=o.currentMonth=f;o.selectedYear=o.currentYear=j;this._selectDate(b,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear))}},_clearDate:function(b){b=a(b);
|
||||
this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(b,f){b=this._getInst(a(b)[0]);f=f!=null?f:this._formatDate(b);b.input&&b.input.val(f);this._updateAlternate(b);var j=this._get(b,"onSelect");if(j)j.apply(b.input?b.input[0]:null,[f,b]);else b.input&&b.input.trigger("change");if(b.inline)this._updateDatepicker(b);else{this._hideDatepicker();this._lastInput=b.input[0];typeof b.input[0]!="object"&&b.input.focus();this._lastInput=null}},_updateAlternate:function(b){var f=this._get(b,"altField");
|
||||
if(f){var j=this._get(b,"altFormat")||this._get(b,"dateFormat"),l=this._getDate(b),o=this.formatDate(j,l,this._getFormatConfig(b));a(f).each(function(){a(this).val(o)})}},noWeekends:function(b){b=b.getDay();return[b>0&&b<6,""]},iso8601Week:function(b){b=new Date(b.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var f=b.getTime();b.setMonth(0);b.setDate(1);return Math.floor(Math.round((f-b)/864E5)/7)+1},parseDate:function(b,f,j){if(b==null||f==null)throw"Invalid arguments";f=typeof f=="object"?
|
||||
f.toString():f+"";if(f=="")return null;var l=(j?j.shortYearCutoff:null)||this._defaults.shortYearCutoff;l=typeof l!="string"?l:(new Date).getFullYear()%100+parseInt(l,10);for(var o=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,n=(j?j.dayNames:null)||this._defaults.dayNames,k=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort,m=(j?j.monthNames:null)||this._defaults.monthNames,p=j=-1,q=-1,s=-1,r=false,u=function(z){(z=H+1<b.length&&b.charAt(H+1)==z)&&H++;return z},v=function(z){var I=
|
||||
u(z);z=new RegExp("^\\d{1,"+(z=="@"?14:z=="!"?20:z=="y"&&I?4:z=="o"?3:2)+"}");z=f.substring(y).match(z);if(!z)throw"Missing number at position "+y;y+=z[0].length;return parseInt(z[0],10)},w=function(z,I,N){z=a.map(u(z)?N:I,function(D,E){return[[E,D]]}).sort(function(D,E){return-(D[1].length-E[1].length)});var J=-1;a.each(z,function(D,E){D=E[1];if(f.substr(y,D.length).toLowerCase()==D.toLowerCase()){J=E[0];y+=D.length;return false}});if(J!=-1)return J+1;else throw"Unknown name at position "+y;},x=
|
||||
function(){if(f.charAt(y)!=b.charAt(H))throw"Unexpected literal at position "+y;y++},y=0,H=0;H<b.length;H++)if(r)if(b.charAt(H)=="'"&&!u("'"))r=false;else x();else switch(b.charAt(H)){case "d":q=v("d");break;case "D":w("D",o,n);break;case "o":s=v("o");break;case "m":p=v("m");break;case "M":p=w("M",k,m);break;case "y":j=v("y");break;case "@":var C=new Date(v("@"));j=C.getFullYear();p=C.getMonth()+1;q=C.getDate();break;case "!":C=new Date((v("!")-this._ticksTo1970)/1E4);j=C.getFullYear();p=C.getMonth()+
|
||||
1;q=C.getDate();break;case "'":if(u("'"))x();else r=true;break;default:x()}if(y<f.length)throw"Extra/unparsed characters found in date: "+f.substring(y);if(j==-1)j=(new Date).getFullYear();else if(j<100)j+=(new Date).getFullYear()-(new Date).getFullYear()%100+(j<=l?0:-100);if(s>-1){p=1;q=s;do{l=this._getDaysInMonth(j,p-1);if(q<=l)break;p++;q-=l}while(1)}C=this._daylightSavingAdjust(new Date(j,p-1,q));if(C.getFullYear()!=j||C.getMonth()+1!=p||C.getDate()!=q)throw"Invalid date";return C},ATOM:"yy-mm-dd",
|
||||
COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(b,f,j){if(!f)return"";var l=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,o=(j?j.dayNames:null)||this._defaults.dayNames,n=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort;j=(j?j.monthNames:
|
||||
null)||this._defaults.monthNames;var k=function(u){(u=r+1<b.length&&b.charAt(r+1)==u)&&r++;return u},m=function(u,v,w){v=""+v;if(k(u))for(;v.length<w;)v="0"+v;return v},p=function(u,v,w,x){return k(u)?x[v]:w[v]},q="",s=false;if(f)for(var r=0;r<b.length;r++)if(s)if(b.charAt(r)=="'"&&!k("'"))s=false;else q+=b.charAt(r);else switch(b.charAt(r)){case "d":q+=m("d",f.getDate(),2);break;case "D":q+=p("D",f.getDay(),l,o);break;case "o":q+=m("o",Math.round(((new Date(f.getFullYear(),f.getMonth(),f.getDate())).getTime()-
|
||||
(new Date(f.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":q+=m("m",f.getMonth()+1,2);break;case "M":q+=p("M",f.getMonth(),n,j);break;case "y":q+=k("y")?f.getFullYear():(f.getYear()%100<10?"0":"")+f.getYear()%100;break;case "@":q+=f.getTime();break;case "!":q+=f.getTime()*1E4+this._ticksTo1970;break;case "'":if(k("'"))q+="'";else s=true;break;default:q+=b.charAt(r)}return q},_possibleChars:function(b){for(var f="",j=false,l=function(n){(n=o+1<b.length&&b.charAt(o+1)==n)&&o++;return n},o=
|
||||
0;o<b.length;o++)if(j)if(b.charAt(o)=="'"&&!l("'"))j=false;else f+=b.charAt(o);else switch(b.charAt(o)){case "d":case "m":case "y":case "@":f+="0123456789";break;case "D":case "M":return null;case "'":if(l("'"))f+="'";else j=true;break;default:f+=b.charAt(o)}return f},_get:function(b,f){return b.settings[f]!==d?b.settings[f]:this._defaults[f]},_setDateFromField:function(b,f){if(b.input.val()!=b.lastVal){var j=this._get(b,"dateFormat"),l=b.lastVal=b.input?b.input.val():null,o,n;o=n=this._getDefaultDate(b);
|
||||
var k=this._getFormatConfig(b);try{o=this.parseDate(j,l,k)||n}catch(m){this.log(m);l=f?"":l}b.selectedDay=o.getDate();b.drawMonth=b.selectedMonth=o.getMonth();b.drawYear=b.selectedYear=o.getFullYear();b.currentDay=l?o.getDate():0;b.currentMonth=l?o.getMonth():0;b.currentYear=l?o.getFullYear():0;this._adjustInstDate(b)}},_getDefaultDate:function(b){return this._restrictMinMax(b,this._determineDate(b,this._get(b,"defaultDate"),new Date))},_determineDate:function(b,f,j){var l=function(n){var k=new Date;
|
||||
k.setDate(k.getDate()+n);return k},o=function(n){try{return a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),n,a.datepicker._getFormatConfig(b))}catch(k){}var m=(n.toLowerCase().match(/^c/)?a.datepicker._getDate(b):null)||new Date,p=m.getFullYear(),q=m.getMonth();m=m.getDate();for(var s=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,r=s.exec(n);r;){switch(r[2]||"d"){case "d":case "D":m+=parseInt(r[1],10);break;case "w":case "W":m+=parseInt(r[1],10)*7;break;case "m":case "M":q+=parseInt(r[1],10);m=
|
||||
Math.min(m,a.datepicker._getDaysInMonth(p,q));break;case "y":case "Y":p+=parseInt(r[1],10);m=Math.min(m,a.datepicker._getDaysInMonth(p,q));break}r=s.exec(n)}return new Date(p,q,m)};if(f=(f=f==null||f===""?j:typeof f=="string"?o(f):typeof f=="number"?isNaN(f)?j:l(f):new Date(f.getTime()))&&f.toString()=="Invalid Date"?j:f){f.setHours(0);f.setMinutes(0);f.setSeconds(0);f.setMilliseconds(0)}return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(b){if(!b)return null;b.setHours(b.getHours()>
|
||||
12?b.getHours()+2:0);return b},_setDate:function(b,f,j){var l=!f,o=b.selectedMonth,n=b.selectedYear;f=this._restrictMinMax(b,this._determineDate(b,f,new Date));b.selectedDay=b.currentDay=f.getDate();b.drawMonth=b.selectedMonth=b.currentMonth=f.getMonth();b.drawYear=b.selectedYear=b.currentYear=f.getFullYear();if((o!=b.selectedMonth||n!=b.selectedYear)&&!j)this._notifyChange(b);this._adjustInstDate(b);if(b.input)b.input.val(l?"":this._formatDate(b))},_getDate:function(b){return!b.currentYear||b.input&&
|
||||
b.input.val()==""?null:this._daylightSavingAdjust(new Date(b.currentYear,b.currentMonth,b.currentDay))},_generateHTML:function(b){var f=new Date;f=this._daylightSavingAdjust(new Date(f.getFullYear(),f.getMonth(),f.getDate()));var j=this._get(b,"isRTL"),l=this._get(b,"showButtonPanel"),o=this._get(b,"hideIfNoPrevNext"),n=this._get(b,"navigationAsDateFormat"),k=this._getNumberOfMonths(b),m=this._get(b,"showCurrentAtPos"),p=this._get(b,"stepMonths"),q=k[0]!=1||k[1]!=1,s=this._daylightSavingAdjust(!b.currentDay?
|
||||
new Date(9999,9,9):new Date(b.currentYear,b.currentMonth,b.currentDay)),r=this._getMinMaxDate(b,"min"),u=this._getMinMaxDate(b,"max");m=b.drawMonth-m;var v=b.drawYear;if(m<0){m+=12;v--}if(u){var w=this._daylightSavingAdjust(new Date(u.getFullYear(),u.getMonth()-k[0]*k[1]+1,u.getDate()));for(w=r&&w<r?r:w;this._daylightSavingAdjust(new Date(v,m,1))>w;){m--;if(m<0){m=11;v--}}}b.drawMonth=m;b.drawYear=v;w=this._get(b,"prevText");w=!n?w:this.formatDate(w,this._daylightSavingAdjust(new Date(v,m-p,1)),this._getFormatConfig(b));
|
||||
w=this._canAdjustMonth(b,-1,v,m)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+g+".datepicker._adjustDate('#"+b.id+"', -"+p+", 'M');\" title=\""+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"e":"w")+'">'+w+"</span></a>":o?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"e":"w")+'">'+w+"</span></a>";var x=this._get(b,"nextText");x=!n?x:this.formatDate(x,this._daylightSavingAdjust(new Date(v,
|
||||
m+p,1)),this._getFormatConfig(b));o=this._canAdjustMonth(b,+1,v,m)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+g+".datepicker._adjustDate('#"+b.id+"', +"+p+", 'M');\" title=\""+x+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"w":"e")+'">'+x+"</span></a>":o?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+x+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"w":"e")+'">'+x+"</span></a>";p=this._get(b,"currentText");x=this._get(b,"gotoCurrent")&&
|
||||
b.currentDay?s:f;p=!n?p:this.formatDate(p,x,this._getFormatConfig(b));n=!b.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+g+'.datepicker._hideDatepicker();">'+this._get(b,"closeText")+"</button>":"";l=l?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(j?n:"")+(this._isInRange(b,x)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
|
||||
g+".datepicker._gotoToday('#"+b.id+"');\">"+p+"</button>":"")+(j?"":n)+"</div>":"";n=parseInt(this._get(b,"firstDay"),10);n=isNaN(n)?0:n;p=this._get(b,"showWeek");x=this._get(b,"dayNames");this._get(b,"dayNamesShort");var y=this._get(b,"dayNamesMin"),H=this._get(b,"monthNames"),C=this._get(b,"monthNamesShort"),z=this._get(b,"beforeShowDay"),I=this._get(b,"showOtherMonths"),N=this._get(b,"selectOtherMonths");this._get(b,"calculateWeek");for(var J=this._getDefaultDate(b),D="",E=0;E<k[0];E++){var P=
|
||||
"";this.maxRows=4;for(var L=0;L<k[1];L++){var Q=this._daylightSavingAdjust(new Date(v,m,b.selectedDay)),B=" ui-corner-all",F="";if(q){F+='<div class="ui-datepicker-group';if(k[1]>1)switch(L){case 0:F+=" ui-datepicker-group-first";B=" ui-corner-"+(j?"right":"left");break;case k[1]-1:F+=" ui-datepicker-group-last";B=" ui-corner-"+(j?"left":"right");break;default:F+=" ui-datepicker-group-middle";B="";break}F+='">'}F+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+B+'">'+(/all|left/.test(B)&&
|
||||
E==0?j?o:w:"")+(/all|right/.test(B)&&E==0?j?w:o:"")+this._generateMonthYearHeader(b,m,v,r,u,E>0||L>0,H,C)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var G=p?'<th class="ui-datepicker-week-col">'+this._get(b,"weekHeader")+"</th>":"";for(B=0;B<7;B++){var A=(B+n)%7;G+="<th"+((B+n+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+x[A]+'">'+y[A]+"</span></th>"}F+=G+"</tr></thead><tbody>";G=this._getDaysInMonth(v,m);if(v==b.selectedYear&&m==b.selectedMonth)b.selectedDay=Math.min(b.selectedDay,
|
||||
G);B=(this._getFirstDayOfMonth(v,m)-n+7)%7;G=Math.ceil((B+G)/7);this.maxRows=G=q?this.maxRows>G?this.maxRows:G:G;A=this._daylightSavingAdjust(new Date(v,m,1-B));for(var R=0;R<G;R++){F+="<tr>";var S=!p?"":'<td class="ui-datepicker-week-col">'+this._get(b,"calculateWeek")(A)+"</td>";for(B=0;B<7;B++){var M=z?z.apply(b.input?b.input[0]:null,[A]):[true,""],K=A.getMonth()!=m,O=K&&!N||!M[0]||r&&A<r||u&&A>u;S+='<td class="'+((B+n+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(A.getTime()==
|
||||
Q.getTime()&&m==b.selectedMonth&&b._keyEvent||J.getTime()==A.getTime()&&J.getTime()==Q.getTime()?" "+this._dayOverClass:"")+(O?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!I?"":" "+M[1]+(A.getTime()==s.getTime()?" "+this._currentClass:"")+(A.getTime()==f.getTime()?" ui-datepicker-today":""))+'"'+((!K||I)&&M[2]?' title="'+M[2]+'"':"")+(O?"":' onclick="DP_jQuery_'+g+".datepicker._selectDay('#"+b.id+"',"+A.getMonth()+","+A.getFullYear()+', this);return false;"')+">"+(K&&!I?" ":O?'<span class="ui-state-default">'+
|
||||
A.getDate()+"</span>":'<a class="ui-state-default'+(A.getTime()==f.getTime()?" ui-state-highlight":"")+(A.getTime()==s.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+'" href="#">'+A.getDate()+"</a>")+"</td>";A.setDate(A.getDate()+1);A=this._daylightSavingAdjust(A)}F+=S+"</tr>"}m++;if(m>11){m=0;v++}F+="</tbody></table>"+(q?"</div>"+(k[0]>0&&L==k[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");P+=F}D+=P}D+=l+(a.browser.msie&&parseInt(a.browser.version,10)<7&&!b.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
|
||||
"");b._keyEvent=false;return D},_generateMonthYearHeader:function(b,f,j,l,o,n,k,m){var p=this._get(b,"changeMonth"),q=this._get(b,"changeYear"),s=this._get(b,"showMonthAfterYear"),r='<div class="ui-datepicker-title">',u="";if(n||!p)u+='<span class="ui-datepicker-month">'+k[f]+"</span>";else{k=l&&l.getFullYear()==j;var v=o&&o.getFullYear()==j;u+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+g+".datepicker._selectMonthYear('#"+b.id+"', this, 'M');\" >";for(var w=0;w<12;w++)if((!k||w>=l.getMonth())&&
|
||||
(!v||w<=o.getMonth()))u+='<option value="'+w+'"'+(w==f?' selected="selected"':"")+">"+m[w]+"</option>";u+="</select>"}s||(r+=u+(n||!(p&&q)?" ":""));if(!b.yearshtml){b.yearshtml="";if(n||!q)r+='<span class="ui-datepicker-year">'+j+"</span>";else{m=this._get(b,"yearRange").split(":");var x=(new Date).getFullYear();k=function(y){y=y.match(/c[+-].*/)?j+parseInt(y.substring(1),10):y.match(/[+-].*/)?x+parseInt(y,10):parseInt(y,10);return isNaN(y)?x:y};f=k(m[0]);m=Math.max(f,k(m[1]||""));f=l?Math.max(f,
|
||||
l.getFullYear()):f;m=o?Math.min(m,o.getFullYear()):m;for(b.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+g+".datepicker._selectMonthYear('#"+b.id+"', this, 'Y');\" >";f<=m;f++)b.yearshtml+='<option value="'+f+'"'+(f==j?' selected="selected"':"")+">"+f+"</option>";b.yearshtml+="</select>";r+=b.yearshtml;b.yearshtml=null}}r+=this._get(b,"yearSuffix");if(s)r+=(n||!(p&&q)?" ":"")+u;r+="</div>";return r},_adjustInstDate:function(b,f,j){var l=b.drawYear+(j=="Y"?f:0),o=b.drawMonth+
|
||||
(j=="M"?f:0);f=Math.min(b.selectedDay,this._getDaysInMonth(l,o))+(j=="D"?f:0);l=this._restrictMinMax(b,this._daylightSavingAdjust(new Date(l,o,f)));b.selectedDay=l.getDate();b.drawMonth=b.selectedMonth=l.getMonth();b.drawYear=b.selectedYear=l.getFullYear();if(j=="M"||j=="Y")this._notifyChange(b)},_restrictMinMax:function(b,f){var j=this._getMinMaxDate(b,"min");b=this._getMinMaxDate(b,"max");f=j&&f<j?j:f;return f=b&&f>b?b:f},_notifyChange:function(b){var f=this._get(b,"onChangeMonthYear");if(f)f.apply(b.input?
|
||||
b.input[0]:null,[b.selectedYear,b.selectedMonth+1,b])},_getNumberOfMonths:function(b){b=this._get(b,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(b,f){return this._determineDate(b,this._get(b,f+"Date"),null)},_getDaysInMonth:function(b,f){return 32-this._daylightSavingAdjust(new Date(b,f,32)).getDate()},_getFirstDayOfMonth:function(b,f){return(new Date(b,f,1)).getDay()},_canAdjustMonth:function(b,f,j,l){var o=this._getNumberOfMonths(b);j=this._daylightSavingAdjust(new Date(j,
|
||||
l+(f<0?f:o[0]*o[1]),1));f<0&&j.setDate(this._getDaysInMonth(j.getFullYear(),j.getMonth()));return this._isInRange(b,j)},_isInRange:function(b,f){var j=this._getMinMaxDate(b,"min");b=this._getMinMaxDate(b,"max");return(!j||f.getTime()>=j.getTime())&&(!b||f.getTime()<=b.getTime())},_getFormatConfig:function(b){var f=this._get(b,"shortYearCutoff");f=typeof f!="string"?f:(new Date).getFullYear()%100+parseInt(f,10);return{shortYearCutoff:f,dayNamesShort:this._get(b,"dayNamesShort"),dayNames:this._get(b,
|
||||
"dayNames"),monthNamesShort:this._get(b,"monthNamesShort"),monthNames:this._get(b,"monthNames")}},_formatDate:function(b,f,j,l){if(!f){b.currentDay=b.selectedDay;b.currentMonth=b.selectedMonth;b.currentYear=b.selectedYear}f=f?typeof f=="object"?f:this._daylightSavingAdjust(new Date(l,j,f)):this._daylightSavingAdjust(new Date(b.currentYear,b.currentMonth,b.currentDay));return this.formatDate(this._get(b,"dateFormat"),f,this._getFormatConfig(b))}});a.fn.datepicker=function(b){if(!this.length)return this;
|
||||
if(!a.datepicker.initialized){a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv);a.datepicker.initialized=true}var f=Array.prototype.slice.call(arguments,1);if(typeof b=="string"&&(b=="isDisabled"||b=="getDate"||b=="widget"))return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(f));if(b=="option"&&arguments.length==2&&typeof arguments[1]=="string")return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(f));return this.each(function(){typeof b==
|
||||
"string"?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this].concat(f)):a.datepicker._attachDatepicker(this,b)})};a.datepicker=new c;a.datepicker.initialized=false;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.16";window["DP_jQuery_"+g]=a})(jQuery);
|
||||
(function(a,d){var c={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},e={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},h=a.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};a.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
|
||||
position:{my:"center",at:"center",collision:"fit",using:function(g){var i=a(this).css(g).offset().top;i<0&&a(this).css("top",g.top-i)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var g=this,i=g.options,b=i.title||" ",f=a.ui.dialog.getTitleId(g.element),j=(g.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
|
||||
i.dialogClass).css({zIndex:i.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){if(i.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===a.ui.keyCode.ESCAPE){g.close(n);n.preventDefault()}}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(n){g.moveToTop(false,n)});g.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j);var l=(g.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j),
|
||||
o=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){o.addClass("ui-state-hover")},function(){o.removeClass("ui-state-hover")}).focus(function(){o.addClass("ui-state-focus")}).blur(function(){o.removeClass("ui-state-focus")}).click(function(n){g.close(n);return false}).appendTo(l);(g.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(i.closeText).appendTo(o);a("<span></span>").addClass("ui-dialog-title").attr("id",
|
||||
f).html(b).prependTo(l);if(a.isFunction(i.beforeclose)&&!a.isFunction(i.beforeClose))i.beforeClose=i.beforeclose;l.find("*").add(l).disableSelection();i.draggable&&a.fn.draggable&&g._makeDraggable();i.resizable&&a.fn.resizable&&g._makeResizable();g._createButtons(i.buttons);g._isOpen=false;a.fn.bgiframe&&j.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var g=this;g.overlay&&g.overlay.destroy();g.uiDialog.hide();g.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
|
||||
g.uiDialog.remove();g.originalTitle&&g.element.attr("title",g.originalTitle);return g},widget:function(){return this.uiDialog},close:function(g){var i=this,b,f;if(false!==i._trigger("beforeClose",g)){i.overlay&&i.overlay.destroy();i.uiDialog.unbind("keypress.ui-dialog");i._isOpen=false;if(i.options.hide)i.uiDialog.hide(i.options.hide,function(){i._trigger("close",g)});else{i.uiDialog.hide();i._trigger("close",g)}a.ui.dialog.overlay.resize();if(i.options.modal){b=0;a(".ui-dialog").each(function(){if(this!==
|
||||
i.uiDialog[0]){f=a(this).css("z-index");isNaN(f)||(b=Math.max(b,f))}});a.ui.dialog.maxZ=b}return i}},isOpen:function(){return this._isOpen},moveToTop:function(g,i){var b=this,f=b.options;if(f.modal&&!g||!f.stack&&!f.modal)return b._trigger("focus",i);if(f.zIndex>a.ui.dialog.maxZ)a.ui.dialog.maxZ=f.zIndex;if(b.overlay){a.ui.dialog.maxZ+=1;b.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)}g={scrollTop:b.element.scrollTop(),scrollLeft:b.element.scrollLeft()};a.ui.dialog.maxZ+=1;
|
||||
b.uiDialog.css("z-index",a.ui.dialog.maxZ);b.element.attr(g);b._trigger("focus",i);return b},open:function(){if(!this._isOpen){var g=this,i=g.options,b=g.uiDialog;g.overlay=i.modal?new a.ui.dialog.overlay(g):null;g._size();g._position(i.position);b.show(i.show);g.moveToTop(true);i.modal&&b.bind("keypress.ui-dialog",function(f){if(f.keyCode===a.ui.keyCode.TAB){var j=a(":tabbable",this),l=j.filter(":first");j=j.filter(":last");if(f.target===j[0]&&!f.shiftKey){l.focus(1);return false}else if(f.target===
|
||||
l[0]&&f.shiftKey){j.focus(1);return false}}});a(g.element.find(":tabbable").get().concat(b.find(".ui-dialog-buttonpane :tabbable").get().concat(b.get()))).eq(0).focus();g._isOpen=true;g._trigger("open");return g}},_createButtons:function(g){var i=this,b=false,f=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),j=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(f);i.uiDialog.find(".ui-dialog-buttonpane").remove();typeof g==="object"&&g!==null&&a.each(g,
|
||||
function(){return!(b=true)});if(b){a.each(g,function(l,o){o=a.isFunction(o)?{click:o,text:l}:o;var n=a('<button type="button"></button>').click(function(){o.click.apply(i.element[0],arguments)}).appendTo(j);a.each(o,function(k,m){if(k!=="click")k in h?n[k](m):n.attr(k,m)});a.fn.button&&n.button()});f.appendTo(i.uiDialog)}},_makeDraggable:function(){function g(l){return{position:l.position,offset:l.offset}}var i=this,b=i.options,f=a(document),j;i.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
|
||||
handle:".ui-dialog-titlebar",containment:"document",start:function(l,o){j=b.height==="auto"?"auto":a(this).height();a(this).height(a(this).height()).addClass("ui-dialog-dragging");i._trigger("dragStart",l,g(o))},drag:function(l,o){i._trigger("drag",l,g(o))},stop:function(l,o){b.position=[o.position.left-f.scrollLeft(),o.position.top-f.scrollTop()];a(this).removeClass("ui-dialog-dragging").height(j);i._trigger("dragStop",l,g(o));a.ui.dialog.overlay.resize()}})},_makeResizable:function(g){function i(l){return{originalPosition:l.originalPosition,
|
||||
originalSize:l.originalSize,position:l.position,size:l.size}}g=g===d?this.options.resizable:g;var b=this,f=b.options,j=b.uiDialog.css("position");g=typeof g==="string"?g:"n,e,s,w,se,sw,ne,nw";b.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:b.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:b._minHeight(),handles:g,start:function(l,o){a(this).addClass("ui-dialog-resizing");b._trigger("resizeStart",l,i(o))},resize:function(l,o){b._trigger("resize",
|
||||
l,i(o))},stop:function(l,o){a(this).removeClass("ui-dialog-resizing");f.height=a(this).height();f.width=a(this).width();b._trigger("resizeStop",l,i(o));a.ui.dialog.overlay.resize()}}).css("position",j).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var g=this.options;return g.height==="auto"?g.minHeight:Math.min(g.minHeight,g.height)},_position:function(g){var i=[],b=[0,0],f;if(g){if(typeof g==="string"||typeof g==="object"&&"0"in g){i=g.split?g.split(" "):
|
||||
[g[0],g[1]];if(i.length===1)i[1]=i[0];a.each(["left","top"],function(j,l){if(+i[j]===i[j]){b[j]=i[j];i[j]=l}});g={my:i.join(" "),at:i.join(" "),offset:b.join(" ")}}g=a.extend({},a.ui.dialog.prototype.options.position,g)}else g=a.ui.dialog.prototype.options.position;(f=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},g));f||this.uiDialog.hide()},_setOptions:function(g){var i=this,b={},f=false;a.each(g,function(j,l){i._setOption(j,l);
|
||||
if(j in c)f=true;if(j in e)b[j]=l});f&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",b)},_setOption:function(g,i){var b=this,f=b.uiDialog;switch(g){case "beforeclose":g="beforeClose";break;case "buttons":b._createButtons(i);break;case "closeText":b.uiDialogTitlebarCloseText.text(""+i);break;case "dialogClass":f.removeClass(b.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+i);break;case "disabled":i?f.addClass("ui-dialog-disabled"):
|
||||
f.removeClass("ui-dialog-disabled");break;case "draggable":var j=f.is(":data(draggable)");j&&!i&&f.draggable("destroy");!j&&i&&b._makeDraggable();break;case "position":b._position(i);break;case "resizable":(j=f.is(":data(resizable)"))&&!i&&f.resizable("destroy");j&&typeof i==="string"&&f.resizable("option","handles",i);!j&&i!==false&&b._makeResizable(i);break;case "title":a(".ui-dialog-title",b.uiDialogTitlebar).html(""+(i||" "));break}a.Widget.prototype._setOption.apply(b,arguments)},_size:function(){var g=
|
||||
this.options,i,b,f=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(g.minWidth>g.width)g.width=g.minWidth;i=this.uiDialog.css({height:"auto",width:g.width}).height();b=Math.max(0,g.minHeight-i);if(g.height==="auto")if(a.support.minHeight)this.element.css({minHeight:b,height:"auto"});else{this.uiDialog.show();g=this.element.css("height","auto").height();f||this.uiDialog.hide();this.element.height(Math.max(g,b))}else this.element.height(Math.max(g.height-
|
||||
i,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});a.extend(a.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(g){g=g.attr("id");if(!g){this.uuid+=1;g=this.uuid}return"ui-dialog-title-"+g},overlay:function(g){this.$el=a.ui.dialog.overlay.create(g)}});a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(g){return g+".dialog-overlay"}).join(" "),
|
||||
create:function(g){if(this.instances.length===0){setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return false})},1);a(document).bind("keydown.dialog-overlay",function(b){if(g.options.closeOnEscape&&!b.isDefaultPrevented()&&b.keyCode&&b.keyCode===a.ui.keyCode.ESCAPE){g.close(b);b.preventDefault()}});a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize)}var i=(this.oldInstances.pop()||
|
||||
a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&i.bgiframe();this.instances.push(i);return i},destroy:function(g){var i=a.inArray(g,this.instances);i!=-1&&this.oldInstances.push(this.instances.splice(i,1)[0]);this.instances.length===0&&a([document,window]).unbind(".dialog-overlay");g.remove();var b=0;a.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var g,i;if(a.browser.msie&&
|
||||
a.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);i=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return g<i?a(window).height()+"px":g+"px"}else return a(document).height()+"px"},width:function(){var g,i;if(a.browser.msie){g=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);i=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return g<i?a(window).width()+"px":g+"px"}else return a(document).width()+
|
||||
"px"},resize:function(){var g=a([]);a.each(a.ui.dialog.overlay.instances,function(){g=g.add(this)});g.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}});a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
|
||||
(function(a){a.ui=a.ui||{};var d=/left|center|right/,c=/top|center|bottom/,e=a.fn.position,h=a.fn.offset;a.fn.position=function(g){if(!g||!g.of)return e.apply(this,arguments);g=a.extend({},g);var i=a(g.of),b=i[0],f=(g.collision||"flip").split(" "),j=g.offset?g.offset.split(" "):[0,0],l,o,n;if(b.nodeType===9){l=i.width();o=i.height();n={top:0,left:0}}else if(b.setTimeout){l=i.width();o=i.height();n={top:i.scrollTop(),left:i.scrollLeft()}}else if(b.preventDefault){g.at="left top";l=o=0;n={top:g.of.pageY,
|
||||
left:g.of.pageX}}else{l=i.outerWidth();o=i.outerHeight();n=i.offset()}a.each(["my","at"],function(){var k=(g[this]||"").split(" ");if(k.length===1)k=d.test(k[0])?k.concat(["center"]):c.test(k[0])?["center"].concat(k):["center","center"];k[0]=d.test(k[0])?k[0]:"center";k[1]=c.test(k[1])?k[1]:"center";g[this]=k});if(f.length===1)f[1]=f[0];j[0]=parseInt(j[0],10)||0;if(j.length===1)j[1]=j[0];j[1]=parseInt(j[1],10)||0;if(g.at[0]==="right")n.left+=l;else if(g.at[0]==="center")n.left+=l/2;if(g.at[1]==="bottom")n.top+=
|
||||
o;else if(g.at[1]==="center")n.top+=o/2;n.left+=j[0];n.top+=j[1];return this.each(function(){var k=a(this),m=k.outerWidth(),p=k.outerHeight(),q=parseInt(a.curCSS(this,"marginLeft",true))||0,s=parseInt(a.curCSS(this,"marginTop",true))||0,r=m+q+(parseInt(a.curCSS(this,"marginRight",true))||0),u=p+s+(parseInt(a.curCSS(this,"marginBottom",true))||0),v=a.extend({},n),w;if(g.my[0]==="right")v.left-=m;else if(g.my[0]==="center")v.left-=m/2;if(g.my[1]==="bottom")v.top-=p;else if(g.my[1]==="center")v.top-=
|
||||
p/2;v.left=Math.round(v.left);v.top=Math.round(v.top);w={left:v.left-q,top:v.top-s};a.each(["left","top"],function(x,y){a.ui.position[f[x]]&&a.ui.position[f[x]][y](v,{targetWidth:l,targetHeight:o,elemWidth:m,elemHeight:p,collisionPosition:w,collisionWidth:r,collisionHeight:u,offset:j,my:g.my,at:g.at})});a.fn.bgiframe&&k.bgiframe();k.offset(a.extend(v,{using:g.using}))})};a.ui.position={fit:{left:function(g,i){var b=a(window);b=i.collisionPosition.left+i.collisionWidth-b.width()-b.scrollLeft();g.left=
|
||||
b>0?g.left-b:Math.max(g.left-i.collisionPosition.left,g.left)},top:function(g,i){var b=a(window);b=i.collisionPosition.top+i.collisionHeight-b.height()-b.scrollTop();g.top=b>0?g.top-b:Math.max(g.top-i.collisionPosition.top,g.top)}},flip:{left:function(g,i){if(i.at[0]!=="center"){var b=a(window);b=i.collisionPosition.left+i.collisionWidth-b.width()-b.scrollLeft();var f=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,j=i.at[0]==="left"?i.targetWidth:-i.targetWidth,l=-2*i.offset[0];g.left+=
|
||||
i.collisionPosition.left<0?f+j+l:b>0?f+j+l:0}},top:function(g,i){if(i.at[1]!=="center"){var b=a(window);b=i.collisionPosition.top+i.collisionHeight-b.height()-b.scrollTop();var f=i.my[1]==="top"?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,j=i.at[1]==="top"?i.targetHeight:-i.targetHeight,l=-2*i.offset[1];g.top+=i.collisionPosition.top<0?f+j+l:b>0?f+j+l:0}}}};if(!a.offset.setOffset){a.offset.setOffset=function(g,i){if(/static/.test(a.curCSS(g,"position")))g.style.position="relative";var b=a(g),
|
||||
f=b.offset(),j=parseInt(a.curCSS(g,"top",true),10)||0,l=parseInt(a.curCSS(g,"left",true),10)||0;f={top:i.top-f.top+j,left:i.left-f.left+l};"using"in i?i.using.call(g,f):b.css(f)};a.fn.offset=function(g){var i=this[0];if(!i||!i.ownerDocument)return null;if(g)return this.each(function(){a.offset.setOffset(this,g)});return h.call(this)}}})(jQuery);
|
||||
(function(a,d){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
|
||||
this.valueDiv.remove();a.Widget.prototype.destroy.apply(this,arguments)},value:function(c){if(c===d)return this._value();this._setOption("value",c);return this},_setOption:function(c,e){if(c==="value"){this.options.value=e;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var c=this.options.value;if(typeof c!=="number")c=0;return Math.min(this.options.max,Math.max(this.min,c))},_percentage:function(){return 100*
|
||||
this._value()/this.options.max},_refreshValue:function(){var c=this.value(),e=this._percentage();if(this.oldValue!==c){this.oldValue=c;this._trigger("change")}this.valueDiv.toggle(c>this.min).toggleClass("ui-corner-right",c===this.options.max).width(e.toFixed(0)+"%");this.element.attr("aria-valuenow",c)}});a.extend(a.ui.progressbar,{version:"1.8.16"})})(jQuery);
|
||||
(function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var d=this,c=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),h=c.values&&c.values.length||1,g=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
|
||||
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(c.disabled?" ui-slider-disabled ui-disabled":""));this.range=a([]);if(c.range){if(c.range===true){if(!c.values)c.values=[this._valueMin(),this._valueMin()];if(c.values.length&&c.values.length!==2)c.values=[c.values[0],c.values[0]]}this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(c.range==="min"||c.range==="max"?" ui-slider-range-"+c.range:""))}for(var i=e.length;i<h;i+=1)g.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
|
||||
this.handles=e.add(a(g.join("")).appendTo(d.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()}).hover(function(){c.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(c.disabled)a(this).blur();else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle",
|
||||
b)});this.handles.keydown(function(b){var f=true,j=a(this).data("index.ui-slider-handle"),l,o,n;if(!d.options.disabled){switch(b.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!d._keySliding){d._keySliding=true;a(this).addClass("ui-state-active");l=d._start(b,j);if(l===false)return}break}n=d.options.step;l=d.options.values&&d.options.values.length?
|
||||
(o=d.values(j)):(o=d.value());switch(b.keyCode){case a.ui.keyCode.HOME:o=d._valueMin();break;case a.ui.keyCode.END:o=d._valueMax();break;case a.ui.keyCode.PAGE_UP:o=d._trimAlignValue(l+(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:o=d._trimAlignValue(l-(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(l===d._valueMax())return;o=d._trimAlignValue(l+n);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(l===d._valueMin())return;o=d._trimAlignValue(l-
|
||||
n);break}d._slide(b,j,o);return f}}).keyup(function(b){var f=a(this).data("index.ui-slider-handle");if(d._keySliding){d._keySliding=false;d._stop(b,f);d._change(b,f);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
|
||||
return this},_mouseCapture:function(d){var c=this.options,e,h,g,i,b;if(c.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();e=this._normValueFromMouse({x:d.pageX,y:d.pageY});h=this._valueMax()-this._valueMin()+1;i=this;this.handles.each(function(f){var j=Math.abs(e-i.values(f));if(h>j){h=j;g=a(this);b=f}});if(c.range===true&&this.values(1)===c.min){b+=1;g=a(this.handles[b])}if(this._start(d,b)===false)return false;
|
||||
this._mouseSliding=true;i._handleIndex=b;g.addClass("ui-state-active").focus();c=g.offset();this._clickOffset=!a(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-c.left-g.width()/2,top:d.pageY-c.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(d,b,e);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(d){var c=
|
||||
this._normValueFromMouse({x:d.pageX,y:d.pageY});this._slide(d,this._handleIndex,c);return false},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c;if(this.orientation==="horizontal"){c=
|
||||
this.elementSize.width;d=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;d=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}c=d/c;if(c>1)c=1;if(c<0)c=0;if(this.orientation==="vertical")c=1-c;d=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+c*d)},_start:function(d,c){var e={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(c);
|
||||
e.values=this.values()}return this._trigger("start",d,e)},_slide:function(d,c,e){var h;if(this.options.values&&this.options.values.length){h=this.values(c?0:1);if(this.options.values.length===2&&this.options.range===true&&(c===0&&e>h||c===1&&e<h))e=h;if(e!==this.values(c)){h=this.values();h[c]=e;d=this._trigger("slide",d,{handle:this.handles[c],value:e,values:h});this.values(c?0:1);d!==false&&this.values(c,e,true)}}else if(e!==this.value()){d=this._trigger("slide",d,{handle:this.handles[c],value:e});
|
||||
d!==false&&this.value(e)}},_stop:function(d,c){var e={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(c);e.values=this.values()}this._trigger("stop",d,e)},_change:function(d,c){if(!this._keySliding&&!this._mouseSliding){var e={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(c);e.values=this.values()}this._trigger("change",d,e)}},value:function(d){if(arguments.length){this.options.value=
|
||||
this._trimAlignValue(d);this._refreshValue();this._change(null,0)}else return this._value()},values:function(d,c){var e,h,g;if(arguments.length>1){this.options.values[d]=this._trimAlignValue(c);this._refreshValue();this._change(null,d)}else if(arguments.length)if(a.isArray(arguments[0])){e=this.options.values;h=arguments[0];for(g=0;g<e.length;g+=1){e[g]=this._trimAlignValue(h[g]);this._change(null,g)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(d):
|
||||
this.value();else return this._values()},_setOption:function(d,c){var e,h=0;if(a.isArray(this.options.values))h=this.options.values.length;a.Widget.prototype._setOption.apply(this,arguments);switch(d){case "disabled":if(c){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
|
||||
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(e=0;e<h;e+=1)this._change(null,e);this._animateOff=false;break}},_value:function(){var d=this.options.value;return d=this._trimAlignValue(d)},_values:function(d){var c,e;if(arguments.length){c=this.options.values[d];
|
||||
return c=this._trimAlignValue(c)}else{c=this.options.values.slice();for(e=0;e<c.length;e+=1)c[e]=this._trimAlignValue(c[e]);return c}},_trimAlignValue:function(d){if(d<=this._valueMin())return this._valueMin();if(d>=this._valueMax())return this._valueMax();var c=this.options.step>0?this.options.step:1,e=(d-this._valueMin())%c;d=d-e;if(Math.abs(e)*2>=c)d+=e>0?c:-c;return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var d=
|
||||
this.options.range,c=this.options,e=this,h=!this._animateOff?c.animate:false,g,i={},b,f,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(o){g=(e.values(o)-e._valueMin())/(e._valueMax()-e._valueMin())*100;i[e.orientation==="horizontal"?"left":"bottom"]=g+"%";a(this).stop(1,1)[h?"animate":"css"](i,c.animate);if(e.options.range===true)if(e.orientation==="horizontal"){if(o===0)e.range.stop(1,1)[h?"animate":"css"]({left:g+"%"},c.animate);if(o===1)e.range[h?"animate":"css"]({width:g-
|
||||
b+"%"},{queue:false,duration:c.animate})}else{if(o===0)e.range.stop(1,1)[h?"animate":"css"]({bottom:g+"%"},c.animate);if(o===1)e.range[h?"animate":"css"]({height:g-b+"%"},{queue:false,duration:c.animate})}b=g});else{f=this.value();j=this._valueMin();l=this._valueMax();g=l!==j?(f-j)/(l-j)*100:0;i[e.orientation==="horizontal"?"left":"bottom"]=g+"%";this.handle.stop(1,1)[h?"animate":"css"](i,c.animate);if(d==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[h?"animate":"css"]({width:g+"%"},
|
||||
c.animate);if(d==="max"&&this.orientation==="horizontal")this.range[h?"animate":"css"]({width:100-g+"%"},{queue:false,duration:c.animate});if(d==="min"&&this.orientation==="vertical")this.range.stop(1,1)[h?"animate":"css"]({height:g+"%"},c.animate);if(d==="max"&&this.orientation==="vertical")this.range[h?"animate":"css"]({height:100-g+"%"},{queue:false,duration:c.animate})}}});a.extend(a.ui.slider,{version:"1.8.16"})})(jQuery);
|
||||
(function(a,d){function c(){return++h}function e(){return++g}var h=0,g=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(i,b){if(i=="selected")this.options.collapsible&&
|
||||
b==this.options.selected||this.select(b);else{this.options[i]=b;this._tabify()}},_tabId:function(i){return i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+c()},_sanitizeSelector:function(i){return i.replace(/:/g,"\\:")},_cookie:function(){var i=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+e());return a.cookie.apply(null,[i].concat(a.makeArray(arguments)))},_ui:function(i,b){return{tab:i,panel:b,index:this.anchors.index(i)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var i=
|
||||
a(this);i.html(i.data("label.tabs")).removeData("label.tabs")})},_tabify:function(i){function b(r,u){r.css("display","");!a.support.opacity&&u.opacity&&r[0].style.removeAttribute("filter")}var f=this,j=this.options,l=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=a(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);this.anchors.each(function(r,u){var v=a(u).attr("href"),w=v.split("#")[0],x;if(w&&(w===location.toString().split("#")[0]||
|
||||
(x=a("base")[0])&&w===x.href)){v=u.hash;u.href=v}if(l.test(v))f.panels=f.panels.add(f.element.find(f._sanitizeSelector(v)));else if(v&&v!=="#"){a.data(u,"href.tabs",v);a.data(u,"load.tabs",v.replace(/#.*$/,""));v=f._tabId(u);u.href="#"+v;u=f.element.find("#"+v);if(!u.length){u=a(j.panelTemplate).attr("id",v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(f.panels[r-1]||f.list);u.data("destroy.tabs",true)}f.panels=f.panels.add(u)}else j.disabled.push(r)});if(i){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
|
||||
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===d){location.hash&&this.anchors.each(function(r,u){if(u.hash==location.hash){j.selected=r;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(f._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected=
|
||||
this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=a.unique(j.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(r){return f.lis.index(r)}))).sort();a.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(a.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
|
||||
if(j.selected>=0&&this.anchors.length){f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");f.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[j.selected],f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash))[0]))});this.load(j.selected)}a(window).bind("unload",function(){f.lis.add(f.anchors).unbind(".tabs");f.lis=f.anchors=f.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
|
||||
this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);i=0;for(var o;o=this.lis[i];i++)a(o)[a.inArray(i,j.disabled)!=-1&&!a(o).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var n=function(r,u){u.is(":not(.ui-state-disabled)")&&u.addClass("ui-state-"+r)},k=function(r,u){u.removeClass("ui-state-"+
|
||||
r)};this.lis.bind("mouseover.tabs",function(){n("hover",a(this))});this.lis.bind("mouseout.tabs",function(){k("hover",a(this))});this.anchors.bind("focus.tabs",function(){n("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){k("focus",a(this).closest("li"))})}var m,p;if(j.fx)if(a.isArray(j.fx)){m=j.fx[0];p=j.fx[1]}else m=p=j.fx;var q=p?function(r,u){a(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.hide().removeClass("ui-tabs-hide").animate(p,p.duration||"normal",
|
||||
function(){b(u,p);f._trigger("show",null,f._ui(r,u[0]))})}:function(r,u){a(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.removeClass("ui-tabs-hide");f._trigger("show",null,f._ui(r,u[0]))},s=m?function(r,u){u.animate(m,m.duration||"normal",function(){f.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");b(u,m);f.element.dequeue("tabs")})}:function(r,u){f.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");f.element.dequeue("tabs")};
|
||||
this.anchors.bind(j.event+".tabs",function(){var r=this,u=a(r).closest("li"),v=f.panels.filter(":not(.ui-tabs-hide)"),w=f.element.find(f._sanitizeSelector(r.hash));if(u.hasClass("ui-tabs-selected")&&!j.collapsible||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||f.panels.filter(":animated").length||f._trigger("select",null,f._ui(this,w[0]))===false){this.blur();return false}j.selected=f.anchors.index(this);f.abort();if(j.collapsible)if(u.hasClass("ui-tabs-selected")){j.selected=
|
||||
-1;j.cookie&&f._cookie(j.selected,j.cookie);f.element.queue("tabs",function(){s(r,v)}).dequeue("tabs");this.blur();return false}else if(!v.length){j.cookie&&f._cookie(j.selected,j.cookie);f.element.queue("tabs",function(){q(r,w)});f.load(f.anchors.index(this));this.blur();return false}j.cookie&&f._cookie(j.selected,j.cookie);if(w.length){v.length&&f.element.queue("tabs",function(){s(r,v)});f.element.queue("tabs",function(){q(r,w)});f.load(f.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
|
||||
a.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(i){if(typeof i=="string")i=this.anchors.index(this.anchors.filter("[href$="+i+"]"));return i},destroy:function(){var i=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var b=
|
||||
a.data(this,"href.tabs");if(b)this.href=b;var f=a(this).unbind(".tabs");a.each(["href","load","cache"],function(j,l){f.removeData(l+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});i.cookie&&this._cookie(null,i.cookie);return this},add:function(i,
|
||||
b,f){if(f===d)f=this.anchors.length;var j=this,l=this.options;b=a(l.tabTemplate.replace(/#\{href\}/g,i).replace(/#\{label\}/g,b));i=!i.indexOf("#")?i.replace("#",""):this._tabId(a("a",b)[0]);b.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var o=j.element.find("#"+i);o.length||(o=a(l.panelTemplate).attr("id",i).data("destroy.tabs",true));o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(f>=this.lis.length){b.appendTo(this.list);o.appendTo(this.list[0].parentNode)}else{b.insertBefore(this.lis[f]);
|
||||
o.insertBefore(this.panels[f])}l.disabled=a.map(l.disabled,function(n){return n>=f?++n:n});this._tabify();if(this.anchors.length==1){l.selected=0;b.addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[f],this.panels[f]));return this},remove:function(i){i=this._getIndex(i);var b=this.options,f=this.lis.eq(i).remove(),j=this.panels.eq(i).remove();
|
||||
if(f.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(i+(i+1<this.anchors.length?1:-1));b.disabled=a.map(a.grep(b.disabled,function(l){return l!=i}),function(l){return l>=i?--l:l});this._tabify();this._trigger("remove",null,this._ui(f.find("a")[0],j[0]));return this},enable:function(i){i=this._getIndex(i);var b=this.options;if(a.inArray(i,b.disabled)!=-1){this.lis.eq(i).removeClass("ui-state-disabled");b.disabled=a.grep(b.disabled,function(f){return f!=i});this._trigger("enable",null,
|
||||
this._ui(this.anchors[i],this.panels[i]));return this}},disable:function(i){i=this._getIndex(i);var b=this.options;if(i!=b.selected){this.lis.eq(i).addClass("ui-state-disabled");b.disabled.push(i);b.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[i],this.panels[i]))}return this},select:function(i){i=this._getIndex(i);if(i==-1)if(this.options.collapsible&&this.options.selected!=-1)i=this.options.selected;else return this;this.anchors.eq(i).trigger(this.options.event+".tabs");return this},
|
||||
load:function(i){i=this._getIndex(i);var b=this,f=this.options,j=this.anchors.eq(i)[0],l=a.data(j,"load.tabs");this.abort();if(!l||this.element.queue("tabs").length!==0&&a.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(i).addClass("ui-state-processing");if(f.spinner){var o=a("span",j);o.data("label.tabs",o.html()).html(f.spinner)}this.xhr=a.ajax(a.extend({},f.ajaxOptions,{url:l,success:function(n,k){b.element.find(b._sanitizeSelector(j.hash)).html(n);b._cleanup();f.cache&&a.data(j,
|
||||
"cache.tabs",true);b._trigger("load",null,b._ui(b.anchors[i],b.panels[i]));try{f.ajaxOptions.success(n,k)}catch(m){}},error:function(n,k){b._cleanup();b._trigger("load",null,b._ui(b.anchors[i],b.panels[i]));try{f.ajaxOptions.error(n,k,i,j)}catch(m){}}}));b.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
|
||||
url:function(i,b){this.anchors.eq(i).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.8.16"});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(i,b){var f=this,j=this.options,l=f._rotate||(f._rotate=function(o){clearTimeout(f.rotation);f.rotation=setTimeout(function(){var n=j.selected;f.select(++n<f.anchors.length?n:0)},i);o&&o.stopPropagation()});b=f._unrotate||(f._unrotate=!b?function(o){o.clientX&&
|
||||
f.rotate(null)}:function(){t=j.selected;l()});if(i){this.element.bind("tabsshow",l);this.anchors.bind(j.event+".tabs",b);l()}else{clearTimeout(f.rotation);this.element.unbind("tabsshow",l);this.anchors.unbind(j.event+".tabs",b);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
|
||||
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Cookie plugin
|
||||
*
|
||||
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a cookie with the given name and value and other optional parameters.
|
||||
*
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Set the value of a cookie.
|
||||
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
|
||||
* @desc Create a cookie with all available options.
|
||||
* @example $.cookie('the_cookie', 'the_value');
|
||||
* @desc Create a session cookie.
|
||||
* @example $.cookie('the_cookie', null);
|
||||
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
|
||||
* used when the cookie was set.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @param String value The value of the cookie.
|
||||
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
|
||||
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
|
||||
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
|
||||
* If set to null or omitted, the cookie will be a session cookie and will not be retained
|
||||
* when the the browser exits.
|
||||
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
|
||||
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
|
||||
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
|
||||
* require a secure protocol (like HTTPS).
|
||||
* @type undefined
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the value of a cookie with the given name.
|
||||
*
|
||||
* @example $.cookie('the_cookie');
|
||||
* @desc Get the value of a cookie.
|
||||
*
|
||||
* @param String name The name of the cookie.
|
||||
* @return The value of the cookie.
|
||||
* @type String
|
||||
*
|
||||
* @name $.cookie
|
||||
* @cat Plugins/Cookie
|
||||
* @author Klaus Hartl/klaus.hartl@stilbuero.de
|
||||
*/
|
||||
jQuery.cookie = function(name, value, options) {
|
||||
if (typeof value != 'undefined') { // name and value given, set cookie
|
||||
options = options || {};
|
||||
if (value === null) {
|
||||
value = '';
|
||||
options.expires = -1;
|
||||
}
|
||||
var expires = '';
|
||||
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
||||
var date;
|
||||
if (typeof options.expires == 'number') {
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
date = options.expires;
|
||||
}
|
||||
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
||||
}
|
||||
// CAUTION: Needed to parenthesize options.path and options.domain
|
||||
// in the following expressions, otherwise they evaluate to undefined
|
||||
// in the packed version for some reason...
|
||||
var path = options.path ? '; path=' + (options.path) : '';
|
||||
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
||||
var secure = options.secure ? '; secure' : '';
|
||||
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
||||
} else { // only name given, get cookie
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+167
@@ -0,0 +1,167 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v1.4.4
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2010, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* http://sizzlejs.com/
|
||||
* Copyright 2010, The Dojo Foundation
|
||||
* Released under the MIT, BSD, and GPL Licenses.
|
||||
*
|
||||
* Date: Thu Nov 11 19:04:53 2010 -0500
|
||||
*/
|
||||
(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
|
||||
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
|
||||
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
|
||||
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
|
||||
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
|
||||
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
|
||||
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
||||
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
|
||||
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
|
||||
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
|
||||
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
|
||||
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
|
||||
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
|
||||
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
|
||||
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
|
||||
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
|
||||
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
|
||||
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
|
||||
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
|
||||
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
|
||||
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
|
||||
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
|
||||
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
|
||||
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
|
||||
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
|
||||
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
|
||||
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
|
||||
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
|
||||
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
|
||||
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
|
||||
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
|
||||
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
|
||||
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
|
||||
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
|
||||
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
|
||||
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
|
||||
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
|
||||
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
|
||||
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
|
||||
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
|
||||
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
|
||||
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
|
||||
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
|
||||
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
|
||||
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
|
||||
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
|
||||
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
|
||||
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
|
||||
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
|
||||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
|
||||
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
|
||||
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
|
||||
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
|
||||
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
|
||||
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
|
||||
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
|
||||
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
|
||||
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
|
||||
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
|
||||
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
|
||||
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
|
||||
c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
|
||||
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
|
||||
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
|
||||
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
|
||||
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
|
||||
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
|
||||
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
|
||||
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
|
||||
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
|
||||
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
|
||||
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
|
||||
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
|
||||
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
|
||||
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
|
||||
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
|
||||
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
|
||||
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
|
||||
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
|
||||
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
|
||||
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
|
||||
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
|
||||
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
|
||||
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
|
||||
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
|
||||
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
|
||||
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
|
||||
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
|
||||
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
|
||||
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
|
||||
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
|
||||
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
|
||||
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
|
||||
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
|
||||
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
|
||||
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
|
||||
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
|
||||
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
|
||||
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
|
||||
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
|
||||
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
|
||||
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
|
||||
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
|
||||
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
|
||||
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
|
||||
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
|
||||
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
|
||||
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
|
||||
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
|
||||
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
|
||||
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
|
||||
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
|
||||
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
|
||||
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
|
||||
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
||||
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
|
||||
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
|
||||
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
|
||||
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
|
||||
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
|
||||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
|
||||
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
|
||||
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
|
||||
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
|
||||
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
|
||||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
|
||||
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
|
||||
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
|
||||
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
|
||||
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
|
||||
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
|
||||
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
|
||||
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
|
||||
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
|
||||
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
|
||||
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
|
||||
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
|
||||
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
|
||||
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
|
||||
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
|
||||
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
|
||||
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
|
||||
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
|
||||
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
|
||||
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
|
||||
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
|
||||
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
|
||||
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
|
||||
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
|
||||
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
|
||||
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
|
||||
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* SimpleModal 1.4.3 - jQuery Plugin
|
||||
* http://simplemodal.com/
|
||||
* Copyright (c) 2012 Eric Martin
|
||||
* Licensed under MIT and GPL
|
||||
* Date: Sat, Sep 8 2012 07:52:31 -0700
|
||||
*/
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):b(jQuery)})(function(b){var j=[],l=b(document),m=b.browser.msie&&6===parseInt(b.browser.version)&&"object"!==typeof window.XMLHttpRequest,o=b.browser.msie&&7===parseInt(b.browser.version),n=null,k=b(window),h=[];b.modal=function(a,d){return b.modal.impl.init(a,d)};b.modal.close=function(){b.modal.impl.close()};b.modal.focus=function(a){b.modal.impl.focus(a)};b.modal.setContainerDimensions=function(){b.modal.impl.setContainerDimensions()};
|
||||
b.modal.setPosition=function(){b.modal.impl.setPosition()};b.modal.update=function(a,d){b.modal.impl.update(a,d)};b.fn.modal=function(a){return b.modal.impl.init(this,a)};b.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1E3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',
|
||||
closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null};b.modal.impl={d:{},init:function(a,d){if(this.d.data)return!1;n=b.browser.msie&&!b.support.boxModel;this.o=b.extend({},b.modal.defaults,d);this.zIndex=this.o.zIndex;this.occb=!1;if("object"===typeof a){if(a=a instanceof b?a:b(a),this.d.placeholder=!1,0<a.parent().parent().size()&&(a.before(b("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),
|
||||
this.d.placeholder=!0,this.display=a.css("display"),!this.o.persist))this.d.orig=a.clone(!0)}else if("string"===typeof a||"number"===typeof a)a=b("<div></div>").html(a);else return alert("SimpleModal Error: Unsupported data type: "+typeof a),this;this.create(a);this.open();b.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]);return this},create:function(a){this.getDimensions();if(this.o.modal&&m)this.d.iframe=b('<iframe src="javascript:false;"></iframe>').css(b.extend(this.o.iframeCss,
|
||||
{display:"none",opacity:0,position:"fixed",height:h[0],width:h[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo);this.d.overlay=b("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?j[0]:0,width:this.o.modal?j[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo);this.d.container=b("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(b.extend({position:this.o.fixed?
|
||||
"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?b(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo);this.d.wrap=b("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container);this.d.data=a.attr("id",a.attr("id")||this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss,{display:"none"})).appendTo("body");this.setContainerDimensions();
|
||||
this.d.data.appendTo(this.d.wrap);(m||n)&&this.fixIE()},bindEvents:function(){var a=this;b("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});l.bind("keydown.simplemodal",function(b){a.o.modal&&9===b.keyCode?a.watchTab(b):a.o.close&&a.o.escClose&&27===b.keyCode&&(b.preventDefault(),a.close())});k.bind("resize.simplemodal orientationchange.simplemodal",
|
||||
function(){a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();m||n?a.fixIE():a.o.modal&&(a.d.iframe&&a.d.iframe.css({height:h[0],width:h[1]}),a.d.overlay.css({height:j[0],width:j[1]}))})},unbindEvents:function(){b("."+this.o.closeClass).unbind("click.simplemodal");l.unbind("keydown.simplemodal");k.unbind(".simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this.o.position;b.each([this.d.iframe||null,!this.o.modal?null:this.d.overlay,
|
||||
"fixed"===this.d.container.css("position")?this.d.container:null],function(b,f){if(f){var g=f[0].style;g.position="absolute";if(2>b)g.removeExpression("height"),g.removeExpression("width"),g.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),g.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else{var c,e;a&&a.constructor===
|
||||
Array?(c=a[0]?"number"===typeof a[0]?a[0].toString():a[0].replace(/px/,""):f.css("top").replace(/px/,""),c=-1===c.indexOf("%")?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',a[1]&&(e="number"===typeof a[1]?
|
||||
a[1].toString():a[1].replace(/px/,""),e=-1===e.indexOf("%")?e+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(e.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(c='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',
|
||||
e='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"');g.removeExpression("top");g.removeExpression("left");g.setExpression("top",c);g.setExpression("left",e)}}})},focus:function(a){var d=this,a=a&&-1!==b.inArray(a,["first","last"])?a:"first",f=b(":input:enabled:visible:"+a,d.d.wrap);setTimeout(function(){0<f.length?f.focus():d.d.wrap.focus()},
|
||||
10)},getDimensions:function(){var a="undefined"===typeof window.innerHeight?k.height():window.innerHeight;j=[l.height(),l.width()];h=[a,k.width()]},getVal:function(a,b){return a?"number"===typeof a?a:"auto"===a?0:0<a.indexOf("%")?parseInt(a.replace(/%/,""))/100*("h"===b?h[0]:h[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){if(!this.d.data)return!1;this.d.origHeight=this.getVal(a,"h");this.d.origWidth=this.getVal(b,"w");this.d.data.hide();a&&this.d.container.css("height",a);b&&this.d.container.css("width",
|
||||
b);this.setContainerDimensions();this.d.data.show();this.o.focus&&this.focus();this.unbindEvents();this.bindEvents()},setContainerDimensions:function(){var a=m||o,d=this.d.origHeight?this.d.origHeight:b.browser.opera?this.d.container.height():this.getVal(a?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h"),a=this.d.origWidth?this.d.origWidth:b.browser.opera?this.d.container.width():this.getVal(a?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w"),f=this.d.data.outerHeight(!0),
|
||||
g=this.d.data.outerWidth(!0);this.d.origHeight=this.d.origHeight||d;this.d.origWidth=this.d.origWidth||a;var c=this.o.maxHeight?this.getVal(this.o.maxHeight,"h"):null,e=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,c=c&&c<h[0]?c:h[0],e=e&&e<h[1]?e:h[1],i=this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto",d=d?this.o.autoResize&&d>c?c:d<i?i:d:f?f>c?c:this.o.minHeight&&"auto"!==i&&f<i?i:f:i,c=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",a=a?this.o.autoResize&&a>e?e:a<c?c:a:
|
||||
g?g>e?e:this.o.minWidth&&"auto"!==c&&g<c?c:g:c;this.d.container.css({height:d,width:a});this.d.wrap.css({overflow:f>d||g>a?"auto":"visible"});this.o.autoPosition&&this.setPosition()},setPosition:function(){var a,b;a=h[0]/2-this.d.container.outerHeight(!0)/2;b=h[1]/2-this.d.container.outerWidth(!0)/2;var f="fixed"!==this.d.container.css("position")?k.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(a=f+(this.o.position[0]||a),b=this.o.position[1]||
|
||||
b):a=f+a;this.d.container.css({left:b,top:a})},watchTab:function(a){if(0<b(a.target).parents(".simplemodal-container").length){if(this.inputs=b(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),!a.shiftKey&&a.target===this.inputs[this.inputs.length-1]||a.shiftKey&&a.target===this.inputs[0]||0===this.inputs.length)a.preventDefault(),this.focus(a.shiftKey?"last":"first")}else a.preventDefault(),this.focus()},open:function(){this.d.iframe&&this.d.iframe.show();b.isFunction(this.o.onOpen)?
|
||||
this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show());this.o.focus&&this.focus();this.bindEvents()},close:function(){if(!this.d.data)return!1;this.unbindEvents();if(b.isFunction(this.o.onClose)&&!this.occb)this.occb=!0,this.o.onClose.apply(this,[this.d]);else{if(this.d.placeholder){var a=b("#simplemodal-placeholder");this.o.persist?a.replaceWith(this.d.data.removeClass("simplemodal-data").css("display",this.display)):(this.d.data.hide().remove(),a.replaceWith(this.d.orig))}else this.d.data.hide().remove();
|
||||
this.d.container.hide().remove();this.d.overlay.hide();this.d.iframe&&this.d.iframe.hide().remove();this.d.overlay.remove();this.d={}}}}});
|
||||
@@ -0,0 +1,351 @@
|
||||
|
||||
/*
|
||||
Lightbox v2.51
|
||||
by Lokesh Dhakar - http://www.lokeshdhakar.com
|
||||
|
||||
For more information, visit:
|
||||
http://lokeshdhakar.com/projects/lightbox2/
|
||||
|
||||
Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
|
||||
- free for use in both personal and commercial projects
|
||||
- attribution requires leaving author name, author link, and the license info intact
|
||||
|
||||
Thanks
|
||||
- Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.com), and Thomas Fuchs(mir.aculo.us) for ideas, libs, and snippets.
|
||||
- Artemy Tregubenko (arty.name) for cleanup and help in updating to latest proto-aculous in v2.05.
|
||||
|
||||
|
||||
Table of Contents
|
||||
=================
|
||||
LightboxOptions
|
||||
|
||||
Lightbox
|
||||
- constructor
|
||||
- init
|
||||
- enable
|
||||
- build
|
||||
- start
|
||||
- changeImage
|
||||
- sizeContainer
|
||||
- showImage
|
||||
- updateNav
|
||||
- updateDetails
|
||||
- preloadNeigbhoringImages
|
||||
- enableKeyboardNav
|
||||
- disableKeyboardNav
|
||||
- keyboardAction
|
||||
- end
|
||||
|
||||
options = new LightboxOptions
|
||||
lightbox = new Lightbox options
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var $, Lightbox, LightboxOptions;
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
LightboxOptions = (function() {
|
||||
|
||||
function LightboxOptions() {
|
||||
this.fileLoadingImage = '/media/lightbox/loading.gif';
|
||||
this.fileCloseImage = '/media/lightbox/close.png';
|
||||
this.resizeDuration = 700;
|
||||
this.fadeDuration = 500;
|
||||
this.labelImage = "Image";
|
||||
this.labelOf = "of";
|
||||
}
|
||||
|
||||
return LightboxOptions;
|
||||
|
||||
})();
|
||||
|
||||
Lightbox = (function() {
|
||||
|
||||
function Lightbox(options) {
|
||||
this.options = options;
|
||||
this.album = [];
|
||||
this.currentImageIndex = void 0;
|
||||
this.init();
|
||||
}
|
||||
|
||||
Lightbox.prototype.init = function() {
|
||||
this.enable();
|
||||
return this.build();
|
||||
};
|
||||
|
||||
Lightbox.prototype.enable = function() {
|
||||
var _this = this;
|
||||
return $('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox]', function(e) {
|
||||
_this.start($(e.currentTarget));
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
Lightbox.prototype.build = function() {
|
||||
var $lightbox,
|
||||
_this = this;
|
||||
$("<div>", {
|
||||
id: 'lightboxOverlay'
|
||||
}).after($('<div/>', {
|
||||
id: 'lightbox'
|
||||
}).append($('<div/>', {
|
||||
"class": 'lb-outerContainer'
|
||||
}).append($('<div/>', {
|
||||
"class": 'lb-container'
|
||||
}).append($('<img/>', {
|
||||
"class": 'lb-image'
|
||||
}), $('<div/>', {
|
||||
"class": 'lb-nav'
|
||||
}).append($('<a/>', {
|
||||
"class": 'lb-prev'
|
||||
}), $('<a/>', {
|
||||
"class": 'lb-next'
|
||||
})), $('<div/>', {
|
||||
"class": 'lb-loader'
|
||||
}).append($('<a/>', {
|
||||
"class": 'lb-cancel'
|
||||
}).append($('<img/>', {
|
||||
src: this.options.fileLoadingImage
|
||||
}))))), $('<div/>', {
|
||||
"class": 'lb-dataContainer'
|
||||
}).append($('<div/>', {
|
||||
"class": 'lb-data'
|
||||
}).append($('<div/>', {
|
||||
"class": 'lb-details'
|
||||
}).append($('<span/>', {
|
||||
"class": 'lb-caption'
|
||||
}), $('<span/>', {
|
||||
"class": 'lb-number'
|
||||
})), $('<div/>', {
|
||||
"class": 'lb-closeContainer'
|
||||
}).append($('<a/>', {
|
||||
"class": 'lb-close'
|
||||
}).append($('<img/>', {
|
||||
src: this.options.fileCloseImage
|
||||
}))))))).appendTo($('body'));
|
||||
$('#lightboxOverlay').hide().on('click', function(e) {
|
||||
_this.end();
|
||||
return false;
|
||||
});
|
||||
$lightbox = $('#lightbox');
|
||||
$lightbox.hide().on('click', function(e) {
|
||||
if ($(e.target).attr('id') === 'lightbox') _this.end();
|
||||
return false;
|
||||
});
|
||||
$lightbox.find('.lb-outerContainer').on('click', function(e) {
|
||||
if ($(e.target).attr('id') === 'lightbox') _this.end();
|
||||
return false;
|
||||
});
|
||||
$lightbox.find('.lb-prev').on('click', function(e) {
|
||||
_this.changeImage(_this.currentImageIndex - 1);
|
||||
return false;
|
||||
});
|
||||
$lightbox.find('.lb-next').on('click', function(e) {
|
||||
_this.changeImage(_this.currentImageIndex + 1);
|
||||
return false;
|
||||
});
|
||||
$lightbox.find('.lb-loader, .lb-close').on('click', function(e) {
|
||||
_this.end();
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
Lightbox.prototype.start = function($link) {
|
||||
var $lightbox, $window, a, i, imageNumber, left, top, _len, _ref;
|
||||
$(window).on("resize", this.sizeOverlay);
|
||||
$('select, object, embed').css({
|
||||
visibility: "hidden"
|
||||
});
|
||||
$('#lightboxOverlay').width($(document).width()).height($(document).height()).fadeIn(this.options.fadeDuration);
|
||||
this.album = [];
|
||||
imageNumber = 0;
|
||||
if ($link.attr('rel') === 'lightbox') {
|
||||
this.album.push({
|
||||
link: $link.attr('href'),
|
||||
title: $link.attr('title')
|
||||
});
|
||||
} else {
|
||||
_ref = $($link.prop("tagName") + '[rel="' + $link.attr('rel') + '"]');
|
||||
for (i = 0, _len = _ref.length; i < _len; i++) {
|
||||
a = _ref[i];
|
||||
this.album.push({
|
||||
link: $(a).attr('href'),
|
||||
title: $(a).attr('title')
|
||||
});
|
||||
if ($(a).attr('href') === $link.attr('href')) imageNumber = i;
|
||||
}
|
||||
}
|
||||
$window = $(window);
|
||||
top = $window.scrollTop() + $window.height() / 10;
|
||||
left = $window.scrollLeft();
|
||||
$lightbox = $('#lightbox');
|
||||
$lightbox.css({
|
||||
top: top + 'px',
|
||||
left: left + 'px'
|
||||
}).fadeIn(this.options.fadeDuration);
|
||||
this.changeImage(imageNumber);
|
||||
};
|
||||
|
||||
Lightbox.prototype.changeImage = function(imageNumber) {
|
||||
var $image, $lightbox, preloader,
|
||||
_this = this;
|
||||
this.disableKeyboardNav();
|
||||
$lightbox = $('#lightbox');
|
||||
$image = $lightbox.find('.lb-image');
|
||||
this.sizeOverlay();
|
||||
$('#lightboxOverlay').fadeIn(this.options.fadeDuration);
|
||||
$('.loader').fadeIn('slow');
|
||||
$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
|
||||
$lightbox.find('.lb-outerContainer').addClass('animating');
|
||||
preloader = new Image;
|
||||
preloader.onload = function() {
|
||||
$image.attr('src', _this.album[imageNumber].link);
|
||||
$image.width = preloader.width;
|
||||
$image.height = preloader.height;
|
||||
return _this.sizeContainer(preloader.width, preloader.height);
|
||||
};
|
||||
preloader.src = this.album[imageNumber].link;
|
||||
this.currentImageIndex = imageNumber;
|
||||
};
|
||||
|
||||
Lightbox.prototype.sizeOverlay = function() {
|
||||
return $('#lightboxOverlay').width($(document).width()).height($(document).height());
|
||||
};
|
||||
|
||||
Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {
|
||||
var $container, $lightbox, $outerContainer, containerBottomPadding, containerLeftPadding, containerRightPadding, containerTopPadding, newHeight, newWidth, oldHeight, oldWidth,
|
||||
_this = this;
|
||||
$lightbox = $('#lightbox');
|
||||
$outerContainer = $lightbox.find('.lb-outerContainer');
|
||||
oldWidth = $outerContainer.outerWidth();
|
||||
oldHeight = $outerContainer.outerHeight();
|
||||
$container = $lightbox.find('.lb-container');
|
||||
containerTopPadding = parseInt($container.css('padding-top'), 10);
|
||||
containerRightPadding = parseInt($container.css('padding-right'), 10);
|
||||
containerBottomPadding = parseInt($container.css('padding-bottom'), 10);
|
||||
containerLeftPadding = parseInt($container.css('padding-left'), 10);
|
||||
newWidth = imageWidth + containerLeftPadding + containerRightPadding;
|
||||
newHeight = imageHeight + containerTopPadding + containerBottomPadding;
|
||||
if (newWidth !== oldWidth && newHeight !== oldHeight) {
|
||||
$outerContainer.animate({
|
||||
width: newWidth,
|
||||
height: newHeight
|
||||
}, this.options.resizeDuration, 'swing');
|
||||
} else if (newWidth !== oldWidth) {
|
||||
$outerContainer.animate({
|
||||
width: newWidth
|
||||
}, this.options.resizeDuration, 'swing');
|
||||
} else if (newHeight !== oldHeight) {
|
||||
$outerContainer.animate({
|
||||
height: newHeight
|
||||
}, this.options.resizeDuration, 'swing');
|
||||
}
|
||||
setTimeout(function() {
|
||||
$lightbox.find('.lb-dataContainer').width(newWidth);
|
||||
$lightbox.find('.lb-prevLink').height(newHeight);
|
||||
$lightbox.find('.lb-nextLink').height(newHeight);
|
||||
_this.showImage();
|
||||
}, this.options.resizeDuration);
|
||||
};
|
||||
|
||||
Lightbox.prototype.showImage = function() {
|
||||
var $lightbox;
|
||||
$lightbox = $('#lightbox');
|
||||
$lightbox.find('.lb-loader').hide();
|
||||
$lightbox.find('.lb-image').fadeIn('slow');
|
||||
this.updateNav();
|
||||
this.updateDetails();
|
||||
this.preloadNeighboringImages();
|
||||
this.enableKeyboardNav();
|
||||
};
|
||||
|
||||
Lightbox.prototype.updateNav = function() {
|
||||
var $lightbox;
|
||||
$lightbox = $('#lightbox');
|
||||
$lightbox.find('.lb-nav').show();
|
||||
if (this.currentImageIndex > 0) $lightbox.find('.lb-prev').show();
|
||||
if (this.currentImageIndex < this.album.length - 1) {
|
||||
$lightbox.find('.lb-next').show();
|
||||
}
|
||||
};
|
||||
|
||||
Lightbox.prototype.updateDetails = function() {
|
||||
var $lightbox,
|
||||
_this = this;
|
||||
$lightbox = $('#lightbox');
|
||||
if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") {
|
||||
$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast');
|
||||
}
|
||||
if (this.album.length > 1) {
|
||||
$lightbox.find('.lb-number').html(this.options.labelImage + ' ' + (this.currentImageIndex + 1) + ' ' + this.options.labelOf + ' ' + this.album.length).fadeIn('fast');
|
||||
} else {
|
||||
$lightbox.find('.lb-number').hide();
|
||||
}
|
||||
$lightbox.find('.lb-outerContainer').removeClass('animating');
|
||||
$lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function() {
|
||||
return _this.sizeOverlay();
|
||||
});
|
||||
};
|
||||
|
||||
Lightbox.prototype.preloadNeighboringImages = function() {
|
||||
var preloadNext, preloadPrev;
|
||||
if (this.album.length > this.currentImageIndex + 1) {
|
||||
preloadNext = new Image;
|
||||
preloadNext.src = this.album[this.currentImageIndex + 1].link;
|
||||
}
|
||||
if (this.currentImageIndex > 0) {
|
||||
preloadPrev = new Image;
|
||||
preloadPrev.src = this.album[this.currentImageIndex - 1].link;
|
||||
}
|
||||
};
|
||||
|
||||
Lightbox.prototype.enableKeyboardNav = function() {
|
||||
$(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));
|
||||
};
|
||||
|
||||
Lightbox.prototype.disableKeyboardNav = function() {
|
||||
$(document).off('.keyboard');
|
||||
};
|
||||
|
||||
Lightbox.prototype.keyboardAction = function(event) {
|
||||
var KEYCODE_ESC, KEYCODE_LEFTARROW, KEYCODE_RIGHTARROW, key, keycode;
|
||||
KEYCODE_ESC = 27;
|
||||
KEYCODE_LEFTARROW = 37;
|
||||
KEYCODE_RIGHTARROW = 39;
|
||||
keycode = event.keyCode;
|
||||
key = String.fromCharCode(keycode).toLowerCase();
|
||||
if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {
|
||||
this.end();
|
||||
} else if (key === 'p' || keycode === KEYCODE_LEFTARROW) {
|
||||
if (this.currentImageIndex !== 0) {
|
||||
this.changeImage(this.currentImageIndex - 1);
|
||||
}
|
||||
} else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) {
|
||||
if (this.currentImageIndex !== this.album.length - 1) {
|
||||
this.changeImage(this.currentImageIndex + 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Lightbox.prototype.end = function() {
|
||||
this.disableKeyboardNav();
|
||||
$(window).off("resize", this.sizeOverlay);
|
||||
$('#lightbox').fadeOut(this.options.fadeDuration);
|
||||
$('#lightboxOverlay').fadeOut(this.options.fadeDuration);
|
||||
return $('select, object, embed').css({
|
||||
visibility: "visible"
|
||||
});
|
||||
};
|
||||
|
||||
return Lightbox;
|
||||
|
||||
})();
|
||||
|
||||
$(function() {
|
||||
var lightbox, options;
|
||||
options = new LightboxOptions;
|
||||
return lightbox = new Lightbox(options);
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* Version: 0.6.0
|
||||
*
|
||||
*/
|
||||
(function(d){jQuery.fn.extend({slimScroll:function(p){var a=ops=d.extend({wheelStep:20,width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:"0.2",railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,scroll:0},p);this.each(function(){function i(a,d,e){var f=a;d&&(f=parseInt(c.css("top"))+a*C/100*c.outerHeight(),d=b.outerHeight()-
|
||||
c.outerHeight(),f=Math.min(Math.max(f,0),d),c.css({top:f+"px"}));g=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());f=g*(b[0].scrollHeight-b.outerHeight());e&&(f=a,a=f/b[0].scrollHeight*b.outerHeight(),c.css({top:a+"px"}));b.scrollTop(f);q();j()}function w(){r=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),p);c.css({height:r+"px"})}function q(){w();clearTimeout(x);g==~~g&&(l=D,y!=g&&b.trigger("slimscroll",0==~~g?"top":"bottom"));y=g;r>=b.outerHeight()?l=!0:(c.stop(!0,!0).fadeIn("fast"),
|
||||
z&&h.stop(!0,!0).fadeIn("fast"))}function j(){m||(x=setTimeout(function(){if((!E||!n)&&!s&&!t)c.fadeOut("slow"),h.fadeOut("slow")},1E3))}var n,s,t,x,r,g,y,p=30,l=!1,C=parseInt(a.wheelStep),k=a.width,A=a.height,e=a.size,F=a.color,G=a.position,B=a.distance,u=a.start,H=a.opacity,E=a.disableFadeOut,m=a.alwaysVisible,z=a.railVisible,I=a.railColor,J=a.railOpacity,D=a.allowPageScroll,o=a.scroll,b=d(this);if(b.parent().hasClass("slimScrollDiv"))o&&(c=b.parent().find(".slimScrollBar"),h=b.parent().find(".slimScrollRail"),
|
||||
i(b.scrollTop()+parseInt(o),!1,!0));else{o=d("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:k,height:A});b.css({overflow:"hidden",width:k,height:A});var h=d("<div></div>").addClass(a.railClass).css({width:e,height:"100%",position:"absolute",top:0,display:m&&z?"block":"none","border-radius":e,background:I,opacity:J,zIndex:90}),c=d("<div></div>").addClass(a.barClass).css({background:F,width:e,position:"absolute",top:0,opacity:H,display:m?"block":"none","border-radius":e,
|
||||
BorderRadius:e,MozBorderRadius:e,WebkitBorderRadius:e,zIndex:99}),k="right"==G?{right:B}:{left:B};h.css(k);c.css(k);b.wrap(o);b.parent().append(c);b.parent().append(h);c.draggable({axis:"y",containment:"parent",start:function(){t=!0},stop:function(){t=!1;j()},drag:function(){i(0,d(this).position().top,!1)}});h.hover(function(){q()},function(){j()});c.hover(function(){s=!0},function(){s=!1});b.hover(function(){n=!0;q();j()},function(){n=!1;j()});var v=function(a){if(n){var a=a||window.event,b=0;a.wheelDelta&&
|
||||
(b=-a.wheelDelta/120);a.detail&&(b=a.detail/3);i(b,!0);a.preventDefault&&!l&&a.preventDefault();l||(a.returnValue=!1)}};(function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)})();w();"bottom"==u?(c.css({top:b.outerHeight()-c.outerHeight()}),i(0,!0)):"object"==typeof u&&(i(d(u).position().top,null,!0),m||c.hide())}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
<?php
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
$user = new User();
|
||||
$user->login();
|
||||
|
||||
require_once( 'lib/cache.php' );
|
||||
$cache = new Cache( Config::$cache['path'], '' );
|
||||
|
||||
if( isset($_GET['addTags']) && $user->id && strlen(trim($_POST['tags'])) >= 3 ) {
|
||||
$i = DB::getRow( 'SELECT id, tags, keyword FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] );
|
||||
if( !empty( $i ) ) {
|
||||
if($user->admin) {
|
||||
$tags = trim($_POST['tags']);
|
||||
} else {
|
||||
$tags = trim(trim($i['tags'])." ".trim($_POST['tags']));
|
||||
}
|
||||
DB::updateRow( TABLE_IMAGES,
|
||||
array('id' => $i['id']),
|
||||
array( 'tags' => $tags )
|
||||
);
|
||||
|
||||
$score = strlen(trim($_POST['tags'])) * Config::$tagScorePerChar;
|
||||
$user->increaseScore( min($score, Config::$tagScoreMax) );
|
||||
$cache->clear( $i['keyword'] );
|
||||
|
||||
echo '{"id":"'.$i['id'].'","tags":"'.addslashes(htmlspecialchars($tags)).'"}';
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if( isset($_GET['quickTag']) && $user->id ) {
|
||||
if( !empty($_POST['id']) ) {
|
||||
|
||||
// remove lock
|
||||
DB::updateRow( TABLE_TAGLOG,
|
||||
array( 'id' => $_POST['logId'], 'userId' => $user->id ),
|
||||
array( 'locked' => 0 )
|
||||
);
|
||||
|
||||
if( strlen(trim($_POST['tags'])) >= 3 ) {
|
||||
$i = DB::getRow( 'SELECT id, tags, keyword FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] );
|
||||
if( !empty( $i ) ) {
|
||||
$tags = trim(trim($i['tags'])." ".trim($_POST['tags']));
|
||||
DB::updateRow( TABLE_IMAGES,
|
||||
array('id' => $i['id']),
|
||||
array( 'tags' => $tags )
|
||||
);
|
||||
}
|
||||
$score = strlen(trim($_POST['tags'])) * Config::$tagScorePerChar;
|
||||
$user->increaseScore( min($score, Config::$tagScoreMax) );
|
||||
$cache->clear( $i['keyword'] );
|
||||
}
|
||||
}
|
||||
|
||||
$i = DB::getRow(
|
||||
'SELECT i.id, i.keyword, i.tags, i.image, UNIX_TIMESTAMP(i.logged) AS loggedTS
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
LEFT JOIN '.TABLE_TAGLOG.' t
|
||||
ON t.imageId = i.id AND (
|
||||
(
|
||||
t.userId = :1 AND
|
||||
t.tagged > NOW() - INTERVAL 24 HOUR
|
||||
) OR (
|
||||
t.locked = 1 AND
|
||||
t.tagged > NOW() - INTERVAL 5 MINUTE
|
||||
)
|
||||
)
|
||||
WHERE t.id IS NULL
|
||||
ORDER BY LENGTH(i.tags), i.logged DESC
|
||||
LIMIT 1',
|
||||
$user->id
|
||||
);
|
||||
if( !empty( $i ) ) {
|
||||
DB::insertRow( TABLE_TAGLOG,
|
||||
array(
|
||||
'tagged' => date( 'Y.m.d H:i:s' ),
|
||||
'userId' => $user->id,
|
||||
'imageId' => $i['id'],
|
||||
'locked' => 1
|
||||
)
|
||||
);
|
||||
$logId = DB::insertId();
|
||||
$link = Config::$absolutePath.'all/view/'.$i['keyword'];
|
||||
$image =
|
||||
Config::$absolutePath
|
||||
.Config::$images['imagePath']
|
||||
.date('Y/m/', $i['loggedTS'])
|
||||
.$i['image'];
|
||||
|
||||
echo '{"id":"'.$i['id'].'","tags":"'.addslashes(htmlspecialchars($i['tags'])).'"'
|
||||
.',"link":"'.$link.'","image":"'.$image.'","logId":"'.$logId.'"}';
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
else if( isset($_GET['delete']) && $user->id && $user->admin ) {
|
||||
|
||||
|
||||
$i = DB::getRow( 'SELECT * FROM pl_images WHERE id=:1', $_POST['id'] );
|
||||
if ($i["hash"] != "x") {
|
||||
DB::insertRow("pl_bannedimages",array("hash"=>$i["hash"]));
|
||||
}
|
||||
if( !empty($i) ) {
|
||||
|
||||
$cmts = DB::query("SELECT * FROM pl_comments WHERE imageId=:1",$_POST['id']);
|
||||
|
||||
foreach (array_keys($cmts) as $k){
|
||||
|
||||
|
||||
$commentimg = DB::getRow( 'SELECT * FROM pl_commentuploads WHERE c_id=:1', $cmts[$k]["id"] );
|
||||
if ($commentimg){
|
||||
if(file_exists($commentimg["image_link"])){
|
||||
unlink($commentimg["image_link"]);
|
||||
}
|
||||
if(file_exists($commentimg["thumb_link"])){
|
||||
unlink($commentimg["thumb_link"]);
|
||||
}
|
||||
if(file_exists(str_replace("64x64","28x28",$commentimg["thumb_link"]))){
|
||||
unlink(str_replace("64x64","128x128",$commentimg["thumb_link"]));
|
||||
}
|
||||
if(file_exists(str_replace("64x64","192x192",$commentimg["thumb_link"]))){
|
||||
unlink(str_replace("64x64","192x192",$commentimg["thumb_link"]));
|
||||
}
|
||||
}
|
||||
DB::query( 'DELETE FROM '.TABLE_COMMENTS.' WHERE id = :1', $cmts[$k]["id"] );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
DB::query( 'DELETE FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] );
|
||||
DB::query( 'DELETE FROM '.TABLE_IMAGECOLORS.' WHERE imageId = :1', $_POST['id'] );
|
||||
DB::query( 'DELETE FROM '.TABLE_COMMENTS.' WHERE imageId = :1', $_POST['id'] );
|
||||
DB::query( 'DELETE FROM pl_abuse WHERE imageid = :1', $_POST['id'] );
|
||||
DB::query( 'DELETE FROM pl_unread WHERE imageid = :1', $_POST['id'] );
|
||||
|
||||
foreach( Config::$gridView['classes'] as $c ) {
|
||||
unlink(
|
||||
Config::$images['thumbPath'] .
|
||||
str_replace( '-', '/', substr( $i['logged'], 0, 7 ) ).'/'.
|
||||
$c['dir'].'/'.
|
||||
$i['thumb']
|
||||
);
|
||||
}
|
||||
|
||||
unlink(
|
||||
Config::$images['imagePath'] .
|
||||
str_replace( '-', '/', substr( $i['logged'], 0, 7 ) ).'/'.
|
||||
$i['image']
|
||||
);
|
||||
|
||||
DB::query(
|
||||
'UPDATE '.TABLE_USERS.' SET images = images -1, score = score - :2
|
||||
WHERE id = :1',
|
||||
$i['user'], Config::$postScore
|
||||
);
|
||||
$cache->clear();
|
||||
}
|
||||
echo "{}";
|
||||
}
|
||||
|
||||
else if( isset($_GET['deleteComment']) && $user->id && $user->admin ) {
|
||||
DB::query( 'DELETE FROM '.TABLE_COMMENTS.' WHERE id = :1', $_POST['id'] );
|
||||
$commentimg = DB::getRow( 'SELECT * FROM pl_commentuploads WHERE c_id=:1', $_POST['id'] );
|
||||
if ($commentimg){
|
||||
if(file_exists($commentimg["image_link"])){
|
||||
unlink($commentimg["image_link"]);
|
||||
}
|
||||
if(file_exists($commentimg["thumb_link"])){
|
||||
unlink($commentimg["thumb_link"]);
|
||||
}
|
||||
if(file_exists(str_replace("64x64","28x28",$commentimg["thumb_link"]))){
|
||||
unlink(str_replace("64x64","128x128",$commentimg["thumb_link"]));
|
||||
}
|
||||
if(file_exists(str_replace("64x64","192x192",$commentimg["thumb_link"]))){
|
||||
unlink(str_replace("64x64","192x192",$commentimg["thumb_link"]));
|
||||
}
|
||||
}
|
||||
//$cache->clear();
|
||||
echo "{}";
|
||||
}
|
||||
else if( isset($_GET['banUser']) && $user->id && $user->admin ) {
|
||||
|
||||
DB::query( 'INSERT INTO pl_banned (id,reason) VALUES (:1,:2)', $_POST['id'],$_POST['rsn']);
|
||||
//$cache->clear();
|
||||
echo "user banned, ".$_POST['id'];
|
||||
|
||||
}else if( isset($_GET['TimeUser']) && $user->id && $user->admin ) {
|
||||
|
||||
DB::updateRow("pl_users",array("id"=>$_POST['id']),array("spamblocked"=>1,"spam_reason"=>$_POST['rsn'],"time"=>$_POST['time']));
|
||||
//$cache->clear();
|
||||
|
||||
|
||||
}else if( isset($_GET['fame']) && $user->id && $user->admin ) {
|
||||
|
||||
DB::updateRow("pl_images",array("id"=>$_POST['id']),array("fame"=>1));
|
||||
//$cache->clear();
|
||||
echo "{}";
|
||||
|
||||
}else if( isset($_GET['CloseThread']) && $user->id && $user->admin ) {
|
||||
|
||||
DB::updateRow("pl_images",array("id"=>$_POST['id']),array("comment"=>1));
|
||||
//$cache->clear();
|
||||
echo "{}";
|
||||
|
||||
}else if( isset($_GET['addfav']) && $user->id) {
|
||||
|
||||
|
||||
$imginfo = DB::getRow("SELECT * FROM pl_images WHERE id=:1",$_POST['id']);
|
||||
|
||||
$countfav = DB::getRow("SELECT COUNT( * ) AS c FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$_POST['id']);
|
||||
if ((int)$countfav["c"] > 0){
|
||||
DB::query("DELETE FROM pl_fav WHERE user=:1 and imageId =:2",$user->id,$_POST['id']);
|
||||
DB::query("DELETE FROM pl_comments WHERE userId=:1 and imageId =:2",$user->id,$_POST['id']);
|
||||
|
||||
$url = Config::$absolutePath.$imginfo["keyword"]."/removefav";
|
||||
|
||||
header('Location:"'.$url.'"');
|
||||
}else{
|
||||
DB::insertRow("pl_fav",array("imageId"=>$_POST['id'],"user"=>$user->id));
|
||||
|
||||
$datenow = date( 'Y.m.d H:i:s' );
|
||||
DB::insertRow( "pl_comments", array(
|
||||
'imageId' => $_POST['id'],
|
||||
'userId' => $user->id,
|
||||
'created' => $datenow,
|
||||
'content' => "i like",
|
||||
'c_like' =>1));
|
||||
|
||||
$url = Config::$absolutePath.$imginfo["keyword"]."/addfav";
|
||||
|
||||
header('Location:"'.$url.'"');
|
||||
}
|
||||
//$cache->clear();
|
||||
echo "{}";
|
||||
|
||||
}else if( isset($_GET['rate']) ) {
|
||||
// score is in valid range / not float?
|
||||
if( in_array( $_POST['score'], array(1,2,3,4,5) ) ) {
|
||||
|
||||
// check if this ip has allready rated this quote
|
||||
list(, $ip) = unpack('l',pack('l',ip2long($_SERVER['REMOTE_ADDR'])));
|
||||
$r = DB::getRow( 'SELECT ip FROM '.TABLE_IPLOCK.'
|
||||
WHERE ip = :1 AND imageId = :2',
|
||||
$ip, $_POST['id']
|
||||
);
|
||||
|
||||
// not rated?
|
||||
if( empty( $r ) ) {
|
||||
// insert ip
|
||||
DB::insertRow( TABLE_IPLOCK,
|
||||
array(
|
||||
'ip' => $ip,
|
||||
'imageId' => $_POST['id'],
|
||||
'ts' => time()
|
||||
)
|
||||
);
|
||||
|
||||
// update score
|
||||
DB::query( 'UPDATE '.TABLE_IMAGES.' SET
|
||||
score = ( score * votes + :1 ) / ( votes + 1 ),
|
||||
votes = votes + 1
|
||||
WHERE id = :2',
|
||||
$_POST['score'], $_POST['id']
|
||||
);
|
||||
|
||||
$user->increaseScore( Config::$votingScore );
|
||||
|
||||
if( rand(1, Config::$cache['clearEvery']) == 1 ) {
|
||||
$cache->clear();
|
||||
}
|
||||
else {
|
||||
$i = DB::getRow( 'SELECT keyword FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] );
|
||||
$cache->clear( $i['keyword'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// delete all ips older than IP_LOCK_TIME
|
||||
DB::query( 'DELETE FROM '.TABLE_IPLOCK.' WHERE ts < :1', time() - Config::$ipLockTime );
|
||||
|
||||
// return JSON Data
|
||||
header( 'Content-Type', 'text/plain' );
|
||||
$r = DB::getRow( 'SELECT id, score, votes FROM '.TABLE_IMAGES.' WHERE id = :1', $_POST['id'] );
|
||||
echo '{"id":"'.$r['id'].'","score":"'.number_format($r['score'],1).'","votes":"'.($r['votes']).'"}';
|
||||
exit(0);
|
||||
}
|
||||
|
||||
echo "{}";
|
||||
|
||||
|
||||
function full_url()
|
||||
{
|
||||
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
|
||||
$protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s;
|
||||
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
|
||||
return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,649 @@
|
||||
<?php
|
||||
/**
|
||||
* Generate a simple api
|
||||
*
|
||||
* @author Daniel Leitner
|
||||
* @version 1.2
|
||||
* @link mail@danielleitner.de
|
||||
*/
|
||||
|
||||
class Api {
|
||||
|
||||
/**
|
||||
* Mysql connection
|
||||
*
|
||||
* @var resource
|
||||
* @access private
|
||||
*/
|
||||
private $_db;
|
||||
|
||||
/**
|
||||
* Store namcespaces
|
||||
*
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
private $_namespaces = array();
|
||||
|
||||
/**
|
||||
* Working namespace name
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
private $_current_namaspace;
|
||||
|
||||
/**
|
||||
* Namespace which is rendered
|
||||
*
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
private $_render_namepsace;
|
||||
|
||||
/**
|
||||
* Url data
|
||||
*
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
private $_route_data;
|
||||
|
||||
/**
|
||||
* Class options
|
||||
*
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
private $_options = array(
|
||||
'output_types' => array(
|
||||
'json', 'xml', 'csv', 'yaml'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Rules to check the route
|
||||
*
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
private $_rules = array(
|
||||
'alpha_numeric', 'numeric'
|
||||
);
|
||||
|
||||
/**
|
||||
* Select result for api
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_result = array();
|
||||
|
||||
/**
|
||||
* Let the magic start ;)
|
||||
*
|
||||
* @param resource $db
|
||||
* @access public
|
||||
*/
|
||||
public function __construct($db) {
|
||||
|
||||
$this->_db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register new namespace
|
||||
*
|
||||
* @param type $namespace
|
||||
* @todo Set defaults to array
|
||||
* @access public
|
||||
* @return Api
|
||||
*/
|
||||
public function register($namespace) {
|
||||
|
||||
if( ! isset($this->_namespaces[$namespace]) ) {
|
||||
$this->_namespaces[$namespace] = array(
|
||||
'key' => false,
|
||||
'sort' => false,
|
||||
'request' => false,
|
||||
'limit' => false,
|
||||
'cache' => false,
|
||||
'conditions' => false
|
||||
);
|
||||
|
||||
$this->_current_namaspace = $namespace;
|
||||
} else {
|
||||
$this->_error('Namespace already exists.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $message
|
||||
* @access private
|
||||
* @todo output
|
||||
* @return Api
|
||||
*/
|
||||
private function _error($message) {
|
||||
header("Content-Type: application/json");
|
||||
|
||||
die(json_encode($message));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set table name
|
||||
*
|
||||
* @param string $table
|
||||
* @return Api
|
||||
*/
|
||||
public function setTable($table) {
|
||||
|
||||
if( is_string($table) ) {
|
||||
$this->_namespaces[$this->_current_namaspace]['table'] = $table;
|
||||
} else {
|
||||
$this->_error('Table name musst be a string.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set output type
|
||||
*
|
||||
* @access public
|
||||
* @param array|string $output
|
||||
* @return Api
|
||||
*/
|
||||
public function setOutput($output) {
|
||||
|
||||
if( is_array($output) ) {
|
||||
foreach($output as $o) {
|
||||
if( ! in_array($o, $this->_options['output_types']) ) {
|
||||
$this->_error('Output as '.$o.' is not supported.');
|
||||
}
|
||||
}
|
||||
|
||||
$this->_namespaces[$this->_current_namaspace]['output'] = $output;
|
||||
} else {
|
||||
|
||||
if( ! in_array($output, $this->_options['output_types']) ) {
|
||||
$this->_error('Output as '.$output.' is not supported.');
|
||||
}
|
||||
|
||||
$this->_namespaces[$this->_current_namaspace]['output'] = $output;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if unique key is required (false = default)
|
||||
*
|
||||
* @access public
|
||||
* @param boolean $key
|
||||
* @return Api
|
||||
*/
|
||||
public function setKey($key) {
|
||||
|
||||
if( is_bool($key) ) {
|
||||
$this->_namespaces[$this->_current_namaspace]['key'] = $key;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set request limit per hour. (false = default)
|
||||
*
|
||||
* @access public
|
||||
* @param integer $limit
|
||||
* @return Api
|
||||
*/
|
||||
public function setLimit($limit) {
|
||||
|
||||
if( is_integer($limit) ) {
|
||||
$this->_namespaces[$this->_current_namaspace]['limit'] = $limit;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Limit output
|
||||
public function setRequest($request) {
|
||||
|
||||
if( is_integer($request) ) {
|
||||
$this->_namespaces[$this->_current_namaspace]['request'] = $request;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
// Sort output
|
||||
public function setSort($sort) {
|
||||
|
||||
if( is_string($sort) ) {
|
||||
$this->_namespaces[$this->_current_namaspace]['sort'] = $sort;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate cache
|
||||
*
|
||||
* @param integer $time
|
||||
* @param string $folder
|
||||
* @return Api
|
||||
*/
|
||||
public function setCache($time, $folder) {
|
||||
|
||||
if( ! is_dir($folder) ) {
|
||||
$this->_error('Cache folder musst be a folder.');
|
||||
}
|
||||
|
||||
if( ! is_integer($time) ) {
|
||||
$this->_error('Cache time musst be integer.');
|
||||
}
|
||||
|
||||
$this->_namespaces[$this->_current_namaspace]['cache'] = array(
|
||||
'folder' => $folder,
|
||||
'time' => $time
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set columns which should be displayed
|
||||
*
|
||||
* @param array $columns
|
||||
* @return Api
|
||||
*/
|
||||
public function setColumns($columns) {
|
||||
|
||||
if( is_array($columns) ) {
|
||||
$this->_namespaces[$this->_current_namaspace]['columns'] = $columns;
|
||||
} else {
|
||||
$this->_error('Columns musst be given as array.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set conditions for data
|
||||
*
|
||||
* @param array $conditions
|
||||
* @return Api
|
||||
*/
|
||||
public function setWhere($conditions) {
|
||||
|
||||
if( is_array($conditions) ) {
|
||||
$this->_namespaces[$this->_current_namaspace]['conditions'] = $conditions;
|
||||
} else {
|
||||
$this->_error('Where conditions musst be given as array.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output data
|
||||
*
|
||||
* @access public
|
||||
* @param arra $route
|
||||
*/
|
||||
public function render($route) {
|
||||
if( ! isset($route['namespace']) || ! isset($this->_namespaces[$route['namespace']]) || strlen($route['namespace']) == 0 ) {
|
||||
$this->_error('No namespace found.');
|
||||
}
|
||||
|
||||
$this->_render_namepsace = $route['namespace'];
|
||||
|
||||
// secure input
|
||||
foreach($route as $key => $value) {
|
||||
$route[strip_tags($key)] = strip_tags($value);
|
||||
}
|
||||
|
||||
$this->_route_data = $route;
|
||||
|
||||
// check if connection is working
|
||||
if( ! mysql_ping($this->_db) ) {
|
||||
$this->_error('Database connection is not working.');
|
||||
}
|
||||
|
||||
// check if request limit is reached
|
||||
if( ! $this->_check_key() ) {
|
||||
$this->_error('Soory, but your api key is not valid.');
|
||||
}
|
||||
|
||||
// check if request limit is reached
|
||||
if( ! $this->_check_request() ) {
|
||||
$this->_error('Soory, you reached the maximum request limit per hour ('.$this->_namespaces[$this->_render_namepsace]['limit'].').');
|
||||
}
|
||||
|
||||
// get data from mysql table
|
||||
if( ! $this->_create() ) {
|
||||
$this->_error('Soory, but the system was not able to generate data.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user key is valid
|
||||
*
|
||||
* @access private
|
||||
* @return boolean
|
||||
*/
|
||||
private function _check_key() {
|
||||
if( $this->_namespaces[$this->_render_namepsace]['key'] == true ) {
|
||||
$result = mysql_query('SELECT id FROM api_keys WHERE hash = "'.mysql_real_escape_string($this->_route_data['key']).'"', $this->_db) or die(mysql_error());
|
||||
|
||||
if( mysql_num_rows($result) == false ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if request limit is reached
|
||||
*
|
||||
* @access prviate
|
||||
* @return boolean
|
||||
*/
|
||||
private function _check_request() {
|
||||
|
||||
if( $this->_namespaces[$this->_render_namepsace]['limit'] != false ) {
|
||||
// check request limit
|
||||
|
||||
// delete old requests
|
||||
if( $this->_namespaces[$this->_render_namepsace]['key'] == true ) {
|
||||
// request limit with key
|
||||
|
||||
// delete old requests
|
||||
mysql_query('DELETE FROM api_requests WHERE hash = "'.mysql_real_escape_string($this->_route_data['key']).'" AND ((UNIX_TIMESTAMP() - time) > 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error());
|
||||
|
||||
// count stored requests
|
||||
$result = mysql_query('SELECT COUNT(time) AS requests FROM api_requests WHERE hash = "'.mysql_real_escape_string($this->_route_data['key']).'" AND ((UNIX_TIMESTAMP() - time) < 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error());
|
||||
|
||||
$total_requests = mysql_fetch_array($result);
|
||||
|
||||
if( $total_requests['requests'] >= $this->_namespaces[$this->_render_namepsace]['limit'] ) {
|
||||
// request limit reached
|
||||
return false;
|
||||
} else {
|
||||
|
||||
// insert new request
|
||||
mysql_query('INSERT INTO api_requests (namespace, hash, ip, time) VALUES("'.$this->_render_namepsace.'", "'.mysql_real_escape_string($this->_route_data['key']).'", "'.$_SERVER['REMOTE_ADDR'].'", "'.time().'")', $this->_db) or die(mysql_error());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} else {
|
||||
// request limit without key
|
||||
|
||||
// delete old requests
|
||||
mysql_query('DELETE FROM api_requests WHERE ((UNIX_TIMESTAMP() - time) > 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error());
|
||||
|
||||
// count stored requests
|
||||
$result = mysql_query('SELECT COUNT(time) AS requests FROM api_requests WHERE ((UNIX_TIMESTAMP() - time) < 3600) AND namespace = "'.$this->_render_namepsace.'"', $this->_db) or die(mysql_error());
|
||||
|
||||
$total_requests = mysql_fetch_array($result);
|
||||
|
||||
if( $total_requests['requests'] >= $this->_namespaces[$this->_render_namepsace]['limit'] ) {
|
||||
// request limit reached
|
||||
return false;
|
||||
} else {
|
||||
|
||||
// insert new request
|
||||
mysql_query('INSERT INTO api_requests (namespace, ip, time) VALUES("'.$this->_render_namepsace.'", "'.$_SERVER['REMOTE_ADDR'].'", "'.time().'")', $this->_db) or die(mysql_error());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// no limit is set
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Array to json
|
||||
*
|
||||
* @access private
|
||||
* @return json
|
||||
*/
|
||||
private function _write_json() {
|
||||
|
||||
header("Content-Type: application/json");
|
||||
|
||||
return json_encode($this->_result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Array to xml
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function _write_xml() {
|
||||
|
||||
header("Content-Type: application/xml");
|
||||
|
||||
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
|
||||
|
||||
$xml .= "<root>";
|
||||
|
||||
foreach($this->_result as $key => $value) {
|
||||
$xml .= "<{$this->_render_namepsace}>\n";
|
||||
|
||||
foreach($value as $k => $d) {
|
||||
$xml .= "<{$k}>{$d}</{$k}>\n";
|
||||
}
|
||||
|
||||
$xml .= "</{$this->_render_namepsace}>\n";
|
||||
}
|
||||
|
||||
$xml .= "</root>";
|
||||
|
||||
return $xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array to csv
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function _write_csv() {
|
||||
$lines = array();
|
||||
|
||||
foreach ($this->_result as $key => $value) {
|
||||
|
||||
$lines[] = implode(';', array_filter($value, function($var) {
|
||||
return $var;
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
return implode("\n", $lines);
|
||||
}
|
||||
|
||||
/**
|
||||
* Array to yaml
|
||||
*
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function _write_yaml() {
|
||||
$yaml = "---\n";
|
||||
|
||||
$yaml .= "{$this->_render_namepsace}: \n";
|
||||
|
||||
foreach($this->_result as $key => $value) {
|
||||
$yaml .= "-";
|
||||
$count = 0;
|
||||
|
||||
foreach($value as $k => $d) {
|
||||
if( $count != 0 ) {
|
||||
$yaml .= " ";
|
||||
}
|
||||
|
||||
$yaml .= " {$k}: {$d} \n";
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
return $yaml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets data from database
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function _get() {
|
||||
|
||||
foreach($this->_namespaces[$this->_render_namepsace]['columns'] as $c) {
|
||||
$columns .= $c.', ';
|
||||
}
|
||||
|
||||
$sql = 'SELECT '.substr($columns, 0, -2).' FROM ' .
|
||||
$this->_namespaces[$this->_render_namepsace]['table'];
|
||||
|
||||
if( $this->_namespaces[$this->_render_namepsace]['conditions'] != false ) {
|
||||
$sql .= ' WHERE ';
|
||||
|
||||
foreach($this->_namespaces[$this->_render_namepsace]['conditions'] as $where => $data) {
|
||||
|
||||
if( ! isset($this->_route_data[$data['route']]) ) {
|
||||
$this->_error('Route '.$data['route'].' is required.');
|
||||
}
|
||||
|
||||
// validate
|
||||
if( isset($data['rule']) ) {
|
||||
if( ! in_array($data['rule'], $this->_rules) ) {
|
||||
$this->_error('Rule '.$data['rule'].' is not avaiable.');
|
||||
}
|
||||
|
||||
$rule = '_'.$data['rule'];
|
||||
|
||||
if( ! $this->$rule($this->_route_data[$data['route']]) ) {
|
||||
$this->_error('Wrong route format.');
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= $where.' = "'.mysql_real_escape_string($this->_route_data[$data['route']]).'"';
|
||||
|
||||
if( isset($data['connect']) ) {
|
||||
$sql .= ' '.$data['connect'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $this->_namespaces[$this->_render_namepsace]['sort'] != false ) {
|
||||
$sql .= ' ORDER BY ' . $this->_namespaces[$this->_render_namepsace]['sort'];
|
||||
}
|
||||
|
||||
if( $this->_namespaces[$this->_render_namepsace]['request'] != false ) {
|
||||
$sql .= ' LIMIT ' . $this->_namespaces[$this->_render_namepsace]['request'];
|
||||
}
|
||||
|
||||
$result = mysql_query($sql, $this->_db) or die(mysql_error());
|
||||
|
||||
if( mysql_num_rows($result) == false ) {
|
||||
$this->_error('No results found.');
|
||||
}
|
||||
|
||||
// write data to a nice array
|
||||
for($i = 0; $i < mysql_num_rows($result); $i++)
|
||||
{
|
||||
$dump[$i] = mysql_fetch_array($result, MYSQL_ASSOC);
|
||||
}
|
||||
|
||||
$this->_result = $dump;
|
||||
}
|
||||
|
||||
private function _alpha_numeric($validate) {
|
||||
if( ctype_alnum($validate) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function _numeric($validate) {
|
||||
if( ctype_digit($validate) ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _create() {
|
||||
|
||||
|
||||
if( $this->_namespaces[$this->_render_namepsace]['cache'] == false ) {
|
||||
|
||||
$this->_get();
|
||||
|
||||
} else {
|
||||
// cache is turned on
|
||||
if( $this->_namespaces[$this->_render_namepsace]['key'] == false ) {
|
||||
// key musst truned off
|
||||
|
||||
$file = $this->_namespaces[$this->_render_namepsace]['cache']['folder'].sha1($this->_render_namepsace).'.txt';
|
||||
|
||||
if( ! file_exists($file) || (time() - filemtime($file) > $this->_namespaces[$this->_render_namepsace]['cache']['time']) ) {
|
||||
|
||||
// write to cache and delete old file
|
||||
@unlink($file);
|
||||
|
||||
$f = fopen($file, 'w');
|
||||
|
||||
$this->_get();
|
||||
|
||||
$cache = new stdClass;
|
||||
$cache->result = $this->_result;
|
||||
|
||||
fwrite($f, serialize($cache));
|
||||
|
||||
fclose($f);
|
||||
}
|
||||
|
||||
// read from cache
|
||||
$data = unserialize(file_get_contents($file));
|
||||
|
||||
$this->_result = $data->result;
|
||||
|
||||
|
||||
} else {
|
||||
$this->_namespaces[$this->_render_namepsace]['cache'] = false;
|
||||
|
||||
$this->_create();
|
||||
}
|
||||
}
|
||||
|
||||
$type_function = '_write_';
|
||||
|
||||
if( is_array($this->_namespaces[$this->_render_namepsace]['output']) ) {
|
||||
if( isset($this->_route_data['output']) ) {
|
||||
$type_function .= $this->_route_data['output'];
|
||||
} else {
|
||||
$type_function .= $this->_namespaces[$this->_render_namepsace]['output'][0];
|
||||
}
|
||||
} else {
|
||||
$type_function .= $this->_namespaces[$this->_render_namepsace]['output'];
|
||||
}
|
||||
|
||||
|
||||
die($this->$type_function());
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
class SimpleBBCode {
|
||||
|
||||
protected $bbcodes = array();
|
||||
|
||||
public function __construct() {
|
||||
|
||||
//standard bbcodes hinzufügen
|
||||
$this->assign('\[b\](.*)\[/b\]', '<strong>$1</strong>');
|
||||
$this->assign('\[i\](.*)\[/i\]', '<em>$1</em>');
|
||||
$this->assign('\[u\](.*)\[/u\]', '<u>$1</u>');
|
||||
$this->assign('\[quote\](?s)(.*)\[/quote\]', '<span class="quote">$1</span>');
|
||||
$this->assign('\[img\](.*)\[/img\]', '"<a href=\"" . htmlentities(\'\\1\', ENT_COMPAT) . "\" rel=\"lightbox[more]\" target=\"_blank\"><img onError=\"this.src=\'/media/dolan404.jpg\';\" src=\"" . htmlentities(\'\\1\', ENT_COMPAT) . "\" border=\"0\" class=\"imgbbcode\"></a>"', true);
|
||||
$this->assign('\[youtube\](.*)\[/youtube\]', '$this->handleYoutubeBBcode(\'\\1\')', true);
|
||||
$this->assign('\[xxx\](.*)\[/xxx\]', '$this->handlePornBBcode(\'\\1\')', true);
|
||||
$this->assign('\[link\](.*)\[/link\]', '$this->handleLinkBBcode(\'\\1\')', true);
|
||||
$this->assign('\[spoiler\](?s)(.*)\[/spoiler\]', '<span class="Spoiler">$1</span>');
|
||||
}
|
||||
|
||||
public function parse($content) {
|
||||
if(!count($this->bbcodes)) return $content;
|
||||
|
||||
foreach($this->bbcodes as $bbcode) {
|
||||
while(preg_match('~' . $bbcode['find'] . '~U', $content)) {
|
||||
if(isset($bbcode['eval']))
|
||||
$content = preg_replace('~' . $bbcode['find'] . '~Ue', $bbcode['eval'], $content);
|
||||
else $content = preg_replace('~' . $bbcode['find'] . '~U', $bbcode['replace'], $content);
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function assign($find, $replace, $eval = false) {
|
||||
$pattern = array('find' => $find);
|
||||
$pattern[(($eval === true) ? 'eval' : 'replace')] = $replace;
|
||||
$this->bbcodes[] = $pattern;
|
||||
}
|
||||
|
||||
protected function handleYoutubeBBcode($url) {
|
||||
|
||||
if(preg_match("/youtube/i",$url)) {
|
||||
$stack = array();
|
||||
preg_match('/v=([A-z0-9=\-]+?)(&.*)?$/i', $url, $stack);
|
||||
if(empty($stack[1])) return '';
|
||||
$watch = $stack[1]; //\w kann nur a-zA-Z0-9_. sein, kein risiko
|
||||
} else {
|
||||
$watch = preg_replace('~\W+~', '', $url);
|
||||
if(empty($watch)) return '';
|
||||
}
|
||||
|
||||
return "<a href=\"javascript:;\" id=\"YTbutton\" onclick=\"toggle('YT" . $watch . "')\">[youtube]</a><iframe id=\"YT" . $watch . "\" width=\"425\" style=\"display:none;\" height=\"344\" src=\"http://www.youtube.com/embed/".$watch."\" frameborder=\"0\" allowfullscreen></iframe>";
|
||||
}
|
||||
|
||||
protected function handlePornBBcode($url) {
|
||||
|
||||
if(preg_match("/xvideo/i",$url)) {
|
||||
$source = "http://flashservice.xvideos.com/embedframe/";
|
||||
preg_match_all("/.*?(\d+)/is", $url, $matches);
|
||||
$watch=$matches[1][0];
|
||||
}
|
||||
/*else if(preg_match("/pornhub/i",$url)){
|
||||
$source = "http://www.pornhub.com/embed/";
|
||||
preg_match_all("/.*?(\d+)/is", $url, $matches);
|
||||
$watch=$matches[1][0];
|
||||
}*/
|
||||
else{
|
||||
if(empty($watch)) return '';
|
||||
}
|
||||
|
||||
return "<a href=\"javascript:;\" id=\"Pornbutton\" onclick=\"toggle('Porn" . $watch . "')\">[xxx]</a><iframe id=\"Porn" .$watch. "\" width=\"425\" height=\"344\" style=\"display:none;\" src=\"".$source.$watch."\" frameborder=\"0\"></iframe>";
|
||||
}
|
||||
|
||||
protected function handleLinkBBcode($text) {
|
||||
if (!empty($text)){
|
||||
if (preg_match("/is.gd/i", $text)) {
|
||||
$text = preg_replace('#(?<!\w)((http://)|(www\.))([^\s<>]+)#i', "<a target=\"_blank\" href=\"http://$3$4\">$text</a>",$text);
|
||||
return($text);
|
||||
}
|
||||
else {
|
||||
$link = $text;
|
||||
$text = preg_replace('#(?<!\w)((http://)|(www\.))([^\s<>]+)#i', "<a target=\"_blank\" href=\"http://$3$4\">$link</a>",$text);
|
||||
return($text);
|
||||
}
|
||||
}
|
||||
else{
|
||||
return("Link-Fail");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
function short($url){
|
||||
$res = "";
|
||||
$handle = @fopen("http://is.gd/api.php?longurl=".urlencode($url), "rb");
|
||||
if($handle){
|
||||
while (!feof($handle)) {
|
||||
$res .= fgets($handle,2000);
|
||||
}
|
||||
fclose($handle);
|
||||
}
|
||||
else{
|
||||
throw new Exception("Link kann nicht gekürzt werden!");
|
||||
}
|
||||
return $res;
|
||||
}*/
|
||||
?>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
The Cache class reads and writes complete pages from the cache.
|
||||
The name of a cache file is based on its URL
|
||||
*/
|
||||
|
||||
class Cache {
|
||||
private $fileName = '';
|
||||
private $path = '';
|
||||
private $enabled = true;
|
||||
private $captured = false;
|
||||
|
||||
public function __construct( $path, $pageName ) {
|
||||
$this->path = $path;
|
||||
$this->fileName = $this->path . strtr( $pageName, '?&', '--' ) . '.html';
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
|
||||
$this->enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function disable() {
|
||||
$this->enabled = false;
|
||||
}
|
||||
|
||||
public function forceEnable() {
|
||||
$this->enabled = true;
|
||||
}
|
||||
|
||||
public function lookup() {
|
||||
if( $this->enabled && file_exists($this->fileName) ) {
|
||||
$fp = fopen($this->fileName, 'rb');
|
||||
fpassthru($fp);
|
||||
fclose($fp);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
public function capture() {
|
||||
if( $this->enabled ) {
|
||||
ob_start();
|
||||
$this->captured = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function clear( $pattern = '' ) {
|
||||
require_once( 'lib/filesystem.php' );
|
||||
if( empty($pattern) && !empty($this->path) ) {
|
||||
Filesystem::rmdirr( $this->path, true );
|
||||
} else {
|
||||
$files = glob( $this->path . 'all/view/' . strtr( $pattern, '?&', '--' ) . '.html' );
|
||||
foreach( $files as $f ) {
|
||||
unlink( $f );
|
||||
}
|
||||
$files = glob( $this->path . 'user/*/view/' . strtr( $pattern, '?&', '--' ) . '.html' );
|
||||
foreach( $files as $f ) {
|
||||
unlink( $f );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function write() {
|
||||
if( $this->captured ) {
|
||||
require_once( 'lib/filesystem.php' );
|
||||
Filesystem::mkdirr( dirname($this->fileName) );
|
||||
file_put_contents( $this->fileName, ob_get_contents() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,323 @@
|
||||
<?php
|
||||
define('FORUMPATH', realpath(dirname(__FILE__)).Config::$vbbIntegration['path']);
|
||||
|
||||
function userdata_convert(&$userdata) {
|
||||
$vbuser = array( 'username' => $userdata['name'] );
|
||||
if (isset($userdata['email']))
|
||||
$vbuser['email'] = $userdata['email'];
|
||||
if (isset($userdata['pass']))
|
||||
$vbuser['password'] = $userdata['pass'];
|
||||
|
||||
return $vbuser;
|
||||
}
|
||||
|
||||
|
||||
define('REGISTERED_USERGROUP', 2); // typical default for registered users
|
||||
define('PERMANENT_COOKIE', false); // false=session cookies (recommended)
|
||||
|
||||
define('THIS_SCRIPT', __FILE__);
|
||||
$cwd = getcwd();
|
||||
chdir(FORUMPATH);
|
||||
require_once('./includes/init.php'); // includes class_core.php
|
||||
require_once('./includes/class_dm.php'); // for class_dm_user.php
|
||||
require_once('./includes/class_dm_user.php'); // for user functions
|
||||
require_once('./includes/functions.php'); // vbsetcookie etc.
|
||||
require_once('./includes/functions_login.php'); // process login/logout
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// This function duplicates the functionality of fetch_userinfo(),
|
||||
// using the user name instead of numeric ID as the argument.
|
||||
// See comments in includes/functions.php for documentation.
|
||||
//---------------------------------------------------------------------
|
||||
function fetch_userinfo_from_username(&$username, $option=0, $languageid=0)
|
||||
{
|
||||
global $vbulletin;
|
||||
$useridq = $vbulletin->db->query_first_slave("SELECT userid FROM "
|
||||
. TABLE_PREFIX . "user WHERE username='{$username}'");
|
||||
if (!$useridq) return $useridq;
|
||||
$userid = $useridq['userid'];
|
||||
return fetch_userinfo($userid, $option, $languageid);
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// CLASS ForumOps
|
||||
//---------------------------------------------------------------------
|
||||
class ForumOps extends vB_DataManager_User {
|
||||
var $userdm;
|
||||
|
||||
// *********************************************************************************************************
|
||||
|
||||
function __construct( &$vbulletin ) // constructor
|
||||
{
|
||||
$this->vbulletin =& $vbulletin;
|
||||
$this->userdm =& datamanager_init('user', $vbulletin, ERRTYPE_ARRAY);
|
||||
}
|
||||
|
||||
function ForumOps() // constructor
|
||||
{
|
||||
global $vbulletin;
|
||||
$this->userdm =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
|
||||
}
|
||||
|
||||
// *********************************************************************************************************
|
||||
|
||||
//======== USER REGISTRATION / UPDATE / DELETE ========
|
||||
|
||||
function register_newuser(&$userdata, $login = true)
|
||||
{
|
||||
global $vbulletin;
|
||||
$vbuser = userdata_convert($userdata);
|
||||
foreach($vbuser as $key => $value)
|
||||
$this->userdm->set($key, $value);
|
||||
$this->userdm->set('usergroupid', REGISTERED_USERGROUP);
|
||||
$this->userdm->set('timezoneoffset', 1);
|
||||
|
||||
// Bitfields; set to desired defaults.
|
||||
// Comment out those you have set as defaults
|
||||
// in the vBuleltin admin control panel
|
||||
$this->userdm->set_bitfield('options', 'adminemail', 1);
|
||||
$this->userdm->set_bitfield('options', 'showsignatures', 1);
|
||||
$this->userdm->set_bitfield('options', 'showavatars', 0);
|
||||
$this->userdm->set_bitfield('options', 'showimages', 1);
|
||||
$this->userdm->set_bitfield('options', 'showemail', 0);
|
||||
|
||||
if ($login) $this->login($vbuser);
|
||||
|
||||
//$this->userdm->errors contains error messages
|
||||
if (empty($this->userdm->errors))
|
||||
$vbulletin->userinfo['userid'] = $this->userdm->save();
|
||||
else
|
||||
return implode('<br>', $this->userdm->errors);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// *********************************************************************************************************
|
||||
|
||||
function update_user(&$userdata)
|
||||
{
|
||||
global $vbulletin;
|
||||
$vbuser = userdata_convert($userdata);
|
||||
|
||||
if (!($existing_user = fetch_userinfo_from_username($vbuser['username'])))
|
||||
return 'fetch_userinfo_from_username() failed.';
|
||||
|
||||
$this->userdm->set_existing($existing_user);
|
||||
foreach($vbuser as $key => $value)
|
||||
$this->userdm->set($key, $value);
|
||||
|
||||
// reset password cookie in case password changed
|
||||
if (isset($vbuser['password']))
|
||||
vbsetcookie('password',
|
||||
md5($vbulletin->userinfo['password'].COOKIE_SALT),
|
||||
PERMANENT_COOKIE, true, true);
|
||||
|
||||
if (count($this->userdm->errors))
|
||||
return implode('<br>', $this->userdm->errors);
|
||||
$vbulletin->userinfo['userid'] = $this->userdm->save();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// *********************************************************************************************************
|
||||
|
||||
function update_avatar(&$userdata) {
|
||||
global $vbulletin;
|
||||
$vbuser = userdata_convert($userdata);
|
||||
|
||||
if (!($existing_user = fetch_userinfo_from_username($vbuser['username'])))
|
||||
return 'fetch_userinfo_from_username() failed.';
|
||||
|
||||
$this->userdm->set_existing($existing_user);
|
||||
|
||||
// update avatar in case it should be
|
||||
if (!empty($vbuser['avatarurl'])) {
|
||||
//~ echo"<pre>";
|
||||
//~ print_r ($existing_user);
|
||||
//~ echo "</pre>";
|
||||
|
||||
// begin custom avatar code
|
||||
require_once(DIR . '/includes/class_upload.php');
|
||||
require_once(DIR . '/includes/class_image.php');
|
||||
|
||||
$upload = new vB_Upload_Userpic($vbulletin);
|
||||
|
||||
$upload->data =& datamanager_init('Userpic_Avatar', $vbulletin, ERRTYPE_STANDARD, 'userpic');
|
||||
$upload->image =& vB_Image::fetch_library($vbulletin);
|
||||
$upload->userinfo =& $existing_user;
|
||||
cache_permissions($existing_user, false);
|
||||
$upload->maxwidth = $vbulletin->userinfo['permissions']['avatarmaxwidth'];
|
||||
$upload->maxheight = $vbulletin->userinfo['permissions']['avatarmaxheight'];
|
||||
if (!$upload->process_upload($vbuser['avatarurl'])) {
|
||||
echo $upload->fetch_error();
|
||||
}
|
||||
}
|
||||
else { // no avatar used!
|
||||
$userpic =& datamanager_init('Userpic_Avatar', $vbulletin, ERRTYPE_CP, 'userpic');
|
||||
$userpic->condition = "userid = " . $existing_user['userid'];
|
||||
$userpic->delete();
|
||||
}
|
||||
$this->userdm->set_existing($vbulletin->userinfo);
|
||||
|
||||
($hook = vBulletinHook::fetch_hook('profile_updateavatar_complete')) ? eval($hook) : false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// *********************************************************************************************************
|
||||
|
||||
function delete_user(&$username)
|
||||
{
|
||||
// The vBulletin documentation suggests using userdm->delete()
|
||||
// to delete a user, but upon examining the code, this doesn't
|
||||
// delete everything associated with the user. The following
|
||||
// is adapted from admincp/user.php instead.
|
||||
// NOTE: THIS MAY REQUIRE MAINTENANCE WITH NEW VBULLETIN UPDATES.
|
||||
|
||||
global $vbulletin;
|
||||
$db = &$vbulletin->db;
|
||||
$userdata = $db->query_first_slave("SELECT userid FROM "
|
||||
. TABLE_PREFIX . "user WHERE username='{$username}'");
|
||||
$userid = $userdata['userid'];
|
||||
if ($userid) {
|
||||
|
||||
// from admincp/user.php 'do prune users (step 1)'
|
||||
|
||||
// delete subscribed forums
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "subscribeforum WHERE userid={$userid}");
|
||||
// delete subscribed threads
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "subscribethread WHERE userid={$userid}");
|
||||
// delete events
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "event WHERE userid={$userid}");
|
||||
// delete event reminders
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "subscribeevent WHERE userid={$userid}");
|
||||
// delete custom avatars
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "customavatar WHERE userid={$userid}");
|
||||
$customavatars = $db->query_read("SELECT userid, avatarrevision FROM "
|
||||
. TABLE_PREFIX . "user WHERE userid={$userid}");
|
||||
while ($customavatar = $db->fetch_array($customavatars)) {
|
||||
@unlink($vbulletin->options['avatarpath'] . "/avatar{$customavatar['userid']}_{$customavatar['avatarrevision']}.gif");
|
||||
}
|
||||
// delete custom profile pics
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "customprofilepic WHERE userid={$userid}");
|
||||
$customprofilepics = $db->query_read(
|
||||
"SELECT userid, profilepicrevision FROM "
|
||||
. TABLE_PREFIX . "user WHERE userid={$userid}");
|
||||
while ($customprofilepic = $db->fetch_array($customprofilepics)) {
|
||||
@unlink($vbulletin->options['profilepicpath'] . "/profilepic$customprofilepic[userid]_$customprofilepic[profilepicrevision].gif");
|
||||
}
|
||||
// delete user forum access
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "access WHERE userid={$userid}");
|
||||
// delete moderator
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "moderator WHERE userid={$userid}");
|
||||
// delete private messages
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "pm WHERE userid={$userid}");
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "pmreceipt WHERE userid={$userid}");
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "session WHERE userid={$userid}");
|
||||
// delete user group join requests
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "usergrouprequest WHERE userid={$userid}");
|
||||
// delete bans
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "userban WHERE userid={$userid}");
|
||||
// delete user notes
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "usernote WHERE userid={$userid}");
|
||||
|
||||
// from admincp/users.php 'do prune users (step 2)'
|
||||
|
||||
// update deleted user's posts with userid=0
|
||||
$db->query_write("UPDATE " . TABLE_PREFIX
|
||||
. "thread SET postuserid = 0, postusername = '"
|
||||
. $db->escape_string($username)
|
||||
. "' WHERE postuserid = $userid");
|
||||
$db->query_write("UPDATE " . TABLE_PREFIX
|
||||
. "post SET userid = 0, username = '"
|
||||
. $db->escape_string($username)
|
||||
. "' WHERE userid = $userid");
|
||||
|
||||
// finally, delete the user
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "usertextfield WHERE userid={$userid}");
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "userfield WHERE userid={$userid}");
|
||||
$db->query_write("DELETE FROM " . TABLE_PREFIX
|
||||
. "user WHERE userid={$userid}");
|
||||
}
|
||||
/*
|
||||
the following is suggested in the documentation but doesn't work:
|
||||
|
||||
$existing_user = fetch_userinfo_from_username($username);
|
||||
$this->userdm->set_existing($existing_user);
|
||||
return $this->userdm->delete();
|
||||
*/
|
||||
}
|
||||
|
||||
function set_email( $username, $email ) {
|
||||
global $vbulletin;
|
||||
$db = &$vbulletin->db;
|
||||
$db->query_write("UPDATE " . TABLE_PREFIX . "user SET email = '"
|
||||
.mysql_real_escape_string($email)."' WHERE username = '"
|
||||
.mysql_real_escape_string($username)."'"
|
||||
);
|
||||
}
|
||||
|
||||
function set_pass( $username, $pass ) {
|
||||
global $vbulletin;
|
||||
$db = &$vbulletin->db;
|
||||
$pass = md5($pass);
|
||||
$salt = $this->fetch_user_salt();
|
||||
$db->query_write("UPDATE " . TABLE_PREFIX . "user SET password = '"
|
||||
.mysql_real_escape_string(md5($pass.$salt))."',
|
||||
salt = '".mysql_real_escape_string($salt)."' WHERE username = '"
|
||||
.mysql_real_escape_string($username)."'"
|
||||
);
|
||||
}
|
||||
|
||||
function fetch_user_salt($length = SALT_LENGTH) {
|
||||
$salt = '';
|
||||
|
||||
for ($i = 0; $i < $length; $i++)
|
||||
{
|
||||
$salt .= chr(rand(33, 126));
|
||||
}
|
||||
|
||||
return $salt;
|
||||
}
|
||||
|
||||
// ======== USER LOGIN / LOGOUT ========
|
||||
|
||||
function login($vbuser)
|
||||
{
|
||||
global $vbulletin;
|
||||
$vbulletin->userinfo = fetch_userinfo_from_username($vbuser['username']);
|
||||
// set cookies
|
||||
vbsetcookie('userid', $vbulletin->userinfo['userid'],
|
||||
PERMANENT_COOKIE, true, true);
|
||||
vbsetcookie('password',
|
||||
md5($vbulletin->userinfo['password'].COOKIE_SALT),
|
||||
PERMANENT_COOKIE, true, true);
|
||||
// create session stuff
|
||||
process_new_login('', 1, '');
|
||||
}
|
||||
|
||||
|
||||
function logout()
|
||||
{
|
||||
process_logout(); // unsets all cookies and session data
|
||||
}
|
||||
|
||||
} // end class ForumOps
|
||||
chdir($cwd);
|
||||
?>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
All config settings are defined in this file. Please refer to your readme
|
||||
for an in depth explanation of each value.
|
||||
*/
|
||||
|
||||
class Config {
|
||||
|
||||
// Names and URLs for your installation
|
||||
public static $absolutePath = '/';
|
||||
public static $frontendPath = 'http://www.4ducky.com/';
|
||||
public static $siteName = '4ducky';
|
||||
public static $siteTitle = '4ducky.com - fol witzik';
|
||||
|
||||
public static $sessionCookie = 'sid';
|
||||
public static $rememberCookie = 'remember';
|
||||
|
||||
// Spam protection
|
||||
public static $ipLockTime = 3600;
|
||||
public static $uploadLockTime = 7200;
|
||||
public static $maxNumUploads = 50;
|
||||
|
||||
// User score
|
||||
public static $votingScore = 5;
|
||||
public static $postScore = 10;
|
||||
public static $tagScorePerChar = 0.5;
|
||||
public static $tagScoreMax = 20;
|
||||
|
||||
// Misc settings
|
||||
public static $usersPerPage = 100;
|
||||
public static $defaultChmod = 0777;
|
||||
public static $templates = 'templates/';
|
||||
public static $keywordWordSeperator = '-';
|
||||
|
||||
public static $colorSearchDev = 50;
|
||||
|
||||
public static $maxRandomThumbs = 10;
|
||||
public static $minRandomScore = 10.0;
|
||||
|
||||
// vbb Forum integration
|
||||
public static $vbbIntegration = array(
|
||||
'enabled' => false,
|
||||
'path' => '/../forum'
|
||||
);
|
||||
|
||||
// Cache settings
|
||||
public static $cache = array(
|
||||
'enabled' => false,
|
||||
'path' => 'cache/',
|
||||
'clearEvery' => 10
|
||||
);
|
||||
|
||||
// Database settings
|
||||
public static $db = array(
|
||||
'host' => 'localhost',
|
||||
'database' => 'name',
|
||||
'user' => 'usernmae',
|
||||
'password' => 'passwort',
|
||||
'prefix' => 'pl_'
|
||||
);
|
||||
|
||||
// Image processing and thumbnail creation
|
||||
public static $images = array(
|
||||
'thumbsPerPage' => 125,
|
||||
'imagePath' => 'data/images/',
|
||||
'thumbPath' => 'data/thumbs/',
|
||||
'avatarsPath' => 'data/avatars/',
|
||||
'maxDownload' => 8097152,
|
||||
'jpegQuality' => 100,
|
||||
'sharpen' => false
|
||||
);
|
||||
|
||||
// Grid Solver settings
|
||||
public static $gridView = array(
|
||||
'gridSize' => 64,
|
||||
'gridWidth' => 12,
|
||||
'borderWidth' => 2,
|
||||
|
||||
// Definition of all Thumbnail classes ---------------------------
|
||||
// KEY: CSS-className
|
||||
// width/ height: Size of the thumb in grid units
|
||||
// percentage: Percentage of thumbnails in this size
|
||||
// dir: Name of the subdir with thumbs in this size
|
||||
'classes' => array(
|
||||
'b2' => array( 'width'=>1, 'height'=>1, 'percentage'=>0.6, 'dir'=>'64x64' ),
|
||||
'b1' => array( 'width'=>2, 'height'=>2, 'percentage'=>0.35, 'dir'=>'128x128' ),
|
||||
'b0' => array( 'width'=>3, 'height'=>3, 'percentage'=>0.05, 'dir'=>'192x192' )
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Edit below this line only if you know what you're doing!
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// MySQL Table names
|
||||
define( 'TABLE_IMAGES', Config::$db['prefix'].'images' );
|
||||
define( 'TABLE_IMAGECOLORS',Config::$db['prefix'].'imagecolors' );
|
||||
define( 'TABLE_USERS', Config::$db['prefix'].'users' );
|
||||
define( 'TABLE_IPLOCK', Config::$db['prefix'].'iplock' );
|
||||
define( 'TABLE_UPLOADLOCK', Config::$db['prefix'].'uploadlock' );
|
||||
define( 'TABLE_TAGLOG', Config::$db['prefix'].'taglog' );
|
||||
define( 'TABLE_COMMENTS', Config::$db['prefix'].'comments' );
|
||||
|
||||
// MagicQuotes undo
|
||||
if( function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ) {
|
||||
$_GET = array_map( 'stripslashes', $_GET );
|
||||
$_POST = array_map( 'stripslashes', $_POST );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This class handles all database IO. To prevent SQL-Injections, all variables
|
||||
that are passed to the database must be specified as additional parameters to
|
||||
your query. e.g.
|
||||
$res = DB::query( 'SELECT * FROM images WHERE user = :1 AND tags LIKE :2', 'testuser', 'funny' );
|
||||
|
||||
query() and getRow() return a 2-dimensional array instead of a result resource.
|
||||
*/
|
||||
|
||||
require_once( 'config.php' );
|
||||
|
||||
class DB {
|
||||
private static $link = null;
|
||||
public static $result;
|
||||
public static $sql;
|
||||
public static $numQueries = 0;
|
||||
|
||||
private static function connect() {
|
||||
self::$link = @mysql_connect( Config::$db['host'], Config::$db['user'], Config::$db['password'] )
|
||||
or die( "Couldn't establish link to database-server: ".Config::$db['host'] );
|
||||
mysql_select_db( Config::$db['database'] )
|
||||
or die( "Couldn't select Database: ".Config::$db['database'] );
|
||||
mysql_query( 'SET NAMES utf8', self::$link );
|
||||
}
|
||||
|
||||
public static function foundRows() {
|
||||
$r = self::query( 'SELECT FOUND_ROWS() AS foundRows' );
|
||||
return $r[0]['foundRows'];
|
||||
}
|
||||
|
||||
public static function numRows() {
|
||||
return mysql_num_rows( self::$result );
|
||||
}
|
||||
|
||||
public static function affectedRows() {
|
||||
return mysql_affected_rows( self::$link );
|
||||
}
|
||||
public static function getresult() {
|
||||
return (self::$result);
|
||||
}
|
||||
public static function insertId() {
|
||||
return mysql_insert_id( self::$link );
|
||||
}
|
||||
|
||||
public static function query( $q, $params = array() ) {
|
||||
if( self::$link === null ) {
|
||||
self::connect();
|
||||
}
|
||||
|
||||
if( !is_array( $params ) ) {
|
||||
$params = array_slice( func_get_args(), 1 );
|
||||
}
|
||||
|
||||
if( !empty( $params ) ) {
|
||||
$q = preg_replace('/:(\d+)/e', 'self::quote($params[$1 - 1])', $q );
|
||||
}
|
||||
self::$numQueries++;
|
||||
self::$sql = $q;
|
||||
self::$result = mysql_query( $q, self::$link );
|
||||
|
||||
echo self::getError();
|
||||
if( !self::$result ) {
|
||||
return false;
|
||||
}
|
||||
else if( !is_resource( self::$result ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$rset = array();
|
||||
while ( $row = mysql_fetch_assoc( self::$result ) ) {
|
||||
$rset[] = $row;
|
||||
}
|
||||
return $rset;
|
||||
}
|
||||
|
||||
public static function getRow( $q, $params = array() ) {
|
||||
if( !is_array( $params ) ) {
|
||||
$params = array_slice( func_get_args(), 1 );
|
||||
}
|
||||
|
||||
$r = self::query( $q, $params );
|
||||
return array_shift($r);
|
||||
}
|
||||
|
||||
public static function updateRow( $table, $idFields, $updateFields ) {
|
||||
$updateString = implode( ',', self::quoteArray( $updateFields, true ) );
|
||||
$idString = implode( ' AND ', self::quoteArray( $idFields, true ) );
|
||||
return self::query( "UPDATE $table SET $updateString WHERE $idString" );
|
||||
}
|
||||
|
||||
public static function insertRow( $table, $insertFields ) {
|
||||
$insertString = implode( ',', self::quoteArray( $insertFields, true ) );
|
||||
return self::query( "INSERT INTO $table SET $insertString" );
|
||||
}
|
||||
|
||||
public static function getError() {
|
||||
if( $e = mysql_error( self::$link ) ) {
|
||||
return "MySQL reports: '$e' on query\n".self::$sql;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function quote( $s ) {
|
||||
if( self::$link === null ) {
|
||||
self::connect();
|
||||
}
|
||||
if( !isset($s) || $s === false ) {
|
||||
return 0;
|
||||
}
|
||||
else if( $s === true ) {
|
||||
return 1;
|
||||
}
|
||||
else if( is_numeric( $s ) ) {
|
||||
return $s;
|
||||
}
|
||||
else {
|
||||
return "'".mysql_real_escape_string( $s )."'";
|
||||
}
|
||||
}
|
||||
|
||||
public static function quoteArray( &$fields, $useKeys = false ) {
|
||||
$r = array();
|
||||
foreach( $fields as $key => &$value ) {
|
||||
$r[] = ( $useKeys ? "`$key`=":'' ) . self::quote( $value );
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This class handles all database IO. To prevent SQL-Injections, all variables
|
||||
that are passed to the database must be specified as additional parameters to
|
||||
your query. e.g.
|
||||
$res = DB::query( 'SELECT * FROM images WHERE user = :1 AND tags LIKE :2', 'testuser', 'funny' );
|
||||
|
||||
query() and getRow() return a 2-dimensional array instead of a result resource.
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
|
||||
class DB {
|
||||
private static $link = null;
|
||||
public static $result;
|
||||
public static $sql;
|
||||
public static $numQueries = 0;
|
||||
|
||||
private static function connect() {
|
||||
self::$link = @mysql_connect( Config::$db['host'], Config::$db['user'], Config::$db['password'] )
|
||||
or die( "Couldn't establish link to database-server: ".Config::$db['host'] );
|
||||
mysql_select_db( Config::$db['database'] )
|
||||
or die( "Couldn't select Database: ".Config::$db['database'] );
|
||||
mysql_query( 'SET NAMES utf8', self::$link );
|
||||
}
|
||||
|
||||
public static function foundRows() {
|
||||
$r = self::query( 'SELECT FOUND_ROWS() AS foundRows' );
|
||||
return $r[0]['foundRows'];
|
||||
}
|
||||
|
||||
public static function numRows() {
|
||||
return mysql_num_rows( self::$result );
|
||||
}
|
||||
|
||||
public static function affectedRows() {
|
||||
return mysql_affected_rows( self::$link );
|
||||
}
|
||||
public static function getresult() {
|
||||
return (self::$result);
|
||||
}
|
||||
public static function insertId() {
|
||||
return mysql_insert_id( self::$link );
|
||||
}
|
||||
|
||||
public static function query( $q, $params = array() ) {
|
||||
if( self::$link === null ) {
|
||||
self::connect();
|
||||
}
|
||||
|
||||
if( !is_array( $params ) ) {
|
||||
$params = array_slice( func_get_args(), 1 );
|
||||
}
|
||||
|
||||
if( !empty( $params ) ) {
|
||||
$q = preg_replace('/:(\d+)/e', 'self::quote($params[$1 - 1])', $q );
|
||||
}
|
||||
self::$numQueries++;
|
||||
self::$sql = $q;
|
||||
self::$result = mysql_query( $q, self::$link );
|
||||
|
||||
echo self::getError();
|
||||
if( !self::$result ) {
|
||||
return false;
|
||||
}
|
||||
else if( !is_resource( self::$result ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$rset = array();
|
||||
while ( $row = mysql_fetch_assoc( self::$result ) ) {
|
||||
$rset[] = $row;
|
||||
}
|
||||
return $rset;
|
||||
}
|
||||
|
||||
public static function getRow( $q, $params = array() ) {
|
||||
if( !is_array( $params ) ) {
|
||||
$params = array_slice( func_get_args(), 1 );
|
||||
}
|
||||
|
||||
$r = self::query( $q, $params );
|
||||
return array_shift($r);
|
||||
}
|
||||
|
||||
public static function updateRow( $table, $idFields, $updateFields ) {
|
||||
$updateString = implode( ',', self::quoteArray( $updateFields, true ) );
|
||||
$idString = implode( ' AND ', self::quoteArray( $idFields, true ) );
|
||||
return self::query( "UPDATE $table SET $updateString WHERE $idString" );
|
||||
}
|
||||
|
||||
public static function insertRow( $table, $insertFields ) {
|
||||
$insertString = implode( ',', self::quoteArray( $insertFields, true ) );
|
||||
return self::query( "INSERT INTO $table SET $insertString" );
|
||||
}
|
||||
|
||||
public static function getError() {
|
||||
if( $e = mysql_error( self::$link ) ) {
|
||||
return "MySQL reports: '$e' on query\n".self::$sql;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function quote( $s ) {
|
||||
if( self::$link === null ) {
|
||||
self::connect();
|
||||
}
|
||||
if( !isset($s) || $s === false ) {
|
||||
return 0;
|
||||
}
|
||||
else if( $s === true ) {
|
||||
return 1;
|
||||
}
|
||||
else if( is_numeric( $s ) ) {
|
||||
return $s;
|
||||
}
|
||||
else {
|
||||
return "'".mysql_real_escape_string( $s )."'";
|
||||
}
|
||||
}
|
||||
|
||||
public static function quoteArray( &$fields, $useKeys = false ) {
|
||||
$r = array();
|
||||
foreach( $fields as $key => &$value ) {
|
||||
$r[] = ( $useKeys ? "`$key`=":'' ) . self::quote( $value );
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Various functions regarding file handling
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
|
||||
class Filesystem {
|
||||
|
||||
public static function rmdirr( $dir, $clearOnly = false ) {
|
||||
$dh = opendir( $dir );
|
||||
while ( $file = readdir( $dh ) ) {
|
||||
if( $file != '.' && $file != '..' ) {
|
||||
$fullpath = $dir.'/'.$file;
|
||||
if( !is_dir( $fullpath ) ) {
|
||||
@unlink( $fullpath );
|
||||
}
|
||||
else {
|
||||
self::rmdirr( $fullpath );
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir( $dh );
|
||||
|
||||
if( !$clearOnly && @rmdir( $dir ) ) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function mkdirr( $pathname ) {
|
||||
// Check if directory already exists
|
||||
if( empty($pathname) || is_dir($pathname) ) {
|
||||
return true;
|
||||
}
|
||||
if ( is_file($pathname) ) {
|
||||
return false;
|
||||
}
|
||||
// Crawl up the directory tree
|
||||
$nextPathname = substr( $pathname, 0, strrpos( $pathname, '/' ) );
|
||||
if( self::mkdirr( $nextPathname ) ) {
|
||||
if( !file_exists( $pathname ) ) {
|
||||
$oldUmask = umask(0);
|
||||
$success = @mkdir( $pathname, Config::$defaultChmod );
|
||||
umask( $oldUmask );
|
||||
return $success;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function download( $url, $target, $maxSize = 2097152, $referer) {
|
||||
$contents = '';
|
||||
$bytesRead = 0;
|
||||
|
||||
|
||||
//$referer = false;
|
||||
/*if( $referer ) {
|
||||
$opts = array(
|
||||
'http'=>array(
|
||||
'method'=>"GET",
|
||||
'header'=>"Referer: $referer\r\n"
|
||||
)
|
||||
);
|
||||
$context = stream_context_create($opts);
|
||||
$fp = fopen( $url, 'r', false, $context );
|
||||
} else {
|
||||
|
||||
}*/
|
||||
|
||||
$contents= file_get_contents($url);
|
||||
$savefile = fopen($target, "w");
|
||||
fwrite($savefile, $contents);
|
||||
fclose($savefile);
|
||||
return true;
|
||||
/*
|
||||
try {
|
||||
$fp = @fopen( $url, 'r' );
|
||||
}
|
||||
catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
while ( !feof( $fp ) ) {
|
||||
$chunk = fread( $fp, 8192 );
|
||||
$bytesRead += strlen( $chunk );
|
||||
if( $bytesRead > $maxSize) {
|
||||
return false;
|
||||
}
|
||||
$contents .= $chunk;
|
||||
}
|
||||
fclose( $fp );
|
||||
|
||||
file_put_contents( $target, $contents );
|
||||
return true;*/
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
|
||||
|
||||
function shorter($input, $length)
|
||||
{
|
||||
//no need to trim, already shorter than trim length
|
||||
if (strlen($input) <= $length) {
|
||||
return $input;
|
||||
}
|
||||
|
||||
//find last space within length
|
||||
$last_space = strrpos(substr($input, 0, $length), ' ');
|
||||
if(!$last_space) $last_space = $length;
|
||||
$trimmed_text = substr($input, 0, $last_space);
|
||||
|
||||
//add ellipses (...)
|
||||
$trimmed_text .= '...';
|
||||
|
||||
return $trimmed_text;
|
||||
}
|
||||
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
$comments = DB::query('SELECT * FROM pl_comments WHERE c_like="0" ORDER BY created DESC LIMIT 40');
|
||||
|
||||
foreach (array_keys($comments) as $c) {
|
||||
$posterinfo = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$comments[$c]["userId"]);
|
||||
$commentimg = DB::getRow("SELECT * FROM pl_commentuploads WHERE c_id=:1",$comments[$c]["id"]);
|
||||
$imageinfo = DB::getRow("SELECT * FROM pl_images WHERE id=:1",$comments[$c]["imageId"]);
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id);
|
||||
$blockeduser = array_map('strtolower', unserialize($blockedrow['users']));
|
||||
$lower = strtolower($posterinfo["name"]);
|
||||
|
||||
if(!($commentimg && ($comments[$c]["userId"] == $imageinfo["user"]))){
|
||||
|
||||
if (!in_array($lower,$blockeduser)){
|
||||
if ($imageinfo && $posterinfo){
|
||||
|
||||
?>
|
||||
|
||||
<div id="commentbar">
|
||||
<a href="<?php echo (Config::$absolutePath.'all/view/'.$imageinfo["keyword"]); ?>">
|
||||
<div id="commentimg">
|
||||
<img width="28" height="28" src="<?php echo(Config::$absolutePath.$posterinfo["avatar"]); ?>" />
|
||||
</div>
|
||||
<div id="commenttext">
|
||||
<strong><?php echo(shorter(strip_tags($posterinfo["name"]),"10")); ?>: </strong><?php echo(shorter(strip_tags($comments[$c]["content"]),"50")); ?>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php }}}}?>
|
||||
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This class takes an array of images and sorts them into a grid view.
|
||||
This is the equivalent of the javascript gridSolve function in picturelicious.js
|
||||
with the difference that it runs server side of course.
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
|
||||
class GridView {
|
||||
|
||||
public $height = 0;
|
||||
protected $grid = array();
|
||||
protected $gridWidth = 20;
|
||||
|
||||
public function __construct( $gridWidth = 20 ) {
|
||||
$this->gridWidth = $gridWidth;
|
||||
$this->grid = array_fill( 0, $this->gridWidth, 0 );
|
||||
}
|
||||
|
||||
// solve expects an array with thumbnails with the keys name and score
|
||||
public function solve( &$thumbs ) {
|
||||
if( !is_array( $thumbs ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Order thumbs by importance (score), but leave the keys as they are
|
||||
uasort( $thumbs, array( $this, 'compareScore' ) );
|
||||
|
||||
// How many thumbs get which CSS-Class? The first n thumbnails
|
||||
// get the biggest box etc.
|
||||
$total = count( $thumbs );
|
||||
$classCounts = array();
|
||||
$currentCount = 0;
|
||||
foreach( Config::$gridView['classes'] as $className => $gc ) {
|
||||
$currentCount += $gc['percentage'] * $total;
|
||||
$classCounts[$className] = ceil( $currentCount );
|
||||
}
|
||||
|
||||
// Assign a CSS-Class to each thumb
|
||||
$currentMax = -1;
|
||||
$currentClass = '';
|
||||
$j = 0;
|
||||
foreach( array_keys( $thumbs ) as $i ) {
|
||||
if( $j >= $currentMax ) {
|
||||
list( $currentClass, $currentMax ) = each( $classCounts );
|
||||
}
|
||||
$j++;
|
||||
$thumbs[$i]['class'] = $currentClass;
|
||||
$thumbs[$i]['thumb'] = Config::$absolutePath . Config::$images['thumbPath'] .
|
||||
str_replace( '-', '/', substr( $thumbs[$i]['logged'], 0, 7 ) )
|
||||
.'/'. Config::$gridView['classes'][$currentClass]['dir']
|
||||
.'/'. $thumbs[$i]['thumb'];
|
||||
}
|
||||
|
||||
// Sort the thumbs back in the order we got them
|
||||
ksort( $thumbs );
|
||||
|
||||
// Now that every thumb has a CSS-Class, we can sort them into our grid
|
||||
for( $i = 0; $i < $total; $i++ ) {
|
||||
list( $x, $y ) = $this->insert(
|
||||
Config::$gridView['classes'][$thumbs[$i]['class']]['width'],
|
||||
Config::$gridView['classes'][$thumbs[$i]['class']]['height']
|
||||
);
|
||||
$thumbs[$i]['left'] = $x * Config::$gridView['gridSize'];
|
||||
$thumbs[$i]['top'] = $y * Config::$gridView['gridSize'];
|
||||
}
|
||||
|
||||
// Calculate the final grid height
|
||||
for( $i = 0; $i < $this->gridWidth; $i++ ) {
|
||||
if( $this->grid[$i] > $this->height ) {
|
||||
$this->height = $this->grid[$i];
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Callback for uasort()
|
||||
protected function compareScore( $a, $b ) {
|
||||
return $a['score'] > $b['score'] ?
|
||||
1 :
|
||||
( $a['score'] == $b['score'] && $a['votes'] > $b['votes'] ?
|
||||
1 :
|
||||
-1
|
||||
);
|
||||
}
|
||||
|
||||
protected function insert( $boxWidth, $boxHeight ) {
|
||||
|
||||
// Height of the grid
|
||||
$maxHeight = 0;
|
||||
|
||||
// Height of the grid at the last position
|
||||
$currentHeight = $this->grid[0];
|
||||
|
||||
// Find free spots within the grid and collect them in an arry
|
||||
// A spot is a area in the grid with equal height
|
||||
$spotWidth = 0; // Width of the spot in grid units
|
||||
$spotLeft = 0; // Position in the grid (relative to left border)
|
||||
$freeSpots = array();
|
||||
|
||||
for( $i = 0; $i < $this->gridWidth; $i++ ) {
|
||||
|
||||
// Height is the same as at the last position?
|
||||
// -> increase the size of this spot
|
||||
if( $currentHeight == $this->grid[$i] ) {
|
||||
$spotWidth++;
|
||||
}
|
||||
|
||||
// The height is different from the last position, and our current spot
|
||||
// is wider than 0
|
||||
if( ( $currentHeight != $this->grid[$i] || $i+1 == $this->gridWidth) && $spotWidth > 0 ) {
|
||||
$freeSpots[] = array( 'width' =>$spotWidth, 'left' => $spotLeft, 'height' => $currentHeight );
|
||||
$spotWidth = 1;
|
||||
$spotLeft = $i;
|
||||
|
||||
// Make sure we don't miss the last one
|
||||
if( $currentHeight != $this->grid[$i] && $i+1 == $this->gridWidth ) {
|
||||
$freeSpots[] = array( 'width' =>$spotWidth, 'left' => $spotLeft, 'height' => $this->grid[$i] );
|
||||
}
|
||||
}
|
||||
|
||||
$currentHeight = $this->grid[$i];
|
||||
$maxHeight = max( $maxHeight, $this->grid[$i] );
|
||||
}
|
||||
|
||||
// Loop through all found spots and rate them, based on their size and height
|
||||
// This way the smallest possible spot in the lowest possible height is filled
|
||||
$targetHeight = 0;
|
||||
$targetLeft = 0;
|
||||
|
||||
// Default spot (left border) if we don't find a better one
|
||||
for( $i = 0; $i < $boxWidth; $i++ ) {
|
||||
if( $this->grid[$i] > $targetHeight ) {
|
||||
$targetHeight = $this->grid[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$bestScore = -1;
|
||||
foreach( array_keys( $freeSpots ) as $i ) {
|
||||
|
||||
// Difference of the height of this spot to the total height of the grid
|
||||
$heightScore = ( $maxHeight - $freeSpots[$i]['height'] );
|
||||
|
||||
// Relation of the required and the available space
|
||||
$widthScore = $boxWidth / $freeSpots[$i]['width'];
|
||||
|
||||
// The score for this spot is calculated by these both criteria
|
||||
$score = $heightScore * $heightScore + $widthScore * 2;
|
||||
|
||||
// Is the score for this spot higher than for the last one we found?
|
||||
if( $freeSpots[$i]['width'] >= $boxWidth && $score > $bestScore ) {
|
||||
$targetHeight = $freeSpots[$i]['height'];
|
||||
$targetLeft = $freeSpots[$i]['left'];
|
||||
$bestScore = $score;
|
||||
}
|
||||
}
|
||||
|
||||
$newHeight = $targetHeight + $boxHeight;
|
||||
|
||||
// Adjust grid height
|
||||
for( $j = 0; $j < $boxWidth; $j++ ) {
|
||||
$this->grid[$targetLeft + $j] = $newHeight;
|
||||
}
|
||||
|
||||
return array( $targetLeft, $targetHeight );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
ImageBrowser loads a set of images specified by a search term, user and page.
|
||||
*/
|
||||
|
||||
require_once( 'lib/imagecatalog.php' );
|
||||
|
||||
class ImageBrowser extends ImageCatalog {
|
||||
protected $page = 0;
|
||||
public $thumbsPerPage = 0;
|
||||
protected $commentBool = false;
|
||||
protected $FavBool = false;
|
||||
protected $unreadBool = false;
|
||||
protected $userID = 0;
|
||||
protected $grid = false;
|
||||
public $thumbs = array();
|
||||
public $pages = array();
|
||||
|
||||
|
||||
public function __construct( $thumbsPerPage = 20 ) {
|
||||
$this->thumbsPerPage = abs(intval($thumbsPerPage));
|
||||
}
|
||||
|
||||
public function setPage( $page ) {
|
||||
$page = intval($page);
|
||||
$this->page = $page > 0 ? $page - 1 : 0;
|
||||
}
|
||||
public function setComment( $cmt,$un ) {
|
||||
$this->commentBool = $cmt ;
|
||||
$this->unreadBool = $un;
|
||||
}
|
||||
public function setFav( $fav ) {
|
||||
$this->FavBool = $fav ;
|
||||
}
|
||||
public function setuserID( $id ) {
|
||||
$this->userID = $id ;
|
||||
}
|
||||
|
||||
public function sortByOneKey(array $array, $key, $asc = true) {
|
||||
$result = array();
|
||||
|
||||
$values = array();
|
||||
foreach ($array as $id => $value) {
|
||||
$values[$id] = isset($value[$key]) ? $value[$key] : '';
|
||||
}
|
||||
|
||||
if ($asc) {
|
||||
asort($values);
|
||||
}
|
||||
else {
|
||||
arsort($values);
|
||||
}
|
||||
|
||||
foreach ($values as $key => $value) {
|
||||
$result[$key] = $array[$key];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function multi_unique($myArray)
|
||||
{
|
||||
if(!is_array($myArray))
|
||||
return $myArray;
|
||||
|
||||
foreach ($myArray as &$myvalue){
|
||||
$myvalue=serialize($myvalue);
|
||||
}
|
||||
|
||||
$myArray=array_unique($myArray);
|
||||
|
||||
foreach ($myArray as &$myvalue){
|
||||
$myvalue=unserialize($myvalue);
|
||||
}
|
||||
|
||||
return $myArray;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function load() {
|
||||
$this->grid=true;
|
||||
|
||||
if( !empty( $this->searchColor ) ) { // ----------------------------------- color search
|
||||
$this->thumbs = DB::query(
|
||||
'SELECT SQL_CALC_FOUND_ROWS
|
||||
i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS,
|
||||
i.keyword, i.thumb, i.score, i.votes,
|
||||
u.name AS userName,
|
||||
MIN( ABS(ic.r - :3) + ABS(ic.g - :4) + ABS(ic.b - :5) ) AS deviation
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = i.user
|
||||
LEFT JOIN '.TABLE_IMAGECOLORS.' ic
|
||||
ON ic.imageId = i.id
|
||||
WHERE
|
||||
ic.r BETWEEN :3 - :6 AND :3 + :6
|
||||
AND
|
||||
ic.g BETWEEN :4 - :6 AND :4 + :6
|
||||
AND
|
||||
ic.b BETWEEN :5 - :6 AND :5 + :6
|
||||
GROUP BY i.id
|
||||
ORDER BY deviation, i.id DESC
|
||||
LIMIT :1, :2',
|
||||
$this->page * $this->thumbsPerPage,
|
||||
$this->thumbsPerPage,
|
||||
|
||||
$this->searchColor['r'],
|
||||
$this->searchColor['g'],
|
||||
$this->searchColor['b'],
|
||||
Config::$colorSearchDev
|
||||
);
|
||||
}
|
||||
else if( $this->searchTerm ) { // ------------------------ fulltext search
|
||||
$ftq = preg_replace( '/\s+/',' +', $this->searchTerm );
|
||||
$this->thumbs = DB::query(
|
||||
'SELECT SQL_CALC_FOUND_ROWS
|
||||
i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS,
|
||||
i.keyword, i.thumb, i.score, i.votes,
|
||||
u.name AS userName
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = i.user
|
||||
WHERE
|
||||
i.image LIKE :3
|
||||
OR MATCH( i.tags ) AGAINST ( :4 IN BOOLEAN MODE )
|
||||
ORDER BY i.id DESC
|
||||
LIMIT :1, :2',
|
||||
$this->page * $this->thumbsPerPage,
|
||||
$this->thumbsPerPage,
|
||||
|
||||
'%'.$this->searchTerm.'%',
|
||||
$ftq
|
||||
);
|
||||
}
|
||||
|
||||
elseif ($this->commentBool) {
|
||||
|
||||
if($this->unreadBool) {
|
||||
|
||||
$this->thumbs = DB::query("SELECT SQL_CALC_FOUND_ROWS i.logged, UNIX_TIMESTAMP(i.logged) as loggedTS,i.keyword as keyword, i.thumb as thumb, i.score as score, i.votes as votes, us.name as userName FROM pl_images as i, pl_unread as u, pl_users as us WHERE u.userid = :1 AND u.imageid=i.id AND us.id=i.user ORDER BY loggedTS DESC LIMIT :2, :3",$this->userID,
|
||||
$this->page * $this->thumbsPerPage,$this->thumbsPerPage);
|
||||
if (count($this->thumbs) < $this->thumbsPerPage){
|
||||
$this->thumbsPerPage = count($this->thumbs);}
|
||||
|
||||
}else{
|
||||
$this->thumbs = DB::query('SELECT SQL_CALC_FOUND_ROWS i.logged, UNIX_TIMESTAMP(i.logged) as loggedTS,i.keyword as keyword, i.thumb as thumb, i.score as score, i.votes as votes, u.name as userName FROM pl_comments as c, pl_images as i, pl_users as u WHERE c.c_like=0 AND c.userId=u.id AND c.userId=:1 AND i.id=c.imageId GROUP BY c.imageId ORDER BY loggedTS DESC LIMIT :2, :3',$this->userID,
|
||||
$this->page * $this->thumbsPerPage,$this->thumbsPerPage);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$this->commentState = true;
|
||||
$this->basePath = "comments/";
|
||||
|
||||
|
||||
|
||||
|
||||
}elseif ($this->FavBool) {
|
||||
$this->thumbs = DB::query("SELECT SQL_CALC_FOUND_ROWS i.logged, UNIX_TIMESTAMP( i.logged ) AS loggedTS, i.keyword AS keyword, i.thumb AS thumb, i.score AS score, i.votes AS votes, u.name AS userName
|
||||
FROM pl_fav AS c, pl_images AS i, pl_users AS u
|
||||
WHERE c.user = u.id
|
||||
AND c.user =:1
|
||||
AND i.id = c.imageId
|
||||
GROUP BY c.imageId
|
||||
ORDER BY loggedTS DESC LIMIT :2, :3",$this->userID,
|
||||
$this->page * $this->thumbsPerPage,$this->thumbsPerPage);
|
||||
$this->basePath = "favorites/";
|
||||
$this->FavState = true;
|
||||
|
||||
|
||||
}else { // -------------------------------------------------------- user/all
|
||||
$conditions = '';
|
||||
if( !empty($this->user) ) {
|
||||
$conditions .= ' AND i.user = :3';
|
||||
}
|
||||
|
||||
$this->thumbs = DB::query(
|
||||
'SELECT SQL_CALC_FOUND_ROWS
|
||||
i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS,
|
||||
i.keyword, i.thumb, i.score, i.votes,
|
||||
u.name AS userName
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = i.user
|
||||
WHERE 1 '.$conditions.'
|
||||
ORDER BY i.id DESC
|
||||
LIMIT :1, :2',
|
||||
|
||||
|
||||
|
||||
$this->page * $this->thumbsPerPage,
|
||||
$this->thumbsPerPage,
|
||||
$this->user['id']
|
||||
);
|
||||
|
||||
$this->grid=true;
|
||||
if(count($this->thumbs) > 3){
|
||||
$this->thumbs[0]["score"] = "100";
|
||||
$this->thumbs[1]["score"] = "10";
|
||||
$this->thumbs[2]["score"] = "10";
|
||||
|
||||
$thumbsCount = count($this->thumbs);
|
||||
if ($thumbsCount > 50){
|
||||
for ($i=$thumbsCount-40; $i<$thumbsCount; $i++){
|
||||
$this->thumbs[$i]["score"] = "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->totalResults = DB::foundRows();
|
||||
|
||||
|
||||
// compute previoues, current and next page
|
||||
if( $this->totalResults > 0 ) {
|
||||
$this->pages['current'] = $this->page+1;
|
||||
$this->pages['total'] = ceil($this->totalResults / $this->thumbsPerPage);
|
||||
if( $this->page > 0 ) {
|
||||
$this->pages['prev'] = $this->page;
|
||||
}
|
||||
if( $this->totalResults > $this->thumbsPerPage * $this->page + $this->thumbsPerPage ) {
|
||||
$this->pages['next'] = $this->page + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function loadRandom( $minScore, $thumbSize ) {
|
||||
$this->thumbs = DB::query(
|
||||
'SELECT SQL_CALC_FOUND_ROWS
|
||||
i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS,
|
||||
i.keyword, i.thumb, i.score, i.votes,
|
||||
u.name AS userName
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = i.user
|
||||
WHERE i.score >= :2
|
||||
ORDER BY RAND()
|
||||
LIMIT :1',
|
||||
|
||||
$this->thumbsPerPage,
|
||||
$minScore
|
||||
);
|
||||
|
||||
foreach( array_keys( $this->thumbs ) as $i ) {
|
||||
$this->thumbs[$i]['thumb'] = Config::$images['thumbPath'] .
|
||||
str_replace( '-', '/', substr( $this->thumbs[$i]['logged'], 0, 7 ) )
|
||||
.'/'. $thumbSize
|
||||
.'/'. $this->thumbs[$i]['thumb'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
ImageCatalog is the abstract base class for ImageBrowser and ImageViewer. It provides
|
||||
the basic functionality to help build queries to get the images out of the database.
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
class ImageCatalog {
|
||||
public $user = array();
|
||||
public $searchTerm = '';
|
||||
public $searchColor = array();
|
||||
public $totalResults = 0;
|
||||
|
||||
public $basePath = 'all/';
|
||||
|
||||
public function setUser( $name ) {
|
||||
$this->user = DB::getRow(
|
||||
'SELECT id, name, score, images, avatar, website
|
||||
FROM '.TABLE_USERS.'
|
||||
WHERE
|
||||
valid = 1 AND
|
||||
name = :1',
|
||||
$name
|
||||
);
|
||||
if( !empty($this->user) ) {
|
||||
$this->basePath = 'user/'.$this->user['name'].'/';
|
||||
}
|
||||
}
|
||||
|
||||
public function setSearch( $term ) {
|
||||
|
||||
$this->basePath = 'search/'.htmlspecialchars($term).'/';
|
||||
|
||||
if( preg_match( '/^\s*0x([0-9a-f]{6})\s*$/i', $term, $m ) ) {
|
||||
$c = str_split( $m[1], 2 );
|
||||
$this->searchColor = array(
|
||||
'r' => hexdec($c[0]),
|
||||
'g' => hexdec($c[1]),
|
||||
'b' => hexdec($c[2]),
|
||||
);
|
||||
}
|
||||
else if( !empty($term) ) {
|
||||
$this->searchTerm = $term;
|
||||
$ftq = preg_replace( '/\s+/',' +', $this->searchTerm );
|
||||
$this->seachCondition .= " AND (
|
||||
i.image LIKE ".DB::quote('%'.$this->searchTerm.'%')."
|
||||
OR MATCH( i.tags ) AGAINST ( ".DB::quote($ftq)." IN BOOLEAN MODE )
|
||||
)";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function load() {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Various functions regarding thumbnail creation and color extraction
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
|
||||
class Image {
|
||||
|
||||
public static function createThumb( $imgPath, $thumbPath, $thumbWidth, $thumbHeight ) {
|
||||
list( $srcWidth, $srcHeight, $type ) = getimagesize( $imgPath );
|
||||
$srcX = 0;
|
||||
$srcY = 0;
|
||||
if(
|
||||
$srcWidth < 1 || $srcWidth > 10000
|
||||
|| $srcHeight < 1 || $srcHeight > 10000
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if( $type == IMAGETYPE_JPEG ) {
|
||||
$imgcreate = 'ImageCreateFromJPEG';
|
||||
} else if( $type == IMAGETYPE_GIF ) {
|
||||
$imgcreate = 'ImageCreateFromGIF';
|
||||
} else if( $type == IMAGETYPE_PNG ) {
|
||||
$imgcreate = 'ImageCreateFromPNG';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
$thumbDirName = dirname( $thumbPath );
|
||||
|
||||
if( ( $srcWidth/$srcHeight ) > ( $thumbWidth/$thumbHeight ) ) {
|
||||
$zoom = ($srcWidth/$srcHeight) / ($thumbWidth/$thumbHeight);
|
||||
$srcX = ($srcWidth - $srcWidth / $zoom) / 2;
|
||||
$srcWidth = $srcWidth / $zoom;
|
||||
}
|
||||
else {
|
||||
$zoom = ($thumbWidth/$thumbHeight) / ($srcWidth/$srcHeight);
|
||||
$srcY = ($srcHeight - $srcHeight / $zoom) / 2;
|
||||
$srcHeight = $srcHeight / $zoom;
|
||||
}
|
||||
|
||||
$thumb = Imagecreatetruecolor( $thumbWidth, $thumbHeight );
|
||||
$orig = $imgcreate( $imgPath );
|
||||
Imagecopyresampled($thumb, $orig, 0, 0, $srcX, $srcY, $thumbWidth, $thumbHeight, $srcWidth, $srcHeight);
|
||||
|
||||
if( Config::$images['sharpen'] && function_exists('imageconvolution') ) {
|
||||
$sharpenMatrix = array( array(-1,-1,-1), array(-1,16,-1), array(-1,-1,-1) );
|
||||
imageconvolution($thumb, $sharpenMatrix, 8, 0);
|
||||
}
|
||||
imagejpeg( $thumb, $thumbPath, Config::$images['jpegQuality'] );
|
||||
|
||||
// clean up
|
||||
Imagedestroy( $thumb );
|
||||
Imagedestroy( $orig );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getColors( $imgPath, $size ) {
|
||||
list( $srcWidth, $srcHeight, $type ) = getimagesize( $imgPath );
|
||||
|
||||
if( $type == IMAGETYPE_JPEG ) {
|
||||
$imgcreate = 'ImageCreateFromJPEG';
|
||||
} else if( $type == IMAGETYPE_GIF ) {
|
||||
$imgcreate = 'ImageCreateFromGIF';
|
||||
} else if( $type == IMAGETYPE_PNG ) {
|
||||
$imgcreate = 'ImageCreateFromPNG';
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
|
||||
$orig = $imgcreate( $imgPath );
|
||||
|
||||
$thumb = Imagecreatetruecolor( $size, $size );
|
||||
Imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $size, $size, $srcWidth, $srcHeight);
|
||||
|
||||
$colors = array();
|
||||
for( $x = 0; $x < $size; $x++ ) {
|
||||
for( $y = 0; $y < $size; $y++ ) {
|
||||
$rgb = ImageColorAt($thumb, $x, $y);
|
||||
$r = ($rgb >> 16) & 0xFF;
|
||||
$g = ($rgb >> 8) & 0xFF;
|
||||
$b = $rgb & 0xFF;
|
||||
$colors[] = array(
|
||||
'r' => $r,
|
||||
'g' => $g,
|
||||
'b' => $b
|
||||
);
|
||||
}
|
||||
}
|
||||
return $colors;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,324 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
The ImageUploader class handles the insertion of images into the system -
|
||||
whether they were uploaded or should be copied from a remote URL
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
require_once( 'lib/filesystem.php' );
|
||||
require_once( 'lib/images.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/keyword.php' );
|
||||
|
||||
class ImageUploader {
|
||||
|
||||
|
||||
public static function writeError($error) {
|
||||
|
||||
$handle = fopen('./import/log.txt', 'a');
|
||||
fwrite($handle, $error);
|
||||
fclose($handle);
|
||||
|
||||
}
|
||||
|
||||
public static function copyFromUrl( $url, $tags, $referer, &$errors,$commentUpload=false,$cid=0) {
|
||||
|
||||
$upl = DB::getRow("SELECT * FROM pl_settings");
|
||||
if ($upl["upload"] != 1){
|
||||
$errors['notLoggedIn'] = 'Upload disabled.';
|
||||
return false;
|
||||
}
|
||||
|
||||
$url = str_replace("https", "http", $url);
|
||||
|
||||
if( stripos( $url, 'http://' ) !== 0 ) {
|
||||
$url = 'http://'.$url;
|
||||
}
|
||||
// no recursion, no non-images
|
||||
if(
|
||||
stripos( $url, Config::$frontendPath ) !== false ||
|
||||
!preg_match( '/([^\/]*?)\.(gif|jpg|jpeg|png)$/i', $url, $fileMatch )
|
||||
) {
|
||||
$errors['downloadFailed'] = 'The Image could not be downloaded!';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$fileName = $fileMatch[1];
|
||||
// use the domain name as part of the keyword
|
||||
$urlParts = parse_url( $url );
|
||||
if( preg_match( '/(^|\.)([\w\-]+)\.\w+$/', $urlParts['host'], $m ) ) {
|
||||
$fileName = strtolower($m[2]).'-'.$fileName;
|
||||
}
|
||||
$fileName = Keyword::get( $fileName ).'.'.$fileMatch[2];
|
||||
$targetPath = './import/'.$fileName;
|
||||
|
||||
if( !Filesystem::download( $url, $targetPath, Config::$images['maxDownload'], $referer ) ) {
|
||||
$errors['downloadFailed'] = 'The Image could not be downloaded!';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( self::process( $fileName, $targetPath, $tags, false, $errors, $url,$commentUpload,$cid) ) {
|
||||
return true;
|
||||
} else {
|
||||
@unlink( $targetPath );
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function process( $name, $localPath, $tags, $uploaded, &$errors, $source, $commentUpload=false,$cid=0) {
|
||||
|
||||
$upl = DB::getRow("SELECT * FROM pl_settings");
|
||||
if ($upl["upload"] != 1){
|
||||
$errors['downloadFailed'] = 'Upload disabled.';
|
||||
return false;
|
||||
}
|
||||
|
||||
self::writeError("test");
|
||||
|
||||
$user = new User();
|
||||
$user->login();
|
||||
|
||||
if( !$user->id ) {
|
||||
$errors['notLoggedIn'] = 'You are not logged in!';
|
||||
return false;
|
||||
}
|
||||
|
||||
// no non-images
|
||||
if(
|
||||
!preg_match( '/([^\/]*?)\.(gif|jpg|jpeg|png)$/i', $name, $fileMatch )
|
||||
) {
|
||||
$errors['wrongExtension'] = 'Your file has not the right extension (gif, jpg or png)!';
|
||||
self::writeError("1");
|
||||
return false;
|
||||
}
|
||||
|
||||
$time = time();
|
||||
$keyword = Keyword::get( $fileMatch[1] );
|
||||
|
||||
// Iterate over all keywords, if this one is allready taken
|
||||
$taken = array();
|
||||
$r = DB::query( 'SELECT keyword FROM '.TABLE_IMAGES.' WHERE keyword LIKE :1', date('Y/m/',$time).$keyword.'%' );
|
||||
foreach( $r as $v ) {
|
||||
$taken[] = substr($v['keyword'],8); // Keyword without date!
|
||||
}
|
||||
$keyword = Keyword::iterate( $keyword, $taken );
|
||||
|
||||
list( $srcWidth, $srcHeight, $type, $attr ) = getimagesize($localPath);
|
||||
|
||||
if( $type == IMAGETYPE_JPEG ) {
|
||||
$extension = 'jpg';
|
||||
} else if( $type == IMAGETYPE_GIF ) {
|
||||
$extension = 'gif';
|
||||
} else if( $type == IMAGETYPE_PNG ) {
|
||||
$extension = 'png';
|
||||
} else if($uploaded == false) {
|
||||
if(preg_match( '/([^\/]*?)\.(jpg|jpeg)$/i', $localPath, $fileMatch )) {
|
||||
$extension = 'jpg';
|
||||
}
|
||||
else if(preg_match( '/([^\/]*?)\.(png)$/i', $localPath, $fileMatch )) {
|
||||
$extension = 'png';
|
||||
}
|
||||
else if(preg_match( '/([^\/]*?)\.(gif)$/i', $localPath, $fileMatch )) {
|
||||
$extension = 'gif';
|
||||
}
|
||||
|
||||
} else {
|
||||
self::writeError("2");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$thumbName = $keyword.".jpg"; // all thumbs are jpegs!
|
||||
$name = $keyword.".".$extension;
|
||||
$imageDir = Config::$images['imagePath'] . date('Y/m', $time);
|
||||
$thumbDir = Config::$images['thumbPath'] . date('Y/m', $time);
|
||||
$imagePath = $imageDir.'/'.$name;
|
||||
|
||||
if( !Filesystem::mkdirr($imageDir) || !Filesystem::mkdirr($thumbDir) ) {
|
||||
$errors['downloadFailed'] = 'folder failed';
|
||||
self::writeError("3");
|
||||
return false;
|
||||
}
|
||||
|
||||
if( $uploaded ) {
|
||||
if( !@move_uploaded_file( $localPath, $imagePath ) ) {
|
||||
$errors['downloadFailed'] = 'move failed';
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if( !@rename( $localPath, $imagePath ) ) {
|
||||
$errors['downloadFailed'] = 'rename failed';
|
||||
self::writeError($extension);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
self::writeError($imagePath);
|
||||
|
||||
if($commentUpload == false && $cid == 0){
|
||||
$hash = md5_file( $imagePath );
|
||||
$c = DB::getRow('SELECT id,keyword FROM '.TABLE_IMAGES.' WHERE hash = :1', $hash);
|
||||
if( !empty( $c ) ) {
|
||||
|
||||
unlink( $imagePath );
|
||||
$errors['duplicate'] =
|
||||
'This image is already in our database!'."<br /><a href='http://www.4ducky.com/all/".'view/'.end($c)."'>Click <u>here</u> to comment it.</a>";
|
||||
self::writeError("5");
|
||||
return false;
|
||||
|
||||
}else{
|
||||
$c = DB::query('SELECT id FROM pl_bannedimages WHERE hash = :1', $hash);
|
||||
if( !empty( $c ) ) {
|
||||
unlink( $imagePath );
|
||||
$errors['duplicate'] = 'This image is already in our database!';
|
||||
self::writeError("6");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// make thumbs
|
||||
foreach( Config::$gridView['classes'] as $gc ) {
|
||||
$thumbPath = $thumbDir.'/'.$gc['dir'].'/'.$thumbName;
|
||||
Filesystem::mkdirr($thumbDir.'/'.$gc['dir']);
|
||||
if( !Image::createThumb( $imagePath, $thumbPath,
|
||||
$gc['width'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth'],
|
||||
$gc['height'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth']
|
||||
)) {
|
||||
unlink( $imagePath );
|
||||
$errors['internalError'] = 'Error generating thumbnails!';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
///watermark
|
||||
watermark($imagePath,"media/watermark.png",$imagePath);
|
||||
///watermark
|
||||
|
||||
$user->increaseScore( Config::$postScore );
|
||||
|
||||
|
||||
|
||||
|
||||
if (($commentUpload) && ($cid != 0)){
|
||||
|
||||
DB::query('INSERT INTO pl_commentuploads (c_id,image_link,thumb_link) VALUES (:1,:2,:3)',$cid,$imagePath,"data/thumbs/".date('Y/m/', $time)."64x64/".$thumbName);
|
||||
|
||||
|
||||
|
||||
|
||||
/*DB::insertRow( "pl_commentuploads",array('c_id' => $cid,"image_link" =>$imagePath,"thumb_link" => "data/thumbs/".date('Y/m/', $time)."/128x128/".$name));*/
|
||||
|
||||
}else{
|
||||
$iCount = DB::getRow("SELECT COUNT(*) as c FROM pl_images WHERE user=:1",$user->id);
|
||||
DB::query( 'UPDATE '.TABLE_USERS.' SET images =:2 WHERE id = :1', $user->id,(int)$iCount["c"]);
|
||||
|
||||
DB::insertRow( TABLE_IMAGES,
|
||||
array(
|
||||
'logged' => date('Y-m-d H:i:s', $time),
|
||||
'user' => $user->id,
|
||||
'score' => 1,
|
||||
'votes' => 0,
|
||||
'keyword' => date('Y/m/', $time).$keyword,
|
||||
'tags' => $tags,
|
||||
'image' => $name,
|
||||
'thumb' => $thumbName,
|
||||
'hash' => $hash,
|
||||
'source' => $source
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$imageId = DB::insertId();
|
||||
|
||||
/*$colors = Image::getColors( $imagePath, 4 );
|
||||
foreach( $colors as $c ) {
|
||||
DB::insertRow( TABLE_IMAGECOLORS,
|
||||
array(
|
||||
'imageId' => $imageId,
|
||||
'r' => $c['r'],
|
||||
'g' => $c['g'],
|
||||
'b' => $c['b']
|
||||
)
|
||||
);
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function watermark($SourceFile, $WatermarkFile, $SaveToFile = NULL)
|
||||
|
||||
{
|
||||
|
||||
list( $srcWidth, $srcHeight, $type ) = getimagesize( $SourceFile );
|
||||
if( $type != IMAGETYPE_GIF ) {
|
||||
|
||||
$watermark = @imagecreatefrompng($WatermarkFile)
|
||||
|
||||
|
||||
or exit('Cannot open the watermark file.');
|
||||
|
||||
imageAlphaBlending($watermark, false);
|
||||
|
||||
imageSaveAlpha($watermark, true);
|
||||
|
||||
$image_string = @file_get_contents($SourceFile)
|
||||
|
||||
|
||||
or exit('Cannot open image file.');
|
||||
|
||||
$image = @imagecreatefromstring($image_string)
|
||||
|
||||
|
||||
or exit('Not a valid image format.');
|
||||
|
||||
/*$tmp = imagecreatetruecolor($srcWidth,($srcHeight + 30));*/
|
||||
|
||||
/*$back = imagecolorallocatealpha($image, 0, 0, 0,60);
|
||||
imagefilledrectangle($image,0, $srcHeight - 20,$srcWidth,$srcHeight ,$back); */
|
||||
|
||||
/*imagecopy($tmp,$image,0,0,0,0,$srcWidth,$srcHeight);
|
||||
|
||||
$image = $tmp;*/
|
||||
|
||||
|
||||
$imageWidth=imageSX($image);
|
||||
$imageHeight=imageSY($image);
|
||||
|
||||
$watermarkWidth=imageSX($watermark);
|
||||
$watermarkHeight=imageSY($watermark);
|
||||
|
||||
$coordinate_X = ( $imageWidth) - ( $watermarkWidth);
|
||||
$coordinate_Y = ( $imageHeight) - ( $watermarkHeight);
|
||||
|
||||
imagecopy($image, $watermark, $coordinate_X, $coordinate_Y, 0, 0, $watermarkWidth, $watermarkHeight);
|
||||
|
||||
if(!($SaveToFile)) header('Content-Type: image/jpeg');
|
||||
|
||||
imagejpeg ($image, $SaveToFile, 100);
|
||||
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
imagedestroy($watermark);
|
||||
|
||||
if(!($SaveToFile)) exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
ImageViewer loads a single image and its comments specified by a keyword.
|
||||
*/
|
||||
|
||||
require_once( 'lib/imagecatalog.php' );
|
||||
|
||||
class ImageViewer extends ImageCatalog {
|
||||
protected $position = 0;
|
||||
protected $keyword = '';
|
||||
|
||||
public $Fav = '';
|
||||
|
||||
public $image = array();
|
||||
public $stream = array();
|
||||
public $userInfo = array();
|
||||
public $uploadid;
|
||||
|
||||
public $datenow;
|
||||
|
||||
|
||||
public function setCurrent( $keyword ) {
|
||||
$this->keyword = $keyword;
|
||||
}
|
||||
public function setFav( $case ) {
|
||||
$this->Fav = $case;
|
||||
}
|
||||
public function CommentSpam( $userId) {
|
||||
|
||||
}
|
||||
|
||||
public function addComment( $userId, $comment,$iname="") {
|
||||
|
||||
|
||||
$countcomments = DB::getRow("SELECT COUNT(*) as c FROM pl_comments WHERE created > now() - INTERVAL 10 SECOND AND userId=:1",$userId);
|
||||
$sp = DB::getRow("SELECT spamblocked, time FROM pl_users WHERE id=:1",$userId);
|
||||
|
||||
if (intval($countcomments["c"]) > 2 || $sp["spamblocked"] == 1) {
|
||||
if (int($sp["time"]) > 0){
|
||||
$timeAdd = int($sp["time"]) + 1800;
|
||||
}else{
|
||||
$timeAdd = time() + 1800;
|
||||
}
|
||||
DB::updateRow("pl_users",array("id" => $userId),array("spamblocked" => 1,"spam_reason"=>"Commentspam","time" => $timeAdd));
|
||||
return false;
|
||||
}else{
|
||||
|
||||
if( $this->image['id'] && $userId && !empty($comment)) {
|
||||
|
||||
|
||||
$datenow = date( 'Y.m.d H:i:s' );
|
||||
|
||||
if (strlen($iname) > 0){
|
||||
DB::insertRow( TABLE_COMMENTS, array(
|
||||
'imageId' => $this->image['id'],
|
||||
'userId' => $userId,
|
||||
'created' => $datenow,
|
||||
'content' => $comment,
|
||||
'thumb' => 1));
|
||||
|
||||
|
||||
}else{
|
||||
DB::insertRow( TABLE_COMMENTS, array(
|
||||
'imageId' => $this->image['id'],
|
||||
'userId' => $userId,
|
||||
'created' => $datenow,
|
||||
'content' => $comment,
|
||||
'thumb' =>0));
|
||||
}
|
||||
if ($this->image['user'] != $userId){
|
||||
DB::query("UPDATE pl_images SET score=score+1 WHERE id=:1",$this->image['id']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$comments_load = DB::query(
|
||||
'SELECT userId FROM pl_comments WHERE imageid=:1',
|
||||
$this->image['id']
|
||||
);
|
||||
|
||||
|
||||
|
||||
foreach( array_keys($comments_load) as $i ) {
|
||||
|
||||
|
||||
$counter = DB::getRow("SELECT COUNT(*) as c FROM pl_unread WHERE userid=:1 AND imageid=:2",$comments_load[$i]["userId"],$this->image['id']);
|
||||
|
||||
if (($counter["c"] == 0) && $comments_load[$i]["userId"] != $userId){
|
||||
DB::insertRow( "pl_unread", array('imageid' =>$this->image['id'], 'userid' => $comments_load[$i]["userId"],'keyword' => $this->keyword, 'createdby' => $userId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$counter = DB::getRow("SELECT COUNT(*) as c FROM pl_unread WHERE userid=:1 AND imageid=:2",$this->image["user"],$this->image['id']);
|
||||
if ($counter["c"] == 0 && $this->image["user"] != $userId){
|
||||
DB::insertRow( "pl_unread", array('imageid' =>$this->image['id'], 'userid' => $this->image["user"],'keyword' => $this->keyword, 'createdby' => $userId));}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function load() {
|
||||
|
||||
|
||||
$conditions = '';
|
||||
if( !empty($this->user) ) {
|
||||
$conditions .= ' AND i.user = :2';
|
||||
$this->userInfo = $this->user;
|
||||
}
|
||||
$this->image = DB::getRow(
|
||||
'SELECT
|
||||
i.id, i.logged, UNIX_TIMESTAMP(i.logged) AS loggedTS,
|
||||
i.keyword, i.image, i.score, i.votes,
|
||||
tags, u.name AS userName, i.user, u.color
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = i.user
|
||||
WHERE i.keyword = :1 '.$conditions,
|
||||
$this->keyword,
|
||||
$this->user['id']
|
||||
);
|
||||
$this->image['path'] = date('Y/m/', $this->image['loggedTS']).$this->image['image'];
|
||||
|
||||
if( empty( $this->user) ) {
|
||||
$this->userInfo = DB::getRow(
|
||||
'SELECT id, name, score, images, avatar, website, color
|
||||
FROM '.TABLE_USERS.'
|
||||
WHERE
|
||||
id = :1',
|
||||
$this->image['user']
|
||||
);
|
||||
}
|
||||
|
||||
// compute previoues and next page
|
||||
$next = DB::getRow(
|
||||
'SELECT i.keyword
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
WHERE i.id < :1 '.$conditions.'
|
||||
ORDER BY id DESC
|
||||
LIMIT 1',
|
||||
$this->image['id'],
|
||||
$this->user['id']
|
||||
);
|
||||
|
||||
$prev = DB::getRow(
|
||||
'SELECT i.keyword
|
||||
FROM '.TABLE_IMAGES.' i
|
||||
WHERE i.id > :1 '.$conditions.'
|
||||
ORDER BY id ASC
|
||||
LIMIT 1',
|
||||
$this->image['id'],
|
||||
$this->user['id']
|
||||
);
|
||||
|
||||
|
||||
|
||||
if( !empty($next) ) {
|
||||
$this->stream['next'] = $next['keyword'];
|
||||
}
|
||||
if( !empty($prev) ) {
|
||||
$this->stream['prev'] = $prev['keyword'];
|
||||
}
|
||||
}
|
||||
|
||||
public function howlong($a=0, $b=0) {
|
||||
if (!is_numeric($a)) $a = strtotime($a); if (!is_numeric($b)) $b = strtotime($b);
|
||||
if ($a == 0) $a = time(); if ($b == 0) $b = time();
|
||||
if ($a == $b) return "at the same time";
|
||||
if ($a > $b) { $aa = $b; $b = $a; $a = $aa; $q = "away"; } else { $q = "ago"; }
|
||||
$value = $b-$a;
|
||||
if ($value == 1) return "1 sec $q";
|
||||
if ($value < 60) return "$value sec $q";
|
||||
$value /= 60;
|
||||
if (round($value) == 1) return "1 min $q";
|
||||
if ($value < 60) return round($value) . " min $q";
|
||||
$value /= 60;
|
||||
if (round($value) == 1) return "1 hour $q";
|
||||
if ($value < 24) return round($value) . " hours $q";
|
||||
$value /= 24;
|
||||
if (round($value) == 1) if ($q == "ago") return "yesterday"; else return "tomorrow";
|
||||
if ($value < 31) return round($value) . " days $q";
|
||||
$value /= 31;
|
||||
if (round($value) == 1) return "1 month $q";
|
||||
if ($value < 12) return round($value) . " months $q";
|
||||
$value /= 12;
|
||||
if (round($value) == 1) return "1 year $q";
|
||||
return round($value) . " years $q";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function loadComments() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
require_once( 'lib/config.php' );
|
||||
|
||||
class Keyword {
|
||||
// Get a keyword from a string
|
||||
// ----------------------------------------------------------------------------
|
||||
public static function get( $kw ) {
|
||||
// narf, since the .php source files are saved as 8859-1 (php doesn't like BOMs)
|
||||
// utf8_decode is invoked, so str_replace actually finds something for these 8859-1
|
||||
// encoded special chars
|
||||
|
||||
$kw = utf8_decode( $kw );
|
||||
$kw = str_replace( array( 'Ä','Ö','Ü','ä','ö','ü','ß',"'" ), array( 'Ae','Oe','Ue','ae','oe','ue','ss','' ), $kw );
|
||||
$kw = preg_replace( '/[^a-zA-Z\d]+/', '#', $kw );
|
||||
$kw = preg_replace( '/^\#+|\#+$/', '', $kw ); // Trim seperators
|
||||
$kw = str_replace( '#', Config::$keywordWordSeperator, $kw ); // replace # with final word seperator
|
||||
|
||||
if( $kw == "" ) {// no keyword?
|
||||
$kw = 'Untitled'; // Assign default keyword
|
||||
}
|
||||
$kw = strtolower( $kw );
|
||||
return $kw;
|
||||
}
|
||||
|
||||
// Check if a keyword has allready been taken. if so, return $keyword-N, where N is an increasing number
|
||||
// ----------------------------------------------------------------------------
|
||||
public static function iterate( $kw, $taken ) {
|
||||
$kwLower = strtolower( $kw );
|
||||
if( in_array( $kwLower, $taken ) ) {
|
||||
for( $i = 2; in_array( $kwLower, $taken); $i++ ) {
|
||||
$kwLower = strtolower( $kw . Config::$keywordWordSeperator . $i );
|
||||
}
|
||||
return $kw . Config::$keywordWordSeperator . ( $i-1 );
|
||||
}
|
||||
else {
|
||||
return $kw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,635 @@
|
||||
<?php
|
||||
|
||||
/* --------------------------------------------------------------------------------
|
||||
*
|
||||
* AXELS CLASS TO MERGE JS AND CSS DATA
|
||||
* V0.9
|
||||
*
|
||||
* License: GPL 3.0 - http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
|
||||
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
* OTHER PARTIES PROVIDE THE PROGRAM ?AS IS? WITHOUT WARRANTY OF ANY KIND,
|
||||
* EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
* ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
|
||||
* SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
|
||||
* SERVICING, REPAIR OR CORRECTION.
|
||||
*
|
||||
* --------------------------------------------------------------------------------
|
||||
* project home:
|
||||
* http://www.axel-hahn.de/php_staticfiles.php
|
||||
* --------------------------------------------------------------------------------
|
||||
*
|
||||
* How it works:
|
||||
*
|
||||
* This script collects all static files per type and saves merged code into a
|
||||
* single file (grouped by defer type for javacscript and media for css).
|
||||
*
|
||||
* It uses caching for the merged files.
|
||||
*
|
||||
* In comparison to other combining scripts this one
|
||||
* - detects relative urls in css files and rewrites them.
|
||||
* - in develop environment you can diasable the merging and debug with
|
||||
* original files
|
||||
* - caching uses a dirty time before cache will be compared with included files
|
||||
*
|
||||
* --------------------------------------------------------------------------------
|
||||
*
|
||||
* --- typical usage:
|
||||
* see readme.txt
|
||||
*
|
||||
* --- KNOWN LIMITS
|
||||
* - static files must be added with absolute path (this class shows you an error)
|
||||
* - don't forget to add gzip compression for .js and .css in your webserver or in .htaccess
|
||||
*
|
||||
* --- TODO/ IDEAS
|
||||
* - html 5: static in js
|
||||
* - merge all css of all media with @media [name]{} sections http://de.selfhtml.org/css/formate/einbinden.htm#media
|
||||
* - cleanup in cache directory
|
||||
* - setter functions have no prameter check
|
||||
* - setter for compression needed?
|
||||
*
|
||||
* --- history:
|
||||
* 2011-08-06 first version
|
||||
* 2011-08-14 rewritten as php class
|
||||
* 2011-08-19 first public version
|
||||
* 2011-08-27 comments added
|
||||
* 2012-02-06 little code rewrite: private functions start with "_"; sortorder of methods, ...
|
||||
* 2012-06-30 css fixed for cachefile in debug mode; css: handle media queries
|
||||
* 2012-07-05 remove css comments in compress function; css default media is "all" now (it was "screen" before)
|
||||
* --------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
class Staticfiles {
|
||||
// set everything to false - they will be set in function setDefaults()
|
||||
|
||||
/**
|
||||
* configuration array
|
||||
* @var array
|
||||
*/
|
||||
private $_aStatic = array(
|
||||
'js' => array(
|
||||
'files' => array(), // will be filled with addMedia()
|
||||
'tplHtml' => '<script type="text/javascript" SRC DEFER></script>',
|
||||
'fRewrite' => '',
|
||||
'fCompress' => 'compressJs',
|
||||
),
|
||||
'css' => array(
|
||||
'files' => array(), // will be filled with addMedia()
|
||||
'tplHtml' => '<link rel="stylesheet" type="text/css" HREF MEDIA TITLE />',
|
||||
'fRewrite' => 'rewriteCss',
|
||||
'fCompress' => 'compressCss',
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* flag: show debug output? If it is true then you see the merged files,
|
||||
* replacements and statistic data in the html header section (as comment)
|
||||
* @var boolean
|
||||
*/
|
||||
var $bDebug = false; // debug enables additional infos
|
||||
|
||||
/**
|
||||
* flag: merge files into a cachefile? If it is false then the source
|
||||
* files will be used. This is helpful in the development environment to
|
||||
* debug code with original files.
|
||||
* @var boolean
|
||||
*/
|
||||
var $bMerging = false; // use compressed files; false links to original files
|
||||
|
||||
/**
|
||||
* flag: overwrite cachefile on each request?
|
||||
* You can use it in your development environment. It overrides the setting
|
||||
* of $this->iMinCacheTime and regenerates merged cachefiles on each request.
|
||||
* debug code with original files.
|
||||
* @var boolean
|
||||
*/
|
||||
var $bRewriteOnEachRequest = false;
|
||||
|
||||
/**
|
||||
* minimum time to cache js and css cachefile on server - even one of the
|
||||
* source files have been changed.
|
||||
* @var integer
|
||||
*/
|
||||
var $iMinCacheTime = 3600;
|
||||
|
||||
/**
|
||||
* name for basepath behind webroot
|
||||
* @var string
|
||||
*/
|
||||
var $sCacheBase = '/~cache/';
|
||||
|
||||
/**
|
||||
* absolute path of cache directory; it will be set in the method
|
||||
* setDefaults to [document root]/$this->sCacheBase/
|
||||
* @var string
|
||||
*/
|
||||
var $sCacheDir = false;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// INIT
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* init function; it sets defaults.
|
||||
* @return bool (dummy)
|
||||
*/
|
||||
public function __construct() {
|
||||
return $this->setDefaults();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* generate html code to link the cachefile (or original files if cache is disabled)
|
||||
* @param string $sType type; one of css|js
|
||||
* @param array $aFile array with filedata (keys are attributes)
|
||||
* @return string html code
|
||||
*/
|
||||
private function _genHtml($sType, $aFile) {
|
||||
$s = $this->_aStatic[$sType]["tplHtml"];
|
||||
|
||||
// TODO: autodetect with pregmatch
|
||||
$aReplace = array("SRC", "DEFER", "HREF", "MEDIA", "TITLE");
|
||||
|
||||
foreach ($aReplace as $sFrom) {
|
||||
$sKey = strtolower($sFrom);
|
||||
$sTo = "";
|
||||
if ($aFile[$sKey])
|
||||
$sTo = " $sKey=\"" . $aFile[$sKey] . "\" ";
|
||||
$s = str_replace($sFrom, $sTo, $s);
|
||||
}
|
||||
$s = str_replace('defer="execution"', " ", $s);
|
||||
$s = str_replace(" ", " ", $s);
|
||||
$s = str_replace(" ", " ", $s);
|
||||
$s = str_replace(" >", ">", $s);
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* show some statistics info about code compression an gzip
|
||||
* @param type $sOrig
|
||||
* @param type $sCrunched
|
||||
* @param type $sCommment
|
||||
* @return type
|
||||
*/
|
||||
private function _getStats($sOrig, $sCrunched, $sCommment) {
|
||||
if (!$this->bDebug)
|
||||
return "";
|
||||
|
||||
$iOrigSize = strlen($sOrig);
|
||||
$iNewSize = strlen($sCrunched);
|
||||
$igzSize1 = strlen(gzencode($sOrig));
|
||||
$igzSize2 = strlen(gzencode($sCrunched));
|
||||
return $sCommment . "
|
||||
statistics:
|
||||
... orig size: $iOrigSize bytes
|
||||
... compression function: " . $iNewSize . " byte (" . (100 - round($iNewSize / $iOrigSize * 100)) . "% less)
|
||||
|
||||
... gzip
|
||||
...... orig " . $igzSize1 . " byte (" . (100 - round($igzSize1 / $iOrigSize * 100)) . "% less)
|
||||
...... compressed: " . $igzSize2 . " byte (" . (100 - round($igzSize2 / $iNewSize * 100)) . "% less than crunched; " . (100 - round($igzSize2 / $iOrigSize * 100)) . "% less than original)
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
* write logging information (only if debug is enabled)
|
||||
* @param type $s
|
||||
* @return type
|
||||
*/
|
||||
private function _log($s) {
|
||||
if (!$this->bDebug)
|
||||
return true;
|
||||
|
||||
if ($s == "===")
|
||||
$s = "================================================================================";
|
||||
if ($s == "---")
|
||||
$s = "................................................................................";
|
||||
echo "<!-- DEBUG: " . $s . " -->\n";
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// add media files
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* add a css file to this object
|
||||
* @param string $sFile path and filename of css file like in href attribute
|
||||
* @param string $sMedia media type
|
||||
* @param title $sTitle title (will be ignored so far)
|
||||
* @return bool (dummy)
|
||||
*/
|
||||
public function addCss($sFile, $sMedia = 'all', $sTitle = '') {
|
||||
return $this->addMedia("css", array(
|
||||
'file' => $sFile,
|
||||
'href' => $sFile,
|
||||
'media' => $sMedia,
|
||||
'title' => $sTitle,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* add a js file to the js array
|
||||
* @param string $sFile file to load
|
||||
* @param string $sDefer
|
||||
* @return type
|
||||
*/
|
||||
public function addJs($sFile, $defer = "execution") {
|
||||
return $this->addMedia("js", array(
|
||||
'file' => $sFile,
|
||||
'src' => $sFile,
|
||||
'defer' => $defer,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* add media file to array; it is called by addJs() and addCss()
|
||||
* @param string $sType one of css|js
|
||||
* @param array $aFiledata; Keys: file: filename; other: attributes
|
||||
* @return type
|
||||
*/
|
||||
public function addMedia($sType, $aFiledata) {
|
||||
$sGroup = false;
|
||||
if ($sType == "css")
|
||||
$sGroup = $aFiledata["media"];
|
||||
if ($sType == "js")
|
||||
$sGroup = $aFiledata["defer"];
|
||||
if (!$sGroup)
|
||||
return false;
|
||||
return $this->_aStatic[$sType]["files"][$sGroup][] = $aFiledata;
|
||||
}
|
||||
|
||||
/**
|
||||
* compress css code: remove spaces, tabs, line breaks
|
||||
* @param string $s css data
|
||||
* @return string rewritten css data
|
||||
*/
|
||||
public function compressCss($s) {
|
||||
// remove unneded spaces, tabs, new lines
|
||||
$s = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ',), '', $s);
|
||||
|
||||
/* remove unnecessary spaces */
|
||||
foreach (explode(" ", "{ } ; , ; ( ) ") as $char) {
|
||||
$s = str_replace('\ *' . $char . '\ *', '{', $s);
|
||||
}
|
||||
// remove comments
|
||||
$s = preg_replace('#\/\*.*\*\/#U', '', $s);
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* compress js code
|
||||
* @param string $s js code
|
||||
* @return string with new js code
|
||||
*/
|
||||
public function compressJs($s) {
|
||||
/* remove tabs, spaces, new lines, etc. */
|
||||
$s = str_replace(array("\t", ' ', ' '), ' ', $s);
|
||||
|
||||
/* remove unnecessary spaces */
|
||||
foreach (explode(" ", "{ } ; , ; ( ) ") as $char) {
|
||||
$s = str_replace('\ *' . $char . '\ *', '{', $s);
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// getter
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* get current basepath of cache
|
||||
* @return boolean
|
||||
*/
|
||||
public function getCacheBase() {
|
||||
return $this->sCacheBase;
|
||||
}
|
||||
|
||||
/**
|
||||
* get full path of current cache directory
|
||||
* @return boolean
|
||||
*/
|
||||
public function getCacheDir() {
|
||||
return $this->sCacheDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* get current debug flag
|
||||
* @return boolean
|
||||
*/
|
||||
public function getDebug() {
|
||||
return $this->bDebug;
|
||||
}
|
||||
|
||||
/**
|
||||
* get current merge flag
|
||||
* @return boolean
|
||||
*/
|
||||
public function getMerging() {
|
||||
return $this->bMerging;
|
||||
}
|
||||
|
||||
/**
|
||||
* get current caching time on server
|
||||
* @return integer
|
||||
*/
|
||||
public function getMinCacheTime() {
|
||||
return $this->iMinCacheTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* get current flag to rewrite the cache
|
||||
* @return boolean
|
||||
*/
|
||||
public function getRewriteCache() {
|
||||
return $this->bRewriteOnEachRequest;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* rewrite urls in css data; this function finds relative
|
||||
* pathes and rewrites them to absolute pathes
|
||||
* @param string $s css content
|
||||
* @param string $sFile filename of included css (to detect the "current" path)
|
||||
* @return string the reswritten css code
|
||||
*/
|
||||
public function rewriteCss($s, $sFile) {
|
||||
|
||||
$aFrom = array();
|
||||
$aTo = array();
|
||||
$treffer = array();
|
||||
preg_match_all("/url\((.*)\)/", $s, $treffer, PREG_OFFSET_CAPTURE);
|
||||
foreach ($treffer[1] as $sUrl) {
|
||||
if (strpos($sUrl[0], "../") or true) {
|
||||
|
||||
$sTo = $sUrl[0];
|
||||
$sWrap = $sTo[0];
|
||||
if ($sWrap == "'" or $sWrap == '"') {
|
||||
$sTo = str_replace($sWrap, "", $sTo);
|
||||
} else
|
||||
$sWrap = "";
|
||||
|
||||
// if there is no absolute path then try to rewrite
|
||||
if ($sTo[0] != "/") {
|
||||
$sTo = str_replace($sWrap, "", $sTo);
|
||||
|
||||
// do replacements
|
||||
$sDir = dirname($sFile);
|
||||
$sTo = str_replace("../", "", $sTo, $count);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$sDir = str_replace(basename($sDir), "", $sDir);
|
||||
}
|
||||
$sTo = $sDir . "/" . $sTo;
|
||||
$sTo = str_replace("//", "/", $sTo);
|
||||
$sTo = str_replace("./", "", $sTo);
|
||||
|
||||
// add wrapping characters
|
||||
$sTo = $sWrap . $sTo . $sWrap;
|
||||
|
||||
$aFrom[] = $sUrl[0];
|
||||
$aTo[] = $sTo;
|
||||
$this->_log("replacing " . $sUrl[0] . " to: " . $sTo . " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($aFrom))
|
||||
$s = str_replace($aFrom, $aTo, $s);
|
||||
return $s;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// setter
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* set another basepath (behind webroot)
|
||||
* @param string new basepath
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCacheBase($str) {
|
||||
$this->sCacheDir = $_SERVER["DOCUMENT_ROOT"] . $str;
|
||||
return $this->sCacheBase = $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* set another cache directory.
|
||||
* @param string new basepath (below webroot)
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCacheDir($str) {
|
||||
return $this->sCacheDir = $_SERVER["DOCUMENT_ROOT"] . $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* set debug flag (for development environment)
|
||||
* @param boolean set true to enable debug output
|
||||
* @return boolean
|
||||
*/
|
||||
public function setDebug($bool) {
|
||||
return $this->bDebug = (bool) $bool;
|
||||
}
|
||||
|
||||
/**
|
||||
* set debug default settings
|
||||
* @return bool (always true)
|
||||
*/
|
||||
public function setDebugDefaults() {
|
||||
$this->iMinCacheTime = 0;
|
||||
$this->bDebug = true;
|
||||
$this->bMerging = true; // set to false that you can debug with original files
|
||||
$this->bRewriteOnEachRequest = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* set all vars to initial values
|
||||
* @return bool (always true)
|
||||
*/
|
||||
public function setDefaults() {
|
||||
$this->sCacheBase = '/~cache/'; // added to url
|
||||
$this->iMinCacheTime = 3600; // force using the cachefile and don't update it
|
||||
$this->bDebug = false; // debug enables additional infos
|
||||
$this->bMerging = true; // use compressed files
|
||||
$this->sCacheDir = $_SERVER["DOCUMENT_ROOT"] . $this->sCacheBase; // local file
|
||||
$this->bRewriteOnEachRequest = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* set merge flag (for development environment)
|
||||
* @param boolean set false to disable the generation of merged cachefiles
|
||||
* @return boolean
|
||||
*/
|
||||
public function setMerging($bool) {
|
||||
return $this->bMerging = (bool) $bool;
|
||||
}
|
||||
|
||||
/**
|
||||
* set minimum cachetime on server for merged js and css files
|
||||
* @param integer value in seconds
|
||||
* @return boolean
|
||||
*/
|
||||
public function setMinCacheTime($int) {
|
||||
return $this->iMinCacheTime = (int) $int;
|
||||
}
|
||||
|
||||
/**
|
||||
* set flag bRewriteOnEachRequest (for development environment)
|
||||
* @param boolean set true to ignore caching time
|
||||
* @return type
|
||||
*/
|
||||
public function setRewriteCache($bool) {
|
||||
return $this->bRewriteOnEachRequest = (bool) $bool;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Merge original files of a group to a single cachefile. It updates or just touches the cachefile.
|
||||
* Output is the html code to include the cached css/ js in the html header.
|
||||
* @param string $sType one of css|js
|
||||
* @return bool (dummy)
|
||||
*/
|
||||
public function writeMedia($sType) {
|
||||
$sHtml = ''; // generated html output to document
|
||||
$aFiles = $this->_aStatic[$sType]["files"];
|
||||
$this->_log("===");
|
||||
$this->_log("type: $sType");
|
||||
$this->_log("THANKS FOR USING MY PHP CLASS STATICFILES!\n (this message and debug stuff below is shown with enabled debug only)\n www.axel-hahn.de");
|
||||
|
||||
// if caching is disabled then generate output with original files and return
|
||||
if (!$this->bMerging) {
|
||||
$this->_log("You disabled the merging feature - here you get the links to the original files.");
|
||||
foreach ($aFiles as $sGroup => $aFiledata) {
|
||||
foreach ($aFiledata as $aFile) {
|
||||
$sHtml.=$this->_genHtml($sType, $aFile);
|
||||
}
|
||||
}
|
||||
echo $sHtml;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// step 1: get all files of a group
|
||||
$aFileList = array();
|
||||
foreach ($aFiles as $sGroup => $aFiledata) {
|
||||
foreach ($aFiledata as $aFile) {
|
||||
$aFileList[$sGroup][] = $aFile['file'];
|
||||
}
|
||||
}
|
||||
|
||||
// check / regenerate cache file
|
||||
foreach ($aFiles as $sGroup => $aFiledata) {
|
||||
$bCompress = true;
|
||||
$iNewest = 0;
|
||||
$sData = '';
|
||||
|
||||
// get cachefile and check age
|
||||
$sCacheFile = $sType . "_cache_" . md5($sGroup . implode($aFileList[$sGroup])) . "." . $sType;
|
||||
$sCacheFullFile = $this->sCacheDir . $sCacheFile;
|
||||
|
||||
$this->_log("===");
|
||||
$this->_log("$sType-group: \"$sGroup\"");
|
||||
$this->_log("cachefile = " . $sCacheFullFile);
|
||||
if (file_exists($sCacheFullFile)) {
|
||||
$bCompress = false;
|
||||
$aStatCache = stat($sCacheFullFile);
|
||||
$iCacheAge = date("U") - $aStatCache['mtime'];
|
||||
if ($iCacheAge > $this->iMinCacheTime)
|
||||
$bCompress = true;
|
||||
$this->_log("age of cachefile = $iCacheAge s (cachefile will be used $this->iMinCacheTime s; " . ($this->iMinCacheTime - $iCacheAge) . " s left)");
|
||||
} else {
|
||||
$this->_log("cachefile does not exist yet");
|
||||
}
|
||||
|
||||
// if there is no cachefile or cachefile is out of date
|
||||
// then compare with newest filestamp
|
||||
if ($bCompress) {
|
||||
|
||||
// merge all files into $sData
|
||||
// and get timestamp of newest file $iNewest
|
||||
foreach ($aFiledata as $aFile) {
|
||||
$this->_log("---");
|
||||
$sFile = $aFile["file"];
|
||||
$sFullFile = $_SERVER["DOCUMENT_ROOT"] . $sFile;
|
||||
if (!file_exists($sFullFile))
|
||||
die("ERROR: writeMedia() failed. File not found: $sFullFile.");
|
||||
$aTmp = stat($sFullFile);
|
||||
if ($aTmp['mtime'] > $iNewest)
|
||||
$iNewest = $aTmp['mtime'];
|
||||
$s = file_get_contents($sFullFile);
|
||||
$this->_log("checking $sFile - \tunix ts: " . $aTmp['mtime'] . ";\t" . strlen($s) . " byte (group: " . $sGroup . ")");
|
||||
if ($this->_aStatic[$sType]["fRewrite"]) {
|
||||
$this->_log("rewrite with \$this->" . $this->_aStatic[$sType]["fRewrite"]);
|
||||
$sRewritten = $this->{$this->_aStatic[$sType]["fRewrite"]}($s, $sFile);
|
||||
if (strlen($sRewritten) == 0) {
|
||||
$this->_log("OOOPS rewrite function for file $sFile - " . $this->_aStatic[$sType]["fRewrite"] . " returns ZERO(!!!) bytes");
|
||||
} else
|
||||
$s = $sRewritten;
|
||||
}
|
||||
$sData.=$s;
|
||||
}
|
||||
$this->_log("unix ts of cachefile " . $aStatCache['mtime']);
|
||||
|
||||
if (($aStatCache['mtime'] - $iMinCacheTime) < $iNewest || $this->bRewriteOnEachRequest) {
|
||||
$this->_log("Need to (re)generate cache. A static file is newer than cache or cache did not exist.");
|
||||
$sOrig = $sData;
|
||||
|
||||
if ($this->_aStatic[$sType]["fCompress"]) {
|
||||
$this->_log("compress with \$this->" . $this->_aStatic[$sType]["fCompress"] . " ");
|
||||
$sData = $this->{$this->_aStatic[$sType]["fCompress"]}($sData);
|
||||
if (strlen($sData) == 0) {
|
||||
$this->_log("OOOPS compress function for type $sType - " . $this->_aStatic[$sType]["fCompress"] . " returns ZERO(!!!) bytes");
|
||||
$this->_log("orig: " . strlen($sOrig) . " byte - files: \n" . print_r($aFileList[$sGroup], true) . " ");
|
||||
$sData = $sOrig;
|
||||
}
|
||||
} else {
|
||||
$this->_log("no compression for type " . $sType . " ");
|
||||
}
|
||||
$sStats = $this->_getStats($sOrig, $sData, " ");
|
||||
$this->_log($sStats);
|
||||
if ($this->bDebug)
|
||||
$sData = "/* AXEL HAHN - CACHED " . $sType . " MERGE FILE ... created " . date("Y-m-d H:i:s") . " " . $sStats . " (you see this only if debug is enabled) */ \n" . $sData;
|
||||
$this->_log("writing cachefile");
|
||||
if (!file_exists(dirname($sCacheFullFile)))
|
||||
mkdir(dirname($sCacheFullFile));
|
||||
file_put_contents($sCacheFullFile, $sData);
|
||||
} else {
|
||||
$this->_log("just touching cachefile to use it further $this->iMinCacheTime s");
|
||||
touch($sCacheFullFile);
|
||||
}
|
||||
}
|
||||
|
||||
// generate html output: link to the cacheile
|
||||
if ($sType == "css")
|
||||
$aCachefileoptions = array(
|
||||
'file' => $this->sCacheBase . $sCacheFile,
|
||||
'href' => $this->sCacheBase . $sCacheFile,
|
||||
'media' => $sGroup,
|
||||
);
|
||||
if ($sType == "js") {
|
||||
$aCachefileoptions = array(
|
||||
'file' => $this->sCacheBase . $sCacheFile,
|
||||
'src' => $this->sCacheBase . $sCacheFile,
|
||||
);
|
||||
}
|
||||
if ($aCachefileoptions)
|
||||
$sHtml.=$this->_genHtml($sType, $aCachefileoptions) . "\n";
|
||||
}
|
||||
|
||||
echo $sHtml . "\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
The UserList class loads a number of users from the database, specified by a page
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
class UserList {
|
||||
protected $page = 0;
|
||||
|
||||
protected $usersPerPage = 0;
|
||||
protected $totalResults = 0;
|
||||
|
||||
public $users = array();
|
||||
public $pages = array();
|
||||
|
||||
public function __construct( $usersPerPage ) {
|
||||
$this->usersPerPage = abs(intval($usersPerPage));
|
||||
}
|
||||
|
||||
public function setPage( $page ) {
|
||||
$page = intval($page);
|
||||
$this->page = $page > 0 ? $page - 1 : 0;
|
||||
}
|
||||
|
||||
public function load() {
|
||||
$this->users = DB::query(
|
||||
'SELECT SQL_CALC_FOUND_ROWS
|
||||
UNIX_TIMESTAMP( u.registered ) as registered,
|
||||
u.name, u.score, u.images, u.avatar, u.website
|
||||
FROM '.TABLE_USERS.' u
|
||||
WHERE valid = 1
|
||||
GROUP BY u.id
|
||||
ORDER BY u.id ASC
|
||||
LIMIT :1, :2',
|
||||
$this->page * $this->usersPerPage,
|
||||
$this->usersPerPage
|
||||
);
|
||||
$this->totalResults = DB::foundRows();
|
||||
|
||||
// compute previoues, current and next page
|
||||
if( $this->totalResults > 0 ) {
|
||||
$this->pages['current'] = $this->page+1;
|
||||
$this->pages['total'] = ceil($this->totalResults / $this->usersPerPage);
|
||||
if( $this->page > 0 ) {
|
||||
$this->pages['prev'] = $this->page;
|
||||
}
|
||||
if( $this->totalResults > $this->usersPerPage * $this->page + $this->usersPerPage ) {
|
||||
$this->pages['next'] = $this->page + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,601 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
An object of this class represents a user on the site. All user
|
||||
related tasks (registration, login, profile etc.) are handled here.
|
||||
|
||||
A user object is created and attempted to login on each page load.
|
||||
*/
|
||||
|
||||
require_once( 'config.php' );
|
||||
require_once( 'db-mobile.php' );
|
||||
|
||||
class User {
|
||||
public $name = '';
|
||||
public $id = 0;
|
||||
public $validationString = '';
|
||||
public $admin = 0;
|
||||
public $website = 0;
|
||||
public $color = "0";
|
||||
public $stylecolor = "black";
|
||||
public $avatar = "data/avatars/default.png";
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function validate( $id ) {
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, color, style, avatar FROM '.TABLE_USERS.' WHERE valid = 0 AND remember = :1',
|
||||
$id
|
||||
);
|
||||
$reg = DB::getRow("SELECT * FROM pl_settings");
|
||||
if ($reg["register"] != 1){
|
||||
return false;
|
||||
}
|
||||
if( empty($u) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DB::updateRow( TABLE_USERS, array('id' => $u['id']), array( 'valid' => 0) );
|
||||
|
||||
session_name( Config::$sessionCookie );
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
$_SESSION['avatar'] = $this->avatar = $u['avatar'];
|
||||
|
||||
setcookie( Config::$rememberCookie, $id, time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isSpamLocked() {
|
||||
// delete all ips older than IP_LOCK_TIME
|
||||
DB::query( 'DELETE FROM '.TABLE_UPLOADLOCK.' WHERE ts < :1', time() - Config::$uploadLockTime );
|
||||
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$r = DB::getRow( 'SELECT COUNT(*) AS c FROM '.TABLE_UPLOADLOCK.'
|
||||
WHERE ip = :1',
|
||||
$ip
|
||||
);
|
||||
|
||||
if( $r['c'] > Config::$maxNumUploads ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function isSpamer() {
|
||||
|
||||
|
||||
$r = DB::getRow( 'SELECT logged FROM pl_images
|
||||
WHERE user = :1 order by logged desc',
|
||||
$this->id
|
||||
);
|
||||
$time = strtotime($r["logged"]);
|
||||
|
||||
if( (time() - (integer)$time) < 10 ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function isSpamming() {
|
||||
$block = DB::getRow("SELECT spamblocked,time FROM pl_users WHERE id=:1",$this->id);
|
||||
if ( (int)$block["spamblocked"] == 1)
|
||||
{
|
||||
if ((int)$block["time"] != 0){
|
||||
$now = time();
|
||||
$then = (int)$block["time"];
|
||||
if ($now > $then) {
|
||||
DB::updateRow("pl_users",array("id" => $this->id),array("time" => 0,"spamblocked" => 0));
|
||||
return false;
|
||||
}else{
|
||||
return $block["time"];
|
||||
exit();
|
||||
}
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$count = DB::getRow( 'SELECT COUNT(*) as c FROM pl_images
|
||||
WHERE user = :1',
|
||||
$this->id
|
||||
);
|
||||
|
||||
if ( $count["c"] >= 3){
|
||||
|
||||
$r = DB::query( 'SELECT id,image,keyword,logged FROM pl_images
|
||||
WHERE user = :1 LIMIT '.((integer)$count["c"]-3).',2',
|
||||
$this->id
|
||||
);
|
||||
|
||||
|
||||
$r0 = DB::getRow( 'SELECT image,keyword,logged FROM pl_images
|
||||
WHERE user = :1 LIMIT '.((integer)$count["c"]-1).',1',
|
||||
$this->id
|
||||
);
|
||||
|
||||
require_once("img_class.php");
|
||||
$ban =0;
|
||||
foreach ($r as $checkable) {
|
||||
|
||||
|
||||
|
||||
if ((strtotime($r0["logged"]) - strtotime($checkable["logged"])) < 60){
|
||||
|
||||
|
||||
|
||||
$splitter = split("/",$checkable["keyword"]);
|
||||
$file2 = $splitter[0]."/".$splitter[1]."/".$checkable["image"];
|
||||
$splitter = split("/",$r0["keyword"]);
|
||||
$file1 = $splitter[0]."/".$splitter[1]."/".$r0["image"];
|
||||
|
||||
$diff = new imagediff("data/images/".$file2, "data/images/".$file1);
|
||||
$dif = $diff->diff();
|
||||
|
||||
if ($dif > 0.92){
|
||||
$ban += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($ban >= 2){
|
||||
foreach ($r as $checkable) {
|
||||
DB::query("DELETE FROM pl_images WHERE id=:1",$checkable["id"]);
|
||||
}
|
||||
DB::updateRow("pl_users",array("id" => $this->id),array("spamblocked" => 1,"spam_reason"=>"Imagespam","time" => time() + (7 * 24 * 60 * 60)));
|
||||
return true;
|
||||
}else{
|
||||
return false;}
|
||||
}else{ return false;}
|
||||
}
|
||||
|
||||
public function logUpload() {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
DB::insertRow( TABLE_UPLOADLOCK, array('ip' => $ip, 'ts' => time(),'user' => $this->id) );
|
||||
}
|
||||
|
||||
public function login() {
|
||||
|
||||
// attempt to login via post, session or remeber cookie
|
||||
|
||||
|
||||
|
||||
session_name( Config::$sessionCookie );
|
||||
|
||||
if( isset($_POST['login']) ) { // post login
|
||||
|
||||
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, color, style,avatar FROM '.TABLE_USERS.' WHERE name = :1 AND pass = :2 and valid = 1',
|
||||
$_POST['name'], md5($_POST['pass'])
|
||||
);
|
||||
$banstate = DB::getRow("SELECT * FROM pl_banned WHERE id=:1",$u['id']);
|
||||
if ($banstate){
|
||||
return "ban/".$banstate["reason"];
|
||||
}
|
||||
|
||||
if( !empty($u) ) {
|
||||
$c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']);
|
||||
if ((int)$c["c"] == 0){
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{
|
||||
DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s')));
|
||||
}
|
||||
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
$_SESSION['avatar'] = $this->avatar = $u['avatar'];
|
||||
|
||||
if( !empty($_POST['remember']) ) {
|
||||
$r = md5(uniqid(rand()));
|
||||
DB::updateRow( TABLE_USERS, array('id' => $this->id), array('remember' => $r ) );
|
||||
setcookie( Config::$rememberCookie, $r, time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
}
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
}else{return "wronglogin";}
|
||||
|
||||
}
|
||||
|
||||
else if( !empty($_COOKIE[Config::$sessionCookie]) ) { // session running
|
||||
session_start();
|
||||
$c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']);
|
||||
if ((int)$c["c"] == 0){
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{
|
||||
DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s')));
|
||||
}
|
||||
if( empty($_SESSION['id']) ) {
|
||||
setcookie(Config::$sessionCookie, false, time() - 3600, Config::$absolutePath );
|
||||
} else {
|
||||
$this->id = $_SESSION['id'];
|
||||
$this->name = $_SESSION['name'];
|
||||
$this->admin = $_SESSION['admin'];
|
||||
$this->website = $_SESSION['website'];
|
||||
$this->color = $u['color'];
|
||||
$this->stylecolor = $u['stylecolor'];
|
||||
$this->avatar = $u['avatar'];
|
||||
|
||||
|
||||
}
|
||||
if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$this->id)){
|
||||
$this->logout();
|
||||
return "banned";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else if( !empty($_COOKIE[Config::$rememberCookie]) ) { // remember cookie found
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, style, color, avatar FROM '.TABLE_USERS.' WHERE remember = :1',
|
||||
$_COOKIE[Config::$rememberCookie]
|
||||
);
|
||||
|
||||
if( !empty($u) ) {
|
||||
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
$_SESSION['avatar'] = $this->avatar = $u['avatar'];
|
||||
// refresh for another year
|
||||
setcookie( Config::$rememberCookie, $_COOKIE[Config::$rememberCookie], time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
|
||||
|
||||
$c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']);
|
||||
if ((int)$c["c"] == 0){
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{
|
||||
DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s')));
|
||||
}
|
||||
|
||||
if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){
|
||||
$this->logout();
|
||||
return "banned";
|
||||
}
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function profile( $localFile, &$messages ) {
|
||||
$upd = array( 'website' => $_POST['website'] );
|
||||
|
||||
$_SESSION['website'] = $_POST['website'];
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
}
|
||||
|
||||
$p = trim($_POST['cpass']);
|
||||
if( !empty( $p ) ) {
|
||||
if( strlen($_POST['cpass']) < 6 ) {
|
||||
$messages['passToShort'] = true;
|
||||
}
|
||||
else if( $_POST['cpass'] != $_POST['cpass2'] ) {
|
||||
$messages['passNotEqual'] = true;
|
||||
}
|
||||
else {
|
||||
$upd['pass'] = md5($_POST['cpass2']);
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
$forum->set_pass( $_SESSION['name'], $_POST['cpass2']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !empty( $localFile ) ) {
|
||||
require_once( 'lib/images.php' );
|
||||
|
||||
list( $imgWidth, $imgHeight, $imgtype ) = getimagesize($localFile);
|
||||
|
||||
if ( $imgWidth == 64 && $imgHeight == 64 && $imgtype == IMAGETYPE_GIF){
|
||||
$name = Config::$images['avatarsPath'].uniqid().'.gif';
|
||||
if (!move_uploaded_file($localFile,$name)){
|
||||
$messages['avatarFailed'] = true;
|
||||
$upd['avatar'] = Config::$images['avatarsPath']."default.png";
|
||||
}else{
|
||||
$upd['avatar'] = $name;
|
||||
}
|
||||
}else{
|
||||
$name = Config::$images['avatarsPath'].uniqid().'.jpg';
|
||||
|
||||
if( Image::createThumb( $localFile, $name, 64,64 ) ) {
|
||||
$upd['avatar'] = $name;
|
||||
} else {
|
||||
$messages['avatarFailed'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_POST['color'])){
|
||||
if(preg_match('/^[a-f0-9]{6}$/i', $_POST['color'])){
|
||||
if ( strtolower($_POST['color']) != "ffffff"){
|
||||
$upd['color'] = $_POST['color'];
|
||||
}else{
|
||||
$upd['color'] = "0";
|
||||
}
|
||||
}else{
|
||||
$messages['colorFailed'] = true;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------blockuser
|
||||
if(!empty($_POST['blockuser'])){
|
||||
if(preg_match('/^\w{2,20}$/', $_POST['blockuser'])){
|
||||
$blockedusers = array();
|
||||
$blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id);
|
||||
|
||||
if(!empty($blockedusers)){
|
||||
$blockedusers = unserialize($blockedusers['users']);
|
||||
if (in_array(strtolower ($_POST['blockuser']),$blockedusers)){
|
||||
$messages['blockAlready'] = true;
|
||||
}else{
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', strtolower ($_POST['blockuser']))){
|
||||
|
||||
array_push($blockedusers,$_POST['blockuser']);
|
||||
if(DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id)){
|
||||
$messages['blocked'] = true;
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
}else{
|
||||
$messages['userFailed'] = true;
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){
|
||||
$newarray = array();
|
||||
array_push($newarray,strtolower ($_POST['blockuser']));
|
||||
|
||||
if(DB::query("INSERT INTO pl_blocked (id,users) VALUES (:1,:2)",$this->id,serialize($newarray))){
|
||||
$messages['blocked'] = true;
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
|
||||
}else{
|
||||
$messages['userFailed'] = true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
|
||||
}
|
||||
//--------------------------------------------------------------------UNblockuser
|
||||
function remove_item_by_value($array, $val = '', $preserve_keys = true) {
|
||||
if (count($array) == 1) return false;
|
||||
if (empty($array) || !is_array($array)) return false;
|
||||
if (!in_array($val, $array)) return $array;
|
||||
|
||||
foreach($array as $key => $value) {
|
||||
if ($value == $val) unset($array[$key]);
|
||||
}
|
||||
|
||||
return ($preserve_keys === true) ? $array : array_values($array);
|
||||
}
|
||||
//--------------------------------------------------------------------UNblockuser
|
||||
if(!empty($_POST['unblockuser'])){
|
||||
if ($_POST['unblockuser'] != "select"){
|
||||
if(preg_match('/^\w{2,20}$/', $_POST['unblockuser'])){
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['unblockuser'])){
|
||||
$blockedusers = array();
|
||||
$blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id);
|
||||
if(!empty($blockedusers)){
|
||||
$blockedusers = unserialize($blockedusers['users']);
|
||||
if (in_array($_POST['unblockuser'],$blockedusers)){
|
||||
$blockedusers = remove_item_by_value($blockedusers,$_POST['unblockuser']);
|
||||
if ($blockedusers){
|
||||
DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id);
|
||||
$messages['unblocked'] = true;
|
||||
}else{
|
||||
DB::query('DELETE FROM pl_blocked WHERE id=:1',$this->id);
|
||||
$messages['unblocked'] = true;
|
||||
}
|
||||
}else{$messages['notBlocked'] = true;}
|
||||
}else{$messages['unblockFailed'] = true;}
|
||||
}else{$messages['userFailed'] = true;}
|
||||
}else{$messages['unblockFailed'] = true;}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------STYLE
|
||||
|
||||
if(isset($_POST['stylecolor'])) {
|
||||
if($_POST['stylecolor'] == 'white') {
|
||||
|
||||
$upd['style'] = $_POST['stylecolor'];
|
||||
|
||||
} elseif($_POST['stylecolor'] == 'black') {
|
||||
$upd['style'] = $_POST['stylecolor'];
|
||||
} else{
|
||||
$upd['style'] = $_POST['black'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( empty($this->email) &&
|
||||
preg_match('/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'])
|
||||
) {
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
$forum->set_email( $_SESSION['name'], $_POST['email']);
|
||||
}
|
||||
$upd['email'] = $_POST['email'];
|
||||
}
|
||||
|
||||
DB::updateRow( TABLE_USERS, array( 'id' => $this->id ), $upd );
|
||||
}
|
||||
|
||||
public function loadEmail() {
|
||||
$tmp = DB::getRow(
|
||||
'SELECT email,color,style,avatar FROM '.TABLE_USERS.' WHERE id = :1',
|
||||
$this->id
|
||||
);
|
||||
$this->email = $tmp['email'];
|
||||
$this->color = $tmp['color'];
|
||||
$this->stylecolor = $tmp['style'];
|
||||
$this->avatar = $u['avatar'];
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
$_SESSION = array();
|
||||
setcookie( Config::$rememberCookie, false, time() - 3600, Config::$absolutePath );
|
||||
setcookie( Config::$sessionCookie, false, time() - 3600, Config::$absolutePath );
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->logout();
|
||||
}
|
||||
}
|
||||
|
||||
public function increaseScore( $amount ) {
|
||||
DB::query(
|
||||
'UPDATE '.TABLE_USERS.' SET score = score + :1 WHERE id = :2',
|
||||
intval( $amount ),
|
||||
$this->id
|
||||
);
|
||||
}
|
||||
|
||||
public function register( &$messages,$inviteC=false ) {
|
||||
|
||||
DB::query( 'DELETE FROM '.TABLE_USERS.' WHERE valid = 0 AND registered < NOW() - INTERVAL 30 MINUTE' );
|
||||
$iplocks = DB::getRow("DELETE FROM pl_registerlock WHERE created < (NOW() - INTERVAL 1440 MINUTE)");
|
||||
|
||||
|
||||
$reg = DB::getRow("SELECT * FROM pl_settings");
|
||||
$doubleacc = DB::getRow("SELECT COUNT(*) as c FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if($inviteC == false){
|
||||
if ($reg["register"] != 1 || $doubleacc["c"] > 0){
|
||||
$messages['registerClosed'] = true;
|
||||
}
|
||||
}else{
|
||||
if ($doubleacc["c"] > 0){
|
||||
DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>1));
|
||||
$inviteC = false;
|
||||
$messages['registerClosed'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( !preg_match('/^\w{2,20}$/', $_POST['name']) ) {
|
||||
$messages['nameInvalid'] = true;
|
||||
} else {
|
||||
$u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE name = :1', $_POST['name'] );
|
||||
if( !empty($u) ) {
|
||||
$messages['nameInUse'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( strlen($_POST['pass']) < 6 ) {
|
||||
$messages['passToShort'] = true;
|
||||
}
|
||||
else if( $_POST['pass'] != $_POST['pass2'] ) {
|
||||
$messages['passNotEqual'] = true;
|
||||
}
|
||||
|
||||
if( !preg_match( '/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'] ) ) {
|
||||
$messages['wrongEmail'] = true;
|
||||
} else {
|
||||
$u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE email = :1', $_POST['email'] );
|
||||
if( !empty($u) ) {
|
||||
$messages['emailInUse'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( !empty($messages) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->validationString = md5(uniqid(rand()));
|
||||
|
||||
DB::insertRow( TABLE_USERS, array(
|
||||
'registered' => date('Y-m-d H:i:s'),
|
||||
'name' => $_POST['name'],
|
||||
'pass' => md5($_POST['pass']),
|
||||
'valid' => 1,
|
||||
'score' => 0,
|
||||
'images' => 0,
|
||||
'website' => '',
|
||||
'avatar' => Config::$images['avatarsPath'].'default.png',
|
||||
'remember' => $this->validationString,
|
||||
'admin' => 0,
|
||||
'email' => $_POST['email'],
|
||||
'color' => '0',
|
||||
'style' => 'black',
|
||||
'invite' => $inviteC
|
||||
));
|
||||
|
||||
if($inviteC != false){
|
||||
$lastid= DB::getRow("SELECT LAST_INSERT_ID() as id");
|
||||
DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>$lastid["id"]));
|
||||
}
|
||||
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$user['name'] = $_POST['name'];
|
||||
$user['pass'] = $_POST['pass'];
|
||||
$user['email'] = $_POST['email'];
|
||||
echo $forum->register_newuser($user, false);
|
||||
}
|
||||
|
||||
$mail = file_get_contents( Config::$templates.'registrationmail.txt' );
|
||||
preg_match( '/From: (?<from>.*?)\r?\nSubject: (?<subject>.*?)\r?\n\r?\n(?<text>.*)/sim', $mail, $mail );
|
||||
$mail['text'] = str_replace( '%validationString%', $this->validationString, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%siteName%', Config::$siteName, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%frontendPath%', Config::$frontendPath, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%userName%', $_POST['name'], $mail['text'] );
|
||||
|
||||
$mail['subject'] = str_replace( '%siteName%', Config::$siteName, $mail['subject'] );
|
||||
$mail['subject'] = str_replace( '%userName%', $_POST['name'], $mail['subject'] );
|
||||
|
||||
//mail( $_POST['email'], $mail['subject'], $mail['text'], 'FROM: '.$mail['from'] );
|
||||
mail($_POST['email'],$mail['subject'],$mail['text'],"FROM:".$mail['from']);
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,601 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
An object of this class represents a user on the site. All user
|
||||
related tasks (registration, login, profile etc.) are handled here.
|
||||
|
||||
A user object is created and attempted to login on each page load.
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
class User {
|
||||
public $name = '';
|
||||
public $id = 0;
|
||||
public $validationString = '';
|
||||
public $admin = 0;
|
||||
public $website = 0;
|
||||
public $color = "0";
|
||||
public $stylecolor = "black";
|
||||
public $avatar = "data/avatars/default.png";
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function validate( $id ) {
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, color, style, avatar FROM '.TABLE_USERS.' WHERE valid = 0 AND remember = :1',
|
||||
$id
|
||||
);
|
||||
$reg = DB::getRow("SELECT * FROM pl_settings");
|
||||
if ($reg["register"] != 1){
|
||||
return false;
|
||||
}
|
||||
if( empty($u) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DB::updateRow( TABLE_USERS, array('id' => $u['id']), array( 'valid' => 0) );
|
||||
|
||||
session_name( Config::$sessionCookie );
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
$_SESSION['avatar'] = $this->avatar = $u['avatar'];
|
||||
|
||||
setcookie( Config::$rememberCookie, $id, time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isSpamLocked() {
|
||||
// delete all ips older than IP_LOCK_TIME
|
||||
DB::query( 'DELETE FROM '.TABLE_UPLOADLOCK.' WHERE ts < :1', time() - Config::$uploadLockTime );
|
||||
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$r = DB::getRow( 'SELECT COUNT(*) AS c FROM '.TABLE_UPLOADLOCK.'
|
||||
WHERE ip = :1',
|
||||
$ip
|
||||
);
|
||||
|
||||
if( $r['c'] > Config::$maxNumUploads ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function isSpamer() {
|
||||
|
||||
|
||||
$r = DB::getRow( 'SELECT logged FROM pl_images
|
||||
WHERE user = :1 order by logged desc',
|
||||
$this->id
|
||||
);
|
||||
$time = strtotime($r["logged"]);
|
||||
|
||||
if( (time() - (integer)$time) < 10 ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function isSpamming() {
|
||||
$block = DB::getRow("SELECT spamblocked,time FROM pl_users WHERE id=:1",$this->id);
|
||||
if ( (int)$block["spamblocked"] == 1)
|
||||
{
|
||||
if ((int)$block["time"] != 0){
|
||||
$now = time();
|
||||
$then = (int)$block["time"];
|
||||
if ($now > $then) {
|
||||
DB::updateRow("pl_users",array("id" => $this->id),array("time" => 0,"spamblocked" => 0));
|
||||
return false;
|
||||
}else{
|
||||
return $block["time"];
|
||||
exit();
|
||||
}
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$count = DB::getRow( 'SELECT COUNT(*) as c FROM pl_images
|
||||
WHERE user = :1',
|
||||
$this->id
|
||||
);
|
||||
|
||||
if ( $count["c"] >= 3){
|
||||
|
||||
$r = DB::query( 'SELECT id,image,keyword,logged FROM pl_images
|
||||
WHERE user = :1 LIMIT '.((integer)$count["c"]-3).',2',
|
||||
$this->id
|
||||
);
|
||||
|
||||
|
||||
$r0 = DB::getRow( 'SELECT image,keyword,logged FROM pl_images
|
||||
WHERE user = :1 LIMIT '.((integer)$count["c"]-1).',1',
|
||||
$this->id
|
||||
);
|
||||
|
||||
require_once("img_class.php");
|
||||
$ban =0;
|
||||
foreach ($r as $checkable) {
|
||||
|
||||
|
||||
|
||||
if ((strtotime($r0["logged"]) - strtotime($checkable["logged"])) < 60){
|
||||
|
||||
|
||||
|
||||
$splitter = split("/",$checkable["keyword"]);
|
||||
$file2 = $splitter[0]."/".$splitter[1]."/".$checkable["image"];
|
||||
$splitter = split("/",$r0["keyword"]);
|
||||
$file1 = $splitter[0]."/".$splitter[1]."/".$r0["image"];
|
||||
|
||||
$diff = new imagediff("data/images/".$file2, "data/images/".$file1);
|
||||
$dif = $diff->diff();
|
||||
|
||||
if ($dif > 0.92){
|
||||
$ban += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($ban >= 2){
|
||||
foreach ($r as $checkable) {
|
||||
DB::query("DELETE FROM pl_images WHERE id=:1",$checkable["id"]);
|
||||
}
|
||||
DB::updateRow("pl_users",array("id" => $this->id),array("spamblocked" => 1,"spam_reason"=>"Imagespam","time" => time() + (7 * 24 * 60 * 60)));
|
||||
return true;
|
||||
}else{
|
||||
return false;}
|
||||
}else{ return false;}
|
||||
}
|
||||
|
||||
public function logUpload() {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
DB::insertRow( TABLE_UPLOADLOCK, array('ip' => $ip, 'ts' => time(),'user' => $this->id) );
|
||||
}
|
||||
|
||||
public function login() {
|
||||
|
||||
// attempt to login via post, session or remeber cookie
|
||||
|
||||
|
||||
|
||||
session_name( Config::$sessionCookie );
|
||||
|
||||
if( isset($_POST['login']) ) { // post login
|
||||
|
||||
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, color, style,avatar FROM '.TABLE_USERS.' WHERE name = :1 AND pass = :2 and valid = 1',
|
||||
$_POST['name'], md5($_POST['pass'])
|
||||
);
|
||||
$banstate = DB::getRow("SELECT * FROM pl_banned WHERE id=:1",$u['id']);
|
||||
if ($banstate){
|
||||
return "ban/".$banstate["reason"];
|
||||
}
|
||||
|
||||
if( !empty($u) ) {
|
||||
$c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']);
|
||||
if ((int)$c["c"] == 0){
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{
|
||||
DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s')));
|
||||
}
|
||||
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
$_SESSION['avatar'] = $this->avatar = $u['avatar'];
|
||||
|
||||
if( !empty($_POST['remember']) ) {
|
||||
$r = md5(uniqid(rand()));
|
||||
DB::updateRow( TABLE_USERS, array('id' => $this->id), array('remember' => $r ) );
|
||||
setcookie( Config::$rememberCookie, $r, time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
}
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
}else{return "wronglogin";}
|
||||
|
||||
}
|
||||
|
||||
else if( !empty($_COOKIE[Config::$sessionCookie]) ) { // session running
|
||||
session_start();
|
||||
$c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']);
|
||||
if ((int)$c["c"] == 0){
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{
|
||||
DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s')));
|
||||
}
|
||||
if( empty($_SESSION['id']) ) {
|
||||
setcookie(Config::$sessionCookie, false, time() - 3600, Config::$absolutePath );
|
||||
} else {
|
||||
$this->id = $_SESSION['id'];
|
||||
$this->name = $_SESSION['name'];
|
||||
$this->admin = $_SESSION['admin'];
|
||||
$this->website = $_SESSION['website'];
|
||||
$this->color = $u['color'];
|
||||
$this->stylecolor = $u['stylecolor'];
|
||||
$this->avatar = $u['avatar'];
|
||||
|
||||
|
||||
}
|
||||
if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$this->id)){
|
||||
$this->logout();
|
||||
return "banned";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else if( !empty($_COOKIE[Config::$rememberCookie]) ) { // remember cookie found
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, style, color, avatar FROM '.TABLE_USERS.' WHERE remember = :1',
|
||||
$_COOKIE[Config::$rememberCookie]
|
||||
);
|
||||
|
||||
if( !empty($u) ) {
|
||||
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
$_SESSION['avatar'] = $this->avatar = $u['avatar'];
|
||||
// refresh for another year
|
||||
setcookie( Config::$rememberCookie, $_COOKIE[Config::$rememberCookie], time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
|
||||
|
||||
$c = DB::getRow('SELECT ip, created, COUNT(*) as c from pl_registerlock WHERE ip=:1 GROUP BY ip',$_SERVER['REMOTE_ADDR']);
|
||||
if ((int)$c["c"] == 0){
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));}else{
|
||||
DB::query("DELETE FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
DB::insertRow("pl_registerlock",array('ip'=>$_SERVER['REMOTE_ADDR'],'created'=>date('Y-m-d H:i:s')));
|
||||
}
|
||||
|
||||
if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){
|
||||
$this->logout();
|
||||
return "banned";
|
||||
}
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function profile( $localFile, &$messages ) {
|
||||
$upd = array( 'website' => $_POST['website'] );
|
||||
|
||||
$_SESSION['website'] = $_POST['website'];
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
}
|
||||
|
||||
$p = trim($_POST['cpass']);
|
||||
if( !empty( $p ) ) {
|
||||
if( strlen($_POST['cpass']) < 6 ) {
|
||||
$messages['passToShort'] = true;
|
||||
}
|
||||
else if( $_POST['cpass'] != $_POST['cpass2'] ) {
|
||||
$messages['passNotEqual'] = true;
|
||||
}
|
||||
else {
|
||||
$upd['pass'] = md5($_POST['cpass2']);
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
$forum->set_pass( $_SESSION['name'], $_POST['cpass2']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !empty( $localFile ) ) {
|
||||
require_once( 'lib/images.php' );
|
||||
|
||||
list( $imgWidth, $imgHeight, $imgtype ) = getimagesize($localFile);
|
||||
|
||||
if ( $imgWidth == 64 && $imgHeight == 64 && $imgtype == IMAGETYPE_GIF){
|
||||
$name = Config::$images['avatarsPath'].uniqid().'.gif';
|
||||
if (!move_uploaded_file($localFile,$name)){
|
||||
$messages['avatarFailed'] = true;
|
||||
$upd['avatar'] = Config::$images['avatarsPath']."default.png";
|
||||
}else{
|
||||
$upd['avatar'] = $name;
|
||||
}
|
||||
}else{
|
||||
$name = Config::$images['avatarsPath'].uniqid().'.jpg';
|
||||
|
||||
if( Image::createThumb( $localFile, $name, 64,64 ) ) {
|
||||
$upd['avatar'] = $name;
|
||||
} else {
|
||||
$messages['avatarFailed'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_POST['color'])){
|
||||
if(preg_match('/^[a-f0-9]{6}$/i', $_POST['color'])){
|
||||
if ( strtolower($_POST['color']) != "ffffff"){
|
||||
$upd['color'] = $_POST['color'];
|
||||
}else{
|
||||
$upd['color'] = "0";
|
||||
}
|
||||
}else{
|
||||
$messages['colorFailed'] = true;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------blockuser
|
||||
if(!empty($_POST['blockuser'])){
|
||||
if(preg_match('/^\w{2,20}$/', $_POST['blockuser'])){
|
||||
$blockedusers = array();
|
||||
$blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id);
|
||||
|
||||
if(!empty($blockedusers)){
|
||||
$blockedusers = unserialize($blockedusers['users']);
|
||||
if (in_array(strtolower ($_POST['blockuser']),$blockedusers)){
|
||||
$messages['blockAlready'] = true;
|
||||
}else{
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', strtolower ($_POST['blockuser']))){
|
||||
|
||||
array_push($blockedusers,$_POST['blockuser']);
|
||||
if(DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id)){
|
||||
$messages['blocked'] = true;
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
}else{
|
||||
$messages['userFailed'] = true;
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){
|
||||
$newarray = array();
|
||||
array_push($newarray,strtolower ($_POST['blockuser']));
|
||||
|
||||
if(DB::query("INSERT INTO pl_blocked (id,users) VALUES (:1,:2)",$this->id,serialize($newarray))){
|
||||
$messages['blocked'] = true;
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
|
||||
}else{
|
||||
$messages['userFailed'] = true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
|
||||
}
|
||||
//--------------------------------------------------------------------UNblockuser
|
||||
function remove_item_by_value($array, $val = '', $preserve_keys = true) {
|
||||
if (count($array) == 1) return false;
|
||||
if (empty($array) || !is_array($array)) return false;
|
||||
if (!in_array($val, $array)) return $array;
|
||||
|
||||
foreach($array as $key => $value) {
|
||||
if ($value == $val) unset($array[$key]);
|
||||
}
|
||||
|
||||
return ($preserve_keys === true) ? $array : array_values($array);
|
||||
}
|
||||
//--------------------------------------------------------------------UNblockuser
|
||||
if(!empty($_POST['unblockuser'])){
|
||||
if ($_POST['unblockuser'] != "select"){
|
||||
if(preg_match('/^\w{2,20}$/', $_POST['unblockuser'])){
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['unblockuser'])){
|
||||
$blockedusers = array();
|
||||
$blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id);
|
||||
if(!empty($blockedusers)){
|
||||
$blockedusers = unserialize($blockedusers['users']);
|
||||
if (in_array($_POST['unblockuser'],$blockedusers)){
|
||||
$blockedusers = remove_item_by_value($blockedusers,$_POST['unblockuser']);
|
||||
if ($blockedusers){
|
||||
DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id);
|
||||
$messages['unblocked'] = true;
|
||||
}else{
|
||||
DB::query('DELETE FROM pl_blocked WHERE id=:1',$this->id);
|
||||
$messages['unblocked'] = true;
|
||||
}
|
||||
}else{$messages['notBlocked'] = true;}
|
||||
}else{$messages['unblockFailed'] = true;}
|
||||
}else{$messages['userFailed'] = true;}
|
||||
}else{$messages['unblockFailed'] = true;}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------STYLE
|
||||
|
||||
if(isset($_POST['stylecolor'])) {
|
||||
if($_POST['stylecolor'] == 'white') {
|
||||
|
||||
$upd['style'] = $_POST['stylecolor'];
|
||||
|
||||
} elseif($_POST['stylecolor'] == 'black') {
|
||||
$upd['style'] = $_POST['stylecolor'];
|
||||
} else{
|
||||
$upd['style'] = $_POST['black'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( empty($this->email) &&
|
||||
preg_match('/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'])
|
||||
) {
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
$forum->set_email( $_SESSION['name'], $_POST['email']);
|
||||
}
|
||||
$upd['email'] = $_POST['email'];
|
||||
}
|
||||
|
||||
DB::updateRow( TABLE_USERS, array( 'id' => $this->id ), $upd );
|
||||
}
|
||||
|
||||
public function loadEmail() {
|
||||
$tmp = DB::getRow(
|
||||
'SELECT email,color,style,avatar FROM '.TABLE_USERS.' WHERE id = :1',
|
||||
$this->id
|
||||
);
|
||||
$this->email = $tmp['email'];
|
||||
$this->color = $tmp['color'];
|
||||
$this->stylecolor = $tmp['style'];
|
||||
$this->avatar = $u['avatar'];
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
$_SESSION = array();
|
||||
setcookie( Config::$rememberCookie, false, time() - 3600, Config::$absolutePath );
|
||||
setcookie( Config::$sessionCookie, false, time() - 3600, Config::$absolutePath );
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->logout();
|
||||
}
|
||||
}
|
||||
|
||||
public function increaseScore( $amount ) {
|
||||
DB::query(
|
||||
'UPDATE '.TABLE_USERS.' SET score = score + :1 WHERE id = :2',
|
||||
intval( $amount ),
|
||||
$this->id
|
||||
);
|
||||
}
|
||||
|
||||
public function register( &$messages,$inviteC=false ) {
|
||||
|
||||
DB::query( 'DELETE FROM '.TABLE_USERS.' WHERE valid = 0 AND registered < NOW() - INTERVAL 30 MINUTE' );
|
||||
$iplocks = DB::getRow("DELETE FROM pl_registerlock WHERE created < (NOW() - INTERVAL 1440 MINUTE)");
|
||||
|
||||
|
||||
$reg = DB::getRow("SELECT * FROM pl_settings");
|
||||
$doubleacc = DB::getRow("SELECT COUNT(*) as c FROM pl_registerlock WHERE ip=:1",$_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if($inviteC == false){
|
||||
if ($reg["register"] != 1 || $doubleacc["c"] > 0){
|
||||
$messages['registerClosed'] = true;
|
||||
}
|
||||
}else{
|
||||
if ($doubleacc["c"] > 0){
|
||||
DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>1));
|
||||
$inviteC = false;
|
||||
$messages['registerClosed'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( !preg_match('/^\w{2,20}$/', $_POST['name']) ) {
|
||||
$messages['nameInvalid'] = true;
|
||||
} else {
|
||||
$u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE name = :1', $_POST['name'] );
|
||||
if( !empty($u) ) {
|
||||
$messages['nameInUse'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( strlen($_POST['pass']) < 6 ) {
|
||||
$messages['passToShort'] = true;
|
||||
}
|
||||
else if( $_POST['pass'] != $_POST['pass2'] ) {
|
||||
$messages['passNotEqual'] = true;
|
||||
}
|
||||
|
||||
if( !preg_match( '/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'] ) ) {
|
||||
$messages['wrongEmail'] = true;
|
||||
} else {
|
||||
$u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE email = :1', $_POST['email'] );
|
||||
if( !empty($u) ) {
|
||||
$messages['emailInUse'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( !empty($messages) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->validationString = md5(uniqid(rand()));
|
||||
|
||||
DB::insertRow( TABLE_USERS, array(
|
||||
'registered' => date('Y-m-d H:i:s'),
|
||||
'name' => $_POST['name'],
|
||||
'pass' => md5($_POST['pass']),
|
||||
'valid' => 1,
|
||||
'score' => 0,
|
||||
'images' => 0,
|
||||
'website' => '',
|
||||
'avatar' => Config::$images['avatarsPath'].'default.png',
|
||||
'remember' => $this->validationString,
|
||||
'admin' => 0,
|
||||
'email' => $_POST['email'],
|
||||
'color' => '0',
|
||||
'style' => 'black',
|
||||
'invite' => $inviteC
|
||||
));
|
||||
|
||||
if($inviteC != false){
|
||||
$lastid= DB::getRow("SELECT LAST_INSERT_ID() as id");
|
||||
DB::updateRow("pl_invites",array("code"=>$inviteC),array("used"=>1,"usedby"=>$lastid["id"]));
|
||||
}
|
||||
|
||||
DB::insertRow( "pl_registerlock", array("ip"=>$_SERVER['REMOTE_ADDR'],"created"=>date('Y-m-d H:i:s')));
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$user['name'] = $_POST['name'];
|
||||
$user['pass'] = $_POST['pass'];
|
||||
$user['email'] = $_POST['email'];
|
||||
echo $forum->register_newuser($user, false);
|
||||
}
|
||||
|
||||
$mail = file_get_contents( Config::$templates.'registrationmail.txt' );
|
||||
preg_match( '/From: (?<from>.*?)\r?\nSubject: (?<subject>.*?)\r?\n\r?\n(?<text>.*)/sim', $mail, $mail );
|
||||
$mail['text'] = str_replace( '%validationString%', $this->validationString, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%siteName%', Config::$siteName, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%frontendPath%', Config::$frontendPath, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%userName%', $_POST['name'], $mail['text'] );
|
||||
|
||||
$mail['subject'] = str_replace( '%siteName%', Config::$siteName, $mail['subject'] );
|
||||
$mail['subject'] = str_replace( '%userName%', $_POST['name'], $mail['subject'] );
|
||||
|
||||
//mail( $_POST['email'], $mail['subject'], $mail['text'], 'FROM: '.$mail['from'] );
|
||||
mail($_POST['email'],$mail['subject'],$mail['text'],"FROM:".$mail['from']);
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,245 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
The ImageUploader class handles the insertion of images into the system -
|
||||
whether they were uploaded or should be copied from a remote URL
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
require_once( 'lib/filesystem.php' );
|
||||
require_once( 'lib/images.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/keyword.php' );
|
||||
|
||||
class ImageUploader {
|
||||
|
||||
public static function copyFromUrl( $url, $tags, $referer, &$errors ) {
|
||||
if( stripos( $url, 'http://' ) !== 0 ) {
|
||||
$url = 'http://'.$url;
|
||||
}
|
||||
// no recursion, no non-images
|
||||
if(
|
||||
stripos( $url, Config::$frontendPath ) !== false ||
|
||||
!preg_match( '/([^\/]*?)\.(gif|jpg|jpeg|png)$/i', $url, $fileMatch )
|
||||
) {
|
||||
$errors['downloadFailed'] = 'The Image could not be downloaded!';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$fileName = $fileMatch[1];
|
||||
// use the domain name as part of the keyword
|
||||
$urlParts = parse_url( $url );
|
||||
if( preg_match( '/(^|\.)([\w\-]+)\.\w+$/', $urlParts['host'], $m ) ) {
|
||||
$fileName = strtolower($m[2]).'-'.$fileName;
|
||||
}
|
||||
$fileName = Keyword::get( $fileName ).'.'.$fileMatch[2];
|
||||
$targetPath = './import/'.$fileName;
|
||||
|
||||
if( !Filesystem::download( $url, $targetPath, Config::$images['maxDownload'], $referer ) ) {
|
||||
$errors['downloadFailed'] = 'The Image could not be downloaded!';
|
||||
return false;
|
||||
}
|
||||
|
||||
if( self::process( $fileName, $targetPath, $tags, false, $errors, $url ) ) {
|
||||
return true;
|
||||
} else {
|
||||
@unlink( $targePath );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function process( $name, $localPath, $tags, $uploaded = true, &$errors, $source = '',$commentUpload = false,$cid=0 ) {
|
||||
echo("hallo");
|
||||
$user = new User();
|
||||
$user->login();
|
||||
|
||||
if( !$user->id ) {
|
||||
$errors['notLoggedIn'] = 'You are not logged in!';
|
||||
return false;
|
||||
}
|
||||
|
||||
// no non-images
|
||||
if(
|
||||
!preg_match( '/([^\/]*?)\.(gif|jpg|jpeg|png)$/i', $name, $fileMatch )
|
||||
) {
|
||||
$errors['wrongExtension'] = 'Your file has not the right extension (gif, jpg or png)!';
|
||||
return false;
|
||||
}
|
||||
|
||||
$time = time();
|
||||
$keyword = Keyword::get( $fileMatch[1] );
|
||||
|
||||
// Iterate over all keywords, if this one is allready taken
|
||||
$taken = array();
|
||||
$r = DB::query( 'SELECT keyword FROM '.TABLE_IMAGES.' WHERE keyword LIKE :1', date('Y/m/',$time).$keyword.'%' );
|
||||
foreach( $r as $v ) {
|
||||
$taken[] = substr($v['keyword'],8); // Keyword without date!
|
||||
}
|
||||
$keyword = Keyword::iterate( $keyword, $taken );
|
||||
|
||||
list( $srcWidth, $srcHeight, $type ) = getimagesize( $localPath );
|
||||
if( $type == IMAGETYPE_JPEG ) {
|
||||
$extension = 'jpg';
|
||||
} else if( $type == IMAGETYPE_GIF ) {
|
||||
$extension = 'gif';
|
||||
} else if( $type == IMAGETYPE_PNG ) {
|
||||
$extension = 'png';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
$thumbName = $keyword.".jpg"; // all thumbs are jpegs!
|
||||
$name = $keyword.".".$extension;
|
||||
$imageDir = Config::$images['imagePath'] . date('Y/m', $time);
|
||||
$thumbDir = Config::$images['thumbPath'] . date('Y/m', $time);
|
||||
$imagePath = $imageDir.'/'.$name;
|
||||
|
||||
if( !Filesystem::mkdirr($imageDir) || !Filesystem::mkdirr($thumbDir) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if( $uploaded ) {
|
||||
if( !@move_uploaded_file( $localPath, $imagePath ) ) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if( !@rename( $localPath, $imagePath ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$hash = md5_file( $imagePath );
|
||||
$c = DB::query('SELECT id FROM '.TABLE_IMAGES.' WHERE hash = :1', $hash);
|
||||
if( !empty( $c ) ) {
|
||||
unlink( $imagePath );
|
||||
$errors['duplicate'] = 'This image is already in our database!';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//watermark
|
||||
function watermark($SourceFile, $WatermarkFile, $SaveToFile = NULL)
|
||||
|
||||
{
|
||||
|
||||
list( $srcWidth, $srcHeight, $type ) = getimagesize( $SourceFile );
|
||||
if( $type != IMAGETYPE_GIF ) {
|
||||
|
||||
|
||||
|
||||
|
||||
$watermark = @imagecreatefrompng($WatermarkFile)
|
||||
|
||||
|
||||
or exit('Cannot open the watermark file.');
|
||||
|
||||
imageAlphaBlending($watermark, false);
|
||||
|
||||
imageSaveAlpha($watermark, true);
|
||||
|
||||
$image_string = @file_get_contents($SourceFile)
|
||||
|
||||
|
||||
or exit('Cannot open image file.');
|
||||
|
||||
$image = @imagecreatefromstring($image_string)
|
||||
|
||||
or exit('Not a valid image format.');
|
||||
|
||||
$imageWidth=imageSX($image);
|
||||
|
||||
$imageHeight=imageSY($image);
|
||||
|
||||
|
||||
$watermarkWidth=imageSX($watermark);
|
||||
|
||||
$watermarkHeight=imageSY($watermark);
|
||||
|
||||
$coordinate_X = ( $imageWidth) - ( $watermarkWidth);
|
||||
|
||||
|
||||
$coordinate_Y = ( $imageHeight) - ( $watermarkHeight);
|
||||
|
||||
imagecopy($image, $watermark, $coordinate_X, $coordinate_Y,
|
||||
|
||||
|
||||
0, 0, $watermarkWidth, $watermarkHeight);
|
||||
|
||||
if(!($SaveToFile)) header('Content-Type: image/jpeg');
|
||||
|
||||
imagejpeg ($image, $SaveToFile, 100);
|
||||
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
imagedestroy($watermark);
|
||||
|
||||
if(!($SaveToFile)) exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// make thumbs
|
||||
foreach( Config::$gridView['classes'] as $gc ) {
|
||||
$thumbPath = $thumbDir.'/'.$gc['dir'].'/'.$thumbName;
|
||||
Filesystem::mkdirr($thumbDir.'/'.$gc['dir']);
|
||||
if( !Image::createThumb( $imagePath, $thumbPath,
|
||||
$gc['width'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth'],
|
||||
$gc['height'] * Config::$gridView['gridSize'] - Config::$gridView['borderWidth']
|
||||
)) {
|
||||
unlink( $imagePath );
|
||||
$errors['internalError'] = 'Internal error processing the image!';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
///watermark
|
||||
watermark($imagePath,"watermark.png",$imagePath);
|
||||
///watermark
|
||||
|
||||
$user->increaseScore( Config::$postScore );
|
||||
|
||||
DB::query( 'UPDATE '.TABLE_USERS.' SET images = images + 1 WHERE id = :1', $user->id );
|
||||
|
||||
|
||||
if ($commentUpload && $cid != 0){
|
||||
DB::insertRow( "pl_commentuploads",array('c_id' => $cid,"image_link" =>$imagePath,"thumb_link" => "data/thumbs/".date('Y/m/', $time)."/128x128/".$name));
|
||||
|
||||
}else{
|
||||
DB::insertRow( TABLE_IMAGES,
|
||||
array(
|
||||
'logged' => date('Y-m-d H:i:s', $time),
|
||||
'user' => $user->id,
|
||||
'score' => 3,
|
||||
'votes' => 0,
|
||||
'keyword' => date('Y/m/', $time).$keyword,
|
||||
'tags' => $tags,
|
||||
'image' => $name,
|
||||
'thumb' => $thumbName,
|
||||
'hash' => $hash,
|
||||
'source' => $source
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$imageId = DB::insertId();
|
||||
|
||||
$colors = Image::getColors( $imagePath, 4 );
|
||||
foreach( $colors as $c ) {
|
||||
DB::insertRow( TABLE_IMAGECOLORS,
|
||||
array(
|
||||
'imageId' => $imageId,
|
||||
'r' => $c['r'],
|
||||
'g' => $c['g'],
|
||||
'b' => $c['b']
|
||||
)
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Vendored
+4
File diff suppressed because one or more lines are too long
@@ -0,0 +1,490 @@
|
||||
function $(id){return document.getElementById(id)}
|
||||
function gridView(id){ gridSolve(id); gridSolve(id); window.setInterval("gridSolve('"+id+"')",250); }
|
||||
function swap(e, c1, c2) { e.className = e.className == c1 ? c2 : c1; };
|
||||
|
||||
// GridSolver ------------------------------------------------------------
|
||||
var gridSize = 64;
|
||||
var gridMinWidth = 6;
|
||||
var gridWidth = 0;
|
||||
var grid = null;
|
||||
var boxDef = {
|
||||
'b0': {'width': 3, 'height': 3},
|
||||
'b1': {'width': 2, 'height': 2},
|
||||
'b2': {'width': 1, 'height': 1}
|
||||
};
|
||||
|
||||
function gridSolve( cid ) {
|
||||
var container = $(cid);
|
||||
var newWidth = parseInt( container.offsetWidth );
|
||||
var newGridWidth = parseInt( newWidth / gridSize );
|
||||
newGridWidth = newGridWidth < gridMinWidth ? gridMinWidth : newGridWidth;
|
||||
|
||||
if( gridWidth == newGridWidth )
|
||||
return;
|
||||
else
|
||||
gridWidth = newGridWidth;
|
||||
|
||||
boxes = new Array();
|
||||
while( container.hasChildNodes() ) {
|
||||
e = container.removeChild( container.firstChild );
|
||||
if( e.tagName == 'DIV' ) {
|
||||
boxes.push( e );
|
||||
}
|
||||
}
|
||||
|
||||
grid = new Array( gridWidth );
|
||||
for( var i = 0; i < grid.length; i++ ) {
|
||||
grid[i] = 0;
|
||||
}
|
||||
|
||||
for(var i = 0; i < boxes.length; i++) {
|
||||
insertThumb( boxes[i], cid )
|
||||
}
|
||||
|
||||
var maxHeight = 0;
|
||||
for( var i = 0; i < grid.length; i++) {
|
||||
maxHeight = Math.max( maxHeight,grid[i] );
|
||||
}
|
||||
container.style.height = (maxHeight * gridSize) + 'px';
|
||||
$('images').style.height = (maxHeight * gridSize) + 'px';
|
||||
}
|
||||
|
||||
function insertThumb( box, cid ) {
|
||||
var boxWidth = boxDef[box.className]['width'];
|
||||
var boxHeight = boxDef[box.className]['height'];
|
||||
var maxHeight = 0;
|
||||
var currentHeight = -1;
|
||||
var spotWidth = 0;
|
||||
var spotLeft = 0;
|
||||
var freeSpots = new Array();
|
||||
for( var i = 0; i < grid.length; i++) {
|
||||
if( currentHeight == grid[i] ) {
|
||||
spotWidth++;
|
||||
}
|
||||
|
||||
if( (currentHeight != grid[i] || i+1 == grid.length) && spotWidth > 0) {
|
||||
freeSpots.push({'width': spotWidth, 'left': spotLeft, 'height': currentHeight});
|
||||
|
||||
spotWidth = 1;
|
||||
spotLeft = i;
|
||||
if(currentHeight != grid[i] && i+1 == grid.length) {
|
||||
freeSpots.push({'width': spotWidth, 'left': spotLeft, 'height': grid[i]});
|
||||
}
|
||||
}
|
||||
|
||||
else if( spotWidth == 0 ) {
|
||||
spotWidth = 1;
|
||||
}
|
||||
|
||||
currentHeight = grid[i];
|
||||
if( grid[i] > maxHeight ) {
|
||||
maxHeight = grid[i];
|
||||
}
|
||||
}
|
||||
|
||||
var targetHeight = 0;
|
||||
var targetLeft = 0;
|
||||
var bestScore = -1;
|
||||
for( var j = 0; j < boxWidth; j++ ) {
|
||||
if( grid[j] > targetHeight ) {
|
||||
targetHeight = grid[j];
|
||||
}
|
||||
}
|
||||
var newHeight = targetHeight + boxHeight;
|
||||
|
||||
for( var i = 0; i < freeSpots.length; i++ ) {
|
||||
var heightScore = ( maxHeight - freeSpots[i]['height'] );
|
||||
var widthScore = boxWidth / freeSpots[i]['width'];
|
||||
var score = heightScore * heightScore + widthScore * 2;
|
||||
|
||||
if( freeSpots[i]['width'] >= boxWidth && score > bestScore ) {
|
||||
targetHeight = freeSpots[i]['height'];
|
||||
targetLeft = freeSpots[i]['left'];
|
||||
newHeight = freeSpots[i]['height'] + boxHeight;
|
||||
bestScore = score;
|
||||
}
|
||||
}
|
||||
|
||||
for( var j = 0; j < boxWidth; j++ ) {
|
||||
grid[targetLeft + j] = newHeight;
|
||||
}
|
||||
|
||||
var container = $( cid );
|
||||
container.appendChild( box );
|
||||
box.style.left = (targetLeft * gridSize) + 'px';
|
||||
box.style.top = (targetHeight * gridSize) + 'px';
|
||||
return true;
|
||||
}
|
||||
|
||||
// Colorpicker -----------------------------------------------------------
|
||||
function colorpicker( id, size, onchange, onshow ) {
|
||||
var that = this;
|
||||
this.size = size;
|
||||
this.onchange = onchange;
|
||||
this.onshow = onshow;
|
||||
|
||||
this.mode = 'none';
|
||||
|
||||
this.sv = $(id+'SV');
|
||||
this.svselect = $(id+'SVSelect');
|
||||
this.h = $(id+'H');
|
||||
this.hselect = $(id+'HSelect');
|
||||
this.value = $(id+'Value');
|
||||
this.current = $(id+'Current');
|
||||
|
||||
this.cap = function( v, min, max ) {
|
||||
return Math.min(Math.max(min,v),max);
|
||||
}
|
||||
|
||||
this.getMousPos = function( event ) {
|
||||
if(event.pageX || event.pageY){
|
||||
return {
|
||||
'x': event.pageX,
|
||||
'y': event.pageY
|
||||
};
|
||||
}
|
||||
return {
|
||||
'x': event.clientX + document.body.scrollLeft - document.body.clientLeft,
|
||||
'y': event.clientY + document.body.scrollTop - document.body.clientTop
|
||||
};
|
||||
}
|
||||
|
||||
this.getObjPos = function( obj ) {
|
||||
var curleft = curtop = 0;
|
||||
if (obj.offsetParent) {
|
||||
curleft = obj.offsetLeft;
|
||||
curtop = obj.offsetTop;
|
||||
while (obj = obj.offsetParent) {
|
||||
curleft += obj.offsetLeft;
|
||||
curtop += obj.offsetTop;
|
||||
}
|
||||
}
|
||||
return {
|
||||
'x':curleft,
|
||||
'y':curtop
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
this.release = function() {
|
||||
document.onmousemove = '';
|
||||
this.mode = 'none';
|
||||
}
|
||||
|
||||
this.move = function( event ) {
|
||||
if (!event) var event = window.event;
|
||||
if(event.pageX || event.pageY) {
|
||||
var mx = event.pageX;
|
||||
var my = event.pageY;
|
||||
} else {
|
||||
var mx = event.clientX + document.body.scrollLeft - document.body.clientLeft;
|
||||
var my = event.clientY + document.body.scrollTop - document.body.clientTop;
|
||||
}
|
||||
if( this.mode == 'sv' ) {
|
||||
var obj = this.getObjPos( this.sv );
|
||||
var x = this.cap(mx - obj.x - 3, -4, this.size - 4);
|
||||
var y = this.cap(my - obj.y - 3, -4, this.size - 4);
|
||||
this.svselect.style.left = x + "px";
|
||||
this.svselect.style.top = y + "px";
|
||||
}
|
||||
else if ( this.mode == 'h' ) {
|
||||
var obj = this.getObjPos( this.sv );
|
||||
var y = this.cap(my - obj.y - 2, -2, this.size - 3);
|
||||
this.hselect.style.top = y + "px";
|
||||
this.sv.style.backgroundColor = '#' + this.rgb2hex(this.hsv2rgb( {'h':1-((y+3)/this.size), 's':1, 'v':1} ));
|
||||
}
|
||||
else return false;
|
||||
|
||||
var hex = this.getHex();
|
||||
this.current.style.backgroundColor = '#' + hex;
|
||||
this.value.innerHTML = '#' + hex;
|
||||
this.onchange( this );
|
||||
return false;
|
||||
}
|
||||
|
||||
this.sv.onmousedown = function() {
|
||||
that.mode = 'sv';
|
||||
document.onmousemove = function( event ) { that.move( event ) };
|
||||
document.onmouseup = that.release;
|
||||
return false;
|
||||
}
|
||||
|
||||
this.h.onmousedown = function() {
|
||||
that.mode = 'h';
|
||||
document.onmousemove = function( event ) { that.move( event ) };
|
||||
document.onmouseup = that.release;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
this.getHSV = function() {
|
||||
var svpos = this.getObjPos( this.sv );
|
||||
var svselectpos = this.getObjPos( this.svselect );
|
||||
|
||||
var hpos = this.getObjPos( this.h );
|
||||
var hselectpos = this.getObjPos( this.hselect );
|
||||
|
||||
return {
|
||||
'h': 1 - (this.cap(hselectpos.y - hpos.y + 3, 0, this.size) / this.size),
|
||||
's': this.cap(svselectpos.x - svpos.x + 2, 0, this.size) / this.size,
|
||||
'v': 1 - (this.cap(svselectpos.y - svpos.y + 4, 0, this.size) / this.size)
|
||||
}
|
||||
}
|
||||
|
||||
this.getRGB = function() {
|
||||
return this.hsv2rgb( this.getHSV() );
|
||||
}
|
||||
|
||||
this.getHex = function() {
|
||||
return this.rgb2hex( this.getRGB() );
|
||||
}
|
||||
|
||||
this.toHex = function(v) { v=Math.round(Math.min(Math.max(0,v),255)); return("0123456789ABCDEF".charAt((v-v%16)/16)+"0123456789ABCDEF".charAt(v%16)); }
|
||||
this.rgb2hex = function(c) { return this.toHex(c.r)+this.toHex(c.g)+this.toHex(c.b); }
|
||||
|
||||
this.hsv2rgb = function( c ) {
|
||||
var R, B, G, H = c.h, S = c.s, V = c.v;
|
||||
if( S>0 ) {
|
||||
if(H>=1) H=0;
|
||||
|
||||
H=6*H; F=H-Math.floor(H);
|
||||
A=Math.round(255*V*(1.0-S));
|
||||
B=Math.round(255*V*(1.0-(S*F)));
|
||||
C=Math.round(255*V*(1.0-(S*(1.0-F))));
|
||||
V=Math.round(255*V);
|
||||
|
||||
switch(Math.floor(H)) {
|
||||
case 0: R=V; G=C; B=A; break;
|
||||
case 1: R=B; G=V; B=A; break;
|
||||
case 2: R=A; G=V; B=C; break;
|
||||
case 3: R=A; G=B; B=V; break;
|
||||
case 4: R=C; G=A; B=V; break;
|
||||
case 5: R=V; G=A; B=B; break;
|
||||
}
|
||||
return {'r': (R?R:0), 'g': (G?G:0), 'b': (B?B:0)};
|
||||
}
|
||||
else {
|
||||
return {'r': (Math.round(V*255)), 'g': (Math.round(V*255)), 'b': (Math.round(V*255))};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Adjust height of prev/next bars in IE ---------------------------------
|
||||
var ieAdjustCount = 0;
|
||||
function ieAdjustHeight( oldHeight ) {
|
||||
var pe = ($('viewer') ? $('viewer') : $('images'));
|
||||
if(
|
||||
!document.all || // IE
|
||||
!( pe ) ||
|
||||
(
|
||||
pe.scrollHeight < oldHeight + 50 &&
|
||||
ieAdjustCount > 10
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
ieAdjustCount++;
|
||||
var newHeight = pe.scrollHeight;
|
||||
$('prevBar').style.height = pe.scrollHeight + 'px';
|
||||
$('nextBar').style.height = pe.scrollHeight + 'px';
|
||||
setTimeout( 'ieAdjustHeight(' + newHeight + ')', 100 );
|
||||
}
|
||||
|
||||
//GET
|
||||
|
||||
function getUrlVars() {
|
||||
var vars = {};
|
||||
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
|
||||
vars[key] = value;
|
||||
});
|
||||
return vars;
|
||||
}
|
||||
|
||||
|
||||
// JSON functions for tagging, rating, deleting... -----------------------
|
||||
function post( url, params, callback ) {
|
||||
if (window.ActiveXObject) { // ie
|
||||
try {
|
||||
req = new ActiveXObject( 'Msxml2.XMLHTTP' );
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
req = new ActiveXObject( 'Microsoft.XMLHTTP' );
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
}
|
||||
else if (window.XMLHttpRequest) { // moz
|
||||
req = new XMLHttpRequest();
|
||||
req.overrideMimeType( 'text/plain' );
|
||||
}
|
||||
req.onreadystatechange = function(){
|
||||
if (req.readyState == 4 && req.status == 200) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
if( !req ) return false;
|
||||
req.open( 'POST', url, true );
|
||||
req.setRequestHeader( 'Content-type', 'application/x-www-form-urlencoded; charset=UTF-8' );
|
||||
req.setRequestHeader( 'Content-length', params.length );
|
||||
req.setRequestHeader( 'Connection', 'close' );
|
||||
req.send( params );
|
||||
}
|
||||
|
||||
function addTags( imageId, inputField, admin ) {
|
||||
$( 'loadTags' ).style.display = 'block';
|
||||
var tags = encodeURIComponent(inputField.value);
|
||||
if( !admin ) {
|
||||
inputField.value = '';
|
||||
}
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?addTags',
|
||||
'id='+imageId+'&tags='+tags,
|
||||
function(){
|
||||
q = ( eval('('+req.responseText+')') );
|
||||
if( q.tags ) {
|
||||
$('tags').innerHTML = q.tags;
|
||||
}
|
||||
$('addTag').className='hidden';
|
||||
$( 'loadTags' ).style.display = 'none';
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
function del( imageId ) {
|
||||
try {
|
||||
if( !confirm( 'Delete this image: ' + imageId +' ?' ) ) return false;
|
||||
//$( 'loadDelete' ).style.display = 'block';
|
||||
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?delete','id='+imageId);
|
||||
LoadData("comments","cmts",imageId);
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
alert("Fehler: "+e);
|
||||
return false;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function movehof( imageId ) {
|
||||
try {
|
||||
if( !confirm( 'Move to Hall of Fame?' ) ) return false;
|
||||
//$( 'loadhof' ).style.display = 'block';
|
||||
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?fame',
|
||||
'id='+imageId);
|
||||
//function(){
|
||||
//$( 'loadhof' ).style.display = 'none';
|
||||
// //$( 'hof' ).style.display = 'none';
|
||||
//}
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
alert("Fehler: "+e);
|
||||
return false;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function CloseThread( imageId ) {
|
||||
try {
|
||||
if( !confirm( 'Close Thread?' ) ) return false;
|
||||
//$( 'loadhof' ).style.display = 'block';
|
||||
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?CloseThread',
|
||||
'id='+imageId);
|
||||
//function(){
|
||||
//$( 'loadhof' ).style.display = 'none';
|
||||
// //$( 'hof' ).style.display = 'none';
|
||||
//}
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
alert("Fehler: "+e);
|
||||
return false;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function banUser( userId ) {
|
||||
|
||||
if( !confirm( 'Ban this User?' ) ) return false;
|
||||
var rsn = prompt("Why?");
|
||||
//$( 'loadDelete' ).style.display = 'block';
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?banUser',
|
||||
'id='+userId+'&rsn='+rsn);
|
||||
return false;
|
||||
}
|
||||
|
||||
function TimeUser( userId ) {
|
||||
|
||||
if( !confirm( 'Spamlock this user?' ) ) return false;
|
||||
var tm = prompt("How long? (in hours)");
|
||||
var rsn = prompt("Why?");
|
||||
//$( 'loadDelete' ).style.display = 'block';
|
||||
var now = parseInt(Math.round((new Date()).getTime() / 1000));
|
||||
now = now + (3600 * parseInt(tm));
|
||||
alert(now);
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?TimeUser',
|
||||
'id='+userId+'&time='+now+'&rsn='+rsn);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function delComment( commentId, e ) {
|
||||
if( !confirm( 'Delete this comment?' ) ) return false;
|
||||
var cdiv = e.parentNode.parentNode.parentNode;
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?deleteComment',
|
||||
'id='+commentId);
|
||||
return false;
|
||||
}
|
||||
|
||||
function addfav( imageId, e ) {
|
||||
post(
|
||||
location.protocol + "//" + location.host + '/json.php?addfav',
|
||||
'id='+imageId);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// mouseover for rating stars
|
||||
function sr( id, scale ) {
|
||||
$( id ).style.backgroundPosition = ( (20 * scale) - 100 ) + 'px 0';
|
||||
}
|
||||
|
||||
function rate( imageId, score ) {
|
||||
$( 'loadRating' ).style.display = 'block';
|
||||
post(
|
||||
$('home').href + 'json.php?rate',
|
||||
'id='+imageId+'&score='+score,
|
||||
function() {
|
||||
q = ( eval('('+req.responseText+')') );
|
||||
$( 'loadRating' ).style.display = 'none';
|
||||
$( 'currentRating' ).style.width = 20 * parseFloat(q.score) + 'px';
|
||||
$( 'ratingDescription' ).innerHTML = q.score + ' after ' + q.votes + ' Vote' + ( q.votes > 1 ? 's' : '' );
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
function s() {
|
||||
var q = $( 'q' );
|
||||
if( q && q.value ) {
|
||||
window.location = $('home').href + 'search/' + encodeURI( q.value );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
require_once( '../lib/config.php' );
|
||||
header( 'Content-type: text/javascript; charset=utf-8' );
|
||||
?>
|
||||
function RP_RemotePost( postURL, stylesheet ) {
|
||||
this.postURL = postURL;
|
||||
this.stylesheet = stylesheet;
|
||||
|
||||
this.visible = false;
|
||||
this.menu = null;
|
||||
this.dialog = null;
|
||||
this.iframe = null;
|
||||
this.checkSuccessInterval = 0;
|
||||
this.minImageSize = 32;
|
||||
|
||||
|
||||
this.create = function(){
|
||||
var that = this;
|
||||
var css = document.createElement('link');
|
||||
css.type = 'text/css';
|
||||
css.rel = 'stylesheet';
|
||||
css.href = this.stylesheet;
|
||||
if( document.getElementsByTagName("head").item(0) ) {
|
||||
document.getElementsByTagName("head").item(0).appendChild( css );
|
||||
} else {
|
||||
document.getElementsByTagName("body").item(0).appendChild( css );
|
||||
}
|
||||
|
||||
var closeButton = document.createElement('a');
|
||||
closeButton.appendChild( document.createTextNode("x") );
|
||||
closeButton.className = 'close';
|
||||
closeButton.onclick = function() { return that.toggle(); }
|
||||
closeButton.href = '#';
|
||||
|
||||
|
||||
this.dialog = document.createElement('div');
|
||||
this.dialog.id = 'RP_Dialog';
|
||||
this.iframe = document.createElement('iframe');
|
||||
this.iframe.src = 'about:blank';
|
||||
this.dialog.appendChild( this.iframe );
|
||||
this.dialog.appendChild( closeButton );
|
||||
document.body.appendChild( this.dialog );
|
||||
|
||||
this.loadIFrame( {} );
|
||||
}
|
||||
|
||||
|
||||
this.loadIFrame = function( params ) {
|
||||
var reqUrl = this.postURL + '?nocache=' + parseInt(Math.random()*10000);
|
||||
for( p in params ) {
|
||||
reqUrl += '&' + p + '=' + encodeURIComponent( params[p] );
|
||||
}
|
||||
this.iframe.src = reqUrl;
|
||||
}
|
||||
|
||||
|
||||
this.selectImage = function( image ) {
|
||||
var title = image.title ? image.title : ( image.alt ? image.alt : document.title );
|
||||
var imageSrc = image.src;
|
||||
if(
|
||||
image.parentNode.tagName.match(/^a$/i) &&
|
||||
image.parentNode.href &&
|
||||
image.parentNode.href.match(/\.(jpe?g|gif|png)$/i)
|
||||
) {
|
||||
imageSrc = image.parentNode.href;
|
||||
}
|
||||
this.loadIFrame( {
|
||||
'url': imageSrc,
|
||||
'xhrLocation': document.location.href.replace(/#.*$/,'')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
this.checkSuccess = function() {
|
||||
if( document.location.href.match(/#RP_Success/) ) {
|
||||
var that = this;
|
||||
document.location.href = document.location.href.replace(/#.*$/, '#');
|
||||
setTimeout( function() { that.hide() }, 500 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.show = function() {
|
||||
this.visible = true;
|
||||
var that = this;
|
||||
|
||||
this.checkSuccessInterval = setInterval( function() { that.checkSuccess(); }, 500 );
|
||||
this.dialog.style.display = 'block';
|
||||
|
||||
var images = document.getElementsByTagName('img');
|
||||
for( var i=0; i<images.length; i++ ) {
|
||||
var img = images[i];
|
||||
if( img && img.src && img.src.match(/(space|blank)[^\/]*\.gif$/i) ) {
|
||||
img.style.display = 'none';
|
||||
}
|
||||
else if( img && img.src && img.width > this.minImageSize && img.height > this.minImageSize) {
|
||||
img.onclick = function( ev ) {
|
||||
if( ev && ev.stopPropagation ) {
|
||||
ev.stopPropagation();
|
||||
}
|
||||
return that.selectImage(this);
|
||||
};
|
||||
img.className = img.className ? img.className + ' RP_PostImage' : 'RP_PostImage';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.hide = function() {
|
||||
this.visible = false;
|
||||
|
||||
clearInterval( this.checkSuccessInterval );
|
||||
this.dialog.style.display = 'none';
|
||||
|
||||
var images = document.getElementsByTagName('img');
|
||||
for( var i=0; i<images.length; i++ ) {
|
||||
var img = images[i];
|
||||
if( img && img.src && img.width > this.minImageSize && img.height > this.minImageSize) {
|
||||
img.onclick = null;
|
||||
img.className = img.className.replace(/\s*RP_PostImage/, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.toggle = function() {
|
||||
if( !this.visible ) {
|
||||
this.show();
|
||||
} else {
|
||||
this.hide();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
this.create();
|
||||
}
|
||||
|
||||
if( typeof(RP_Instance) == 'undefined' ) {
|
||||
var RP_Instance = new RP_RemotePost(
|
||||
'<?php echo Config::$frontendPath; ?>remotepost.php',
|
||||
'<?php echo Config::$frontendPath; ?>media/remotepost.css'
|
||||
);
|
||||
}
|
||||
RP_Instance.toggle();
|
||||
@@ -0,0 +1,44 @@
|
||||
var nextImage = {};
|
||||
var preload = null;
|
||||
function quickTag( logId, imageId, inputField ) {
|
||||
var tags = encodeURIComponent(inputField.value);
|
||||
|
||||
// swap nextImage
|
||||
$('imageLocation').href = nextImage['link'];
|
||||
$('imageLocation').innerHTML = nextImage['link'];
|
||||
$('imageId').value = nextImage['id'];
|
||||
$('logId').value = nextImage['logId'];
|
||||
$('image').src = nextImage['image'];
|
||||
$('tags').innerHTML = nextImage['tags'];
|
||||
$('tagText').value = '';
|
||||
$('tagText').focus();
|
||||
|
||||
if( !nextImage['link'] ) {
|
||||
$('imageInfo').innerHTML = 'No more Images found';
|
||||
}
|
||||
|
||||
post(
|
||||
$('home').href + 'json.php?quickTag',
|
||||
'logId='+logId+'&id='+imageId+'&tags='+tags,
|
||||
function(){
|
||||
nextImage = ( eval('('+req.responseText+')') );
|
||||
preload = new Image(1,1)
|
||||
preload.src=nextImage['image'];
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
function quickTagInit() {
|
||||
swap($('quickTagIntro'), 'article', 'hidden');
|
||||
swap($('viewer'), 'hidden', 'visible');
|
||||
post(
|
||||
$('home').href + 'json.php?quickTag',
|
||||
'',
|
||||
function(){
|
||||
nextImage = ( eval('('+req.responseText+')') );
|
||||
quickTag( 0, 0, $('tagText') );
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
<?php
|
||||
/*
|
||||
* This is a PHP library that handles calling reCAPTCHA.
|
||||
* - Documentation and latest version
|
||||
* http://recaptcha.net/plugins/php/
|
||||
* - Get a reCAPTCHA API Key
|
||||
* https://www.google.com/recaptcha/admin/create
|
||||
* - Discussion group
|
||||
* http://groups.google.com/group/recaptcha
|
||||
*
|
||||
* Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
|
||||
* AUTHORS:
|
||||
* Mike Crawford
|
||||
* Ben Maurer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The reCAPTCHA server URL's
|
||||
*/
|
||||
define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
|
||||
define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
|
||||
define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
|
||||
|
||||
/**
|
||||
* Encodes the given data into a query string format
|
||||
* @param $data - array of string elements to be encoded
|
||||
* @return string - encoded request
|
||||
*/
|
||||
function _recaptcha_qsencode ($data) {
|
||||
$req = "";
|
||||
foreach ( $data as $key => $value )
|
||||
$req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
|
||||
|
||||
// Cut the last '&'
|
||||
$req=substr($req,0,strlen($req)-1);
|
||||
return $req;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Submits an HTTP POST to a reCAPTCHA server
|
||||
* @param string $host
|
||||
* @param string $path
|
||||
* @param array $data
|
||||
* @param int port
|
||||
* @return array response
|
||||
*/
|
||||
function _recaptcha_http_post($host, $path, $data, $port = 80) {
|
||||
|
||||
$req = _recaptcha_qsencode ($data);
|
||||
|
||||
$http_request = "POST $path HTTP/1.0\r\n";
|
||||
$http_request .= "Host: $host\r\n";
|
||||
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
|
||||
$http_request .= "Content-Length: " . strlen($req) . "\r\n";
|
||||
$http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
|
||||
$http_request .= "\r\n";
|
||||
$http_request .= $req;
|
||||
|
||||
$response = '';
|
||||
if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
|
||||
die ('Could not open socket');
|
||||
}
|
||||
|
||||
fwrite($fs, $http_request);
|
||||
|
||||
while ( !feof($fs) )
|
||||
$response .= fgets($fs, 1160); // One TCP-IP packet
|
||||
fclose($fs);
|
||||
$response = explode("\r\n\r\n", $response, 2);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets the challenge HTML (javascript and non-javascript version).
|
||||
* This is called from the browser, and the resulting reCAPTCHA HTML widget
|
||||
* is embedded within the HTML form it was called from.
|
||||
* @param string $pubkey A public key for reCAPTCHA
|
||||
* @param string $error The error given by reCAPTCHA (optional, default is null)
|
||||
* @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
|
||||
|
||||
* @return string - The HTML to be embedded in the user's form.
|
||||
*/
|
||||
function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
|
||||
{
|
||||
if ($pubkey == null || $pubkey == '') {
|
||||
die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
|
||||
}
|
||||
|
||||
if ($use_ssl) {
|
||||
$server = RECAPTCHA_API_SECURE_SERVER;
|
||||
} else {
|
||||
$server = RECAPTCHA_API_SERVER;
|
||||
}
|
||||
|
||||
$errorpart = "";
|
||||
if ($error) {
|
||||
$errorpart = "&error=" . $error;
|
||||
}
|
||||
return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
|
||||
|
||||
<noscript>
|
||||
<iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
|
||||
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
|
||||
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
|
||||
</noscript>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A ReCaptchaResponse is returned from recaptcha_check_answer()
|
||||
*/
|
||||
class ReCaptchaResponse {
|
||||
var $is_valid;
|
||||
var $error;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calls an HTTP POST function to verify if the user's guess was correct
|
||||
* @param string $privkey
|
||||
* @param string $remoteip
|
||||
* @param string $challenge
|
||||
* @param string $response
|
||||
* @param array $extra_params an array of extra variables to post to the server
|
||||
* @return ReCaptchaResponse
|
||||
*/
|
||||
function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
|
||||
{
|
||||
if ($privkey == null || $privkey == '') {
|
||||
die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
|
||||
}
|
||||
|
||||
if ($remoteip == null || $remoteip == '') {
|
||||
die ("For security reasons, you must pass the remote ip to reCAPTCHA");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//discard spam submissions
|
||||
if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
|
||||
$recaptcha_response = new ReCaptchaResponse();
|
||||
$recaptcha_response->is_valid = false;
|
||||
$recaptcha_response->error = 'incorrect-captcha-sol';
|
||||
return $recaptcha_response;
|
||||
}
|
||||
|
||||
$response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
|
||||
array (
|
||||
'privatekey' => $privkey,
|
||||
'remoteip' => $remoteip,
|
||||
'challenge' => $challenge,
|
||||
'response' => $response
|
||||
) + $extra_params
|
||||
);
|
||||
|
||||
$answers = explode ("\n", $response [1]);
|
||||
$recaptcha_response = new ReCaptchaResponse();
|
||||
|
||||
if (trim ($answers [0]) == 'true') {
|
||||
$recaptcha_response->is_valid = true;
|
||||
}
|
||||
else {
|
||||
$recaptcha_response->is_valid = false;
|
||||
$recaptcha_response->error = $answers [1];
|
||||
}
|
||||
return $recaptcha_response;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* gets a URL where the user can sign up for reCAPTCHA. If your application
|
||||
* has a configuration page where you enter a key, you should provide a link
|
||||
* using this function.
|
||||
* @param string $domain The domain where the page is hosted
|
||||
* @param string $appname The name of your application
|
||||
*/
|
||||
function recaptcha_get_signup_url ($domain = null, $appname = null) {
|
||||
return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
|
||||
}
|
||||
|
||||
function _recaptcha_aes_pad($val) {
|
||||
$block_size = 16;
|
||||
$numpad = $block_size - (strlen ($val) % $block_size);
|
||||
return str_pad($val, strlen ($val) + $numpad, chr($numpad));
|
||||
}
|
||||
|
||||
/* Mailhide related code */
|
||||
|
||||
function _recaptcha_aes_encrypt($val,$ky) {
|
||||
if (! function_exists ("mcrypt_encrypt")) {
|
||||
die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
|
||||
}
|
||||
$mode=MCRYPT_MODE_CBC;
|
||||
$enc=MCRYPT_RIJNDAEL_128;
|
||||
$val=_recaptcha_aes_pad($val);
|
||||
return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
|
||||
}
|
||||
|
||||
|
||||
function _recaptcha_mailhide_urlbase64 ($x) {
|
||||
return strtr(base64_encode ($x), '+/', '-_');
|
||||
}
|
||||
|
||||
/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
|
||||
function recaptcha_mailhide_url($pubkey, $privkey, $email) {
|
||||
if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
|
||||
die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
|
||||
"you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
|
||||
}
|
||||
|
||||
|
||||
$ky = pack('H*', $privkey);
|
||||
$cryptmail = _recaptcha_aes_encrypt ($email, $ky);
|
||||
|
||||
return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the parts of the email to expose to the user.
|
||||
* eg, given johndoe@example,com return ["john", "example.com"].
|
||||
* the email is then displayed as john...@example.com
|
||||
*/
|
||||
function _recaptcha_mailhide_email_parts ($email) {
|
||||
$arr = preg_split("/@/", $email );
|
||||
|
||||
if (strlen ($arr[0]) <= 4) {
|
||||
$arr[0] = substr ($arr[0], 0, 1);
|
||||
} else if (strlen ($arr[0]) <= 6) {
|
||||
$arr[0] = substr ($arr[0], 0, 3);
|
||||
} else {
|
||||
$arr[0] = substr ($arr[0], 0, 4);
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets html to display an email address given a public an private key.
|
||||
* to get a key, go to:
|
||||
*
|
||||
* http://www.google.com/recaptcha/mailhide/apikey
|
||||
*/
|
||||
function recaptcha_mailhide_html($pubkey, $privkey, $email) {
|
||||
$emailparts = _recaptcha_mailhide_email_parts ($email);
|
||||
$url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
|
||||
|
||||
return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
|
||||
"' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
$user = new User();
|
||||
$user->login();
|
||||
|
||||
$status = 'ready';
|
||||
|
||||
if (is_numeric($user->isSpamming())){
|
||||
$status = 'failed';
|
||||
if( $user->isSpamming() > 0 ){
|
||||
$uploadErrors[] = 'Upload gesperrt bis: '.date("D M j G:i:s T Y",$user->isSpamming());
|
||||
}
|
||||
|
||||
}elseif( $user->id && !$user->isSpamLocked() && !$user->isSpamer() && !$user->isSpamming() && !empty($_GET['url'])) {
|
||||
$uploadErrors = array();
|
||||
require_once( 'lib/imageuploader.php' );
|
||||
if(
|
||||
ImageUploader::copyFromUrl( $_GET['url'], '', $_SERVER['HTTP_REFERER'], $uploadErrors)
|
||||
) {
|
||||
$status = 'posted';
|
||||
$user->logUpload();
|
||||
} else {
|
||||
$status = 'failed';
|
||||
}
|
||||
}
|
||||
|
||||
include( Config::$templates.'remotepost.tpl.php' );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
|
||||
for ($i=1; $i<=500; $i++)
|
||||
{
|
||||
DB::query("INSERT INTO pl_invites (code,owner,used,usedby) VALUES (MD5(RAND()),:1,:2,:3)",$i,0,0);
|
||||
}
|
||||
|
||||
?>
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
/** @license
|
||||
|
||||
DHTML Snowstorm! JavaScript-based Snow for web pages
|
||||
--------------------------------------------------------
|
||||
Version 1.43.20111201 (Previous rev: 1.42.20111120)
|
||||
Copyright (c) 2007, Scott Schiller. All rights reserved.
|
||||
Code provided under the BSD License:
|
||||
http://schillmania.com/projects/snowstorm/license.txt
|
||||
*/
|
||||
var snowStorm=function(e,d){function g(a,d){isNaN(d)&&(d=0);return Math.random()*a+d}function o(){e.setTimeout(function(){a.start(true)},20);a.events.remove(i?d:e,"mousemove",o)}function r(){if(!a.excludeMobile||!s)a.freezeOnBlur?a.events.add(i?d:e,"mousemove",o):o();a.events.remove(e,"load",r)}this.autoStart=true;this.flakesMax=128;this.flakesMaxActive=64;this.animationInterval=33;this.excludeMobile=true;this.flakeBottom=null;this.followMouse=true;this.snowColor="#fff";this.snowCharacter="•";
|
||||
this.snowStick=true;this.targetElement=null;this.useMeltEffect=true;this.usePositionFixed=this.useTwinkleEffect=false;this.freezeOnBlur=true;this.flakeRightOffset=this.flakeLeftOffset=0;this.flakeHeight=this.flakeWidth=8;this.vMaxX=5;this.vMaxY=4;this.zIndex=0;var a=this,y=this,i=navigator.userAgent.match(/msie/i),z=navigator.userAgent.match(/msie 6/i),A=navigator.appVersion.match(/windows 98/i),s=navigator.userAgent.match(/mobile|opera m(ob|in)/i),B=i&&d.compatMode==="BackCompat",t=s||B||z,h=null,
|
||||
k=null,j=null,m=null,u=null,v=null,p=1,n=false,q;a:{try{d.createElement("div").style.opacity="0.5"}catch(C){q=false;break a}q=true}var w=false,x=d.createDocumentFragment();this.timers=[];this.flakes=[];this.active=this.disabled=false;this.meltFrameCount=20;this.meltFrames=[];this.events=function(){function a(b){var b=f.call(b),c=b.length;l?(b[1]="on"+b[1],c>3&&b.pop()):c===3&&b.push(false);return b}function d(a,c){var e=a.shift(),f=[b[c]];if(l)e[f](a[0],a[1]);else e[f].apply(e,a)}var l=!e.addEventListener&&
|
||||
e.attachEvent,f=Array.prototype.slice,b={add:l?"attachEvent":"addEventListener",remove:l?"detachEvent":"removeEventListener"};return{add:function(){d(a(arguments),"add")},remove:function(){d(a(arguments),"remove")}}}();this.randomizeWind=function(){var c;c=g(a.vMaxX,0.2);u=parseInt(g(2),10)===1?c*-1:c;v=g(a.vMaxY,0.2);if(this.flakes)for(c=0;c<this.flakes.length;c++)this.flakes[c].active&&this.flakes[c].setVelocities()};this.scrollHandler=function(){var c;m=a.flakeBottom?0:parseInt(e.scrollY||d.documentElement.scrollTop||
|
||||
d.body.scrollTop,10);isNaN(m)&&(m=0);if(!n&&!a.flakeBottom&&a.flakes)for(c=a.flakes.length;c--;)a.flakes[c].active===0&&a.flakes[c].stick()};this.resizeHandler=function(){e.innerWidth||e.innerHeight?(h=e.innerWidth-16-a.flakeRightOffset,j=a.flakeBottom?a.flakeBottom:e.innerHeight):(h=(d.documentElement.clientWidth||d.body.clientWidth||d.body.scrollWidth)-(!i?8:0)-a.flakeRightOffset,j=a.flakeBottom?a.flakeBottom:d.documentElement.clientHeight||d.body.clientHeight||d.body.scrollHeight);k=parseInt(h/
|
||||
2,10)};this.resizeHandlerAlt=function(){h=a.targetElement.offsetLeft+a.targetElement.offsetWidth-a.flakeRightOffset;j=a.flakeBottom?a.flakeBottom:a.targetElement.offsetTop+a.targetElement.offsetHeight;k=parseInt(h/2,10)};this.freeze=function(){var c;if(a.disabled)return false;else a.disabled=1;for(c=a.timers.length;c--;)clearInterval(a.timers[c])};this.resume=function(){if(a.disabled)a.disabled=0;else return false;a.timerInit()};this.toggleSnow=function(){a.flakes.length?(a.active=!a.active,a.active?
|
||||
(a.show(),a.resume()):(a.stop(),a.freeze())):a.start()};this.stop=function(){var c;this.freeze();for(c=this.flakes.length;c--;)this.flakes[c].o.style.display="none";a.events.remove(e,"scroll",a.scrollHandler);a.events.remove(e,"resize",a.resizeHandler);a.freezeOnBlur&&(i?(a.events.remove(d,"focusout",a.freeze),a.events.remove(d,"focusin",a.resume)):(a.events.remove(e,"blur",a.freeze),a.events.remove(e,"focus",a.resume)))};this.show=function(){var a;for(a=this.flakes.length;a--;)this.flakes[a].o.style.display=
|
||||
"block"};this.SnowFlake=function(a,e,l,f){var b=this;this.type=e;this.x=l||parseInt(g(h-20),10);this.y=!isNaN(f)?f:-g(j)-12;this.vY=this.vX=null;this.vAmpTypes=[1,1.2,1.4,1.6,1.8];this.vAmp=this.vAmpTypes[this.type];this.melting=false;this.meltFrameCount=a.meltFrameCount;this.meltFrames=a.meltFrames;this.twinkleFrame=this.meltFrame=0;this.active=1;this.fontSize=10+this.type/5*10;this.o=d.createElement("div");this.o.innerHTML=a.snowCharacter;this.o.style.color=a.snowColor;this.o.style.position=n?"fixed":
|
||||
"absolute";this.o.style.width=a.flakeWidth+"px";this.o.style.height=a.flakeHeight+"px";this.o.style.fontFamily="arial,verdana";this.o.style.cursor="default";this.o.style.overflow="hidden";this.o.style.fontWeight="normal";this.o.style.zIndex=a.zIndex;x.appendChild(this.o);this.refresh=function(){if(isNaN(b.x)||isNaN(b.y))return false;b.o.style.left=b.x+"px";b.o.style.top=b.y+"px"};this.stick=function(){t||a.targetElement!==d.documentElement&&a.targetElement!==d.body?b.o.style.top=j+m-a.flakeHeight+
|
||||
"px":a.flakeBottom?b.o.style.top=a.flakeBottom+"px":(b.o.style.display="none",b.o.style.top="auto",b.o.style.bottom="0px",b.o.style.position="fixed",b.o.style.display="block")};this.vCheck=function(){if(b.vX>=0&&b.vX<0.2)b.vX=0.2;else if(b.vX<0&&b.vX>-0.2)b.vX=-0.2;if(b.vY>=0&&b.vY<0.2)b.vY=0.2};this.move=function(){var d=b.vX*p;b.x+=d;b.y+=b.vY*b.vAmp;if(b.x>=h||h-b.x<a.flakeWidth)b.x=0;else if(d<0&&b.x-a.flakeLeftOffset<-a.flakeWidth)b.x=h-a.flakeWidth-1;b.refresh();if(j+m-b.y<a.flakeHeight)b.active=
|
||||
0,a.snowStick?b.stick():b.recycle();else{if(a.useMeltEffect&&b.active&&b.type<3&&!b.melting&&Math.random()>0.998)b.melting=true,b.melt();if(a.useTwinkleEffect)if(b.twinkleFrame)b.twinkleFrame--,b.o.style.visibility=b.twinkleFrame&&b.twinkleFrame%2===0?"hidden":"visible";else if(Math.random()>0.9)b.twinkleFrame=parseInt(Math.random()*20,10)}};this.animate=function(){b.move()};this.setVelocities=function(){b.vX=u+g(a.vMaxX*0.12,0.1);b.vY=v+g(a.vMaxY*0.12,0.1)};this.setOpacity=function(a,b){if(!q)return false;
|
||||
a.style.opacity=b};this.melt=function(){!a.useMeltEffect||!b.melting?b.recycle():b.meltFrame<b.meltFrameCount?(b.setOpacity(b.o,b.meltFrames[b.meltFrame]),b.o.style.fontSize=b.fontSize-b.fontSize*(b.meltFrame/b.meltFrameCount)+"px",b.o.style.lineHeight=a.flakeHeight+2+a.flakeHeight*0.75*(b.meltFrame/b.meltFrameCount)+"px",b.meltFrame++):b.recycle()};this.recycle=function(){b.o.style.display="none";b.o.style.position=n?"fixed":"absolute";b.o.style.bottom="auto";b.setVelocities();b.vCheck();b.meltFrame=
|
||||
0;b.melting=false;b.setOpacity(b.o,1);b.o.style.padding="0px";b.o.style.margin="0px";b.o.style.fontSize=b.fontSize+"px";b.o.style.lineHeight=a.flakeHeight+2+"px";b.o.style.textAlign="center";b.o.style.verticalAlign="baseline";b.x=parseInt(g(h-a.flakeWidth-20),10);b.y=parseInt(g(j)*-1,10)-a.flakeHeight;b.refresh();b.o.style.display="block";b.active=1};this.recycle();this.refresh()};this.snow=function(){for(var c=0,d=0,e=0,f=null,f=a.flakes.length;f--;)a.flakes[f].active===1?(a.flakes[f].move(),c++):
|
||||
a.flakes[f].active===0?d++:e++,a.flakes[f].melting&&a.flakes[f].melt();if(c<a.flakesMaxActive&&(f=a.flakes[parseInt(g(a.flakes.length),10)],f.active===0))f.melting=true};this.mouseMove=function(c){if(!a.followMouse)return true;c=parseInt(c.clientX,10);c<k?p=-2+c/k*2:(c-=k,p=c/k*2)};this.createSnow=function(c,d){var e;for(e=0;e<c;e++)if(a.flakes[a.flakes.length]=new a.SnowFlake(a,parseInt(g(6),10)),d||e>a.flakesMaxActive)a.flakes[a.flakes.length-1].active=-1;y.targetElement.appendChild(x)};this.timerInit=
|
||||
function(){a.timers=!A?[setInterval(a.snow,a.animationInterval)]:[setInterval(a.snow,a.animationInterval*3),setInterval(a.snow,a.animationInterval)]};this.init=function(){var c;for(c=0;c<a.meltFrameCount;c++)a.meltFrames.push(1-c/a.meltFrameCount);a.randomizeWind();a.createSnow(a.flakesMax);a.events.add(e,"resize",a.resizeHandler);a.events.add(e,"scroll",a.scrollHandler);a.freezeOnBlur&&(i?(a.events.add(d,"focusout",a.freeze),a.events.add(d,"focusin",a.resume)):(a.events.add(e,"blur",a.freeze),a.events.add(e,
|
||||
"focus",a.resume)));a.resizeHandler();a.scrollHandler();a.followMouse&&a.events.add(i?d:e,"mousemove",a.mouseMove);a.animationInterval=Math.max(20,a.animationInterval);a.timerInit()};this.start=function(c){if(w){if(c)return true}else w=true;if(typeof a.targetElement==="string"&&(c=a.targetElement,a.targetElement=d.getElementById(c),!a.targetElement))throw Error('Snowstorm: Unable to get targetElement "'+c+'"');if(!a.targetElement)a.targetElement=!i?d.documentElement?d.documentElement:d.body:d.body;
|
||||
if(a.targetElement!==d.documentElement&&a.targetElement!==d.body)a.resizeHandler=a.resizeHandlerAlt;a.resizeHandler();a.usePositionFixed=a.usePositionFixed&&!t;n=a.usePositionFixed;if(h&&j&&!a.disabled)a.init(),a.active=true};a.autoStart&&a.events.add(e,"load",r,false);return this}(window,document);
|
||||
@@ -0,0 +1,17 @@
|
||||
<h1>» Bookmarklet</h1>
|
||||
<div class="article">
|
||||
<h2><?php echo Config::$siteName ?> Remote Upload</h2>
|
||||
|
||||
|
||||
<p>
|
||||
To use the remote upload just drag the following link somewhere to your bookmarks (or in Opera right click it
|
||||
and choose <em>Bookmark link</em>):
|
||||
» <a onclick="alert('Drag this Link to your Bookmarks!'); return false;" href="javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('src','<?php echo Config::$frontendPath; ?>media/post.js.php');document.body.appendChild(e)})());">Post to <?php echo Config::$siteName ?></a> «
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Now, if you're on a website where you see an image you want to post, just click on your newly created bookmark
|
||||
and then on the image you want to post. Thats all. Really!
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
|
||||
|
||||
<div class="warn"><img style="float: left; margin: 100px;" alt="404" src="http://www.4ducky.com/media/404.jpg"/>Broken link - no image found!<br/>
|
||||
<a href="http://www.4ducky.com">Go back to the main...</a></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php include("templates/header.tpl.php");
|
||||
|
||||
|
||||
if (isset($abuseerrors["abusefailed"])){
|
||||
?>
|
||||
<div class="warn" style="text-align:center">
|
||||
Abused failed.<br><br>
|
||||
<strong><?php if ($abuseerrors["referer"]) { echo ('<a href="'.$abuseerrors["referer"].'">» back</a>'); } ?></strong>
|
||||
</div>
|
||||
<?php
|
||||
}elseif (isset($abuseerrors["abuse"])){?>
|
||||
<div class="success" style="text-align:center">
|
||||
Abused. Wait for response.<br><br>
|
||||
<strong><?php if ($abuseerrors["referer"]) { echo ('<a href="'.$abuseerrors["referer"].'">» back</a>'); } ?></strong>
|
||||
</div>
|
||||
<?php }elseif (isset($abuseerrors["captchafailed"])){?>
|
||||
<div class="warn" style="text-align:center">
|
||||
Wrong captcha.<br><br>
|
||||
<strong><?php if ($abuseerrors["referer"]) { echo ('<a href="'.$abuseerrors["referer"].'">» back</a>'); } ?></strong>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
|
||||
include("templates/footer.tpl.php");
|
||||
?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<div align="center">
|
||||
|
||||
<form action="/abuse" method="post">
|
||||
|
||||
<fieldset>
|
||||
<legend>Abuse // Contact: abuse@4ducky.com</legend>
|
||||
<p style="text-align:left;">Report Abuse or Request Deletion (Copyrighted Material, Pornography, Harassment) If requesting the removal of copyrighted materials, you must be the owner or legally represent the owner of said materials. Report it here:</p>
|
||||
<dl class="form">
|
||||
|
||||
<dt>Imagelink:</dt>
|
||||
<dd>
|
||||
<input type="text" name="imglink" value=""/>
|
||||
</dd>
|
||||
<dt>Reason:</dt>
|
||||
<dd>
|
||||
<input type="text" name="rsn" value=""/>
|
||||
</dd>
|
||||
|
||||
<dt>Email:</dt>
|
||||
<dd>
|
||||
<input type="text" name="mail" value="" />
|
||||
</dd>
|
||||
|
||||
<dd>
|
||||
<input type="submit" class="button login" name="abuse" value="Send" />
|
||||
<input type="hidden" name="image" value="<?php echo $iv->image["id"]; ?>">
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,154 @@
|
||||
<?php include( $templates.'header.tpl.php' );
|
||||
|
||||
/*if (!$user->id){
|
||||
?>
|
||||
<div class="warn" style="text-align:center">
|
||||
Only registered users can see images! Register now.
|
||||
</div>
|
||||
<?php
|
||||
include( $templates.'footer.tpl.php' );
|
||||
exit();
|
||||
}*/
|
||||
|
||||
if( $ib->user['id'] ) {
|
||||
/* Abfrage nach Kommentaren / Likes des Users */
|
||||
$idAbfrage = $ib->user['id'];
|
||||
$comm = DB::getRow("SELECT COUNT(*) as count FROM pl_comments WHERE userid=:1 AND c_like = 0",$idAbfrage);
|
||||
$favs = DB::getRow("SELECT COUNT(*) as count FROM pl_fav WHERE user=:1",$idAbfrage);
|
||||
$users = DB::getRow("SELECT color as color,registered as reg FROM pl_users WHERE id=:1",$idAbfrage);
|
||||
$days = floor((time() - strtotime(substr($users['reg'],0,10)))/86400);
|
||||
?>
|
||||
|
||||
<div style="margin-left: 5px; width: 95%;">
|
||||
|
||||
<div style="font-size: 20px; margin-bottom: 5px; font-weight: bold;">
|
||||
<a style="color:#<?php echo $users['color'] ?>" href="<?php echo Config::$absolutePath.'user/'.$ib->user['name']; ?>"><?php echo $ib->user['name']; ?></a> <?php
|
||||
if ($idAbfrage > 1100) {echo "☪";}
|
||||
elseif ($idAbfrage < 500) {echo "ϟϟ";}
|
||||
elseif ($idAbfrage > 939) {echo "✡";}
|
||||
else {echo "☭";} ?> <?php if( !empty($ib->user['website'])) { ?>- <a href="<?php echo htmlspecialchars($ib->user['website']); ?>" target="_blank">www</a> -<?php } ?>
|
||||
</div>
|
||||
|
||||
<div style="max-width: 35em; float: left;"><img alt="<?php echo $ib->user['name']; ?>" src="<?php echo Config::$absolutePath.$ib->user['avatar']; ?>"/></div>
|
||||
<div id="userstats"><a href="<?php echo Config::$absolutePath.'inbox/'.$ib->user['name']; ?>"><img alt="mailme" src="/media/<?php if ($user->stylecolor == "white") {?>mailme_fb.png<?php } else{ ?>mailme.png<?php }?>" width="64px" height="64px"/></a></div>
|
||||
<div id="userstats"><div><?php echo $ib->user['id']; ?></div>ID</div>
|
||||
<div id="userstats"><div><?php echo $days; ?></div>Days past</div>
|
||||
<div id="userstats"><div><?php echo $ib->user['images']; ?></div>Uploads</div>
|
||||
<div id="userstats"><div><?php echo $comm["count"]; ?></div>Comments</div>
|
||||
<div id="userstats"><div><?php echo $favs["count"]; ?></div>Favs</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
|
||||
<h1>
|
||||
» Browsing
|
||||
<?php if( !empty($ib->user) ) { ?>
|
||||
User: <a href="<?php echo Config::$absolutePath.'user/'.$ib->user['name']; ?>"><?php echo $ib->user['name']; ?></a>
|
||||
<?php } else if( !empty($ib->channel) ) { ?>
|
||||
Channel: <a href="<?php echo Config::$absolutePath.'channel/'.$ib->channel['keyword']; ?>"><?php echo $ib->channel['name']; ?></a>,
|
||||
<?php } else if( !empty($ib->searchColor) || !empty($ib->searchTerm) ) { ?>
|
||||
Results for <?php echo htmlspecialchars($term); ?>,
|
||||
<?php } else if(($ib->commentState)) { ?>
|
||||
Comments ,
|
||||
<?php } else if(($ib->FavState)) { ?>
|
||||
favorites ,
|
||||
<?php } else { ?>
|
||||
All,
|
||||
<?php } ?>
|
||||
|
||||
Page: <?php echo $ib->pages['current']; ?> of <?php echo $ib->pages['total']; ?>
|
||||
<?php if(($ib->commentState)) { ?>
|
||||
| <strong><a href="/comments/reset">» reset unread</a></strong>
|
||||
<?php $newcomments = DB::getRow("SELECT COUNT(*) as c FROM pl_unread as u,pl_images as i WHERE u.userid=:1 AND u.imageid = i.id",$user->id);
|
||||
if( $newcomments["c"] > 0 ) { ?>
|
||||
|
||||
| <a href="/unread">» newest comments (<?php echo $newcomments["c"]; ?>)</a> | <a href="/comments">» Comments</a></strong>
|
||||
<?php }} ?>
|
||||
</h1>
|
||||
|
||||
<div id="images" style="height:<?php echo $gv->height * Config::$gridView['gridSize']; ?>px">
|
||||
<?php if( isset($ib->pages['prev']) ) { ?>
|
||||
<a href="<?php echo Config::$absolutePath.$ib->basePath.'page/'.$ib->pages['prev']; ?>" class="prev" title="Previous" id="prevBar">Previous</a>
|
||||
<?php } else { ?>
|
||||
<div class="noPrev" id="prevBar">Previous</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($ib->pages['next']) ) { ?>
|
||||
<a href="<?php echo Config::$absolutePath.$ib->basePath.'page/'.$ib->pages['next']; ?>" class="next" title="Next" id="nextBar">Next</a>
|
||||
<?php } else { ?>
|
||||
<div class="noNext" id="nextBar">Next</div>
|
||||
<?php } ?>
|
||||
|
||||
<noscript>
|
||||
<div class="noscr">Please enable Javascript.</div>
|
||||
</noscript>
|
||||
|
||||
<div id="imageGrid" style="height:<?php echo $gv->height * Config::$gridView['gridSize'];?>px">
|
||||
<?php
|
||||
if( !empty($ib->searchColor) || !empty($ib->searchTerm) || ($ib->commentState) || ($ib->FavState) ) {
|
||||
$imgBasePath = 'all/';
|
||||
} else {
|
||||
$imgBasePath = $ib->basePath;
|
||||
}
|
||||
foreach( $ib->thumbs as $thumb ) {
|
||||
if( isset( $thumb['left'] ) ) {
|
||||
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id);
|
||||
$commentalert = DB::getRow("SELECT COUNT(*) as count FROM pl_unread WHERE keyword=:1 AND userid=:2",$thumb['keyword'],$user->id);
|
||||
$commentdiv = "";
|
||||
$commentcolor ="";
|
||||
$commentalertdiv ="";
|
||||
|
||||
if($commentalert["count"] > 0){
|
||||
$commentdiv ='<div class="overlay"></div>';
|
||||
$commentcolor = 'style="background-color:#96b2e4;"' ;
|
||||
$commentalertdiv = '<div class="inboxalert" style="padding:3px;" >!</div>';
|
||||
}else{
|
||||
$commentdiv = "";
|
||||
$commentalertdiv ="";
|
||||
$commentcolor = '' ;
|
||||
}
|
||||
|
||||
if (!empty($blockedrow)) {
|
||||
|
||||
$blockeduser = array_map('strtolower', unserialize($blockedrow['users']));
|
||||
$lower = strtolower($thumb['userName']);
|
||||
if (!in_array($lower,$blockeduser)){
|
||||
|
||||
echo '<div class="'.$thumb['class'].'" style="left:'.$thumb['left'].'px;top:'.$thumb['top'].'px;">'.$commentalertdiv.'<a '.$commentcolor.' class="thumb" href="'
|
||||
.Config::$absolutePath.$imgBasePath.'view/'.$thumb['keyword'].'">'.$commentdiv.'<img src="'.$thumb['thumb'].'" title="'.$thumb['userName'].' - '.
|
||||
date('d. M Y H:i',$thumb['loggedTS']).'" alt="'.$thumb['keyword'].'"/></a></div>'."\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
if (!$user->id){
|
||||
$bilder = scandir('images/rs', 1);
|
||||
$random = rand(3,114);
|
||||
$thumb['thumb'] = "http://www.4ducky.com/images/rs/" . $bilder[$random];
|
||||
|
||||
echo "<h5>" . $bilder[0] . "</h5>";
|
||||
}
|
||||
echo '<div class="'.$thumb['class'].'" style="left:'.$thumb['left'].'px;top:'.$thumb['top'].'px;">'.$commentalertdiv.'<a '.$commentcolor.' class="thumb" href="'
|
||||
.Config::$absolutePath.$imgBasePath.'view/'.$thumb['keyword'].'">'.$commentdiv.'<img src="'.$thumb['thumb'].'" title="'.$thumb['userName'].' - '.
|
||||
date('d. M Y H:i',$thumb['loggedTS']).'" alt="'.$thumb['keyword'].'"/></a></div>'."\n";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
gridView('imageGrid');
|
||||
//jQuery(function(){jQuery("#imageGrid").preloader();});
|
||||
ieAdjustHeight(0);
|
||||
</script>
|
||||
|
||||
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<div align="center">
|
||||
<iframe src="http://irc.chillzonenet.org:9090/?nick=fuehls&channels=fuehls&prompt=1&uio=d4" width="800" height="500"></iframe></div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<div style=" font-family:Verdana, Geneva, sans-serif;text-align:center; height:100%; margin-top:100px;">
|
||||
Monglol wurde gebannt da er sich anscheinend nicht an Regeln halten will.<br>
|
||||
Ich gebe euch viele Freiheiten, aber das hier ist nicht edelchan, da könnt ihr eure Gorebildchen posten.<br>
|
||||
Oder geht auf entsprechende Seiten, dafür sind diese da wenn euch das erregt oderso.<br>
|
||||
<br>
|
||||
Ich habe keine Lust zu entsprechend harten Regeln zu greifen wie 4fuckr, aber wenn ihr nicht anders könnt, dann werde ich das tun. Zudem: Ich mach das hier zu Spaß und bin nicht wie Feivel auf die Einnahmen angewiesen. Ich werde die Seite also bei Bedarf einfach wieder vom Netz nehmen. Juckt mich wenig.<br>
|
||||
<br>
|
||||
Für heute ist hier erstmal zu. Solltet ihr euch einfach nicht an die 2 Regeln halten können, werden ich schärfere einführen oder die Seite anders nutzen.
|
||||
</div>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
|
||||
<?php
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
$fame = DB::query("SELECT *, UNIX_TIMESTAMP(logged) AS loggedTS from pl_images WHERE fame=1 ORDER BY logged DESC");
|
||||
|
||||
foreach( array_keys($fame) as $k){
|
||||
$uploader = DB::getRow("SELECT * from pl_users WHERE id=:1",$fame[$k]["user"]);
|
||||
?>
|
||||
<div align="center">
|
||||
|
||||
<div class="userInfo" style="border:1px solid #777777;width:60%;min-height:192px;padding:5px;">
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="7%">
|
||||
<div><img src="<?php echo(Config::$absolutePath."data/thumbs/".date("Y/m",$fame[$k]["loggedTS"])."/192x192/".$fame[$k]["thumb"]); ?>" align="top" style="float:left;margin-right:5px;"></div>
|
||||
|
||||
</td>
|
||||
<td valign="top" width="93%">
|
||||
|
||||
<div class="userInfo" style="float:left;width:100%;border:1px solid #777777;">
|
||||
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$uploader['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$uploader['name']; ?>"><?php echo $uploader['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
ID: <strong><?php echo $uploader['id']; ?></strong> |
|
||||
Images: <strong><?php echo $uploader['images']; ?></strong>
|
||||
<?php if( !empty($uploader['website'])) { ?>|
|
||||
<strong><a href="<?php echo htmlspecialchars($uploader['website']); ?>" target="_blank">
|
||||
Website
|
||||
</a></strong>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td valign="bottom">
|
||||
<strong><a href="<?php echo Config::$absolutePath."all/view/".$fame[$k]['keyword']; ?>" target="_blank">» watch thread.</a></strong>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }?>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
|
||||
<br/>
|
||||
|
||||
<?php
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
$fame = DB::query("SELECT *, UNIX_TIMESTAMP(logged) AS loggedTS from pl_images WHERE fame=1 ORDER BY logged DESC");
|
||||
|
||||
foreach( array_keys($fame) as $k){
|
||||
$uploader = DB::getRow("SELECT * from pl_users WHERE id=:1",$fame[$k]["user"]);
|
||||
?>
|
||||
<div align="center">
|
||||
|
||||
<a href="<?php echo Config::$absolutePath."all/view/".$fame[$k]['keyword']; ?>"><img src="<?php echo(Config::$absolutePath."data/thumbs/".date("Y/m",$fame[$k]["loggedTS"])."/192x192/".$fame[$k]["thumb"]); ?>" align="top" style="float:left;margin-right:5px;"></a>
|
||||
|
||||
</div>
|
||||
|
||||
<?php }?>
|
||||
<div style="clear:both;"></div>
|
||||
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,64 @@
|
||||
</div></div>
|
||||
<!--
|
||||
<div id="footer">© <?php echo date('Y'); ?> 4ducky.com - a Dolan Duck Production | <a href="/impressum">Contact us</a> | <a href="/abuseform">Abuse / Request Deletion</a></div> -->
|
||||
|
||||
<?php if ($user->id){ ?>
|
||||
<div id="sidebar">
|
||||
<div id="top"><?php if($user->admin) { ?><a href="/manage"><img height="28" width="28" src="<?php if ($user->stylecolor == "white") {?>/media/manage-fb.png<?php }else{ ?>/media/manage.png<?php } ?>" alt="manage"/></a><?php } ?> <a href="javascript:;" id="loadcom"><img height="28" width="28" src="<?php if ($user->stylecolor == "white") {?>/media/refresh_fb.png<?php }else{ ?>/media/refresh.png<?php } ?>" alt="refresh"/></a> <a href="#" id="x"><img height="28" width="28" src="<?php if ($user->stylecolor == "white") {?>/media/xfb.png<?php }else{ ?>/media/xd.png<?php } ?>" alt="close"/></a></div>
|
||||
|
||||
<div id="rightpanel">
|
||||
<noscript><div class="noscr">Please enable Javascript.</div></noscript>
|
||||
<div align="center"><img alt="load" src="<?php if ($user->stylecolor == "white") {?>/media/load.gif<?php } else{ ?>/media/load_b.gif<?php }?>" /></div>
|
||||
</div>
|
||||
|
||||
<div id="bottom">
|
||||
<div id="commentbar"><a href="/truhe"><div id="commentimg"><img width="28" height="28" src="/media/truhe.png" alt="Spenden"></div><div id="commenttext"><strong>4ducky.com </strong>Statistiken</div></a></div>
|
||||
|
||||
<script type="text/javascript" src="http://www.4ducky.com/random/1/128x128/"></script>
|
||||
|
||||
<div id="commentbar"><a target="_blank" href="http://goodius.com"><div id="commentimg"><img width="28" height="28" src="/media/forum.png" alt="Forum"></div><div id="commenttext"><strong>Goodius.com</strong> <br />für alle Hipster</div></a></div>
|
||||
|
||||
<div id="commentbar"><a href="http://www.facebook.com/goodius" target="_blank"><div id="commentimg"><img width="28" height="28" src="/media/fbicon.png" alt="Facebook"></div><div id="commenttext"><strong>Duckies: </strong><br /> auf Judenbuch</div></a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}else{ ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var addthis_config = {
|
||||
services_overlay:'facebook,twitter,tumblr,reddit,more'
|
||||
}
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#sidebar").hide(); jQuery("#site").css("margin-right","0px");
|
||||
jQuery("#footer-back-to-top").css("right","30px"); jQuery("#footer").css("margin-right","0px");
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<div><a href="#" id="footer-back-to-top"></a></div>
|
||||
<?php if(isset($iv->image["id"])){?><script type="text/javascript"><?php echo 'LoadData("comments","cmts",'.$iv->image["id"].');'; ?></script><?php } ?>
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-46457338-2', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
|
||||
<?php
|
||||
/*
|
||||
$musel = rand(0, 125);
|
||||
|
||||
if($musel == 1 && $user->id) {
|
||||
echo '<iframe style="display:none;" width="1" height="1" src="https://www.youtube.com/embed/naCD-q4kKek?rel=0&&autoplay=1&start=109;controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>';
|
||||
|
||||
echo '<script type="text/javascript">setTimeout(function() {alert("Kein Bock auf Musel-Musik? Einmalig für 4ducky spenden und nie wieder dieses Geheule hören. Versprochen! Schicke einen Amazon-Gutschein an Pandora (#1) und du wirst arischer Ducky!");},5000);</script>';
|
||||
}
|
||||
*/
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div align="center" style="margin-top: 2px; margin-bottom: 25px;">
|
||||
|
||||
<script type="text/javascript" src="http://gelbegefahr.bplaced.net/plugins/embedvanilla/remote.js"></script>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
$pname = ereg_replace("(\.).*","",$iv->image['image']);
|
||||
|
||||
function shorter($input, $length)
|
||||
{
|
||||
//no need to trim, already shorter than trim length
|
||||
if (strlen($input) <= $length) {
|
||||
return $input;
|
||||
}
|
||||
|
||||
//find last space within length
|
||||
$last_space = strrpos(substr($input, 0, $length), ' ');
|
||||
if(!$last_space) $last_space = $length;
|
||||
$trimmed_text = substr($input, 0, $last_space);
|
||||
|
||||
//add ellipses (...)
|
||||
$trimmed_text .= '...';
|
||||
|
||||
return $trimmed_text;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?php if( !empty($ib->user) ) { echo $ib->user['name']." | ";} ?><?php if( !empty($pname) ) { echo $pname." | ".Config::$siteTitle; } else { echo Config::$siteTitle;} ?></title>
|
||||
<meta name="description" content="ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔ ENTE ✔"/>
|
||||
<link rel="icon" href="http://www.4ducky.com/favicon.ico"/>
|
||||
<?php if ($user->stylecolor == "white") { ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Config::$absolutePath; ?>media/styles_fb.css" />
|
||||
<?php }else{ ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Config::$absolutePath; ?>media/styles_b.css" />
|
||||
<?php } ?>
|
||||
|
||||
<script type="text/javascript" src="<?php echo Config::$absolutePath; ?>media/picturelicious.js"></script><?php if( !empty($r[0]) ){ if ($r[0] == 'profile'){ ?><script type="text/javascript" src="/media/jscolor.js"></script><?php }} ?><script type="text/javascript" src="/js/functions.js"></script><script type="text/javascript" src="/media/jquery.js"></script><script type="text/javascript" src="/js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="/js/jquery.cookie.js"></script><script type="text/javascript" src="/js/slimScroll.min.js"></script><script type="text/javascript" src="/js/jquery.simplemodal.min.js"></script><link rel="stylesheet" href="/media/lightbox/lightbox.css" type="text/css" /><script type="text/javascript" src="/js/jqpr.js"></script><script type="text/javascript">jQuery.noConflict();</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="site">
|
||||
<div id="menu"> <a href="<?php echo Config::$absolutePath; ?>" id="logo"></a>
|
||||
<?php if($user->id){ ?>
|
||||
<div id="MenuLoad">
|
||||
<div id="UploadD"><div style="float:right;margin:5px;"><img onclick="CloseU()" src="/media/close.png" /></div><div id="UploadD_d">
|
||||
|
||||
<?php if( !empty( $uploadErrors ) ) { ?>
|
||||
<ul>
|
||||
<?php foreach( $uploadErrors as $msg ) { ?>
|
||||
<li><?php echo $msg?></li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<script type="text/javascript">Menu("","error");</script>
|
||||
<?php }else{ ?>
|
||||
<div style="margin-top:12px;text-align:center;" id="UbLoad">
|
||||
<div align="center">
|
||||
<img src="/media/load_b.gif" />
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="MenuRightBlock"></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( $user->id ) { ?>
|
||||
<div class="menuItems">
|
||||
<a href="javascript:;" onclick="Menu('upload');">Upload</a> <a href="javascript:;" onclick="Menu('addon');">Addon</a> <a href="<?php echo Config::$absolutePath; ?>truhe">Truhe</a> <a href="<?php echo Config::$absolutePath; ?>fame">HoD</a>
|
||||
</div>
|
||||
<?php }else{ ?>
|
||||
|
||||
<div class="menuItems2">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" valign="middle" ><a href="/impressum"><img title="contact" width="28" height="28" src="/media/mailme.png" alt="login"/></a></td>
|
||||
<td align="center" valign="middle"><a href="/impressum">Contact</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="menuItems2">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" valign="middle" ><a href="/register"><img title="Register" width="28" height="28" src="/media/register_fb.png" alt="register"/></a></td>
|
||||
<td align="center" valign="middle"><a href="/register">Register</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="menuItems2">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" valign="middle" ><a href="/login"><img title="Login" width="28" height="28" src="/media/login_fb.png" alt="login"/></a></td>
|
||||
<td align="center" valign="middle"><a href="/login">Login</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$b = "";
|
||||
if($user->stylecolor == "white"){
|
||||
$b = ""; } else { $b="_b";
|
||||
}
|
||||
if ($user->id){ ?>
|
||||
|
||||
<div class="menuItems2"><a id="nigger" href="/logout" original-title="Hello World"><img width="28" height="28" src="/media/logout<?php echo $b; ?>.png" /></a></div>
|
||||
<div class="menuItems2"><a href="/profile"><img width="28" height="28" src="/media/profile<?php echo $b; ?>.png" /></a></div>
|
||||
<div class="menuItems2"><a href="/favorites"><img width="28" height="28" src="/media/p<?php echo $b; ?>.png" /></a></div>
|
||||
<div class="menuItems2">
|
||||
<?php $unreadcount = DB::getRow("SELECT COUNT(*) as c FROM pl_messages WHERE to_m=:1 AND read_m=0",$user->id);
|
||||
if( $unreadcount["c"] > 0 ) {
|
||||
?>
|
||||
<div class="inboxalert"><?php echo $unreadcount["c"]; ?></div>
|
||||
<?php } ?>
|
||||
<div><a href="/inbox"><img width="28" height="28" src="/media/n<?php echo $b; ?>.png" /></a></div>
|
||||
</div>
|
||||
<div class="menuItems2">
|
||||
<?php $newcomments = DB::query("SELECT i.keyword,i.thumb,DATE_FORMAT(i.logged,'%Y/%m') as tm FROM pl_unread as u,pl_images as i WHERE u.userid=:1 AND u.imageid = i.id",$user->id);
|
||||
if( count($newcomments) > 0 ) {
|
||||
?>
|
||||
<div class="inboxalert"> <?php echo count($newcomments); ?></div>
|
||||
<a onMouseOver="toggleDiv('Last5Div',1)" href="/unread" ><img width="28" height="28" src="/media/w<?php echo $b; ?>.png" /></a>
|
||||
|
||||
|
||||
<?php }else{
|
||||
DB::query("DELETE FROM pl_unread WHERE userid=:1",$user->id);
|
||||
?>
|
||||
<a href="/comments" ><img width="28" height="28" src="/media/w<?php echo $b; ?>.png" /></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="Last5Div" class="Last5Div" onMouseOver="toggleDiv('Last5Div',1)" onMouseOut="toggleDiv('Last5Div',0)">
|
||||
|
||||
<?php
|
||||
|
||||
if(count($newcomments) > 0) {
|
||||
$newcomments = DB::query("SELECT i.keyword,i.thumb,DATE_FORMAT(i.logged,'%Y/%m') as tm FROM pl_unread as u,pl_images as i WHERE u.userid=:1 AND u.imageid = i.id ORDER BY i.logged DESC LIMIT 5",$user->id);
|
||||
foreach (array_keys($newcomments) as $c) { ?>
|
||||
|
||||
<a href="<?php echo (Config::$absolutePath.'all/view/'.$newcomments[$c]["keyword"]); ?>">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr height="45px">
|
||||
<td valign="middle" align="left" width="45px"><img width="40" height="40" src="<?php echo(Config::$absolutePath."data/thumbs/".$newcomments[$c]["tm"]."/64x64/".$newcomments[$c]["thumb"]); ?>" /></td>
|
||||
<td align="left"><strong>Image:</strong><br /><?php echo(shorter($newcomments[$c]["keyword"],20)); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</a>
|
||||
|
||||
<?php }} ?>
|
||||
<div style="text-align:right;padding:2px;">
|
||||
<a href="/comments/reset">» reset unread</a>
|
||||
<a href="<?php echo Config::$absolutePath.'unread'; ?>">» watch all</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="menuItems2">
|
||||
<?php $infos = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$user->id); ?>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" valign="middle" ><a href="#" id="del_cookie"><img title="Reload page, activate sidebar" width="28" height="28" src="<?php echo Config::$absolutePath.$infos["avatar"]; ?>" /></a></td>
|
||||
<td align="center" valign="middle"><a href="<?php echo Config::$absolutePath; ?>user/<?php echo $user->name; ?>"><?php echo $user->name; ?></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="alert" id="dolan"><?php if ($user->id){ $settings = DB::getRow("SELECT * FROM pl_settings"); echo $settings["message"]; ?> <img style="float: right;" id="stfu" height="16" width="16" src="<?php if ($user->stylecolor == "white") {?>/media/xfb.png<?php }else{ ?>/media/xd.png<?php } ?>" alt="close"/><?php } else { ?>Dolan: "Hate annoying advertisements? <a href="http://www.4ducky.com/register">Register now for free</a> to have them removed!" Like us on <a href="http://www.facebook.com/fuehls">Facebook.com</a><?php } ?></div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<div align="center">
|
||||
<fieldset>
|
||||
<legend>About</legend>
|
||||
<img id="ownerboy" height="20%" width="20%" style="float: right;" src="/media/andrew.jpeg" alt="Admin"/>
|
||||
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="112" valign="top">Owner:</td>
|
||||
<td width="388"><strong>
|
||||
<p> </p>
|
||||
</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email:</td>
|
||||
<td><a href="mailto:support@4ducky.com">support@4ducky.com</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rules </td>
|
||||
<td>1.) No underaged people / no cp / no illustration with naked kids</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>2.) No gore / dead people / dead animals</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Saw something like this?</td>
|
||||
<td><a href="http://www.4ducky.com/abuseform">Please request deletion</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
|
||||
<?php if( !empty( $msgErrors ) ) { ?>
|
||||
<?php if( $msgErrors["usernotfound"] == true ) { ?>
|
||||
<div class="warn">
|
||||
<ul>
|
||||
<li class="error">User not found.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php if( $msgErrors["userblocked"] == true ) { ?>
|
||||
<div class="warn">
|
||||
<ul>
|
||||
<li class="error">User blocked you.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
<br/><br/>
|
||||
<table class="duckytable" align="center" width="800px" border="0" cellspacing="0" cellpadding="0">
|
||||
<caption>Messages:</caption>
|
||||
|
||||
<?php
|
||||
|
||||
$messages = DB::query("SELECT from_m as sender, title_m as title, created FROM pl_messages WHERE to_m=:1 GROUP BY from_m",$user->id);
|
||||
|
||||
if ( count($messages) == 0 ){ ?>
|
||||
<tr>
|
||||
<td width="400px">
|
||||
<div class="userInfo" style="border:1px solid #d2d9e7;padding:8px;">
|
||||
Your inbox is empty.
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php }
|
||||
|
||||
foreach (array_keys($messages) as $k){
|
||||
$temp = DB::query("SELECT created FROM pl_messages WHERE from_m=:1 ORDER BY created DESC",$messages[$k]["sender"]);
|
||||
|
||||
$messages[$k]["created"] = $temp[0]["created"];
|
||||
}
|
||||
|
||||
function sortByOption($a, $b) {
|
||||
return strcmp($b['created'], $a['created']);
|
||||
}
|
||||
|
||||
usort($messages, 'sortByOption');
|
||||
|
||||
foreach($messages as $s){
|
||||
|
||||
$userinformation = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$s["sender"]);
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id);
|
||||
$blockeduser = array_map('strtolower', unserialize($blockedrow['users']));
|
||||
$lower = strtolower($userinformation["name"]);
|
||||
if (!in_array($userinformation["name"],$blockeduser)){
|
||||
$unread = DB::getRow("SELECT COUNT(*) as c, read_m FROM pl_messages WHERE from_m=:1 AND read_m=0 AND to_m=:2",$s["sender"],$user->id);
|
||||
|
||||
if ($unread["c"] > 0) {
|
||||
|
||||
$unreadborder = ' border:1px solid #FFD600; ';
|
||||
|
||||
}elseif ($unread["c"] == 0){
|
||||
|
||||
if ($user->stylecolor == "black") {
|
||||
$unreadborder="border:1px solid #333;";
|
||||
}else{
|
||||
$unreadborder = ' border:1px solid #d2d9e7; ';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td width="400px">
|
||||
|
||||
<div class="userInfo" style="margin:5px;min-height:40px;<?php echo $unreadborder; ?>" >
|
||||
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$userinformation['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'inbox/'.$userinformation['name']; ?>"><?php echo $userinformation['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
ID: <strong><?php echo $userinformation['id']; ?></strong> /
|
||||
Images: <strong><?php echo $userinformation['images']; ?></strong>
|
||||
|
||||
<?php if( !empty($userinformation['website'])) { ?>/
|
||||
Website: <strong><a href="<?php echo htmlspecialchars($userinformation['website']); ?>" target="_blank">
|
||||
<?php echo htmlspecialchars($userinformation['website']); ?>
|
||||
</a></strong>
|
||||
<?php } ?>
|
||||
<?php if (strlen ($s["title"]) > 1 ){ ?>
|
||||
|
||||
/ Subject: <strong> <?php
|
||||
|
||||
$s["title"] = strip_tags($s["title"]);
|
||||
$s["title"] = preg_replace(
|
||||
'#(?<!\w)((http://)|(www\.))([^\s<>]+)#i',
|
||||
"<a href=\"http://$3$4\">$3$4</a>",
|
||||
nl2br( htmlspecialchars($s["title"])));
|
||||
|
||||
|
||||
|
||||
echo $s["title"]; ?>
|
||||
|
||||
|
||||
</strong><br />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<?php }} ?>
|
||||
|
||||
|
||||
</table> <br/>
|
||||
|
||||
<?php include("templates/footer.tpl.php"); ?>
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<table class="duckytable" align="center" width="800px" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<caption>Conversation with:</caption>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
if ($user->stylecolor == "black") {
|
||||
$border="border:1px dotted #333;";
|
||||
}else{
|
||||
$border = ' border:1px solid #d2d9e7; ';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$userinformation = DB::getRow('SELECT * FROM pl_users WHERE name="'.$r[1].'"');
|
||||
|
||||
|
||||
if (count($userinformation) == 0 ){ header( 'location: '.Config::$absolutePath); }
|
||||
|
||||
$messages = DB::query("SELECT * FROM pl_messages WHERE (to_m=:1 AND from_m=:2) OR (to_m=:2 AND from_m=:1) ORDER BY created DESC",$userinformation["id"],$user->id);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td width="400px" style="border-bottom: 0;">
|
||||
|
||||
<div class="userInfo" style=" <?php echo $border; ?>">
|
||||
<img class="avatar" width="60" height="60" src="<?php echo Config::$absolutePath.$userinformation['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$userinformation['name']; ?>"><?php echo $userinformation['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
ID: <strong><?php echo $userinformation['id']; ?></strong> /
|
||||
Images: <strong><?php echo $userinformation['images']; ?></strong>
|
||||
|
||||
<?php if( !empty($userinformation['website'])) { ?>/
|
||||
<strong><a href="<?php echo htmlspecialchars($userinformation['website']); ?>" target="_blank">
|
||||
Website
|
||||
</a></strong>
|
||||
<?php } ?>
|
||||
<br /><br />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div align="center">
|
||||
<div class="comment" style=" <?php echo $border; ?>margin:5px; text-align:left;width:700px;color:#333">
|
||||
<strong>Message to <?php echo $userinformation['name']; ?>:</strong>
|
||||
<form method="post" class="addComment" action="<?php echo Config::$absolutePath.'inbox/'.$r[1]; ?>">
|
||||
<div>
|
||||
<textarea name="content" rows="6" cols="93"></textarea><br />
|
||||
<input class="submit" type="submit" name="addComment" value="Submit Message"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
if (count($messages) != 0){
|
||||
|
||||
foreach( $messages as $s ) {
|
||||
$postedfrom = DB::getRow('SELECT * FROM pl_users WHERE id='.$s["from_m"]);
|
||||
DB::updateRow("pl_messages",array("to_m" => $user->id, "created" => $s["created"]),array("read_m" => 1));
|
||||
$bordercolor = $border;
|
||||
if ($s["read_m"] == 0 && $s["to_m"] == $user->id){
|
||||
$bordercolor = 'border:1px solid #FFD600';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="comment" style=" margin:5px; text-align:left;width:700px;<?php echo $bordercolor; ?>">
|
||||
<div class="commentHead">
|
||||
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$postedfrom['name']; ?>"><?php echo $postedfrom['name']; ?></a>
|
||||
at <?php echo date('d. M Y H:i',$s['created']); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
//$s['message_m'] = strip_tags($s['message_m']);
|
||||
$s['message_m'] = preg_replace(
|
||||
'#(?<!\w)((http://)|(www\.))([^\s<>]+)#i',
|
||||
"<a href=\"http://$3$4\">$3$4</a>",
|
||||
nl2br( htmlspecialchars($s['message_m'])));
|
||||
|
||||
?>
|
||||
<hr style=" <?php echo $bordercolor; ?> width: 99%;">
|
||||
<?php echo $s['message_m']; ?>
|
||||
</div>
|
||||
|
||||
<?php }}else{ echo('No messages found. <hr style="background-color:#d2d9e7;">');} ?>
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <br/>
|
||||
<?php include ("templates/footer.tpl.php"); ?>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<div align="center">
|
||||
<form action="<?php echo Config::$absolutePath; ?>login" method="post">
|
||||
<fieldset>
|
||||
<legend>Invites</legend>
|
||||
|
||||
<dl class="form">
|
||||
<dt>Info:</dt>
|
||||
<dd>
|
||||
-Invitemissbrauch führt zum Ban. (Keine Reaktivierung) / Darunter fällt auch einem gebannten User einen Invite zu geben.
|
||||
</dd>
|
||||
<dt></dt>
|
||||
<dd>-Nutzt die Invites weise. Baut euer Gast groben Unfug, seid ihr auch weg.</dd>
|
||||
<dt>Howto:</dt>
|
||||
<dd>Einfach den Link weiterschicken.</dd>
|
||||
</dl>
|
||||
<table class="table" width="100%" border="0" cellspacing="0">
|
||||
<tr class="tabletop">
|
||||
<td align="center" class="tabletoptd"><strong>InviteCode</strong></td>
|
||||
<td align="center" class="tabletoptd" width="100px"><strong>Used</strong></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
$invites = DB::query("SELECT * FROM pl_invites WHERE owner=:1",$user->id);
|
||||
|
||||
if($invites){
|
||||
foreach(array_keys($invites) as $i){?>
|
||||
<tr class="tablelist">
|
||||
<td align="center" class="tabletd">
|
||||
<?php
|
||||
if($invites[$i]["used"] == "0"){
|
||||
echo '<strong><a href="http://www.4ducky.com/invites/'.$invites[$i]["code"].'">'.$invites[$i]["code"].'</a></strong>';
|
||||
}else{
|
||||
echo $invites[$i]["code"];
|
||||
}?>
|
||||
</td>
|
||||
<td align="center" class="tabletd" width="50px"><?php
|
||||
|
||||
if($invites[$i]["used"] == "0"){
|
||||
echo "no";
|
||||
|
||||
}else{
|
||||
$usedby = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$invites[$i]["usedby"]);
|
||||
echo $usedby["name"];
|
||||
|
||||
}?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php }
|
||||
} else{
|
||||
?>
|
||||
<td align="center" class="tabletd">Zurzeit keine Invites für dich</td>
|
||||
<td class="tabletd"></td>
|
||||
|
||||
<?php }
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<div align="center">
|
||||
<form action="<?php echo Config::$absolutePath; ?>login" method="post">
|
||||
<fieldset>
|
||||
<legend>Login</legend>
|
||||
|
||||
<?php if( isset($messages['wrongLogin']) ) { ?>
|
||||
<div class="warn">
|
||||
Wrong user or password!
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['bannedLogin']) ) { ?>
|
||||
<div class="warn">
|
||||
Account banned!<br /> <?php if(strlen($messages['bannedLogin']) >2){ echo "Grund: ".$messages['bannedLogin'];} ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<dl class="form">
|
||||
<dt>Name:</dt>
|
||||
<dd>
|
||||
<input type="text" name="name" value="<?php echo htmlspecialchars($_POST['name']); ?>"/>
|
||||
</dd>
|
||||
|
||||
<dt>Passwort:</dt>
|
||||
<dd>
|
||||
<input type="password" name="pass" />
|
||||
</dd>
|
||||
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input class="check" type="checkbox" name="remember" id="inputRemember" value="1"/>
|
||||
<label for="inputRemember">Remember me!</label>
|
||||
</dd>
|
||||
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" class="button login" name="login" value="Login" />
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Don't have an account yet? <a href="<?php echo Config::$absolutePath; ?>register">Register!</a>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/users.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
header("Content-type: text/html; charset=UTF-8");
|
||||
$user = new User();
|
||||
$user->login();
|
||||
$user->loadEmail();
|
||||
if( !$user->admin ) {
|
||||
echo "You need to be logged in as an admin user!";
|
||||
exit();
|
||||
}
|
||||
|
||||
$Spammer = DB::query("SELECT * from pl_users WHERE spamblocked=1");
|
||||
$Abuses = DB::query("SELECT * FROM `pl_abuse`WHERE `read` =:1",0);
|
||||
|
||||
$newComments = DB::query(
|
||||
'SELECT
|
||||
c.id, c.content, u.name, u.avatar,
|
||||
UNIX_TIMESTAMP(c.created) AS created,
|
||||
i.keyword FROM '.TABLE_COMMENTS.' c
|
||||
LEFT JOIN '.TABLE_USERS.' u
|
||||
ON u.id = c.userId
|
||||
LEFT JOIN '.TABLE_IMAGES.' i
|
||||
ON i.id = c.imageId
|
||||
ORDER BY c.created DESC LIMIT 100'
|
||||
);
|
||||
include( 'templates/header.tpl.php' );
|
||||
?>
|
||||
<br />
|
||||
|
||||
<table align="center" class="duckytable" width="800px" cellspacing="0" cellpadding="0">
|
||||
<caption>Spammer / Abuse:</caption>
|
||||
<tr>
|
||||
<td style="width:50%;">
|
||||
<?php
|
||||
if((count($Spammer)) > 0){
|
||||
echo '<h2 style="margin:5px;" >Newest Spammer:</h2>';
|
||||
foreach( $Spammer as $u ) {?>
|
||||
|
||||
<div class="userInfo" style="margin:5px;">
|
||||
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$u['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$u['name']; ?>"><?php echo $u['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
ID: <strong><?php echo $u['id']; ?></strong> /
|
||||
Images: <strong><?php echo $u['images']; ?></strong>
|
||||
<?php if( !empty($u['website'])) { ?>/
|
||||
Website: <strong><a href="<?php echo htmlspecialchars($u['website']); ?>" target="_blank">
|
||||
<?php echo htmlspecialchars($u['website']); ?>
|
||||
</a></strong>
|
||||
<?php } ?>
|
||||
<?php if ((int)$u["time"] > 0 ){ echo "/ Bis:".date('Y-m-d H:i:s', $u["time"]); echo("<br>Grund: ".$u["spam_reason"]);} if ($user->id == 11 || $user->id == 1 ){ ?> / <a href="/manage/free/<?php echo $u["id"] ?>">Unblock</a><?php } ?>
|
||||
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php } }else{echo '<h2 style="margin:5px;" >No Spammer atm</h2>'; }?></td>
|
||||
|
||||
<td style="width:50%;">
|
||||
|
||||
|
||||
<?php
|
||||
if((count($Abuses)) > 0){
|
||||
echo '<h2 style="margin:5px;" >Newest Abuses:</h2>';
|
||||
foreach( $Abuses as $a ) {
|
||||
$Image = DB::getRow("SELECT *,UNIX_TIMESTAMP(logged) AS loggedTS FROM pl_images WHERE id=:1",$a["imageid"]);
|
||||
|
||||
if ($Image != NULL && $a["imageid"] != 0){
|
||||
?>
|
||||
|
||||
<div class="userInfo" style="margin:5px;">
|
||||
<img style="float:left; margin:2px;" width="64" height="64" src="<?php echo Config::$absolutePath."data/thumbs/".date("Y/m",$Image["loggedTS"])."/128x128/".$Image["thumb"]; ?>"/>
|
||||
|
||||
<div class="info">
|
||||
Reason: <strong><?php echo htmlspecialchars($a['reason']); ?></strong> /
|
||||
Email: <strong><?php echo htmlspecialchars($a['email']); ?></strong>
|
||||
|
||||
<?php if ($a["user"] != 0){
|
||||
$username = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$a["user"]);
|
||||
echo('<br>User:<strong>'.$username["name"].'</strong>');
|
||||
}
|
||||
|
||||
echo('<br><a href="/manage/del/'.$a["id"].'">Delete Abuse</a>'); ?>
|
||||
|
||||
</div>
|
||||
<div class="info">
|
||||
<strong><a href="<?php echo Config::$absolutePath."all/view/".$Image['keyword']; ?>"> >> Zum Thread</a> </strong>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
}elseif ($a["imageid"] == "0") {
|
||||
echo('<div class="userInfo" style="padding:5px;">');
|
||||
echo('<a href="'.$a["imagelink"].'">'.$a["imagelink"].'</a><br>');
|
||||
echo('Reason: <strong>'.$a['reason'].'</strong> /
|
||||
Email: <strong>'.$a['email'].'</strong>');
|
||||
echo('</div>');
|
||||
echo('<div class="userInfo" style="padding:5px;">');
|
||||
echo('<a href="/manage/del/'.$a["id"].'">Löschen</a>');
|
||||
echo('</div>');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{echo '<h2 style="margin:5px;">No Abuses</h2>';}?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
include( 'templates/footer.tpl.php' );
|
||||
?>
|
||||
@@ -0,0 +1,195 @@
|
||||
<?php include( $templates.'header.tpl.php' );
|
||||
|
||||
function color_inverse($color){
|
||||
$color = str_replace('#', '', $color);
|
||||
if (strlen($color) != 6){ return '000000'; }
|
||||
$rgb = '';
|
||||
for ($x=0;$x<3;$x++){
|
||||
$c = 255 - hexdec(substr($color,(2*$x),2));
|
||||
$c = ($c < 0) ? 0 : dechex($c);
|
||||
$rgb .= (strlen($c) < 2) ? '0'.$c : $c;
|
||||
}
|
||||
return '#'.$rgb;
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<div align="center">
|
||||
|
||||
<form action="<?php echo Config::$absolutePath; ?>profile" enctype="multipart/form-data" method="post">
|
||||
<fieldset>
|
||||
<legend>Change Profile</legend>
|
||||
|
||||
<?php if( isset($messages['passToShort']) ) { ?>
|
||||
<div class="warn">Your password must be at least 6 characters long!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passNotEqual']) ) { ?>
|
||||
<div class="warn">Your both passwords are not equal!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['avatarFailed']) ) { ?>
|
||||
<div class="warn">Your avatar Image could not be processed!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['colorFailed']) ) { ?>
|
||||
<div class="warn">Not a valid colorcode!</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="form">
|
||||
<dt>Passwort:</dt>
|
||||
<dd>
|
||||
<input type="password" name="cpass" /> (leave empty, if you don't want to change it)
|
||||
</dd>
|
||||
|
||||
<dt>(Repeat)</dt>
|
||||
<dd>
|
||||
<input type="password" name="cpass2" />
|
||||
</dd>
|
||||
|
||||
|
||||
|
||||
<?php if( empty($user->email) ) { ?>
|
||||
<dt>E-Mail:</dt>
|
||||
<dd>
|
||||
<input type="text" name="email" />
|
||||
</dd>
|
||||
<?php } ?>
|
||||
|
||||
<dt>Website:</dt>
|
||||
<dd>
|
||||
<input type="text" name="website" value="<?php echo htmlspecialchars( $user->website ); ?>"/>
|
||||
</dd>
|
||||
|
||||
<dt>Avatar:</dt>
|
||||
<dd>
|
||||
<input type="file" name="avatar" style="color: #000; background-color: #fff;"/><br/>
|
||||
</dd>
|
||||
<dt>Color:</dt>
|
||||
<dd>
|
||||
<input class="color" maxlength="6" type="text" name="color" value="<?php echo htmlspecialchars( $user->color ); ?>" style="width:100px;"/> (default:: 000000)
|
||||
<br/>
|
||||
</dd>
|
||||
|
||||
<dt>Style:</dt>
|
||||
<dd>
|
||||
<select name="stylecolor">
|
||||
<?php if ($user->stylecolor == "black"){echo('<option value="black">Black</option><option value="white">White</option>');}elseif ($user->stylecolor == "white"){echo('<option value="white">White</option><option value="black">Black</option>');} ?>
|
||||
</select>
|
||||
</dd>
|
||||
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="save" class="button" value="Save" />
|
||||
</dd>
|
||||
|
||||
|
||||
</dl>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<form action="<?php echo Config::$absolutePath; ?>profile" enctype="multipart/form-data" method="post">
|
||||
<fieldset>
|
||||
<legend>Block user</legend>
|
||||
|
||||
<?php if( isset($messages['blocked']) ) { ?>
|
||||
<div class="success">User blocked!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['blockFailed']) ) { ?>
|
||||
<div class="warn">Could not block user!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['blockAlready']) ) { ?>
|
||||
<div class="warn">User already blocked!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['userFailed']) ) { ?>
|
||||
<div class="warn">User not found!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['unblocked']) ) { ?>
|
||||
<div class="success">User unblocked!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['unblockFailed']) ) { ?>
|
||||
<div class="warn">Could not unblock user!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['TEMP']) ) { ?>
|
||||
<div class="warn">WHAT?</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['notBlocked']) ) { ?>
|
||||
<div class="warn">User not blocked!</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<dl class="form">
|
||||
<?php
|
||||
|
||||
$blockedrow = DB::getRow("SELECT id,users FROM pl_blocked WHERE id=:1",$user->id);
|
||||
|
||||
if (!empty($blockedrow['users'])){
|
||||
$des = unserialize($blockedrow['users']);
|
||||
|
||||
foreach ( $des as $username){
|
||||
$userinfo = DB::query('SELECT id,name,images,avatar FROM pl_users WHERE name="'.$username.'"');
|
||||
?>
|
||||
<div style="text-align:left" class="userInfo">
|
||||
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$userinfo[0]['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$userinfo[0]['name']; ?>"><?php echo $userinfo[0]['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
|
||||
Images: <strong><?php echo $userinfo[0]['images']; ?></strong>
|
||||
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}else{ ?>
|
||||
|
||||
<div class="success">No users blocked!</div>
|
||||
|
||||
|
||||
<?php }?>
|
||||
|
||||
<dt>User:</dt>
|
||||
<dd>
|
||||
<input type="text" name="blockuser" />
|
||||
</dd>
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="block" class="button" value="Block" />
|
||||
</dd>
|
||||
|
||||
<dt>User:</dt>
|
||||
<dd>
|
||||
<?php
|
||||
|
||||
if (!empty($blockedrow['users'])){
|
||||
$des = unserialize($blockedrow['users']);
|
||||
echo('<select name="unblockuser">');
|
||||
echo('<option value="select">Select user</option>');
|
||||
foreach ( $des as $username){
|
||||
echo('<option value="'.$username.'">'.$username.'</option>');
|
||||
}
|
||||
echo('</select>');
|
||||
}else{ echo("No user blocked!");}
|
||||
|
||||
?>
|
||||
</dd>
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="unblock" class="button" value="Unblock" />
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
|
||||
<script type="text/javascript" src="<?php echo Config::$absolutePath; ?>media/quicktags.js"></script>
|
||||
<h1>
|
||||
» Quicktagger
|
||||
</h1>
|
||||
|
||||
<div class="article" id="quickTagIntro">
|
||||
<h2>Quick tagging?</h2>
|
||||
<p>
|
||||
This special site automatically searches for images which are in desperate need of getting tagged.
|
||||
That is: new images without any or very few tags.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This site is carefully designed to allow efficient tagging of images. You don't have to move your hands
|
||||
away from the keyboard - just write and press enter for the next image. Make sure javascript is
|
||||
enabled in your browser, or you wont see anything.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>A few words about tagging</h2>
|
||||
|
||||
<p>
|
||||
If you are unsure what tags to write, just imagine you are searching for this image - what word(s) would you
|
||||
search for?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Also, is there any written text on the image itself? Try to write only the most essential words down. For instance
|
||||
if you see a motivational with the text:
|
||||
</p>
|
||||
<blockquote>
|
||||
<strong>Huddle House</strong><br/>
|
||||
For those times when Waffle House isn't quite white trashy enough
|
||||
</blockquote>
|
||||
<p>
|
||||
good tags for this image would be "<em>motivational huddle house white trash</em>"
|
||||
</p>
|
||||
<p>
|
||||
If you don't know what to write, just press enter to skip the image.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Don't abuse the system in any way, or the wrath of the administrator will come done on you!</strong>
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a href="#" onclick="return quickTagInit();"> » I get it, let's start already!</a></h2>
|
||||
</div>
|
||||
|
||||
<div id="viewer" class="hidden">
|
||||
<div id="imageInfo">
|
||||
<div>
|
||||
location: <a id="imageLocation" href="#"></a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
Tags: <span id="tags"></span>
|
||||
</div>
|
||||
<form class="visible" id="addTag" action="" onsubmit="return quickTag($('logId').value, $('imageId').value, $('tagText'));">
|
||||
<input type="text" name="tags" id="tagText"/>
|
||||
<input type="hidden" id="imageId" name="imageId" value="0"/>
|
||||
<input type="hidden" id="logId" name="logId" value="0"/>
|
||||
<input type="button" name="save" value="Add Tags" class="button" onclick="quickTag($('logId').value, $('imageId').value, $('tagText'));"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="imageContainer">
|
||||
<img id="image" onclick="swap(this, 'scaled', 'full')" class="scaled" src=""/>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
header( 'Content-type: text/javascript; charset=utf-8' );
|
||||
?>
|
||||
<?php foreach($ib->thumbs as $t ) { ?>
|
||||
document.write('<div id="commentbar"><a href="<?php echo Config::$frontendPath; ?>all/view/<?php echo $t['keyword']; ?>"><div id="commentimg"><img width="28" height="28" src="/media/random.png" alt="Random"></div><div id="commenttext"><strong>Random: </strong><br />Quark bitte!</div></a></div>');
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<div align="center">
|
||||
<form action="<?php echo Config::$absolutePath; ?>register" method="post">
|
||||
<fieldset>
|
||||
<legend>Create Account</legend>
|
||||
|
||||
<?php if(isset($messages['validInvite'])) { ?>
|
||||
<div class="warn">Not a valid invitecode!<br />Code: <?php echo $messages['validInvite'] ?></div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['nameInUse']) ) { ?>
|
||||
<div class="warn">This Username is already registered!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['nameInvalid']) ) { ?>
|
||||
<div class="warn">Your name must be at least 2 characters long an may not have any special characters!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passToShort']) ) { ?>
|
||||
<div class="warn">Your password must be at least 6 characters long!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passNotEqual']) ) { ?>
|
||||
<div class="warn">Your both passwords are not equal!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['emailInUse']) ) { ?>
|
||||
<div class="warn">There is already a registered user with this E-Mail address!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['wrongEmail']) ) { ?>
|
||||
<div class="warn">Your E-Mail address seems to be invalid!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['registerClose']) ) { ?>
|
||||
<div class="warn">Register Closed!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['captchaInc']) ) { ?>
|
||||
<div class="warn">Incorrect Captcha!</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<dl class="form">
|
||||
<dt>Username:</dt>
|
||||
<dd>
|
||||
<input type="text" name="name" value="<?php echo htmlspecialchars($_POST['name']); ?>"/>
|
||||
Only letters and numbers; at least 2 characters long; no spaces
|
||||
</dd>
|
||||
|
||||
<dt>E-Mail:</dt>
|
||||
<dd>
|
||||
<input type="text" name="email" value="<?php echo htmlspecialchars($_POST['email']); ?>"/>
|
||||
Must be valid!
|
||||
</dd>
|
||||
|
||||
<dt>Password:</dt>
|
||||
<dd>
|
||||
<input type="password" name="pass" class="pass"/>
|
||||
</dd>
|
||||
|
||||
<dt>(Repeat)</dt>
|
||||
<dd>
|
||||
<input type="password" name="pass2" class="pass"/>
|
||||
</dd>
|
||||
|
||||
<dt>Captcha:</dt>
|
||||
<dd>
|
||||
<?php
|
||||
require_once('recaptchalib.php');
|
||||
$publickey = "6LfIwOYSAAAAALllrivDb1JTAfKDIIzcjv_hwZ60"; // you got this from the signup page
|
||||
echo recaptcha_get_html($publickey);
|
||||
?>
|
||||
|
||||
</dd>
|
||||
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="register" class="button register" value="Register" />
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<div align="center">
|
||||
<?php if(isset($messages['validInvite'])) { ?>
|
||||
<div class="warn">Not a valid invitecode!<br />Code: <?php echo $messages['validInvite'] ?></div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['nameInUse']) ) { ?>
|
||||
<div class="warn">This Username is allready registered!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['nameInvalid']) ) { ?>
|
||||
<div class="warn">Your name must be at least 2 characters long an may not have any special characters!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passToShort']) ) { ?>
|
||||
<div class="warn">Your password must be at least 6 characters long!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passNotEqual']) ) { ?>
|
||||
<div class="warn">Your both passwords are not equal!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['emailInUse']) ) { ?>
|
||||
<div class="warn">There is already a registered user with this E-Mail address!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['wrongEmail']) ) { ?>
|
||||
<div class="warn">Your E-Mail address seems to be invalid!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['registerClose']) ) { ?>
|
||||
<div class="warn">Register Closed!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['captchaInc']) ) { ?>
|
||||
<div class="warn">Incorrect Captcha!</div>
|
||||
<?php } ?>
|
||||
|
||||
<fieldset>
|
||||
<legend>Register</legend>
|
||||
|
||||
<dl class="form">
|
||||
<dd>Registration is closed at the moment. Like us on Facebook to stay up2date:</dd>
|
||||
<dd><br /></dd>
|
||||
<dd><iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2F4duckie&width=600&height=590&colorscheme=dark&show_faces=true&border_color&stream=true&header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:640px; height:590px;" allowTransparency="true"></iframe></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<div align="center">
|
||||
<form action="<?php echo Config::$absolutePath; ?>register" method="post">
|
||||
<fieldset>
|
||||
<legend>Create Account</legend>
|
||||
|
||||
<?php if(isset($messages['validInvite'])) { ?>
|
||||
<div class="warn">Not a valid invitecode!<br />Code: <?php echo $messages['validInvite'] ?></div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['nameInUse']) ) { ?>
|
||||
<div class="warn">This Username is allready registered!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['nameInvalid']) ) { ?>
|
||||
<div class="warn">Your name must be at least 2 characters long an may not have any special characters!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passToShort']) ) { ?>
|
||||
<div class="warn">Your password must be at least 6 characters long!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['passNotEqual']) ) { ?>
|
||||
<div class="warn">Your both passwords are not equal!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['emailInUse']) ) { ?>
|
||||
<div class="warn">There is already a registered user with this E-Mail address!</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($messages['wrongEmail']) ) { ?>
|
||||
<div class="warn">Your E-Mail address seems to be invalid!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['registerClose']) ) { ?>
|
||||
<div class="warn">Register Closed!</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($messages['captchaInc']) ) { ?>
|
||||
<div class="warn">Incorrect Captcha!</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<dl class="form">
|
||||
<dt>Name:</dt>
|
||||
<dd>
|
||||
<input type="text" name="name" value="<?php echo htmlspecialchars($_POST['name']); ?>"/>
|
||||
Only letters and numbers; at least 2 characters long
|
||||
</dd>
|
||||
|
||||
<dt>E-Mail:</dt>
|
||||
<dd>
|
||||
<input type="text" name="email" value="<?php echo htmlspecialchars($_POST['email']); ?>"/>
|
||||
Must be valid!
|
||||
</dd>
|
||||
|
||||
<dt>Password:</dt>
|
||||
<dd>
|
||||
<input type="password" name="pass" class="pass"/>
|
||||
</dd>
|
||||
|
||||
<dt>(Repeat)</dt>
|
||||
<dd>
|
||||
<input type="password" name="pass2" class="pass"/>
|
||||
</dd>
|
||||
|
||||
<dt>Invitecode: </dt>
|
||||
<dd>
|
||||
<div style="padding:5px;">
|
||||
<?php echo $r[1]; ?>
|
||||
<input type="hidden" name="invite" value="<?php echo $r[1]; ?>"/>
|
||||
</div>
|
||||
</dd>
|
||||
|
||||
<dt>Captcha</dt>
|
||||
<dd>
|
||||
<?php
|
||||
require_once('recaptchalib.php');
|
||||
$publickey = "6LfXrc8SAAAAAHtc2BaJZ_3OfRx4gLPREaVCLhS8"; // you got this from the signup page
|
||||
echo recaptcha_get_html($publickey);
|
||||
?>
|
||||
|
||||
</dd>
|
||||
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="register" class="button register" value="Register" />
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<div class="article">
|
||||
<h2>Account successfully created</h2>
|
||||
<p>You can now login.</p>
|
||||
|
||||
</div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,11 @@
|
||||
From: support@4ducky.com
|
||||
Subject: Welcome to %siteName%!
|
||||
|
||||
Hello %userName%,
|
||||
thank you for your registration at %siteName%.
|
||||
|
||||
To activate your account, please click the following link
|
||||
%frontendPath%login/%validationString%
|
||||
|
||||
|
||||
Your %siteName% Team
|
||||
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo Config::$siteTitle ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Config::$absolutePath; ?>media/styles_b.css" />
|
||||
<link rel="Shortcut Icon" href="<?php echo Config::$absolutePath; ?>media/favicon.ico"/>
|
||||
<script type="text/javascript" src="<?php echo Config::$absolutePath; ?>media/general.js"></script>
|
||||
</head>
|
||||
<body style="margin: 0.2em 1em 0 1em; padding: 0;">
|
||||
|
||||
<h1 class="remotePost">4ducky.com - One click Uploader</h1>
|
||||
|
||||
<?php if( !$user->id ) { ?>
|
||||
<form action="remotepost.php" method="post">
|
||||
<em>Name:</em>
|
||||
<input type="text" name="name" style="width: 80px; margin-right: 10px" value="<?php echo htmlspecialchars($_POST['name']); ?>"/>
|
||||
|
||||
<em>Passwort:</em>
|
||||
<input type="password" style="width: 80px; margin-right: 10px" name="pass" />
|
||||
|
||||
<input type="submit" class="button login" name="login" value="Login" />
|
||||
<input type="hidden" name="remember" value="1"/>
|
||||
</form>
|
||||
<?php } else if( $user->isSpamLocked() ) { ?>
|
||||
<p>Sorry, you are not allowed to post more than 10 Images in 2 Hours.</p>
|
||||
<?php } else if( $status == 'ready' ) { ?>
|
||||
<p>Please click on the image you want to publish on 4ducky.com!</p>
|
||||
<p><strong>Rules:</strong> Gore, CP, Spam (no Thread) = Ban</p>
|
||||
<?php } else if( $status == 'failed' ) { ?>
|
||||
<p>Sorry, the Image could not be posted for the following reason:</p>
|
||||
<p><strong><?php echo implode(' ', $uploadErrors); ?></strong></p>
|
||||
<?php } else if( $status == 'posted' ) { ?>
|
||||
<p>Image posted! Thank you!</p>
|
||||
<script type="text/javascript">
|
||||
if( parent ) {
|
||||
parent.location = "<?php echo addslashes($_GET['xhrLocation']) ?>#RP_Success";
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div align="center" style="margin-top: 10px; margin-bottom: 25px;">
|
||||
|
||||
<iframe height="1800" width="848" src="http://fuehls.spreadshirt.de/" name="Spreadshop" id="Spreadshop" frameborder="0" onload="window.scrollTo(0, 0);"></iframe>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,311 @@
|
||||
<?php
|
||||
$duckys = mysql_fetch_object(mysql_query('SELECT COUNT(id) AS zaehler FROM pl_users'))->zaehler;
|
||||
|
||||
$banned = mysql_fetch_object(mysql_query('SELECT COUNT(id) AS zaehler FROM pl_banned'))->zaehler;
|
||||
|
||||
$comm = mysql_fetch_object(mysql_query('SELECT COUNT(id) AS zaehler FROM pl_comments'))->zaehler;
|
||||
|
||||
$img = mysql_fetch_object(mysql_query('SELECT COUNT(id) AS zaehler FROM pl_images'))->zaehler;
|
||||
|
||||
$fav = mysql_fetch_object(mysql_query('SELECT COUNT(imageId) AS zaehler FROM pl_fav'))->zaehler;
|
||||
?>
|
||||
|
||||
<div align="center" style="margin-top: 25px; margin-bottom: 25px;">
|
||||
|
||||
<table class="duckytable" width="600px" cellspacing="0" cellpadding="0">
|
||||
<caption>4ducky.com Finances:</caption>
|
||||
<tr>
|
||||
<td>Current 4ducky balance:</td>
|
||||
<td><strong>20,00 Euro</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="meter"><span style="width: 50%">50 % achieved</span></div></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="text-align:left;">
|
||||
<div style="margin: 5px; float: right; vertical-align: bottom;">
|
||||
<script src="http://coinwidget.com/widget/coin.js"></script>
|
||||
<script>
|
||||
CoinWidgetCom.go({
|
||||
wallet_address: "13wcgskYqQ2L4cPtV6TJHyfzrQ8NT5Zt9e"
|
||||
, currency: "bitcoin"
|
||||
, counter: "amount"
|
||||
, alignment: "bl"
|
||||
, qrcode: false
|
||||
, auto_show: false
|
||||
, lbl_button: "Donate"
|
||||
, lbl_address: "My Bitcoin Address:"
|
||||
, lbl_count: "donations"
|
||||
, lbl_amount: "BTC"
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
Jeder User hat die Möglichkeit 4ducky.com mit Spenden zu unterstützen. Der 4ducky.com Server kostet derzeit 30 Euro im Monat.
|
||||
Wer etwas beisteuern möchte, der schickt einfach einen <a href="https://www.amazon.de/gp/product/BT00DHI7XI">Amazon-Gutschein</a> (bitte auf eure E-Mail Adresse und nur den Code per PN) an den User "<a href="http://www.4ducky.com/inbox/Pandora">Pandora</a>" oder spendet via Bitcoin an 13wcgskYqQ2L4cPtV6TJHyfzrQ8NT5Zt9e. Spender werden hier geehrt:
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><strong>Last activities & donations:</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="duckytable" width="600px" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td style="width: 40%;"><strong>Date</strong></td>
|
||||
<td style="width: 40%;"><strong>Activity / Feeler</strong></td>
|
||||
<td style="width: 40%;"><strong>Amount</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery("#spendenducks").slimScroll({
|
||||
height: "190px",
|
||||
width: "599px"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="spendenducks">
|
||||
<table class="duckytable" width="600px" cellspacing="0" cellpadding="0">
|
||||
<tr class="spender">
|
||||
<td>Oktober 2015</td>
|
||||
<td><a href="/user/Pulvertoastmann">Pulvertoastmann</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Oktober 2015</td>
|
||||
<td><a href="/user/nadjer">nadjer</a></td>
|
||||
<td>+ 20,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>Oktober 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>September 2015</td>
|
||||
<td><a href="/user/Moses">Moses</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>September 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>August 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>August 2015</td>
|
||||
<td>Anonym</td>
|
||||
<td>+ 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>Juli 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juni 2015</td>
|
||||
<td><a href="/user/DerFickNigger">DerFickNigger</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juni 2015</td>
|
||||
<td><a href="/user/waluri">waluri</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juni 2015</td>
|
||||
<td><a href="/user/Kastritis">Kastritis</a></td>
|
||||
<td>+ 17,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juni 2015</td>
|
||||
<td><a href="/user/BASEDGOD">BASEDGOD</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>Juni 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>Mai 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>April 2015</td>
|
||||
<td><a href="/user/DerFickNigger">DerFickNigger</a></td>
|
||||
<td>+ 25,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>April 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>März 2015</td>
|
||||
<td><a href="/user/AntraX">AntraX</a></td>
|
||||
<td>+ 88,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>März 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Februar 2015</td>
|
||||
<td><a href="/user/Ahmed">Ahmed</a></td>
|
||||
<td>+ 50,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>März 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Januar 2015</td>
|
||||
<td><a href="/user/FG">FG</a></td>
|
||||
<td>+ 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Januar 2015</td>
|
||||
<td><a href="/user/Nadjer">Nadjer</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>Januar 2015</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 30,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Dezember 2014</td>
|
||||
<td><a href="/user/Kastritis">Kastritis</a></td>
|
||||
<td>+ 11,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Dezember 2014</td>
|
||||
<td>vergessen wer</td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juli 2014</td>
|
||||
<td><a href="/user/RoterIndianer">RoterIndianer</a></td>
|
||||
<td>+ 40,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juli 2014</td>
|
||||
<td><a href="/user/Seine_Durchlaucht">Seine_Durchlaucht</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juli 2014</td>
|
||||
<td><a href="/user/Napalm">Napalm</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Juni 2014</td>
|
||||
<td><a href="/user/Sozialfall">Sozialfall</a></td>
|
||||
<td>+ 20,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Dezember 2013</td>
|
||||
<td><a href="/user/IchHab4Euro">IchHab4Euro</a></td>
|
||||
<td>+ 4,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Dezember 2013</td>
|
||||
<td><a href="/user/FG">FG</a></td>
|
||||
<td>+ 25,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Dezember 2013</td>
|
||||
<td><a href="/user/Kastritis">Kastritis</a></td>
|
||||
<td>+ 10,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>Oktober 2013</td>
|
||||
<td><a href="/user/Hitler">Hitler</a></td>
|
||||
<td>+ 20,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="spender">
|
||||
<td>September 2013</td>
|
||||
<td><a href="/user/Pandora">Pandora</a></td>
|
||||
<td>+ 20,00 Euro</td>
|
||||
</tr>
|
||||
<tr class="kosten">
|
||||
<td>September 2013</td>
|
||||
<td>Server-Miete</td>
|
||||
<td>- 20 Euro</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<table class="duckytable" width="600px" cellspacing="0" cellpadding="0">
|
||||
<caption>4ducky.com Statistics:</caption>
|
||||
|
||||
<tr>
|
||||
<td>Images:</td>
|
||||
<td><?php echo $img;?> Images</td>
|
||||
<td>~ <?php echo round($img/$duckys,2);?> Images/User</td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td>Size:</td>
|
||||
<td>
|
||||
<?php
|
||||
$fp = fopen("data/size.txt","r");
|
||||
if ($fp) {
|
||||
while(!feof($fp)) {
|
||||
$text = fgets($fp);
|
||||
$size = substr($text,0,3);
|
||||
echo $size;
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
?> GB
|
||||
</td>
|
||||
<td>~ 100 GB Max Size</td>
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<td>User:</td>
|
||||
<td><?php echo $duckys;?> Duckies</td>
|
||||
<td><?php echo $banned;?> Banned Duckies</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Comments:</td>
|
||||
<td><?php echo $comm;?> Comments</td>
|
||||
<td>~ <?php echo round($comm/$duckys,2);?> Comments/User</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Likes:</td>
|
||||
<td><?php echo $fav;?> Likes</td>
|
||||
<td>~ <?php echo round($fav/$duckys,2);?> Likes/User</td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td>Visits:</td>
|
||||
<td colspan="2" style="width: 50%;"><iframe src="http://www.seethestats.com/stats/7569/Visits_56ea3b613_ifr.html" style="width:400px;height:210px;border:none;" scrolling="no" frameborder="0"></iframe></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pageviews:</td>
|
||||
<td colspan="2" style="width: 50%;"><iframe src="http://www.seethestats.com/stats/7569/Pageviews_0d72476f4_ifr.html" style="width:400px;height:210px;border:none;" scrolling="no" frameborder="0"></iframe></td>
|
||||
</tr>
|
||||
-->
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php include( $templates.'header.tpl.php' );
|
||||
|
||||
$upl = DB::getRow("SELECT * FROM pl_settings");
|
||||
if ($upl["upload"] != 1){ ?>
|
||||
<div align="center">
|
||||
<fieldset>
|
||||
<legend>Upload / Post</legend>
|
||||
<div class="warn">
|
||||
There was an issue uploading your image:
|
||||
<ul>Upload Disabled.</ul>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<?php }else{
|
||||
?>
|
||||
<div align="center">
|
||||
<form action="<?php echo Config::$absolutePath; ?>upload" enctype="multipart/form-data" method="POST">
|
||||
<fieldset>
|
||||
<legend>Upload / Post</legend>
|
||||
|
||||
|
||||
<?php if( !empty( $uploadErrors ) ) { ?>
|
||||
<div class="warn">
|
||||
There was an issue uploading your image:
|
||||
<ul>
|
||||
<?php foreach( $uploadErrors as $msg ) { ?>
|
||||
<li class="error"><?php echo $msg?></li>
|
||||
<?php }/*foreach*/?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php }/*if*/?>
|
||||
|
||||
<dl class="form">
|
||||
<dt>Info:</dt>
|
||||
<dd>
|
||||
- Sinnloser Goreupload = Ban
|
||||
</dd>
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
- Nur lustige Sachen erlaubt.
|
||||
</dd>
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
- Wenn ihr Fragen habt schreibt eine PN - oh wait hier ist nicht Schwuchtel-4fuckr, nervt jemand Anderen mit euren Problemen.
|
||||
</dd>
|
||||
<dt> </dt> <dd> </dd>
|
||||
<dt>File:</dt>
|
||||
<dd>
|
||||
<input type="file" name="image" style="color: #000; background-color: #fff;"/>
|
||||
</dd>
|
||||
|
||||
<dt>or URL:</dt>
|
||||
<dd>
|
||||
<input type="text" name="url" value="<?php echo htmlspecialchars( $_POST['url'] ); ?>"/>
|
||||
</dd>
|
||||
<dt>Comment</dt>
|
||||
<dd>
|
||||
<textarea name="ucomment" rows="3" cols="60"></textarea>
|
||||
</dd>
|
||||
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" name="upload" value="Upload" class="button"/>
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<?php } include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php include( $templates.'header.tpl.php' ); ?>
|
||||
<h1>
|
||||
» Browsing Users,
|
||||
Page: <?php echo $ul->pages['current']; ?> of <?php echo $ul->pages['total']; ?>
|
||||
</h1>
|
||||
|
||||
|
||||
<?php
|
||||
if ($user->stylecolor == "black") {
|
||||
$border="border:1px solid #333;";
|
||||
}else{
|
||||
$border = ' border:1px solid #d2d9e7; ';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach( $ul->users as $i => $u ) { ?>
|
||||
<div class="userInfo" style=" <?php echo $border; ?> ">
|
||||
<img class="avatar" width="40" height="40" src="<?php echo Config::$absolutePath.$u['avatar']; ?>"/>
|
||||
<div class="name">
|
||||
<strong>
|
||||
<a href="<?php echo Config::$absolutePath.'user/'.$u['name']; ?>"><?php echo $u['name']; ?></a>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="info">
|
||||
|
||||
Images: <strong><?php echo $u['images']; ?></strong>
|
||||
<?php if( !empty($u['website'])) { ?>|
|
||||
<strong><a href="<?php echo htmlspecialchars($u['website']); ?>" target="_blank">
|
||||
Website
|
||||
</a></strong>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="userInfo">
|
||||
<?php if( isset($ul->pages['prev']) ) { ?>
|
||||
<a href="<?php echo Config::$absolutePath.'users/page/'.$ul->pages['prev']; ?>" class="textPrev" title="Previous">« Previous</a>
|
||||
<?php } else { ?>
|
||||
<div class="textNoPrev">« Previous</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( isset($ul->pages['next']) ) { ?>
|
||||
<a href="<?php echo Config::$absolutePath.'users/page/'.$ul->pages['next']; ?>" class="textNext" title="Next">Next »</a>
|
||||
<?php } else { ?>
|
||||
<div class="textNoNext">Next »</div>
|
||||
<?php } ?>
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
@@ -0,0 +1,511 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
An object of this class represents a user on the site. All user
|
||||
related tasks (registration, login, profile etc.) are handled here.
|
||||
|
||||
A user object is created and attempted to login on each page load.
|
||||
*/
|
||||
|
||||
require_once( 'lib/config.php' );
|
||||
require_once( 'lib/db.php' );
|
||||
|
||||
class User {
|
||||
public $name = '';
|
||||
public $id = 0;
|
||||
public $validationString = '';
|
||||
public $admin = 0;
|
||||
public $website = 0;
|
||||
public $color = "0";
|
||||
public $stylecolor = "black";
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function validate( $id ) {
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, color, style FROM '.TABLE_USERS.' WHERE valid = 0 AND remember = :1',
|
||||
$id
|
||||
);
|
||||
|
||||
if( empty($u) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DB::updateRow( TABLE_USERS, array('id' => $u['id']), array( 'valid' => 1) );
|
||||
|
||||
session_name( Config::$sessionCookie );
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
|
||||
setcookie( Config::$rememberCookie, $id, time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isSpamLocked() {
|
||||
// delete all ips older than IP_LOCK_TIME
|
||||
DB::query( 'DELETE FROM '.TABLE_UPLOADLOCK.' WHERE ts < :1', time() - Config::$uploadLockTime );
|
||||
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$r = DB::getRow( 'SELECT COUNT(*) AS c FROM '.TABLE_UPLOADLOCK.'
|
||||
WHERE ip = :1',
|
||||
$ip
|
||||
);
|
||||
|
||||
if( $r['c'] > Config::$maxNumUploads ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function isSpamer() {
|
||||
|
||||
|
||||
$r = DB::getRow( 'SELECT logged FROM pl_images
|
||||
WHERE user = :1 order by logged desc',
|
||||
$this->id
|
||||
);
|
||||
$time = strtotime($r["logged"]);
|
||||
|
||||
if( (time() - (integer)$time) < 10 ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function isSpamming() {
|
||||
|
||||
|
||||
$count = DB::getRow( 'SELECT COUNT(*) as c FROM pl_images
|
||||
WHERE user = :1',
|
||||
$this->id
|
||||
);
|
||||
|
||||
if ( $count["c"] >= 3){
|
||||
|
||||
$r = DB::query( 'SELECT image,keyword,logged FROM pl_images
|
||||
WHERE user = :1 LIMIT '.((integer)$count["c"]-3).',2',
|
||||
$this->id
|
||||
);
|
||||
|
||||
|
||||
$r0 = DB::getRow( 'SELECT image,keyword,logged FROM pl_images
|
||||
WHERE user = :1 LIMIT '.((integer)$count["c"]-1).',1',
|
||||
$this->id
|
||||
);
|
||||
|
||||
require_once("img_class.php");
|
||||
$ban =0;
|
||||
foreach ($r as $checkable) {
|
||||
|
||||
echo(strtotime($r0["logged"])." - ");
|
||||
echo(strtotime($checkable["logged"]));
|
||||
|
||||
if ((strtotime($r0["logged"]) - strtotime($checkable["logged"])) < 15){
|
||||
|
||||
|
||||
|
||||
$splitter = split("/",$checkable["keyword"]);
|
||||
$file2 = $splitter[0]."/".$splitter[1]."/".$checkable["image"];
|
||||
$splitter = split("/",$r0["keyword"]);
|
||||
$file1 = $splitter[0]."/".$splitter[1]."/".$r0["image"];
|
||||
|
||||
$diff = new imagediff("data/images/".$file2, "data/images/".$file1);
|
||||
$dif = $diff->diff();
|
||||
|
||||
if ($dif > 0.92){
|
||||
$ban += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($ban >= 2){
|
||||
return true;
|
||||
}else{
|
||||
return false;}
|
||||
}else{ return false;}
|
||||
}
|
||||
|
||||
public function logUpload() {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
DB::insertRow( TABLE_UPLOADLOCK, array('ip' => $ip, 'ts' => time(),'user' => $this->id) );
|
||||
}
|
||||
|
||||
public function login() {
|
||||
|
||||
// attempt to login via post, session or remeber cookie
|
||||
|
||||
|
||||
|
||||
session_name( Config::$sessionCookie );
|
||||
|
||||
if( isset($_POST['login']) ) { // post login
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, color, style FROM '.TABLE_USERS.' WHERE name = :1 AND pass = :2 and valid = 1',
|
||||
$_POST['name'], md5($_POST['pass'])
|
||||
);
|
||||
|
||||
if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){
|
||||
return "banned";
|
||||
}
|
||||
|
||||
if( !empty($u) ) {
|
||||
|
||||
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
|
||||
if( !empty($_POST['remember']) ) {
|
||||
$r = md5(uniqid(rand()));
|
||||
DB::updateRow( TABLE_USERS, array('id' => $this->id), array('remember' => $r ) );
|
||||
setcookie( Config::$rememberCookie, $r, time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
}
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if( !empty($_COOKIE[Config::$sessionCookie]) ) { // session running
|
||||
session_start();
|
||||
if( empty($_SESSION['id']) ) {
|
||||
setcookie(Config::$sessionCookie, false, time() - 3600, Config::$absolutePath );
|
||||
} else {
|
||||
$this->id = $_SESSION['id'];
|
||||
$this->name = $_SESSION['name'];
|
||||
$this->admin = $_SESSION['admin'];
|
||||
$this->website = $_SESSION['website'];
|
||||
$this->color = $u['color'];
|
||||
$this->stylecolor = $u['stylecolor'];
|
||||
if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$this->id)){
|
||||
$this->logout();
|
||||
return "banned";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if( !empty($_COOKIE[Config::$rememberCookie]) ) { // remember cookie found
|
||||
$u = DB::getRow(
|
||||
'SELECT id, name, admin, website, style, color FROM '.TABLE_USERS.' WHERE remember = :1',
|
||||
$_COOKIE[Config::$rememberCookie]
|
||||
);
|
||||
if( !empty($u) ) {
|
||||
|
||||
session_start();
|
||||
$_SESSION['id'] = $this->id = $u['id'];
|
||||
$_SESSION['name'] = $this->name = $u['name'];
|
||||
$_SESSION['admin'] = $this->admin = $u['admin'];
|
||||
$_SESSION['website'] = $this->website = $u['website'];
|
||||
$_SESSION['color'] = $this->color = $u['color'];
|
||||
$_SESSION['stylecolor'] = $this->stylecolor = $u['style'];
|
||||
|
||||
// refresh for another year
|
||||
setcookie( Config::$rememberCookie, $_COOKIE[Config::$rememberCookie], time() + 3600 * 24 * 365, Config::$absolutePath );
|
||||
|
||||
if (DB::getRow("SELECT id FROM pl_banned WHERE id=:1",$u['id'])){
|
||||
$this->logout();
|
||||
return "banned";
|
||||
}
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->login(array('username' => $u['name']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function profile( $localFile, &$messages ) {
|
||||
$upd = array( 'website' => $_POST['website'] );
|
||||
|
||||
$_SESSION['website'] = $_POST['website'];
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
}
|
||||
|
||||
$p = trim($_POST['cpass']);
|
||||
if( !empty( $p ) ) {
|
||||
if( strlen($_POST['cpass']) < 6 ) {
|
||||
$messages['passToShort'] = true;
|
||||
}
|
||||
else if( $_POST['cpass'] != $_POST['cpass2'] ) {
|
||||
$messages['passNotEqual'] = true;
|
||||
}
|
||||
else {
|
||||
$upd['pass'] = md5($_POST['cpass2']);
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
$forum->set_pass( $_SESSION['name'], $_POST['cpass2']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !empty( $localFile ) ) {
|
||||
require_once( 'lib/images.php' );
|
||||
|
||||
list( $imgWidth, $imgHeight, $imgtype ) = getimagesize($localFile);
|
||||
|
||||
if ( $imgWidth == 64 && $imgHeight == 64 && $imgtype == IMAGETYPE_GIF){
|
||||
$name = Config::$images['avatarsPath'].uniqid().'.gif';
|
||||
if (!move_uploaded_file($localFile,$name)){
|
||||
$messages['avatarFailed'] = true;
|
||||
$upd['avatar'] = Config::$images['avatarsPath']."default.png";
|
||||
}else{
|
||||
$upd['avatar'] = $name;
|
||||
}
|
||||
}else{
|
||||
$name = Config::$images['avatarsPath'].uniqid().'.jpg';
|
||||
|
||||
if( Image::createThumb( $localFile, $name, 64,64 ) ) {
|
||||
$upd['avatar'] = $name;
|
||||
} else {
|
||||
$messages['avatarFailed'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_POST['color'])){
|
||||
if(preg_match('/^[a-f0-9]{6}$/i', $_POST['color'])){
|
||||
$upd['color'] = $_POST['color'];
|
||||
}else{
|
||||
$messages['colorFailed'] = true;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------blockuser
|
||||
if(!empty($_POST['blockuser'])){
|
||||
if(preg_match('/^\w{2,20}$/', $_POST['blockuser'])){
|
||||
$blockedusers = array();
|
||||
$blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id);
|
||||
|
||||
if(!empty($blockedusers)){
|
||||
$blockedusers = unserialize($blockedusers['users']);
|
||||
if (in_array($_POST['blockuser'],$blockedusers)){
|
||||
$messages['blockAlready'] = true;
|
||||
}else{
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){
|
||||
|
||||
array_push($blockedusers,$_POST['blockuser']);
|
||||
if(DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id)){
|
||||
$messages['blocked'] = true;
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
}else{
|
||||
$messages['userFailed'] = true;
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['blockuser'])){
|
||||
$newarray = array();
|
||||
array_push($newarray,$_POST['blockuser']);
|
||||
|
||||
if(DB::query("INSERT INTO pl_blocked (id,users) VALUES (:1,:2)",$this->id,serialize($newarray))){
|
||||
$messages['blocked'] = true;
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
|
||||
}else{
|
||||
$messages['userFailed'] = true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$messages['blockFailed'] = true;
|
||||
}
|
||||
|
||||
}
|
||||
//--------------------------------------------------------------------UNblockuser
|
||||
function remove_item_by_value($array, $val = '', $preserve_keys = true) {
|
||||
if (count($array) == 1) return false;
|
||||
if (empty($array) || !is_array($array)) return false;
|
||||
if (!in_array($val, $array)) return $array;
|
||||
|
||||
foreach($array as $key => $value) {
|
||||
if ($value == $val) unset($array[$key]);
|
||||
}
|
||||
|
||||
return ($preserve_keys === true) ? $array : array_values($array);
|
||||
}
|
||||
//--------------------------------------------------------------------UNblockuser
|
||||
if(!empty($_POST['unblockuser'])){
|
||||
if(preg_match('/^\w{2,20}$/', $_POST['unblockuser'])){
|
||||
if(DB::query('SELECT * FROM pl_users WHERE name=:1', $_POST['unblockuser'])){
|
||||
$blockedusers = array();
|
||||
$blockedusers = DB::getRow("SELECT id, users FROM pl_blocked WHERE id=:1",$this->id);
|
||||
if(!empty($blockedusers)){
|
||||
$blockedusers = unserialize($blockedusers['users']);
|
||||
if (in_array($_POST['unblockuser'],$blockedusers)){
|
||||
$blockedusers = remove_item_by_value($blockedusers,$_POST['unblockuser']);
|
||||
if ($blockedusers){
|
||||
DB::query('UPDATE pl_blocked SET users=:1 WHERE id=:2', serialize($blockedusers),$this->id);
|
||||
$messages['unblocked'] = true;
|
||||
}else{
|
||||
DB::query('DELETE FROM pl_blocked WHERE id=:1',$this->id);
|
||||
$messages['unblocked'] = true;
|
||||
}
|
||||
}else{$messages['notBlocked'] = true;}
|
||||
}else{$messages['unblockFailed'] = true;}
|
||||
}else{$messages['userFailed'] = true;}
|
||||
}else{$messages['unblockFailed'] = true;}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------STYLE
|
||||
|
||||
if(isset($_POST['stylecolor'])) {
|
||||
if($_POST['stylecolor'] == 'white') {
|
||||
|
||||
$upd['style'] = $_POST['stylecolor'];
|
||||
|
||||
} elseif($_POST['stylecolor'] == 'black') {
|
||||
$upd['style'] = $_POST['stylecolor'];
|
||||
} else{
|
||||
$upd['style'] = $_POST['black'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( empty($this->email) &&
|
||||
preg_match('/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'])
|
||||
) {
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
$forum->set_email( $_SESSION['name'], $_POST['email']);
|
||||
}
|
||||
$upd['email'] = $_POST['email'];
|
||||
}
|
||||
|
||||
DB::updateRow( TABLE_USERS, array( 'id' => $this->id ), $upd );
|
||||
}
|
||||
|
||||
public function loadEmail() {
|
||||
$tmp = DB::getRow(
|
||||
'SELECT email,color,style FROM '.TABLE_USERS.' WHERE id = :1',
|
||||
$this->id
|
||||
);
|
||||
$this->email = $tmp['email'];
|
||||
$this->color = $tmp['color'];
|
||||
$this->stylecolor = $tmp['style'];
|
||||
}
|
||||
|
||||
public function logout() {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
$_SESSION = array();
|
||||
setcookie( Config::$rememberCookie, false, time() - 3600, Config::$absolutePath );
|
||||
setcookie( Config::$sessionCookie, false, time() - 3600, Config::$absolutePath );
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$forum->logout();
|
||||
}
|
||||
}
|
||||
|
||||
public function increaseScore( $amount ) {
|
||||
DB::query(
|
||||
'UPDATE '.TABLE_USERS.' SET score = score + :1 WHERE id = :2',
|
||||
intval( $amount ),
|
||||
$this->id
|
||||
);
|
||||
}
|
||||
|
||||
public function register( &$messages ) {
|
||||
|
||||
DB::query( 'DELETE FROM '.TABLE_USERS.' WHERE valid = 0 AND registered < NOW() - INTERVAL 30 MINUTE' );
|
||||
|
||||
if( !preg_match('/^\w{2,20}$/', $_POST['name']) ) {
|
||||
$messages['nameInvalid'] = true;
|
||||
} else {
|
||||
$u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE name = :1', $_POST['name'] );
|
||||
if( !empty($u) ) {
|
||||
$messages['nameInUse'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( strlen($_POST['pass']) < 6 ) {
|
||||
$messages['passToShort'] = true;
|
||||
}
|
||||
else if( $_POST['pass'] != $_POST['pass2'] ) {
|
||||
$messages['passNotEqual'] = true;
|
||||
}
|
||||
|
||||
if( !preg_match( '/^[\.\w\-]{1,}@[\.\w\-]{2,}\.[\w]{2,}$/', $_POST['email'] ) ) {
|
||||
$messages['wrongEmail'] = true;
|
||||
} else {
|
||||
$u = DB::getRow( 'SELECT * FROM '.TABLE_USERS.' WHERE email = :1', $_POST['email'] );
|
||||
if( !empty($u) ) {
|
||||
$messages['emailInUse'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( !empty($messages) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->validationString = md5(uniqid(rand()));
|
||||
|
||||
DB::insertRow( TABLE_USERS, array(
|
||||
'registered' => date('Y-m-d H:i:s'),
|
||||
'name' => $_POST['name'],
|
||||
'pass' => md5($_POST['pass']),
|
||||
'valid' => 0,
|
||||
'score' => 0,
|
||||
'images' => 0,
|
||||
'website' => '',
|
||||
'avatar' => Config::$images['avatarsPath'].'default.png',
|
||||
'remember' => $this->validationString,
|
||||
'admin' => 0,
|
||||
'email' => $_POST['email'],
|
||||
'color' => '0',
|
||||
'style' => '"black"'
|
||||
));
|
||||
|
||||
if( Config::$vbbIntegration['enabled'] ) {
|
||||
global $vbulletin;
|
||||
$forum = new ForumOps($vbulletin);
|
||||
$user['name'] = $_POST['name'];
|
||||
$user['pass'] = $_POST['pass'];
|
||||
$user['email'] = $_POST['email'];
|
||||
echo $forum->register_newuser($user, false);
|
||||
}
|
||||
|
||||
$mail = file_get_contents( Config::$templates.'registrationmail.txt' );
|
||||
preg_match( '/From: (?<from>.*?)\r?\nSubject: (?<subject>.*?)\r?\n\r?\n(?<text>.*)/sim', $mail, $mail );
|
||||
$mail['text'] = str_replace( '%validationString%', $this->validationString, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%siteName%', Config::$siteName, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%frontendPath%', Config::$frontendPath, $mail['text'] );
|
||||
$mail['text'] = str_replace( '%userName%', $_POST['name'], $mail['text'] );
|
||||
|
||||
$mail['subject'] = str_replace( '%siteName%', Config::$siteName, $mail['subject'] );
|
||||
$mail['subject'] = str_replace( '%userName%', $_POST['name'], $mail['subject'] );
|
||||
|
||||
mail( $_POST['email'], $mail['subject'], $mail['text'], 'FROM: '.$mail['from'] );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,256 @@
|
||||
<?php include( $templates.'header.tpl.php' );
|
||||
|
||||
$csi = "";
|
||||
if ($iv->image["color"] != "000000"){
|
||||
$csi = 'style="color:#'.$iv->image["color"].'"';
|
||||
}
|
||||
|
||||
//if (!$user->id){
|
||||
// echo('<div class="warn" style="text-align:center"> Only registered users can see images! Register now. </div>');
|
||||
// include( $templates.'footer.tpl.php' );
|
||||
// exit();
|
||||
// }
|
||||
|
||||
//DB::query("UPDATE `pl_images` SET `views` = views + '1' WHERE id=:1",$iv->image['id']);
|
||||
// $bild = DB::getRow("SELECT views as views,source as source FROM pl_images WHERE id=:1",$iv->image['id']);
|
||||
|
||||
// $comment = DB::getRow("SELECT COUNT(*) as count FROM pl_comments WHERE imageId=:1",$iv->image['id']);
|
||||
|
||||
$comment_open = DB::getRow("SELECT comment as open FROM pl_images WHERE id=:1",$iv->image['id']);
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="/js/lightbox.js"></script>
|
||||
|
||||
<h1> » Viewing
|
||||
<?php if( !empty($iv->user) ) { ?>
|
||||
User: <a href="<?php echo Config::$absolutePath.'user/'.$iv->user['name']; ?>"><?php echo $iv->user['name']; ?></a>
|
||||
<?php } else if( !empty($iv->channel) ) { ?>
|
||||
Channel: <a href="<?php echo Config::$absolutePath.'channel/'.$iv->channel['keyword']; ?>"><?php echo $iv->channel['name']; ?></a>
|
||||
<?php } else { ?>
|
||||
: <?php echo $pname ?>, uploaded <?php echo $iv->howlong($iv->image['loggedTS'],time());} ?> (<?php echo date('d. M Y H:i',$iv->image['loggedTS']); ?>)
|
||||
</h1>
|
||||
|
||||
<div id="viewer">
|
||||
<?php if( isset($iv->stream['prev']) ) { ?>
|
||||
<a href="<?php echo Config::$absolutePath.$iv->basePath.'view/'.$iv->stream['prev']; ?>" class="prev" id="prevBar" title="Previous">Previous</a>
|
||||
<?php } else { ?>
|
||||
<div class="noPrev" id="prevBar">Previous</div>
|
||||
<?php } ?>
|
||||
<?php if( isset($iv->stream['next']) ) { ?>
|
||||
<a href="<?php echo Config::$absolutePath.$iv->basePath.'view/'.$iv->stream['next']; ?>" class="next" id="nextBar" title="Next">Next</a>
|
||||
<?php } else { ?>
|
||||
<div class="noNext" id="nextBar">Next</div>
|
||||
<?php } ?>
|
||||
|
||||
<div id="imageContainer">
|
||||
<?php if ($user->id){?>
|
||||
<img class="scaled" id="image" onclick="swap(this, 'scaled', 'full')" src="<?php echo Config::$absolutePath.Config::$images['imagePath'].$iv->image['path']; ?>" alt="<?php echo $pname ?>"/>
|
||||
<?php }else{?>
|
||||
<a href="/register"><img id="image" src="/images/gate.png" alt="register"/></a><br />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="imageInfo">
|
||||
|
||||
<div class="userInfo">
|
||||
<img class="avatar" width="50" height="50" alt="Avatar" src="<?php echo Config::$absolutePath.$iv->userInfo['avatar']; ?>"/>
|
||||
|
||||
<?php if ($user->id){?>
|
||||
<a onmouseover="img1.src='/media/duck.png';" onmouseout="img1.src='/media/ducksw.png';" style="font-size: 45px; float:right;margin-top:-9px;" href="javascript:;" onclick="LoadData('fav','FavDiv',<?php echo $iv->image['id']; ?>)"><img name=img1 src="/media/ducksw.png" alt="fav" height="64px" width="64px"/></a>
|
||||
<?php } ?>
|
||||
|
||||
<div class="name"><strong><a title="<?php echo('ID: '.$iv->userInfo['id'].' | Images: '.$iv->userInfo['images']); ?>" <?php echo($csi);?> href="<?php echo Config::$absolutePath.'user/'.$iv->userInfo['name']; ?>"><?php echo $iv->userInfo['name']; ?></a> </strong>
|
||||
|
||||
<?php
|
||||
if ($iv->userInfo['id'] == 180) {echo "ϟϟ xxx Stellvertreter";}
|
||||
elseif ($iv->userInfo['id'] == 191) {echo "aka. katzenschnupfen :3";}
|
||||
elseif ($iv->userInfo['id'] == 807) {echo "Beliebteste Neuente";}
|
||||
elseif ($iv->userInfo['id'] == 29) {echo "RGR";}
|
||||
elseif ($iv->userInfo['id'] == 74) {echo "ϟϟ Arschfodse";}
|
||||
elseif ($iv->userInfo['id'] == 238) {echo "Musikente";}
|
||||
elseif ($iv->userInfo['id'] == 297) {echo "DarkPsyPolizei";}
|
||||
elseif ($iv->userInfo['id'] == 75) {echo "DJ";}
|
||||
elseif ($iv->userInfo['id'] == 12) {echo "König der ✡ und ewiger Mod";}
|
||||
elseif ($iv->userInfo['id'] > 250) {echo "☪";}
|
||||
elseif ($iv->userInfo['id'] < 89) {echo "ϟϟ";}
|
||||
elseif ($iv->userInfo['id'] > 89) {echo "✡";}
|
||||
|
||||
else {echo "☭";} ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ($user->id){ ?>
|
||||
<div class="info"><a class="smalllink" href="javascript:;" onclick="javascript:toggle('MessageForm');">message</a> | <a href="#CommentForm">comment</a> | <?php }else{ ?> <div class="info"><?php }?><a class="smalllink" href="javascript:;" onclick="javascript:toggle('ShareForm');">share</a> | <a target="_blank" href="https://www.google.com/searchbyimage?hl=en&safe=off&site=search&image_url=http://www.4ducky.com<?php echo Config::$absolutePath.Config::$images['imagePath'].$iv->image['path']; ?>">search</a> | <a target="_blank" href="http://imgops.com/http://www.4ducky.com<?php echo Config::$absolutePath.Config::$images['imagePath'].$iv->image['path']; ?>">edit</a> | <a href="javascript:;" onclick="javascript:toggle('AbuseForm');">abuse</a></div>
|
||||
|
||||
<?php if($user->admin) { ?>
|
||||
<div class="info" style="font-size: 14px; border:dotted 1px #666;float:left;padding:1px; margin-top:8px;">Score: <?php echo $iv->image["score"]; ?> |
|
||||
<?php if ($user->id == "1"){ ?> <a href="javascript:;" onclick="movehof(<?php echo $iv->image['id']; ?>)">HoF</a> | <a href="javascript:;" onclick="banUser(<?php echo $iv->userInfo['id']; ?>)">Ban</a> | <?php } ?><a href="javascript:;" onclick="TimeUser(<?php echo $iv->userInfo['id']; ?>)">TimeBlock User</a> | <a href="javascript:;" onclick="CloseThread(<?php echo $iv->image['id']; ?>)">Close Thread</a> | <a href="javascript:;" onclick="del(<?php echo $iv->image['id']; ?>)">Delete Pic</a></div></div>
|
||||
<br/>
|
||||
<!-- <div id="imgscore" class="score"><div><?php echo $iv->image["score"]; ?>%</div>
|
||||
<span style="width: <?php echo $iv->image["score"]; ?>%"></span></div> -->
|
||||
<?php } ?>
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
|
||||
<div id="AbuseForm" style="display: none">
|
||||
<div class="comment">
|
||||
|
||||
<form action="<?php echo Config::$absolutePath; ?>abuse" method="post">
|
||||
<dl class="form">
|
||||
<dt>Reason:</dt>
|
||||
<dd>
|
||||
<input type="text" name="rsn" value=""/>
|
||||
</dd>
|
||||
<dt>Email:</dt>
|
||||
<dd>
|
||||
<input type="text" name="mail" value="" />
|
||||
</dd>
|
||||
<dt> </dt>
|
||||
<dd>
|
||||
<input type="submit" class="submit" name="abuse" value="Send" />
|
||||
<input type="hidden" name="image" value="<?php echo $iv->image["id"]; ?>"/>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="FavDiv" class="comment" style="display:none"> </div>
|
||||
|
||||
|
||||
<div id="MessageForm" style="display:none">
|
||||
<div class="comment">
|
||||
|
||||
Send:
|
||||
<form method="post" class="addComment" action="<?php echo Config::$absolutePath.'inbox/'.$iv->userInfo['name']; ?>">
|
||||
<div>
|
||||
<input name="title" rows="1" cols="10"></input><br />
|
||||
<textarea name="content" rows="3" cols="40"></textarea><br />
|
||||
<input class="submit" type="submit" name="addComment" value="Submit"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ShareForm" style="display:none">
|
||||
<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4ffb39056048380d"></script>
|
||||
<div class="comment">
|
||||
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" style="filter:alpha(opacity=50); -moz-opacity: 0.50; opacity: 0.50; float: right;">
|
||||
<a class="addthis_button_preferred_1"></a>
|
||||
<a class="addthis_button_preferred_2"></a>
|
||||
<a class="addthis_button_preferred_3"></a>
|
||||
<a class="addthis_button_preferred_4"></a>
|
||||
<a class="addthis_button_compact"></a>
|
||||
</div><br/>
|
||||
Link:<br/> <input type="text" readonly="1" value="<?php echo Config::$frontendPath.'all/view/'.$iv->image['keyword']; ?>" style="width: 400px; font-size:10px" onclick="this.focus();this.select();"/>
|
||||
<br />
|
||||
Forum-Code: <input type="text" readonly="1" value="[URL=<?php echo Config::$frontendPath ?>][IMG]<?php echo Config::$frontendPath.Config::$images['imagePath'].$iv->image['path']; ?>[/IMG][/URL]" style="width: 400px; font-size:10px" onclick="this.focus();this.select();"/>
|
||||
<br />
|
||||
HTML-Code: <input type="text" readonly="1" value="<a target='_blank' href='<?php echo Config::$frontendPath ?>'><img alt='4ducky.com' src='<?php echo Config::$frontendPath.Config::$images['imagePath'].$iv->image['path']; ?>'/></a>" style="width: 400px; font-size:10px" onclick="this.focus();this.select();"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="comments">
|
||||
|
||||
<div id="cmts">
|
||||
<noscript>
|
||||
<div class="noscr">Please enable Javascript.</div>
|
||||
</noscript>
|
||||
<?php
|
||||
if ($user->stylecolor == "white") {?>
|
||||
<div align="center">
|
||||
<img src="/media/load.gif" />
|
||||
</div>
|
||||
<?php }else{ ?>
|
||||
<div align="center">
|
||||
<img src="/media/load_b.gif" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if( $user->id && $comment_open[open] == 0 ) { ?>
|
||||
<div class="comment">
|
||||
<noscript>
|
||||
<div class="noscr">Please enable Javascript.</div>
|
||||
</noscript>
|
||||
<div class="noscr" id="CommentError" style="display:none"></div>
|
||||
|
||||
<form method="post" class="addComment" id="CommentForm" enctype="multipart/form-data" action="<?php echo Config::$absolutePath.$iv->basePath.'view/'.$iv->image['keyword']; ?>">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
|
||||
<?php
|
||||
$spaming = $user->isSpamming();
|
||||
if (is_numeric($spaming)){
|
||||
echo '<div class="comment">';
|
||||
$blockreason = DB::getRow("SELECT * FROM pl_users WHERE id=:1",$user->id);
|
||||
echo 'Upload gesperrt bis: '.date('Y-m-d H:i:s',(int)$blockreason["time"]);
|
||||
echo '<br>Grund: '.$blockreason["spam_reason"];
|
||||
$left = ((int)$blockreason["time"] - (int)time())/60;
|
||||
echo '<br>Noch: '.round($left,2).' Minuten ';
|
||||
echo "</div>";
|
||||
}elseif( $user->isSpamming() ){
|
||||
echo '<div class="comment">';
|
||||
echo "Spamblocked";
|
||||
echo "</div>";
|
||||
}else{
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<td width="40" valign="top"><img class="avatarSmall" width="32" height="32" src="<?php echo Config::$absolutePath.$infos['avatar']; ?>"/></td>
|
||||
|
||||
<td valign="top" >
|
||||
» BB-Codes: <a class="quote" href="javascript:;" onclick="BBcode('img');">[img]</a> <a class="quote" href="javascript:;" onclick="BBcode('link');">[link]</a> <a class="quote" href="javascript:;" onclick="BBcode('spoiler');">[spoiler]</a> <a class="quote" href="javascript:;" onclick="BBcode('youtube');">[youtube]</a>
|
||||
|
||||
<div id="ImgFile" style="display:none">
|
||||
<input type="file" id="image_comment" name="image_comment" value="" style="color: #000; background-color: #fff; border:1px solid #bdc7d8;"/>
|
||||
<input type="text" id="url_comment" name="url_comment" value="http//URL Upload" />
|
||||
</div>
|
||||
<textarea name="content" id="content_comment" rows="6" cols="53"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input id="SubBut" class="submit" type="button" name="addComment" value="Submit Comment" onclick="SubmitComment(<?php echo $iv->image["id"]; ?>);"/>
|
||||
<div style="text-align:center;display:none" id="SubLoad">
|
||||
<?php if ($user->stylecolor == "white") {?>
|
||||
<div align="center">
|
||||
<img src="/media/load.gif" />
|
||||
</div>
|
||||
<?php }else{ ?>
|
||||
<div align="center">
|
||||
<img src="/media/load_b.gif" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</table>
|
||||
<div> </div>
|
||||
</form>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="comment">
|
||||
<?php
|
||||
if($comment_open[open] == 0){
|
||||
echo "Register to comment...";
|
||||
}
|
||||
else{
|
||||
echo "Comments are closed!";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
ieAdjustHeight(0);
|
||||
</script>
|
||||
</div></div></div>
|
||||
<?php include( $templates.'footer.tpl.php' ); ?>
|
||||
Reference in New Issue
Block a user