phpBMS

Changeset 501 for trunk/phpbms/include

Show
Ignore:
Timestamp:
04/21/09 11:08:21 (3 years ago)
Author:
brieb
Message:
  • Added basics for centralized posting
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/include/post_class.php

    r499 r501  
    99                var $maintable = ""; 
    1010                var $datefieldname = ""; 
     11                var $notpostedCriteria = ""; 
    1112 
    1213                function tablePost($db, $modifiedby = NULL){ 
     
    2223 
    2324 
    24                 function getRecordsToPost($startdate, $enddate){ 
     25                function getRecordsToPost($startdate = null, $enddate = null){ 
    2526                        // This function creates an array of 
    2627                        // record ids within the date range given 
     
    3435                                        `".$this->maintable."` 
    3536                                WHERE 
    36                                         `".$this->maintable."`.readytopost = 1 
     37                                        `".$this->maintable."`.readytopost = 1"; 
     38 
     39                        if($startdate){ 
     40 
     41                                $querystatement .= " 
    3742                                        AND `".$this->maintable."`.`".$this->datefieldname."` >= '".dateToString($startdate, "SQL")."' 
    3843                                        AND `".$this->maintable."`.`".$this->datefieldname."` <= '".dateToString($enddate, "SQL")."'"; 
    3944 
     45                        }//endif 
     46 
     47                        if($this->notpostedCriteria){ 
     48 
     49                                $querystatement .= " 
     50                                        AND ".$this->notpostedCriteria; 
     51 
     52                        }//endif 
     53 
    4054                        $queryresult = $this->db->query($querystatement); 
    4155 
    42                         while($thecord = $this->db->fetchArray($queryresult)) 
     56                        while($therecord = $this->db->fetchArray($queryresult)) 
    4357                                $idarray[] = $therecord["id"]; 
    4458 
     
    5367                        // segment using 'IN' 
    5468 
    55                         $where = "`".$this->maintable."`.id IN"; 
     69                        $where = "`".$this->maintable."`.id "; 
    5670                        if(count($idarray)) 
    5771                                $where .= " IN(".implode(",", $idarray).")"; 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.