PHP Classes

File: upload/plugins/bulletinboard/api_libs/bb_save_disallow_words.php

Recommend this page to a friend!
  Classes of James Brows   PHP Bulletin Board   upload/plugins/bulletinboard/api_libs/bb_save_disallow_words.php   Download  
File: upload/plugins/bulletinboard/api_libs/bb_save_disallow_words.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Bulletin Board
Manage and post messages in multi-user forums
Author: By
Last change:
Date: 2 years ago
Size: 934 bytes
 

Contents

Class file image Download
<?php

function bb_save_disallow_words()
{
   
  
$username=isset(Configs::$_['user_data']['user_id'])?Configs::$_['user_data']['user_id']:'';

// useClass('EmailSystem');

   
$bb_disallow_words=trim(addslashes(getPost('bb_disallow_words')));

   
$db=new Database();

   
$db->nonquery("delete from bb_disallow_word_data");

   
$splitWords=explode(',',$bb_disallow_words);

   
$total=count($splitWords);

   
$theWord='';

    for (
$i=0; $i < $total; $i++) {

       
$theWord=trim($splitWords[$i]);

        if(isset(
$theWord[1]))
        {
           
$insertData=array(
               
'word'=>$theWord,
            );
        
           
$queryStr=arrayToInsertStr('bb_disallow_word_data',$insertData);
           
           
$db->nonquery($queryStr);
        }

    }

   
$savePath=BB_CACHES_PATH.'disallow_words.php';

    if(
file_exists($savePath))
    {
       
unlink($savePath);
    }
 

   return
'OK';
}