Remvod unused CC_CONFIG, reformatted some code

This commit is contained in:
Rudi Grinberg 2012-09-13 10:26:50 -04:00
parent 0df0c41012
commit 24b3fb7e8a
2 changed files with 6 additions and 5 deletions

View file

@ -210,7 +210,7 @@ FROM cc_blockcontents AS pc
LEFT JOIN cc_files AS f ON pc.file_id=f.id LEFT JOIN cc_files AS f ON pc.file_id=f.id
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id LEFT JOIN cc_block AS bl ON pc.block_id = bl.id
WHERE pc.block_id = :block_id WHERE pc.block_id = :block_id
ORDER BY pc.position; ORDER BY pc.position
SQL; SQL;
$rows = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id)); $rows = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id));

View file

@ -522,7 +522,6 @@ SQL;
*/ */
public static function getItems($p_startTime, $p_endTime) public static function getItems($p_startTime, $p_endTime)
{ {
global $CC_CONFIG;
$baseQuery = <<<SQL $baseQuery = <<<SQL
SELECT st.file_id AS file_id, SELECT st.file_id AS file_id,
st.id AS id, st.id AS id,
@ -556,8 +555,10 @@ SQL;
$sql = $baseQuery." ".$predicates; $sql = $baseQuery." ".$predicates;
$rows = Application_Common_Database::prepareAndExecute($sql, $rows = Application_Common_Database::prepareAndExecute($sql, array(
array(':startTime1'=>$p_startTime, ':endTime'=>$p_endTime, ':startTime2'=>$p_startTime)); ':startTime1' => $p_startTime,
':endTime' => $p_endTime,
':startTime2' => $p_startTime));
if (count($rows) < 3) { if (count($rows) < 3) {
$dt = new DateTime("@".time()); $dt = new DateTime("@".time());
@ -572,7 +573,7 @@ WHERE st.ends > :startTime1
ORDER BY st.starts LIMIT 3 ORDER BY st.starts LIMIT 3
SQL; SQL;
$sql = " ".$baseQuery." ".$predicates." "; $sql = $baseQuery." ".$predicates." ";
$rows = Application_Common_Database::prepareAndExecute($sql, $rows = Application_Common_Database::prepareAndExecute($sql,
array( array(
':startTime1' => $p_startTime, ':startTime1' => $p_startTime,