Example #1
0
 protected function loadFormData()
 {
     // Check the session for previously entered form data.
     //RS $data = JFactory::getApplication()->getUserState('com_gglms.edit.content.data', array());
     $app = JFactory::getApplication();
     $data = $app->getUserState('com_gglms.edit.content.data', array());
     fb::log($data, "data load form");
     if (empty($data)) {
         $data = $this->getItem();
         $data->prerequisiti = explode(',', $data->prerequisiti);
         $data->prodotto = explode(',', $data->prodotto);
         //RS
         $data->prodotto = gglmsHelper::GetMappaContenutoProdotti($data);
         $data->formato = explode(',', $data->formato);
         //RS
         $data->formato = gglmsHelper::GetMappaContenutoFormati($data);
         $data->categoria = explode(',', $data->categoria);
         $data->categoria = gglmsHelper::GetMappaContenutoUnita($data);
         $data->files = explode(',', $data->files);
         $data->files = gglmsHelper::GetMappaContenutoFiles($data);
         $data->parametri = explode(',', $data->parametri);
         $data->parametri = gglmsHelper::GetMappaContenutoParams($data);
         $data->acl = explode(',', $data->acl);
         $data->acl = gglmsHelper::GetMappaContenutoAcl($data);
         $data->isNotifiche = true;
         if (!$data->datapubblicazione) {
             $data->datapubblicazione = date("Y-m-d");
         }
         if ($data->durata == 0) {
             $data->durata = $this->checkContentDuration($data->id);
         }
     }
     fb::log($data, "return data load form");
     return $data;
 }
Example #2
0
function sendDebugTrace($message = '')
{
    global $objFuseTrap, $options;
    fb::log($options, $options);
    $subject = '[' . $options['app']['code'] . '] Debug Trace';
    $objFuseTrap->sendToServer(anvilFuseTrap::EVENT_TYPE_DEBUG, $subject, 0, $message, __FILE__, __LINE__);
}
 function thumb_list()
 {
     /*as title_thumb_desc, but outputs a list of thumbs with titles as title tags*/
     $curl = $this->curl;
     $entries = $this->all_vids;
     $return['first_film_id'] = $entries['video'][0]['id'];
     //$return = $this->get_requested_video($entries['video'][0]['id']);
     $return['list'] = '<div id="photoset_select" class="clear">';
     foreach ($entries['video'] as $video) {
         $return['list'] .= '<div class="photoset">';
         $return['list'] .= "<a href='";
         $return['list'] .= $curl . "vimeo=" . $video['id'];
         $return['list'] .= "' title='";
         $return['list'] .= htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8', true);
         fb::log(htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8', true), 'html');
         $return['list'] .= "'>";
         $return['list'] .= "<img src='";
         $return['list'] .= $video['thumbnail_small'] . "' alt='";
         $return['list'] .= htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8', true);
         $return['list'] .= "'/>";
         $return['list'] .= '</a>';
         $return['list'] .= '</div>';
     }
     $return['list'] .= '</div>';
     return $return;
 }
Example #4
0
<?php

require_once 'classFb.php';
$fbid = fb::userID();
echo $fbid;
    if ($artist_ID != "") {
        foreach ($artist_ID as $artist_post) {
            array_push($artist, get_post($artist_post));
        }
    }
    $time = get_post_meta(get_the_ID(), 'mf_SALF_meta_time', true);
    $time = mf_get_time($time);
    //////fb::log($time,'time');
    $eventbrite_link = get_post_meta(get_the_ID(), 'mf_SALF_meta_eventbrite', true);
    $concession_link = get_post_meta(get_the_ID(), 'mf_SALF_meta_concession', true);
    $price = get_post_meta(get_the_ID(), 'mf_SALF_meta_price', true);
    $date = get_post_meta(get_the_ID(), 'mf_SALF_meta_date', true);
    $date = mf_date_format($date);
} else {
    // if custom_loop set to true, fetch the vars with different methods
    $venue_ID = get_post_meta($current_post->ID, 'mf_SALF_meta_venue', true);
    $venue = get_post($venue_ID);
    $artist_ID = get_post_meta($current_post->ID, 'mf_SALF_artist_meta_checks', true);
    $artist = array();
    if ($artist_ID != "") {
        foreach ($artist_ID as $artist_post) {
            array_push($artist, get_post($artist_post));
        }
    }
    $eventbrite_link = get_post_meta($current_post->ID, 'mf_SALF_meta_eventbrite', true);
    $concession_link = get_post_meta($current_post->ID, 'mf_SALF_meta_concession', true);
    fb::log($concession_link, "concession");
    $price = get_post_meta($current_post->ID, 'mf_SALF_meta_price', true);
    $date = get_post_meta($current_post->ID, 'mf_SALF_meta_date', true);
}
//end custom loop check
Example #6
0
 public static function SetMappaContenutoAcl($item)
 {
     FB::info($item . "->SetMappaContenutoAcl");
     $db = JFactory::getDBO();
     $contentid = $item['id'];
     $acl = explode(",", $item['acl']);
     $query = "DELETE FROM #__gg_contenuti_acl WHERE id_contenuto= {$contentid}";
     $db->setQuery((string) $query);
     $res = $db->loadResult();
     foreach ($acl as $value) {
         $query = "INSERT IGNORE INTO #__gg_contenuti_acl (id_contenuto, id_group ) values ({$contentid},{$value})";
         fb::log($query, "{$querySetMappaContenutoACL}");
         $db->setQuery((string) $query);
         $res = $db->loadResult();
     }
     return $res;
 }
 function get_photoset_info($id)
 {
     $this->method = 'flickr.photosets.getInfo';
     $this->params = array('photoset_id' => $id);
     $this->api_call();
     $details = get_object_vars($this->callback_array['photoset']);
     $thumb_id = $details['@attributes']['primary'];
     $photoset_url = "http://www.flickr.com/photos/" . $details['@attributes']['owner'] . "/sets/" . $details['@attributes']['id'] . "/";
     $this->get_image_by_id($thumb_id, $photoset_url);
     fb::log($details, 'hello world');
 }
Example #8
0
public function query_handler($q) {

    $q= preg_replace('/t:[a-z]*/', '', $q);

    FB::log($q, "testo cercato ripulito");

    preg_match_all('/(?<!")\b\w+\b|(?<=")\b[^"]+/', $q, $words);

    if (empty($words[0]))
        return 0;
    fb::log($words, "parole cercate ");

    $search_words = array();

    foreach ($words[0] as $word) {
        $word = filter_var($word, FILTER_SANITIZE_STRING);
        if (!empty($word))
            $search_words[] = $word;
    }

    fb::log($search_words, "search_words");

    return $search_words;
}
Example #9
0
<?php

include "../src/fb.php";
$configFB = array('apiKey' => 'azeazeaze', 'secretKey' => 'xxxxxxxx');
$uri = 'current_url';
$fb = new fb($configFB['apiKey'], $configFB['secretKey']);
$like_status = $fb->like_status;
$signed_request = $fb->signed_request;
//Si on aime pas la page
if (!$like_status) {
    include 'templates/forcelike.html';
} else {
    $fbuid = isset($signed_request['user_id']) ? $signed_request['user_id'] : null;
    //Si pas de compte FB alors on va lui demander de se connecter
    if (!$fbuid) {
        if (isset($signed_request['page']) && isset($signed_request['page']['id'])) {
            $tabId = $signed_request['page']['id'];
            $url = "http://www.facebook.com/pages/" . $tabId . "/" . $tabId . "?sk=app_" . $configFB['apiKey'];
        } else {
            $url = "url_courrante";
        }
        $login_url = $fb->getLoginUrl(array('req_perms' => 'publish_stream', 'scope' => 'email,user_about_me', 'redirect_uri' => $url, 'next' => $url));
        echo '<script type="text/javascript">top.location.href = "' . $login_url . '";</script>';
        exit;
        //Si compte FB Alors on recupe le token
    } else {
        $accessToken = $signed_request['oauth_token'];
        $fb->getFacebook()->setAccessToken($accessToken);
    }
    $fbuid = !empty($fbuid) ? $fbuid : null;
    include 'templates/welcome.html';
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) {
    ?>
					
					<?php 
    if (is_page() || is_single()) {
        ?>
						<?php 
        $side_vid = new VimeoObject();
        $post_id = ID_ouside_loop();
        $video_id = get_post_meta($post_id, 'mf_vimeo', true);
        $side_vid->width = 304;
        $side_vid->height = 171;
        if (post_has_video($post_id, $video_id) == false) {
            $single_video = false;
            //prevents sidebar from displaying video if no video exists
            fb::log($post_id, $video_id);
        } else {
            $single_video = $side_vid->oembed_single_video_by_id($video_id);
            //places video object inside single video
        }
        ?>
						<?php 
        if (is_page('videos') == true) {
            ?>
							<li>
							<div class="video">
							<?php 
            $first_video = $side_vid->title_thumb_desc();
            $player = $side_vid->get_requested_video($first_video['first_film_id']);
            echo '<h4>' . $player['title'] . '</h4>';
            echo "<p class='video-nav'>Next Video:" . $player['next'] . "</p>";
 public function open($persistent = true)
 {
     $return = false;
     if (!isset($this->_connection) || isset($this->_connection) && !$this->isConnected()) {
         $msg = 'Opening Database Connection...';
         fb::info($msg);
         $this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg);
         $this->_connection = mssql_connect($this->server, $this->username, $this->password);
         if (!$this->_connection) {
             $errorMsg = mssql_get_last_message();
             if (empty($errorMsg)) {
                 $errorMsg = 'Unable to connect to server: ' . $this->server;
             }
             $this->errorMessages[] = $errorMsg;
             $msg = 'Unable to establish a database connection.';
             fb::error($msg);
             $this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg);
         } else {
             $return = mssql_select_db($this->database, $this->_connection);
             $lastErrorMsg = mssql_get_last_message();
             if (!$return) {
                 $msg = 'Unable to select the database, ' . $this->database . '...';
                 fb::error($msg);
                 $this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg);
                 $this->errorMessages[] = $lastErrorMsg;
             }
         }
     }
     return $return;
 }
Example #12
0
function flog()
{
    $args = func_get_args();
    foreach ($args as $obj) {
        $obj === 'die' && die;
        fb::log($obj);
    }
    return true;
}
 /**
  * Ends a log group.
  *
  * @param string $name
  * The name of the group.
  *
  * @return NULL
  */
 protected function _logGroupEnd($name = '')
 {
     //        global $phpAnvil;
     fb::groupEnd($name);
     //        $phpAnvil->_log->endGroup($name);
 }
Example #14
0
 function out($message, $group, $color)
 {
     \fb::info($message, $group);
 }
 function save($post_id)
 {
     fb::log('Save Fired');
     // check autosave
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         fb::log('AutoSave Failed');
         return $post_id;
     }
     // check permissions
     if ('page' == $_POST['post_type']) {
         if (!current_user_can('edit_page', $post_id)) {
             fb::log('User Check Failed');
             return $post_id;
         }
     } elseif (!current_user_can('edit_post', $post_id)) {
         fb::log('User Check Failed');
         return $post_id;
     }
     foreach ($this->fields as $field) {
         fb::log($_POST);
         $old = get_post_meta($post_id, $field['id'], true);
         $new = $_POST[$field['id']];
         fb::log($old, 'old = ');
         fb::log($new, 'new = ');
         //var_dump($field['id']);
         //var_dump($new);
         if ($new && $new != $old) {
             fb::log('Post Meta updated');
             update_post_meta($post_id, $field['id'], $new);
         } elseif ('' == $new && $old) {
             fb::log('Post Meta deleted');
             delete_post_meta($post_id, $field['id'], $old);
         }
     }
 }
Example #16
0
File: test.php Project: nahue/Siefu


}



// Usage

$password = createRandomPassword();

echo "Your random password is: $password <br />";




$q = Doctrine_Query::create()
                ->select("d.*, l.*, c.*, p.*, partido.*")
                ->from("Domicilio d, d.Localidad l, d.Calle c, d.Provincia p, d.PartidoDepto partido")
                ->where("d.ente_id = ?", "32135988")
                ->orderBy("d.id DESC");

$domicilioAnterior = $q->execute()->get(1);
if($domicilioAnterior->exists())
        echo "existe";
else
    echo "no existe";


fb::log($domicilioAnterior);
?>
 public function isConnected()
 {
     //		if(!isset($this->_connection)) {
     //			$this->open(true);
     //		}
     $return = false;
     if (isset($this->_connection)) {
         $status = pg_connection_status($this->_connection);
         if ($status === PGSQL_CONNECTION_BAD) {
             $msg = 'Database not connected.';
             fb::log($msg);
             fb::log(pg_last_error($this->_connection), 'PG Last Error');
             $this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg);
         } else {
             $return = true;
         }
     }
     return $return;
 }
Example #18
0
<? if (!$this->get_perfil()->esAdmin())
    die("Necesita ser Administrador para ingresar a este modulo");

    $entidades = Doctrine_Core::getTable("Entidades")->findAll()->toArray();
    fb::log($entidades);
    if ($_POST)
    {
        $usuario = new Usuario();
        $usuario->nombre = $_POST["nombre"];
        $usuario->usuario = $_POST["usuario"];
        $usuario->apellido = $_POST["apellido"];
        $usuario->admin = $_POST["esAdmin"] == "on" ? 1 : 0;
        $usuario->email = $_POST["email"];
        $usuario->Entidad_id = $_POST["entidad_id"];
        $claveAleatoria = Crypt::claveAleatoria();
        $usuario->pass = $claveAleatoria;

        if($this->get_perfil()->notificarUsuario($_POST["email"],$_POST["nombre"], $claveAleatoria))
        {
            $usuario->save();
            $this->get_perfil()->set_flash("Usuario ". $_POST["usuario"] ." dado de alta correctamente");
            Html::redireccionar("admin");
        } else {
            $this->get_perfil()->set_flash("Ocurrio un error");
            Html::redireccionar("admin");
        }

    }