14if (!defined(
'XOOPS_LISTS_INCLUDED')) {
15 define(
'XOOPS_LISTS_INCLUDED', 1);
18 public static function getTimeZoneList()
20 $root =& XCube_Root::getSingleton();
21 if (
null !== $root->mLanguageManager && !defined(
'_TZ_GMT0')) {
22 $root->mLanguageManager->loadPageTypeMessageCatalog(
'timezone');
48 '5.75' => _TZ_GMTP575,
60 return $time_zone_list;
66 public static function &getThemesList()
68 $ret =& XoopsLists::getDirListAsArray(XOOPS_THEME_PATH.
'/');
75 public static function &getModulesList()
77 $ret =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH .
'/modules/');
84 public static function &getDirListAsArray($dirname)
87 if (is_dir($dirname) && $handle = opendir($dirname)) {
88 while (
false !== ($file = readdir($handle))) {
89 if (!preg_match(
"/^\..*$/", $file)) {
90 if (
'cvs' != strtolower($file) && is_dir($dirname . $file)) {
91 $dirlist[$file]=$file;
105 public static function &getFileListAsArray($dirname, $prefix=
'')
108 if (
'/' == substr($dirname, -1)) {
109 $dirname = substr($dirname, 0, -1);
111 if (is_dir($dirname) && $handle = opendir($dirname)) {
112 while (
false !== ($file = readdir($handle))) {
113 if (!preg_match(
"/^[\.]{1,2}$/", $file) && is_file($dirname.
'/'.$file)) {
114 $file = $prefix.$file;
115 $filelist[$file]=$file;
128 public static function &getImgListAsArray($dirname, $prefix=
'')
131 if ($handle = opendir($dirname)) {
132 while (
false !== ($file = readdir($handle))) {
133 if (!preg_match(
"/^[\.]{1,2}$/", $file) && preg_match(
"/(\.gif|\.jpg|\.png)$/i", $file)) {
134 $file = $prefix.$file;
135 $filelist[$file]=$file;
148 public static function &getHtmlListAsArray($dirname, $prefix=
'')
151 if ($handle = opendir($dirname)) {
152 while (
false !== ($file = readdir($handle))) {
153 if ((!preg_match(
"/^[\.]{1,2}$/", $file) && preg_match(
"/(\.htm|\.html|\.xhtml)$/i", $file) && !is_dir($file)) &&
'cvs' != strtolower($file) && !is_dir($file)) {
154 $file = $prefix.$file;
155 $filelist[$file] = $prefix.$file;
169 public static function &getAvatarsList($avatar_dir=
'')
172 if (
'' !== $avatar_dir) {
173 $avatars =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH .
'/images/avatar/' . $avatar_dir .
'/', $avatar_dir .
'/');
175 $avatars =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH .
'/images/avatar/');
183 public static function &getAllAvatarsList()
187 $dirlist =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH .
'/images/avatar/');
188 if (count($dirlist) > 0) {
189 foreach ($dirlist as $dir) {
190 $avatars[$dir] =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH .
'/images/avatar/' . $dir .
'/', $dir .
'/');
202 public static function &getSubjectsList($sub_dir=
'')
205 if (
'' !== $sub_dir) {
206 $subjects =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH .
'/images/subject/' . $sub_dir, $sub_dir .
'/');
208 $subjects =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH .
'/images/subject/');
216 public static function &getLangList()
219 $lang_list =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH .
'/language/');
223 public static function &getCountryList()
228 'AE' =>
'United Arab Emirates',
229 'AF' =>
'Afghanistan',
230 'AG' =>
'Antigua and Barbuda',
234 'AN' =>
'Netherlands Antilles',
236 'AQ' =>
'Antarctica',
238 'AS' =>
'American Samoa',
242 'AZ' =>
'Azerbaijan',
243 'BA' =>
'Bosnia and Herzegovina',
245 'BD' =>
'Bangladesh',
247 'BF' =>
'Burkina Faso',
253 'BN' =>
'Brunei Darussalam',
258 'BV' =>
'Bouvet Island',
263 'CC' =>
'Cocos (Keeling) Islands',
264 'CF' =>
'Central African Republic',
266 'CH' =>
'Switzerland',
267 'CI' =>
"Cote D'Ivoire (Ivory Coast)",
268 'CK' =>
'Cook Islands',
273 'CR' =>
'Costa Rica',
274 'CS' =>
'Czechoslovakia (former)',
276 'CV' =>
'Cape Verde',
277 'CX' =>
'Christmas Island',
279 'CZ' =>
'Czech Republic',
284 'DO' =>
'Dominican Republic',
289 'EH' =>
'Western Sahara',
295 'FK' =>
'Falkland Islands (Malvinas)',
296 'FM' =>
'Micronesia',
297 'FO' =>
'Faroe Islands',
299 'FX' =>
'France, Metropolitan',
301 'GB' =>
'Great Britain (UK)',
304 'GF' =>
'French Guiana',
310 'GP' =>
'Guadeloupe',
311 'GQ' =>
'Equatorial Guinea',
313 'GS' =>
'S. Georgia and S. Sandwich Isls.',
316 'GW' =>
'Guinea-Bissau',
319 'HM' =>
'Heard and McDonald Islands',
321 'HR' =>
'Croatia (Hrvatska)',
328 'IO' =>
'British Indian Ocean Territory',
337 'KG' =>
'Kyrgyzstan',
341 'KN' =>
'Saint Kitts and Nevis',
342 'KP' =>
'Korea (North)',
343 'KR' =>
'Korea (South)',
345 'KY' =>
'Cayman Islands',
346 'KZ' =>
'Kazakhstan',
349 'LC' =>
'Saint Lucia',
350 'LI' =>
'Liechtenstein',
355 'LU' =>
'Luxembourg',
361 'MG' =>
'Madagascar',
362 'MH' =>
'Marshall Islands',
368 'MP' =>
'Northern Mariana Islands',
369 'MQ' =>
'Martinique',
370 'MR' =>
'Mauritania',
371 'MS' =>
'Montserrat',
378 'MZ' =>
'Mozambique',
380 'NC' =>
'New Caledonia',
382 'NF' =>
'Norfolk Island',
385 'NL' =>
'Netherlands',
389 'NT' =>
'Neutral Zone',
391 'NZ' =>
'New Zealand (Aotearoa)',
395 'PF' =>
'French Polynesia',
396 'PG' =>
'Papua New Guinea',
397 'PH' =>
'Philippines',
400 'PM' =>
'St. Pierre and Miquelon',
402 'PR' =>
'Puerto Rico',
409 'RU' =>
'Russian Federation',
411 'SA' =>
'Saudi Arabia',
412 'Sb' =>
'Solomon Islands',
413 'SC' =>
'Seychelles',
417 'SH' =>
'St. Helena',
419 'SJ' =>
'Svalbard and Jan Mayen Islands',
420 'SK' =>
'Slovak Republic',
421 'SL' =>
'Sierra Leone',
422 'SM' =>
'San Marino',
426 'ST' =>
'Sao Tome and Principe',
427 'SU' =>
'USSR (former)',
428 'SV' =>
'El Salvador',
431 'TC' =>
'Turks and Caicos Islands',
433 'TF' =>
'French Southern Territories',
436 'TJ' =>
'Tajikistan',
438 'TM' =>
'Turkmenistan',
441 'TP' =>
'East Timor',
443 'TT' =>
'Trinidad and Tobago',
449 'UK' =>
'United Kingdom',
450 'UM' =>
'US Minor Outlying Islands',
451 'US' =>
'United States',
453 'UZ' =>
'Uzbekistan',
454 'VA' =>
'Vatican City State (Holy See)',
455 'VC' =>
'Saint Vincent and the Grenadines',
457 'VG' =>
'Virgin Islands (British)',
458 'VI' =>
'Virgin Islands (U.S.)',
461 'WF' =>
'Wallis and Futuna Islands',
465 'YU' =>
'Yugoslavia',
466 'ZA' =>
'South Africa',
471 asort($country_list);
472 reset($country_list);
473 return $country_list;
476 public static function &getHtmlList()
480 'abbr' =>
'<abbr>',
481 'acronym' =>
'<acronym>',
482 'address' =>
'<address>',
484 'bdo' =>
'<bdo>',
485 'big' =>
'<big>',
486 'blockquote' =>
'<blockquote>',
487 'caption' =>
'<caption>',
488 'cite' =>
'<cite>',
489 'code' =>
'<code>',
490 'col' =>
'<col>',
491 'colgroup' =>
'<colgroup>',
492 'dd' =>
'<dd>',
493 'del' =>
'<del>',
494 'dfn' =>
'<dfn>',
495 'div' =>
'<div>',
496 'dl' =>
'<dl>',
497 'dt' =>
'<dt>',
498 'em' =>
'<em>',
499 'font' =>
'<font>',
500 'h1' =>
'<h1>',
501 'h2' =>
'<h2>',
502 'h3' =>
'<h3>',
503 'h4' =>
'<h4>',
504 'h5' =>
'<h5>',
505 'h6' =>
'<h6>',
506 'hr' =>
'<hr>',
508 'img' =>
'<img>',
509 'ins' =>
'<ins>',
510 'kbd' =>
'<kbd>',
511 'li' =>
'<li>',
512 'map' =>
'<map>',
513 'object' =>
'<object>',
514 'ol' =>
'<ol>',
515 'samp' =>
'<samp>',
516 'small' =>
'<small>',
517 'strong' =>
'<strong>',
518 'sub' =>
'<sub>',
519 'sup' =>
'<sup>',
520 'table' =>
'<table>',
521 'tbody' =>
'<tbody>',
522 'td' =>
'<td>',
523 'tfoot' =>
'<tfoot>',
524 'th' =>
'<th>',
525 'thead' =>
'<thead>',
526 'tr' =>
'<tr>',
527 'tt' =>
'<tt>',
528 'ul' =>
'<ul>',
529 'var' =>
'<var>'
536 public static function &getUserRankList()
541 $sql =
'SELECT rank_id, rank_title FROM ' . $db->prefix(
'ranks') .
' WHERE rank_special = 1';
543 $result = $db->query($sql);
544 while ($myrow = $db->fetchArray($result)) {
545 $ret[$myrow[
'rank_id']] = $myts->makeTboxData4Show($myrow[
'rank_title']);
static & getDatabaseConnection()