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
Ok, but crakter there are couple of things.
1st, the navigation crumb isn't changed, same as the thread title in the tcat, it will display, [ color=red ]subject[/color].
for that reason, open
./showthread.php
find
PHP Code:
<?php
addnav($thread['subject'], "showthread.php?tid=$tid");
above it add
PHP Code:
<?php
$titletop = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#si", "$2", $thread['subject']);
$thread['subject'] = preg_replace("#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#si", "<span style=\"color: $1;\">$2</span>", $thread['subject']);
the other thing is the thread icon, it is getting messed. to fix that.