-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile-modify.xml
111 lines (97 loc) · 3.04 KB
/
profile-modify.xml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>JovanT:ultimate_profile</id>
<version>0.9.1</version>
<file name="$sourcedir/Profile-Modify.php">
<operation>
<search position="after"><![CDATA[
// Recursive function to retrieve avatar files
]]></search>
<add><![CDATA[
function customized($memID)
{
global $context, $modSettings, $sourcedir, $smcFunc, $func, $txt;
// Filter bad HTML...
require_once $sourcedir . '/HtmLawed.php';
/*
See http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/htmLawed_README.htm for more information.
*/
$config_filter = array(
'safe'=> 1,
'elements' => '*+embed+object+style-form-textarea-input-button'
);
// HTML&CSS customization field
$request = $smcFunc['db_query']('', '
SELECT value
FROM {db_prefix}themes
WHERE id_member = {int:id_member}
AND variable = "css"',
array(
'id_member' => $memID,
)
);
list($old_html) = $smcFunc['db_fetch_row']($request);
$html = substr(htmLawed(un_htmlspecialchars($old_html), $config_filter), 0, 65533);
$smcFunc['db_query']('', '
UPDATE {db_prefix}themes SET
value = {string:html}
WHERE id_member = {int:id_member}
AND variable = "css"',
array(
'html' => addslashes(htmlspecialchars($html)),
'id_member' => $memID,
)
);
// MediaBox field
$request = $smcFunc['db_query']('', '
SELECT value
FROM {db_prefix}themes
WHERE id_member = {int:id_member}
AND variable = "media"',
array(
'id_member' => $memID,
)
);
list($old_html) = $smcFunc['db_fetch_row']($request);
$html = substr(htmLawed(un_htmlspecialchars($old_html), $config_filter), 0, 65533);
$smcFunc['db_query']('', '
UPDATE {db_prefix}themes SET
value = {string:html}
WHERE id_member = {int:id_member}
AND variable = "media"',
array(
'html' => addslashes(htmlspecialchars($html)),
'id_member' => $memID,
)
);
loadLanguage('UltimateProfile');
$context['sub_template'] = 'customized';
$context['page_desc'] = $txt['profile_customized'];
}
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[global $txt, $scripturl, $modSettings;
global $context, $user_profile, $memberContext, $smcFunc;
// For making changes!
$buddiesArray = explode(',', $user_profile[$memID]['buddy_list']);]]></search>
<add><![CDATA[/*
**** Sorry devs, we should comment your codes :/ ****
global $txt, $scripturl, $modSettings;
global $context, $user_profile, $memberContext, $smcFunc;
// For making changes!
$buddiesArray = explode(',', $user_profile[$memID]['buddy_list']);]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[$context['buddies'][$buddy] = $memberContext[$buddy];
}]]></search>
<add><![CDATA[$context['buddies'][$buddy] = $memberContext[$buddy];
}
*/
global $sourcedir;
require_once($sourcedir . '/Buddies.php');
BuddiesMain();]]></add>
</operation>
</file>
</modification>