示例#1
0
    }
    if (empty($rex->info['Collection']['sitesearch_url'])) {
        continue;
    }
    $find = array();
    if (!empty($rex->info['Collection']['sitesearch_include_field'])) {
        $find[$rex->info['Collection']['sitesearch_include_field']] = new rEqual($rex->info['Collection']['sitesearch_include_field'], 'yes');
    }
    $struct = $rex->getStruct();
    if (isset($struct['sitellite_status'])) {
        $find['sitellite_status'] = new rEqual('sitellite_status', 'approved');
    }
    if (isset($struct['sitellite_access'])) {
        $find['sitellite_access'] = new rEqual('sitellite_access', 'public');
    }
    foreach ($rex->getList($find) as $obj) {
        $urls[] = 'http://' . conf('Site', 'domain') . '/index/' . sprintf($rex->info['Collection']['sitesearch_url'], $obj->{$rex->key});
    }
}
$out = '<?xml version="1.0" encoding="UTF-8"?' . ">\n";
$out .= '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">' . "\n";
foreach ($urls as $url) {
    $out .= '<url><loc>' . $url . "</loc></url>\n";
}
$out .= '</urlset>';
umask(00);
if (extension_loaded('zlib')) {
    $fp = gzopen('googlesitemap.xml.gz', 'w');
    gzwrite($fp, $out);
    gzclose($fp);
} else {
示例#2
0
loader_import('sitesearch.Logger');
loader_import('sitesearch.Extractor');
loader_import('sitesearch.Functions');
loader_import('cms.Versioning.Rex');
$search = new SiteSearch();
$collections = Rex::getCollections();
$default_domain = conf('Site', 'domain');
$mtime = time();
$counts = array();
foreach ($collections as $collection) {
    $rex = new Rex($collection);
    if (!$rex->collection || !$rex->info['Collection']['sitesearch_url']) {
        continue;
    }
    $counts[$collection] = 0;
    foreach ($rex->getList(array()) as $item) {
        // index item
        $item = $rex->getCurrent($item->{$rex->key});
        if (!$item) {
            continue;
        }
        if (isset($rex->info['Collection']['sitesearch_include_field'])) {
            if ($item->{$rex->info['Collection']['sitesearch_include_field']} == 'no') {
                continue;
            }
        }
        if (!isset($item->sitellite_access)) {
            $item->sitellite_access = 'public';
        }
        if (!isset($item->sitellite_status)) {
            $item->sitellite_status = 'approved';
示例#3
0
loader_import('sitesearch.Logger');
loader_import('sitesearch.Extractor');
loader_import('sitesearch.Functions');
loader_import('cms.Versioning.Rex');
$search = new SiteSearch();
$collections = Rex::getCollections();
$default_domain = conf('Site', 'domain');
$mtime = time();
$counts = array();
foreach ($collections as $collection) {
    $rex = new Rex($collection);
    if (!$rex->collection || !$rex->info['Collection']['sitesearch_url']) {
        continue;
    }
    $counts[$collection] = 0;
    $item_list = $rex->getList(array());
    if (!is_array($item_list)) {
        continue;
    }
    while (count($item_list) > 0) {
        // index item
        $item = array_shift($item_list);
        $item = $rex->getCurrent($item->{$rex->key});
        if (!$item) {
            continue;
        }
        if (isset($rex->info['Collection']['sitesearch_include_field'])) {
            if ($item->{$rex->info['Collection']['sitesearch_include_field']} == 'no') {
                continue;
            }
        }
示例#4
0
    }
}
foreach ($rex->info as $key => $vals) {
    if (strpos($key, 'browse:') === 0) {
        $key = substr($key, 7);
        $data['headers'][] = new TableHeader($key, $vals['header']);
        $data['fields'][$key] = $vals;
        if (isset($vals['filter_import'])) {
            loader_import($vals['filter_import']);
        }
    }
}
if ($rex->isVersioned) {
    $res = $rex->getStoreList($acl, $limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
} else {
    $res = $rex->getList($acl, $limit, $cgi->offset, $cgi->orderBy, $cgi->sort);
}
if (!$res) {
    $res = array();
    $rex->total = 0;
}
$pg->total = $rex->total;
$rex->ignore(array('_msg'));
/*
if (isset ($rex->info['Collection']['key_field_name'])) {
	$data['headers'][] = new TableHeader ($rex->info['Collection']['key_field'], $rex->info['Collection']['key_field_name']);
	if (isset ($rex->info['Collection']['key_field_align'])) {
		$data['key_field_align'] = $rex->info['Collection']['key_field_align'];
	}
}
$data['headers'][] = new TableHeader ($rex->info['Collection']['title_field'], $rex->info['Collection']['title_field_name']);
示例#5
0
 /**
  * Get a list of items that have not yet been translated.
  */
 function getUntranslated($collection = false)
 {
     if (!$collection) {
         $collection = $this->collection;
         if (!$collection) {
             // needs a collection, can't search 'em all
             return array();
         }
     }
     $r = new Rex($collection);
     $list = $r->getList(array());
     if (!$list) {
         return array();
     }
     $remove_sql = 'select distinct pkey from sitellite_translation where collection = ' . db_quote($collection);
     if ($this->lang) {
         $remove_sql .= ' and lang = ' . db_quote($this->lang);
     }
     $remove = db_shift_array($remove_sql);
     // subtract $remove from $list
     foreach ($list as $k => $obj) {
         if (in_array($obj->{$r->key}, $remove)) {
             unset($list[$k]);
         }
     }
     return $list;
 }