Skip to content

Commit e97bdaa

Browse files
author
Savetheinternet
committed
custom tripcodes
1 parent c9c0e67 commit e97bdaa

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

inc/config.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
'flood_filters' => Array(),
2525
'wordfilters' => Array(),
2626
'custom_capcode' => Array(),
27+
'custom_tripcode' => Array(),
2728
'dnsbl' => Array()
2829
);
2930
// Database stuff
@@ -477,6 +478,12 @@
477478
// 'color:red;font-weight:bold' // Change tripcode style; optional
478479
//);
479480

481+
482+
// Custom tripcodes. The below example makes a tripcode
483+
// of "#test123" evaluate to "!HelloWorld"
484+
// $config['custom_tripcode']['#test123'] = '!HelloWorld';
485+
// $config['custom_tripcode']['##securetrip'] = '!!somethingelse';
486+
480487
// Spam filter
481488
$config['spam']['hidden_inputs_min'] = 4;
482489
$config['spam']['hidden_inputs_max'] = 12;

inc/functions.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,10 +1423,16 @@ function generate_tripcode($name, $length = 10){
14231423
$salt = strtr ( $salt, ':;<=>?@[\]^_`', 'ABCDEFGabcdef' );
14241424
if ( isset ( $t[2] ) ) {
14251425
// secure
1426-
$trip = '!!' . substr ( crypt ( $trip, $config['secure_trip_salt'] ), ( -1 * $length ) );
1426+
if(isset($config['custom_tripcode']["##{$trip}"]))
1427+
$trip = $config['custom_tripcode']["##{$trip}"];
1428+
else
1429+
$trip = '!!' . substr ( crypt ( $trip, $config['secure_trip_salt'] ), ( -1 * $length ) );
14271430
} else {
14281431
// insecure
1429-
$trip = '!' . substr ( crypt ( $trip, $salt ), ( -1 * $length ) );
1432+
if(isset($config['custom_tripcode']["#{$trip}"]))
1433+
$trip = $config['custom_tripcode']["#{$trip}"];
1434+
else
1435+
$trip = '!' . substr ( crypt ( $trip, $salt ), ( -1 * $length ) );
14301436
}
14311437
}
14321438
if ( isset ( $trip ) ) {

0 commit comments

Comments
 (0)