forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserPhotoUploadInclude.php
45 lines (43 loc) · 1.36 KB
/
userPhotoUploadInclude.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
$finalWidth = 150;
$finalHeight = 150;
$screenWidth = 150;
$caUid = 'Photo_' . uniqid();
?>
<div class="form-group" id="<?php echo $caUid; ?>">
<?php
$croppie = getCroppie(__('Profile Photo'), 'userPhotoUpload', $finalWidth, $finalHeight, $screenWidth);
echo $croppie['html'];
?>
</div>
<button class="btn btn-success btn-block" type="button" onclick="<?php echo $croppie['getCroppieFunction']; ?>"><i class="fas fa-save"></i> <?php echo __('Save Profile Photo'); ?></button>
<?php
if ($vloObj = AVideoPlugin::getDataObjectIfEnabled('VideoLogoOverlay')) {
if ($vloObj->useUserChannelImageAsLogo) {
?>
<div class="alert alert-info"><?php echo __("This image will appear in your livestream"); ?></div>
<?php
}
}
?>
<script>
$(document).ready(function () {
<?php
echo $croppie['restartCroppie'] . "('" . User::getPhoto(0, true) . "');";
?>
});
function userPhotoUpload(image) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL'] . "objects/uploadUserPhoto.json.php"; ?>',
data: {
image: image
},
type: 'post',
success: function (response) {
avideoResponse(response);
modal.hidePleaseWait();
}
});
}
</script>