Skip to content

Commit d8765f3

Browse files
committed
problems solved
1 parent 781d043 commit d8765f3

File tree

7 files changed

+191
-197
lines changed

7 files changed

+191
-197
lines changed

about.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
$template .= "<p>Developer: en0ndev</p>";
2929
$template .= "<a class='link' target='_blank' href='https://www.youtube.com/channel/UC3CSOAThanO-LvYKFwJ24RQ'>My YouTube Channel</a></div>";
3030

31-
use cpa__template\cpa__page__template;
32-
3331
$page = new cpa__page__template;
3432

3533
$page->cpa__get__template("About", $template, 0);

assets/js/modules.js

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
1-
/**
2-
** File: modules.js
3-
** Version: 1.0
4-
** Author: en0ndev
5-
This file is part of Custom Profile Avatar.
6-
7-
Custom Profile Avatar is free software: you can redistribute it and/or modify
8-
it under the terms of the GNU General Public License as published by
9-
the Free Software Foundation, either version 3 of the License, or
10-
(at your option) any later version.
11-
12-
Custom Profile Avatar is distributed in the hope that it will be useful,
13-
but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
GNU General Public License for more details.
16-
17-
You should have received a copy of the GNU General Public License
18-
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
19-
*/
20-
21-
jQuery(document).ready(function($) {
22-
var mediaUploader;
23-
$('#change').click(function(e) {
24-
e.preventDefault();
25-
// If the uploader object has already been created, reopen the dialog
26-
if (mediaUploader) {
27-
mediaUploader.open();
28-
return;
29-
}
30-
// Extend the wp.media object
31-
mediaUploader = wp.media.frames.file_frame = wp.media({
32-
title: 'Choose Your Custom Profile Avatar',
33-
button: {
34-
text: 'Choose'
35-
},
36-
multiple: false,
37-
library: {
38-
type: ['image']
39-
},
40-
});
41-
// When a file is selected, grab the URL and set it as the text field's value
42-
mediaUploader.on('select', function() {
43-
attachment = mediaUploader.state().get('selection').first().toJSON();
44-
$('.user__avatar > .avatar').attr('src', attachment.url);
45-
$('input[name="avatar__val"]').attr('value', attachment.url);
46-
if (!$('.user__avatar').children().hasClass('remove')) { $('.user__avatar > .avatar').after('<div class="remove"></div>') };
47-
});
48-
// Open the uploader dialog
49-
mediaUploader.open();
50-
});
51-
$(document).on('click', '.remove', function() {
52-
var pull = $('#pull > img').attr('src');
53-
$('.user__avatar .avatar').attr('src', pull);
54-
$('input[name="avatar__val"]').removeAttr('value');
55-
$(this).remove();
56-
});
1+
/**
2+
** File: modules.js
3+
** Version: 1.0
4+
** Author: en0ndev
5+
This file is part of Custom Profile Avatar.
6+
7+
Custom Profile Avatar is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation, either version 3 of the License, or
10+
(at your option) any later version.
11+
12+
Custom Profile Avatar is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU General Public License for more details.
16+
17+
You should have received a copy of the GNU General Public License
18+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
19+
*/
20+
21+
jQuery(document).ready(function($) {
22+
var mediaUploader;
23+
$('#change').click(function(e) {
24+
e.preventDefault();
25+
// If the uploader object has already been created, reopen the dialog
26+
if (mediaUploader) {
27+
mediaUploader.open();
28+
return;
29+
}
30+
// Extend the wp.media object
31+
mediaUploader = wp.media.frames.file_frame = wp.media({
32+
title: 'Choose Your Custom Profile Avatar',
33+
button: {
34+
text: 'Choose'
35+
},
36+
multiple: false,
37+
library: {
38+
type: ['image']
39+
},
40+
});
41+
// When a file is selected, grab the URL and set it as the text field's value
42+
mediaUploader.on('select', function() {
43+
attachment = mediaUploader.state().get('selection').first().toJSON();
44+
$('.user__avatar > .avatar').attr('src', attachment.url);
45+
$('input[name="avatar__val"]').attr('value', attachment.url);
46+
if (!$('.user__avatar').children().hasClass('remove')) { $('.user__avatar > .avatar').after('<div class="remove"></div>') };
47+
});
48+
// Open the uploader dialog
49+
mediaUploader.open();
50+
});
51+
$(document).on('click', '.remove', function() {
52+
var pull = $('#pull > img').attr('src');
53+
$('.user__avatar .avatar').attr('src', pull);
54+
$('input[name="avatar__val"]').removeAttr('value');
55+
$(this).remove();
56+
});
5757
});

main.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
$template .= "<input id='change' type='button' value='" . esc_html__("Change Avatar") . "' /></div>";
2929
$template .= "<input id='save' type='submit' name='cpa__save__avatar' value='" . esc_html__("Save") . "' />";
3030

31-
use cpa__template\cpa__page__template;
32-
3331
$page = new cpa__page__template;
3432

3533
$page->cpa__get__template("Settings", $template, 1);

modules/admin_footer.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
<?php
2-
3-
/**
4-
** admin_footer.php
5-
** @version 1.0
6-
** @author en0ndev
7-
*/
8-
/*
9-
This file is part of Custom Profile Avatar.
10-
11-
Custom Profile Avatar is free software: you can redistribute it and/or modify
12-
it under the terms of the GNU General Public License as published by
13-
the Free Software Foundation, either version 3 of the License, or
14-
(at your option) any later version.
15-
16-
Custom Profile Avatar is distributed in the hope that it will be useful,
17-
but WITHOUT ANY WARRANTY; without even the implied warranty of
18-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19-
GNU General Public License for more details.
20-
21-
You should have received a copy of the GNU General Public License
22-
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
23-
*/
24-
defined('ABSPATH') || exit; // Exit if accessed directly
25-
26-
function cpa__admin__footer($text)
27-
{
28-
29-
$get_url = $_SERVER['QUERY_STRING'];
30-
31-
$keys = 'custom_profile_avatar';
32-
33-
if (strpos($get_url, $keys) == true) {
34-
35-
$text = '<span id="author__by"><a>Developed by </a><a class="bold" href="https://github.com/en0ndev" target="_blank">en0ndev</a></span>';
36-
}
37-
38-
return $text;
39-
}
40-
41-
add_filter('admin_footer_text', 'cpa__admin__footer');
1+
<?php
2+
3+
/**
4+
** admin_footer.php
5+
** @version 1.0
6+
** @author en0ndev
7+
*/
8+
/*
9+
This file is part of Custom Profile Avatar.
10+
11+
Custom Profile Avatar is free software: you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation, either version 3 of the License, or
14+
(at your option) any later version.
15+
16+
Custom Profile Avatar is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
23+
*/
24+
defined('ABSPATH') || exit; // Exit if accessed directly
25+
26+
function cpa__admin__footer($text)
27+
{
28+
29+
$get_url = $_SERVER['QUERY_STRING'];
30+
31+
$keys = 'custom_profile_avatar';
32+
33+
if (strpos($get_url, $keys) == true) {
34+
35+
$text = '<span id="author__by"><a>Developed by </a><a class="bold" href="https://github.com/en0ndev" target="_blank">en0ndev</a></span>';
36+
}
37+
38+
return $text;
39+
}
40+
41+
add_filter('admin_footer_text', 'cpa__admin__footer');

modules/admin_menu_join.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
<?php
2-
3-
/**
4-
** admin_menu_join.php
5-
** @version 1.0
6-
** @author en0ndev
7-
*/
8-
/*
9-
This file is part of Custom Profile Avatar.
10-
11-
Custom Profile Avatar is free software: you can redistribute it and/or modify
12-
it under the terms of the GNU General Public License as published by
13-
the Free Software Foundation, either version 3 of the License, or
14-
(at your option) any later version.
15-
16-
Custom Profile Avatar is distributed in the hope that it will be useful,
17-
but WITHOUT ANY WARRANTY; without even the implied warranty of
18-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19-
GNU General Public License for more details.
20-
21-
You should have received a copy of the GNU General Public License
22-
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
23-
*/
24-
defined('ABSPATH') || exit; // Exit if accessed directly
25-
26-
function cpa__main__settings()
27-
{
28-
include_once(__DIR__ . '/../main.php');
29-
include_once(__DIR__ . '/change_avatar.php');
30-
}
31-
function cpa__about__author()
32-
{
33-
include_once(__DIR__ . '/../about.php');
34-
}
1+
<?php
2+
3+
/**
4+
** admin_menu_join.php
5+
** @version 1.0
6+
** @author en0ndev
7+
*/
8+
/*
9+
This file is part of Custom Profile Avatar.
10+
11+
Custom Profile Avatar is free software: you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation, either version 3 of the License, or
14+
(at your option) any later version.
15+
16+
Custom Profile Avatar is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with Custom Profile Avatar. If not, see <https://www.gnu.org/licenses/>.
23+
*/
24+
defined('ABSPATH') || exit; // Exit if accessed directly
25+
26+
function cpa__main__settings()
27+
{
28+
include_once(__DIR__ . '/../main.php');
29+
include_once(__DIR__ . '/change_avatar.php');
30+
}
31+
function cpa__about__author()
32+
{
33+
include_once(__DIR__ . '/../about.php');
34+
}

0 commit comments

Comments
 (0)