The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi,
i want to replace single characters from thread titles in specific forums only. i've added a small piece of code Code:
function verify_title(&$title)
{
// replace html-encoded spaces with actual spaces
$title = preg_replace('/&#(0*32|x0*20);/', ' ', $title);
if($foruminfo['forumid'] == '31' or $foruminfo['forumid'] == '114' or $foruminfo['forumid'] == '32') {
$title = preg_replace('/[\.]/', ' ', $title);
$title = preg_replace('/[\-]/', ' - ', $title);
$title = str_replace(" ", " ", $title);
}
$title = trim($title);
how to get the forumid in class_dm_thread_post? Any idea? cheers |
|
#2
|
||||
|
||||
|
The forumid would be contained in:
PHP Code:
|
|
#3
|
|||
|
|||
|
I need do same
How this work exactly? Can any1 Help me? I want remove - and _ on specific forums... |
|
#4
|
|||
|
|||
|
The OP has edited the file class_dm_threadpost.php and inserted the code in bold into the function verify_title() where shown (it still looks like it's around line 110). But you also need to use $this->info['forum']['forumid'] instead of $foruminfo['forumid'], so maybe like this:
Code:
function verify_title(&$title)
{
// replace html-encoded spaces with actual spaces
$title = preg_replace('/&#(0*32|x0*20);/', ' ', $title);
if (in_array($this->info['forum']['forumid'], 1, 2, 3)) {
$title = preg_replace('/[\.]/', ' ', $title);
$title = preg_replace('/[\-]/', ' - ', $title);
$title = str_replace(" ", " ", $title);
}
$title = trim($title);
Of course you'd replace 1, 2, 3 with the list of one or more forum ids where you want those characters removed. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|