Skip to content

Commit

Permalink
* I hate SMF's default colors for admin and global moderator groups. …
Browse files Browse the repository at this point in the history
…It may work if it's only used on the group color. But Wedge also uses these colors to show usernames everywhere, and it's just plain AWFUL, so I'm adding some code which will hopefully work on the first try, to replace them with the default Wedge colors. (smf2_to_wedge.xml, smf2RC_to_wedge.xml)

* Commenazi. (import.php)

Signed-off-by: Nao <nao@wedge>
  • Loading branch information
Nao committed Feb 27, 2014
1 parent bf6dbf2 commit 19cd1ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 2 additions & 4 deletions import.php
Expand Up @@ -2054,7 +2054,7 @@ public static function fix($text)
$buf = mb_decode_numericentity($buf, array(0x80, 0x2ffff, 0, 0xffff), 'UTF-8');
else
{
// Take care of html entities..
// Take care of HTML entities
$entity_replace = create_function('$num', '
return $num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) ? \'\' :
($num < 0x80 ? \'&#\' . $num . \';\' : ($num < 0x800 ? chr(192 | $num >> 6) . chr(128 | $num & 63) :
Expand All @@ -2065,7 +2065,7 @@ public static function fix($text)
$buf = preg_replace('~(&#x(\d{1,7}|x[0-9a-fA-F]{1,6});)~e', '$entity_replace(0x\\2)', $buf);
}

// surprise, surprise... the string
// Surprise, surprise... The string.
return $buf;
}
}
Expand Down Expand Up @@ -2945,5 +2945,3 @@ public function extend($data, $name = 'wedge_importer_cookie')
return true;
}
}

?>
9 changes: 9 additions & 0 deletions smf2RC_to_wedge.xml
Expand Up @@ -525,6 +525,15 @@
<options>
<replace>true</replace>
</options>
<preparsecode>
if (!empty($row['online_color']))
{
if ($row['online_color'] == '#FF0000') // admin's shiny red?
$row['online_color'] = '#d2653a'; // subdued red is better.
if ($row['online_color'] == '#0000FF') // global mod's bright blue?
$row['online_color'] = '#c18933'; // light brown is better.
}
</preparsecode>
<query>
SELECT
id_group, group_name, description, online_color, min_posts,
Expand Down
9 changes: 9 additions & 0 deletions smf2_to_wedge.xml
Expand Up @@ -525,6 +525,15 @@
<options>
<replace>true</replace>
</options>
<preparsecode>
if (!empty($row['online_color']))
{
if ($row['online_color'] == '#FF0000') // admin's shiny red?
$row['online_color'] = '#d2653a'; // subdued red is better.
if ($row['online_color'] == '#0000FF') // global mod's bright blue?
$row['online_color'] = '#c18933'; // light brown is better.
}
</preparsecode>
<query>
SELECT
id_group, group_name, description, online_color, min_posts,
Expand Down

0 comments on commit 19cd1ad

Please sign in to comment.