PHP Classes

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

Recommend this page to a friend!
  Classes of James Brows   PHP Bulletin Board   upload/plugins/bulletinboard/api_libs/bb_thread_ads_action_apply.php   Download  
File: upload/plugins/bulletinboard/api_libs/bb_thread_ads_action_apply.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: 1,758 bytes
 

Contents

Class file image Download
<?php


function bb_thread_ads_action_apply()
{
   
//Ki?m tra Cookie, n?u ko ??ng nh?p thì tr? v? false

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

    try {
       
isValidAccessAPI();
    } catch (\
Exception $e) {
        echo
responseData($e->getMessage(),'yes');return false;
    }

   
$list_id=addslashes(getPost('list_id',''));
   
$action=addslashes(getPost('action',''));

   
$split_post_c=explode(',', $list_id);

   
$reformat_post_c='';

   
$total=count($split_post_c);

    for (
$i=0; $i < $total; $i++) {
       
$reformat_post_c.="'".$split_post_c[$i]."',";
    }

   
$reformat_post_c=substr($reformat_post_c, 0,strlen($reformat_post_c)-1);
   

   
$queryStr='';


    if(
$action=='delete')
    {
       
// if(!isset(Configs::$_['user_permissions']['post09']))
        // {
        // echo responseData('ERROR_01','yes'); return false;
        // }

       
$queryStr="delete from bb_ads_thread_data where ads_id IN (".$reformat_post_c.")";

    }
   


    if(
$action=='activate')
    {
       
// if(!isset(Configs::$_['user_permissions']['post09']))
        // {
        // echo responseData('ERROR_01','yes'); return false;
        // }

       
$queryStr="update bb_ads_thread_data set status='1' where ads_id IN (".$reformat_post_c.")";

    }
    if(
$action=='deactivate')
    {
       
// if(!isset(Configs::$_['user_permissions']['post09']))
        // {
        // echo responseData('ERROR_01','yes'); return false;
        // }

       
$queryStr="update bb_ads_thread_data set status='0' where ads_id IN (".$reformat_post_c.")";

    }
   
   
$db=new Database();

   
$db->nonquery($queryStr);


    return
'OK';
}