Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2008, 10:57 PM
arlarson arlarson is offline
 
Join Date: Apr 2006
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Stripping Phrases From Start And End Of Thread Title

I'm trying to strip some phrases from the beginning and end of a thread title. I'm an amateur with coding, so I'm assuming I'm missing something basic. This doesn't work:
PHP Code:
$newtitle = $vbulletin->GPC['subject'];
$bannedphrases = array ('question on','question for','question about','question','questions');
foreach ($bannedphrases as $word) {
  $i = strlen($word);
    if (substr($newtitle,0,$i) == $word) {$newtitle = substr($newtitle,$i);}
    if (substr($newtitle,-$i,$i) == $word) {$newtitle = substr($newtitle,0,-$i);}
}
$vbulletin->GPC['subject'] = $newtitle; 
I would appreciate any suggestions or tips on how to get on the clue bus. Thanks.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:11 PM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.