MyBB Community Forums

Full Version: Is possible to add color to the thread?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i was wondering if is possible to add color to the tittle of a thread, like on vbulletin...
using [color][/color] for example
is possible?
Not by default. however
do this.
Go to inc/functions_post.php
find:
$post['subject'] = htmlspecialchars_uni(dobadwords($post['subject']));
add under:
$post['subject'] = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#si", "<span style=\"color: $1;\">$2</span>", $post['subject']);
Then go to forumdisplay.php
find:
$thread['subject'] = htmlspecialchars_uni(dobadwords($thread['subject']));
add under:
$thread['subject'] = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#si", "<span style=\"color: $1;\">$2</span>", $thread['subject']);
Find:
$lastpostsubject = htmlspecialchars_uni(dobadwords($lastpostsubject));
Add under:
$lastpostsubject = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#si", "<span style=\"color: $1;\">$2</span>", $lastpostsubject);
$lastpostsubject = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)#si", "<span style=\"color: $1;\">$2</span>", $lastpostsubject);
Find:
$fulllastpostsubject = htmlspecialchars_uni(dobadwords($fulllastpostsubject));
Add under:
$fulllastpostsubject = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#si", "<span style=\"color: $1;\">$2</span>", $fulllastpostsubject);
$fulllastpostsubject = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)#si", "<span style=\"color: $1;\">$2</span>", $fulllastpostsubject);
uhm that doesnt seems to work, i get this error:

Warning: main(): Unable to access ./inc/functions_post.php in /www/sites/1/iespana.es/t/h/theanimangaworld/site/index.php on line 18

Warning: main(./inc/functions_post.php): failed to open stream: No such file or directory in /www/sites/1/iespana.es/t/h/theanimangaworld/site/index.php on line 18

Fatal error: main(): Failed opening required './inc/functions_post.php' (include_path='.:/www/usr/lib/php') in /www/sites/1/iespana.es/t/h/theanimangaworld/site/index.php on line 18
Updated my first post to cover more.
About your error, my changes couldn't have thrown that error Confused
so if i do what zaher said this is going to work?