Ejemplo n.º 1
0
 public function save()
 {
     foreach ($this->getAttributes() as $prop => $value) {
         $setting = SiteVariable::model()->findByPk($prop);
         if (!$setting) {
             $setting = new SiteVariable();
             $setting->variable = $prop;
             $setting->title = $this->getAttributeLabel($prop);
         }
         $setting->value = $this->{$prop};
         //            print_r($this);exit;
         $setting->save(false);
     }
 }
Ejemplo n.º 2
0
 public static function getBitlyUrl($url)
 {
     if (self::isBitlyActive()) {
         $login = SiteVariable::get('BITLY_LOGIN');
         $key = SiteVariable::get('BITLY_API_KEY');
         $out = json_decode(Yii::app()->CURL->run('http://api.bit.ly/shorten?version=2.0.1&longUrl=' . urlencode($url) . '&login='******'&apiKey=' . $key . '&format=json'));
         if ($out->errorCode == 0) {
             $urls = (array) $out->results;
             return $urls[$url]->shortUrl;
         }
     }
     return '';
 }
Ejemplo n.º 3
0
 public function save()
 {
     $ad1 = SiteVariable::model()->findByPk('GAD_728x90');
     $ad2 = SiteVariable::model()->findByPk('GAD_336x280');
     $ad3 = SiteVariable::model()->findByPk('GAD_728x15');
     $ad1->value = $this->GAD_728x90;
     $ad2->value = $this->GAD_336x280;
     $ad3->value = $this->GAD_728x15;
     //            print_r($this);exit;
     $ad1->save(false);
     $ad2->save(false);
     $ad3->save(false);
 }
Ejemplo n.º 4
0
        </div>
    </div>
<?php 
}
?>

<script>
    $('#slideshow').rhinoslider({
        effect: 'kick',
        controlsPrevNext: false,
        controlsPlayPause: false,
        autoPlay: true,
        showBullets: 'never',
        showControls: 'never',
        controlsMousewheel: false
    });
</script>

<div class="container gad">
    <?php 
echo SiteVariable::get('GAD_728x15');
?>
</div>

<div class="container gad">
    <?php 
echo SiteVariable::get('GAD_728x90');
?>
</div>

 public static function newCounter($name)
 {
     return SiteVariable::save("uniqueIDs", $name, 1);
 }
Ejemplo n.º 6
0
        ?>
        <?php 
    }
    ?>
        <?php 
    if ($i != 1) {
        echo '      </div>
                </div>';
    }
}
?>
</div>

<div class="container gad">
    <?php 
echo SiteVariable::get('GAD_728x90');
?>
</div>

<div class="container gad">
    <?php 
echo SiteVariable::get('GAD_728x15');
?>
</div>


<div style="text-align: center;margin-bottom: 30px;">
<?php 
$this->widget('CLinkPager', array('pages' => $pages, 'header' => ''));
?>
</div>
Ejemplo n.º 7
0
<?php

// For installations, we need to make sure that we're using the 3col CSS system
Metadata::$headerData = array('<link rel="stylesheet" href="' . PUBLIC_PATH . '/css/unifaction-3col.css" />');
// Get the Site Variable, if SiteVarable plugin has been installed
$installComplete = false;
// Attempt to retrieve site configurations if the database is connected
if (Database::$database !== null) {
    try {
        $installComplete = SiteVariable::load("site-configs", "install-complete");
    } catch (Exception $e) {
        // Do nothing
    }
}
// If the installation is complete, go to the completed page
if ($installComplete !== false) {
    header("Location: /install/complete");
    exit;
}