summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-05-25 16:21:36 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-05-25 16:21:36 +1000
commite97bdaac2141df18552451ca93b656726cd69cb5 (patch)
treee0966ffe4d96fc6456dd9bf7ae08bd141b6e3d6f
parentc9c0e675f3ce586ee207a5f60ab5a21e38ac08ad (diff)
custom tripcodes
-rw-r--r--inc/config.php7
-rw-r--r--inc/functions.php10
2 files changed, 15 insertions, 2 deletions
diff --git a/inc/config.php b/inc/config.php
index 38d865c0..ac3996d8 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -24,6 +24,7 @@
'flood_filters' => Array(),
'wordfilters' => Array(),
'custom_capcode' => Array(),
+ 'custom_tripcode' => Array(),
'dnsbl' => Array()
);
// Database stuff
@@ -477,6 +478,12 @@
// 'color:red;font-weight:bold' // Change tripcode style; optional
//);
+
+ // Custom tripcodes. The below example makes a tripcode
+ // of "#test123" evaluate to "!HelloWorld"
+ // $config['custom_tripcode']['#test123'] = '!HelloWorld';
+ // $config['custom_tripcode']['##securetrip'] = '!!somethingelse';
+
// Spam filter
$config['spam']['hidden_inputs_min'] = 4;
$config['spam']['hidden_inputs_max'] = 12;
diff --git a/inc/functions.php b/inc/functions.php
index 35a88aec..bb729857 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1423,10 +1423,16 @@
$salt = strtr ( $salt, ':;<=>?@[\]^_`', 'ABCDEFGabcdef' );
if ( isset ( $t[2] ) ) {
// secure
- $trip = '!!' . substr ( crypt ( $trip, $config['secure_trip_salt'] ), ( -1 * $length ) );
+ if(isset($config['custom_tripcode']["##{$trip}"]))
+ $trip = $config['custom_tripcode']["##{$trip}"];
+ else
+ $trip = '!!' . substr ( crypt ( $trip, $config['secure_trip_salt'] ), ( -1 * $length ) );
} else {
// insecure
- $trip = '!' . substr ( crypt ( $trip, $salt ), ( -1 * $length ) );
+ if(isset($config['custom_tripcode']["#{$trip}"]))
+ $trip = $config['custom_tripcode']["#{$trip}"];
+ else
+ $trip = '!' . substr ( crypt ( $trip, $salt ), ( -1 * $length ) );
}
}
if ( isset ( $trip ) ) {