I announce that I cease all development and activity in the programming universe indefinitely. My career has reached the turning point I was not expecting for at least another year, leaving me highly off guard and without laid-out plans for this hobby's continuity. I have begun a 5-year residency program in Neurosurgery which is clearly not compatible, time-wise, with programming.
I gave in all my passion for developing, and you gave me back your loyalty and trust, even when I did not deserve that much. Now it is the time for payback. I release all my present and past work as Open Source software, in the hope some talented developer will continue maintaining and expanding my vision of a modern, sleek forum software. The intrinsic flexibility of MyBB is the true hidden gem of an otherwise outdated codebase; I do hope the project can continue and be updated complying to the latest coding standards.
I hereby thank Euan, kawaii, andrewjs18, Ben, Matt, Omar G., effone, Eric J., Devilshakerz, Wildcard, JordanMussi and all the other team members I have had the opportunity to work with when I was a MyBB team member. I thank Tomm M, my mentor, who inspired me to pick up coding with his piece-of-art plugins. And finally, I thank all of you MyBBoost subscribers who have helped me getting through my toughest university years economically.
Yours sincerely, Filippo
Insert beforefunction my_number_format($number)
// Shortens a number and attaches K, M, B, etc. accordingly @https://stackoverflow.com/questions/4371059/shorten-long-numbers-to-k-m-b
function my_number_shorten($number, $precision = 1, $divisors = null) {
// Setup default $divisors if not provided
if (!isset($divisors)) {
$divisors = array(
pow(1000, 1) => 'k', // Thousand
pow(1000, 2) => 'm', // Million
pow(1000, 3) => 'b', // Billion
pow(1000, 4) => 't', // Trillion
);
}
// Loop through each $divisor and find the
// lowest amount that matches
foreach ($divisors as $divisor => $shorthand) {
if (abs($number) < ($divisor * 1000)) {
// We found a match!
break;
}
}
// We found our match, or there were no matches.
// Either way, use the last defined value for $divisor.
return 0 + number_format($number / $divisor, $precision) . $shorthand;
}
Insert beforereturn number_format((double)$number, $decimals, $mybb->settings['decpoint'], $mybb->settings['thousandssep']);
File: inc/functions.phpif ($number > 999) {
return my_number_shorten($number);
}
Insert beforereturn number_format($number, 0, $mybb->settings['decpoint'], $mybb->settings['thousandssep']);
if ($number > 999) {
return my_number_shorten($number);
}
By default, lowercase letters are used but you can use whatever you want.$divisors = array(
pow(1000, 1) => 'k', // Thousand
pow(1000, 2) => 'm', // Million
pow(1000, 3) => 'b', // Billion
pow(1000, 4) => 't', // Trillion
);
Before the showthread template is eval'd, or you use PHP in templates and format it directly in your showthread template:$thread['views'] = my_number_format($thread['views']);
<?php echo my_number_format($thread['views']) ?>