( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
$mag = $_GET["mag"];
$VideoPath = "uploads/live/";
$live_img = 'uploads/images/';
$msg_id2 =$msg_id;
$msg_id = $db->base64url_decode($msg_id);
if($action=="custom") { $script = "processCoke.php"; }
else { $script = "brandX.php";}
$result = $db->getstar2($msg_id);
$catalogid = $result[0]["catalogid"];
$title = $result[0]["title"];
$message = $result[0]["title"];
$viewnum = $result[0]["viewnum"];
$rating = $result[0]["rating"];
$pic = $result[0]["id"];
$pictureX = "v/uploads/gthumbs/".$result[0]["picture"];
$ratenum = $result[0]["ratenum"];
$episodeid = $result[0]["episodeid"];
$slug = $result[0]["slug"];
$keywords = $result[0]["keywords"];
$isdisplay = $result[0]["isdisplay"];
$description = $result[0]["description"];
$vcat = $result[0]["vcat"];
$summary = $result[0]["summary"];
$video = $result[0]["video"];
$description= $result[0]["description"];
$original= $result[0]["picture"];
$fxme= $result[0]["fx"];
$default2 = $user_nameX.rand(10,99);
if($isdisplay == 7)
{
$default = $description;
}
if($isdisplay == 3 || $isdisplay == 4 || $isdisplay == 5/* || $isdisplay == 7*/) {
}
else
{
header("Location: ./index.php?mode=startags&msg=Sorry+this+Startag+is+already+published+cannot+be+edited");
}
?>
<link type="text/css" href="wigshot/css/jquery.ui.theme.css" rel="stylesheet" />
<link type="text/css" href="wigshot/css/jquery.ui.core.css" rel="stylesheet" />
<link type="text/css" href="wigshot/css/jquery.ui.resizable.css" rel="stylesheet" />
<link type="text/css" href="wigshot/css/jquery.ui.slider.css" rel="stylesheet" />
<link type="text/css" href="wigshot/css/style.css" rel="stylesheet" />
<script type="text/javascript" src="wigshot/js/jquery.min.js"></script>
<script type="text/javascript" src="wigshot/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="wigshot/js/json2.js"></script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top:-20px; margin-bottom:10px" >
<tr>
<td width="100%">
<h2 id="notify2"><i class="icon-asterisk"></i> Create My Brand</h2>
<p>Drag and Drop Brand Elements below. <strong>Press Shift </strong> to Resize Proportionately </p>
</td>
<td width="100" align="right" valign="top"><a id="submit" class="btn-lg btn-warning pull-right m-t-lg">Save</a></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="10">
<tr>
<td width="600" valign="top"><div id="background" class="background">
<img id="obj_0" width="600" height="600" src="<?php echo $pictureX ?>"></img>
</div></td>
<td valign="top" width="250" height="600" style="padding-left:5px; padding-right:5px" >
<li class="list-group-item obj_item">
<h4 class="font-thin padder" id="notify">Drag & Drop Elements</h4>
</li>
<div id="objects" >
<?php $homecataresultt = $db->elements(9,$pic);
$obj = 1;
if (!empty($homecataresultt)) {
while ( list($key,$val)=each($homecataresultt) ) {
$title = stripslashes($val["title"]);
$picture = stripslashes($val["picture"]);
$msg_id = stripslashes($val["id"]);
$obj = $obj+1;
?>
<li class="list-group-item obj_item"> <span class="pull-left thumb-sm"><img class="ui-widget-content" src="taswira.php?width=600&height=600&quality=100&cropratio=1:1&image=/v/uploads/elements/<?php echo $picture; ?>" id="obj_<?php echo $obj ?>"></span>
<div class="pull-right text-muted m-t-sm"> <i class="icon-circle"></i> </div>
<div class="media-body">
<div style=" padding-left:5px"><?php echo $title ?></div>
<small class="text-muted" style=" padding-left:5px">Drag and Drop Element</small> </div> </li>
<?php }}
?>
</div>
</td>
<td valign="top" width="100%" style="padding-left:5px; padding-right:5px" ><ul class="list-group alt "><li class="list-group-item obj_item">
<h4 class="font-thin padder" id="notify">Branding Tools</h4>
</li>
</ul>
<div id="tools" style=" padding-left:3px">
</div></td>
</tr>
</table>
<form id="jsonform" action="merge.php?appno=<?php echo $appno; ?>&user=<?php echo $catalogid; ?>&pic=<?php echo $pic; ?>" method="POST">
<input id="jsondata" name="jsondata" type="hidden" value="" autocomplete="off"></input>
</form>
</div>
<script>
$(document).ready(function(id) {
var count_dropped_hits = 0;
var data = {
"images": [
{"id" : "obj_0" ,"src" : "<?php echo $pictureX ?>" ,"width" : "600", "height" : "600"}
]
};
// Array Remove - By John Resig (MIT Licensed)
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
/* remove an object from data */
$('.remove',$('#tools')).live('click',function(){
var $this = $(this);
/* the element next to this is the input that stores the obj id */
var objid = $this.next().val();
/* remove the object from the sidebar */
$this.parent().remove();
/* ,from the picture */
var divwrapper = $('#'+objid).parent().parent();
$('#'+objid).remove();
/* add again to the objects list */
var image_elem = $this.parent().find('img');
var thumb_width = image_elem.attr('width');
var thumb_height = image_elem.attr('height');
var thumb_src = image_elem.attr('src');
$('<img/>',{
id : objid,
src : thumb_src,
width : thumb_width,
//height : thumb_height,
className : 'ui-widget-content'
}).appendTo(divwrapper).resizable({
handles : 'se',
stop : resizestop
}).parent('.ui-wrapper').draggable({
revert: 'invalid'
});
/* and unregister it - delete from object data */
var index = exist_object(objid);
data.images.remove(index);
});
/* checks if an object was already registered */
function exist_object(id){
for(var i = 0;i<data.images.length;++i){
if(data.images[i].id == id)
return i;
}
return -1;
}
/* triggered when stop resizing an object */
function resizestop(event, ui) {
//calculate and change values to obj (width and height)
var $this = $(this);
var objid = $this.find('.ui-widget-content').attr('id');
var objwidth = ui.size.width;
var objheight = ui.size.height;
var index = exist_object(objid);
if(index!=-1) { //if exists (it should!) update width and height
data.images[index].width = objwidth;
data.images[index].height = objheight;
}
}
/* objects are resizable and draggable */
$('#objects img').resizable({
/* only diagonal (south east)*/
handles : 'se',
stop : resizestop
}).parent('.ui-wrapper').draggable({
revert : 'invalid'
});
$('#background').droppable({
accept : '#objects div', /* accept only draggables from #objects */
drop : function(event, ui) {
var $this = $(this);
++count_dropped_hits;
var draggable_elem = ui.draggable;
draggable_elem.css('z-index',count_dropped_hits);
/* object was dropped : register it */
var objsrc = draggable_elem.find('.ui-widget-content').attr('src');
var objwidth = parseFloat(draggable_elem.css('width'),10);
var objheight = parseFloat(draggable_elem.css('height'),10);
/* for top and left we decrease the top and left of the droppable element */
var objtop = ui.offset.top - $this.offset().top;
var objleft = ui.offset.left - $this.offset().left;
var objid = draggable_elem.find('.ui-widget-content').attr('id');
var index = exist_object(objid);
if(index!=-1) { //if exists update top and left
data.images[index].top = objtop;
data.images[index].left = objleft;
}
else{
/* register new one */
var newObject = {
'id' : objid,
'src' : objsrc,
'width' : objwidth,
'height' : objheight,
'top' : objtop,
'left' : objleft,
'rotation' : '0'
};
data.images.push(newObject);
/* add object to sidebar*/
$('<div/>',{
className : 'item'
}).append(
$('<div/>',{
className : 'thumb',
html : '<img width="50" class="ui-widget-content" src="'+objsrc+'"></img>'
})
).append(
$('<div/>',{
className : 'slider',
html : '<span>Rotate</span><span class="degrees">0</span>'
})
).append(
$('<a/>',{
className : 'remove'
})
).append(
$('<input/>',{
type : 'hidden',
value : objid // keeps track of which object is associated
})
).appendTo($('#tools'));
$('.slider').slider({
orientation : 'horizontal',
max : 180,
min : -180,
value : 0,
slide : function(event, ui) {
var $this = $(this);
/* Change the rotation and register that value in data object when it stops */
draggable_elem.css({'-moz-transform':'rotate('+ui.value+'deg)','-webkit-transform':'rotate('+ui.value+'deg)'});
$('.degrees',$this).html(ui.value);
},
stop : function(event, ui) {
newObject.rotation = ui.value;
}
});
}
}
});
/* User presses the download button */
$('#submit').bind('click',function(){
var dataString = JSON.stringify(data);
$('#jsondata').val(dataString);
$('#jsonform').submit();
});
});
</script>