コード例 #1
0
ファイル: dbreader.php プロジェクト: nicolaisi/adei-cube
 function __construct(array &$info, DBReader &$rdr, $flags = 0)
 {
     parent::__construct($info);
     if (preg_match("/^(.*)__BLOB__(.*)\$/", $this->gid, $m)) {
         $gid = $m[1];
         $blob_group = $m[2];
         $blob_opts = $rdr->GetGroupOption($this, "blob_groups");
         $blob_col = array("data" => false, "custom" => "/^(" . $blob_group . ")/");
         $col = $rdr->GetGroupOption($this, "columns");
         $this->options = array("data_extractors" => $blob_opts[$gid]["data_extractors"], "custom_data_filters" => $blob_opts[$gid]["custom_data_filters"], "columns" => array_replace($col, $blob_col));
     } else {
         $gid = $this->gid;
         $blob_group = false;
     }
     if (is_array($rdr->groups)) {
         foreach ($rdr->groups as $re => &$table) {
             if (preg_match($re, $this->gid)) {
                 $this->table = preg_replace($re, $table, $gid);
                 return;
             }
         }
     }
     $this->table = $this->gid;
 }
コード例 #2
0
ファイル: dvinreader.php プロジェクト: nicolaisi/adei
 function GetMaskList(LOGGROUP $grp = NULL, $flags = 0)
 {
     $list = array();
     try {
         $gids = array();
         $groups = $this->GetDVINGroups();
         $sth = $this->db->Query("SELECT ColumnName, GrID  FROM DVIN_TIMESERIES", DATABASE::FETCH_NUM);
         while ($row = $sth->fetch(PDO::FETCH_NUM)) {
             $gids[$row[0]] = $row[1];
         }
         $items = parent::GetItemList($grp, $mask, $flags);
         foreach ($items as $iid => $item) {
             $gid = $gids[$item['column']];
             if (is_numeric($gid)) {
                 if (!isset($list[$gid])) {
                     if ($groups[$gid]) {
                         $name = $groups[$gid];
                     } else {
                         $name = "Mask {$gid}";
                     }
                     $list[$gid] = array('id' => "maskid{$gid}", 'name' => $name);
                     if ($flags & REQUEST::NEED_INFO) {
                         $list[$gid]['mask'] = "{$iid}";
                     }
                 } else {
                     if ($flags & REQUEST::NEED_INFO) {
                         $list[$gid]['mask'] .= ",{$iid}";
                     }
                 }
             }
         }
     } catch (ADEIException $ae) {
     }
     /*
         $resp = $this->db->Query("SELECT maskid, name, mask FROM masks WHERE gid=" . $grp->gid);
         foreach ($resp as $row) {
     	if (!preg_match("/[\w\d]/", $row['name'])) $row['name'] = _("No name");
     
     	$id = "maskid" . $row['maskid'];
     	
     	$list[$id] = array(
     	    'id' => $id,
     	    'name' => $row['name']
     	);
     	
     	if ($flags&REQUEST::NEED_INFO) {
     	    $list[$id]['mask'] = implode(",", $this->ParseMask($row['mask']));
     	}
         }
     */
     return array_merge(parent::GetMaskList($grp, $flags), $list);
 }
コード例 #3
0
ファイル: inflate.php プロジェクト: veontomo/Sectors
define('FILE_NAME_PATTERN', "#FILE_MARKER#.html");
define('BLOCK_SIZE', 40);
define('PRODUCTION_DIR', 'settoriali');
define('START_REP', '<!-- #REPETITIVE_PART_START# -->');
define('END_REP', '<!-- #REPETITIVE_PART_END# -->');
define('DESCR_MAX_LENGTH', 300);
define('LOGO_STORE', "http://adv.networkagenti.it/images/idem/007351/");
define('LOGO_DEFAULT', "attesalogo.jpg");
define('SINGLE_SECTOR_TEMPLATE', '<a href="#SECTOR_URL#" style="text-decoration:underline; color:#0000FF;font-size: 11pt; font-family: Arial, sans-serif; font-style: normal; font-weight: normal;" target="_blank" title="vedi le aziende del settore #SECTOR_TEXT#">#SECTOR_TEXT#</a>');
$dbConfig = ['dsn' => 'mysql:host=localhost;dbname=forum_agenti;charset=utf8', 'userName' => 'readonly', 'pswd' => 'D7ehjC9WydUdmHeY', 'tableName' => 'companies'];
$replacements = ['macro_settore' => '#PLACEHOLDER1#', 'thumb' => '#PLACEHOLDER2#', 'company' => '#PLACEHOLDER3#', 'companydescr' => '#PLACEHOLDER4#'];
$reader = new DBReader($dbConfig);
// info about company without sectors (only macrosectors)
$data = $reader->retreiveFields($dbConfig['tableName'], array_keys($replacements));
unset($reader);
$reader = new DBReader($dbConfig);
// info about company only with sectors and corresponding adv links
$sectorsData = $reader->retreiveFields($dbConfig['tableName'], ['company', 'settori', 'adv_link']);
unset($reader);
// elaborate retreived data:
// 1. eliminate tags;
// 2. shorten description
// 3. if the logo does not exist, use default one
$dataLen = count($data);
$descrKey = 'companydescr';
$logoKey = 'thumb';
// stores the result of controls whether an url corresponds to a resource that exists
// It serves to avoid multiple requests to the same url
$urlExists = [];
$parser0 = new DataParser();
for ($i = 0; $i < $dataLen; $i++) {
コード例 #4
0
ファイル: ipereader.php プロジェクト: nicolaisi/adei
 function __construct(&$props)
 {
     parent::__construct($props);
 }