The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
Hello ,
i try to REPLACE some words to another word , so make text area opition and write each word on Each word in a separate line . but my code only REPLACE the last word only from text-area .. what is wrong ? hook : parse_templates Code:
$bwords = explode("\n", $vbulletin->options['words_list']);
foreach ($bwords as $val)
{
$db->query_write(" UPDATE " . TABLE_PREFIX . " post SET pagetext = REPLACE(pagetext, '".$val."' , 'another-word') ");
}
|
|
#2
|
|||
|
|||
|
I'm not sure what's wrong, but maybe try this for the query line:
Code:
$db->query_write(" UPDATE " . TABLE_PREFIX . " post SET pagetext = REPLACE(pagetext, '".$db->escape_string(trim($val))."' , 'another-word') ");
|
|
#3
|
||||
|
||||
|
Quote:
now working good thnx brother :up: |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|