7 if (!empty(
$_POST[
'migrate-sigs'])) {
8 if (!isset(
$_POST[
'confirmation']) || strtolower(
$_POST[
'confirmation']) !==
'yes') {
9 echo 'Invalid confirmation code.';
12 $PHORUM[
'mod_htmlpurifier'][
'migrate-sigs'] =
true;
13 phorum_db_update_settings(
array(
"mod_htmlpurifier"=>$PHORUM[
"mod_htmlpurifier"]));
15 } elseif (!empty(
$_GET[
'migrate-sigs']) && $PHORUM[
'mod_htmlpurifier'][
'migrate-sigs']) {
16 $offset = (int)
$_GET[
'migrate-sigs'];
30 $increment = $PHORUM[
'mod_htmlpurifier'][
'migrate-sigs-increment'];
32 require_once(dirname(__FILE__) .
'/../migrate.php');
35 $end = $offset + $increment;
37 for ($i = $offset; $i < $end; $i++) {
40 $userinfos = phorum_db_user_get_fields($user_ids,
'signature');
41 foreach ($userinfos as $i => $user) {
42 if (empty($user[
'signature']))
continue;
43 $sig = $user[
'signature'];
45 $sig = str_replace(
array(
"&",
"<",
">"),
array(
"&",
"<",
">"), $sig);
46 $sig = preg_replace(
"/<((http|https|ftp):\/\/[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%]+?)>/i",
"$1", $sig);
48 $fake_data =
array(
array(
"author"=>
"",
"email"=>
"",
"subject"=>
"",
'body' => $sig));
50 $user[
'signature'] = $fake_message[
'body'];
51 if (!phorum_api_user_save($user)) {
52 exit(
'Error while saving user data');
58 $type = $PHORUM[
'DBCONFIG'][
'type'];
59 $sql =
"select MAX(user_id) from {$PHORUM['user_table']}";
60 $row = phorum_db_interact(DB_RETURN_ROW, $sql);
61 $top_id = (int)
$row[0];
63 $offset += $increment;
64 if ($offset > $top_id) {
65 echo 'Migration finished';
66 $PHORUM[
'mod_htmlpurifier'][
'migrate-sigs'] =
false;
71 $uri = rtrim(dirname(
$_SERVER[
'PHP_SELF']),
'/\\');
72 $extra =
'admin.php?module=modsettings&mod=htmlpurifier&migrate-sigs=' . $offset;
74 header(
"Location: http://$host$uri/$extra");
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
phorum_htmlpurifier_migrate_sigs_check()
phorum_htmlpurifier_migrate($data)
'format' hook style function that will be called to convert legacy markup into HTML.
$PHORUM['mod_htmlpurifier']['directives']
Add a drawing to the header
Create styles array
The data for the language used.
phorum_htmlpurifier_migrate_sigs($offset)
phorum_htmlpurifier_commit_settings()