當前位置: 首頁>>代碼示例>>PHP>>正文


PHP numbers函數代碼示例

本文整理匯總了PHP中numbers函數的典型用法代碼示例。如果您正苦於以下問題:PHP numbers函數的具體用法?PHP numbers怎麽用?PHP numbers使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了numbers函數的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: persian_normalizer

function persian_normalizer($str)
{
    $str = numbers($str);
    return persian_letters($str);
}
開發者ID:AmirHome,項目名稱:AmirHome,代碼行數:5,代碼來源:TextHelpers.php

示例2: get_error

 /**
  * Gets the correct error message.
  *
  * Methoed tries to use $lang-Object. If not available, hardcoded english phrases will be used.
  * 
  * @return	string		error message
  */
 function get_error()
 {
     if ($this->error == null) {
         return false;
     }
     global $lang;
     if (is_object($lang)) {
         switch ($this->error) {
             case UPLOAD_ERR_FILE_INDEX:
                 $message = $lang->phrase('upload_error_noupload');
                 break;
             case UPLOAD_ERR_FILE_SIZE:
                 $lang->assign('mfs', formatFilesize($this->max_filesize));
                 $message = $lang->phrase('upload_error_maxfilesize');
                 break;
             case UPLOAD_ERR_IMAGE_WIDTH:
             case UPLOAD_ERR_IMAGE_HEIGHT:
                 $lang->assign('mih', $this->max_image_height > 0 ? numbers($this->max_image_height) : $lang->phrase('upload_unspecified'));
                 $lang->assign('miw', $this->max_image_width > 0 ? numbers($this->max_image_width) : $lang->phrase('upload_unspecified'));
                 $message = $lang->phrase('upload_error_maximagesize');
                 break;
             case UPLOAD_ERR_FILE_TYPE:
                 $lang->assign('aft', implode($lang->phrase('listspacer'), $this->file_types));
                 $message = $lang->phrase('upload_error_wrongfiletype');
                 break;
             case UPLOAD_ERR_COPY:
                 $message = $lang->phrase('upload_error_noaccess');
                 break;
             case UPLOAD_ERR_FILE_EXISTS:
                 $message = $lang->phrase('upload_error_fileexists');
                 break;
             default:
                 $message = $lang->phrase('upload_error_default');
         }
         if (!empty($this->file['name'])) {
             return "{$this->file['name']}: {$message}";
         } else {
             return $message;
         }
     } else {
         switch ($this->error) {
             case UPLOAD_ERR_FILE_INDEX:
                 $message = 'No file has been uploaded.';
                 break;
             case UPLOAD_ERR_FILE_SIZE:
                 $message = 'Max. filesize reached. The file is not allowed to be bigger than ' . formatFilesize($this->max_filesize) . '.';
                 break;
             case UPLOAD_ERR_IMAGE_WIDTH:
             case UPLOAD_ERR_IMAGE_HEIGHT:
                 $mih = $this->max_image_height > 0 ? numbers($this->max_image_height) : 'any';
                 $miw = $this->max_image_width > 0 ? numbers($this->max_image_width) : 'any';
                 $message = "Max. imagesize reached. Image is not allowed to be greater than {$miw} x {$mih} pixels.";
                 break;
             case UPLOAD_ERR_FILE_TYPE:
                 $lang->assign('aft', implode($lang->phrase('listspacer'), $this->file_types));
                 $message = 'Only ' . implode(', ', $this->file_types) . ' files are allowed to be uploaded.';
                 break;
             case UPLOAD_ERR_COPY:
                 $message = 'Access denied. Could not copy file.';
                 break;
             case UPLOAD_ERR_FILE_EXISTS:
                 $message = 'File already exists.';
                 break;
             default:
                 $message = 'An unknown error occured while uploading.';
         }
         if (!empty($this->file['name'])) {
             return "{$this->file['name']}: {$message}";
         } else {
             return $message;
         }
     }
 }
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:80,代碼來源:class.upload.php

示例3: while

while ($row = $gpc->prepare($db->fetch_assoc($result))) {
    if (isset($row['regdate'])) {
        $row['regdate'] = gmdate($lang->phrase('dformat2'), times($row['regdate']));
    }
    if (isset($row['location'])) {
        $row['location'] = iif(!empty($row['location']), $row['location'], $lang->phrase('location_no_data'));
    }
    if (isset($row['gender'])) {
        if ($row['gender'] == 'm' || $row['gender'] == 'w') {
            $row['gender'] = $lang->phrase('gender_' . $row['gender']);
        } else {
            $row['gender'] = $lang->phrase('gender_na');
        }
    }
    if (isset($row['posts'])) {
        $row['posts'] = numbers($row['posts']);
    }
    if (isset($row['birthday'])) {
        $bday = explode('-', $row['birthday']);
        if ($row['birthday'] != null && $row['birthday'] != '0000-00-00') {
            $row['birthday'] = iif($bday[0] > 0, $lang->phrase('members_bday_full'), $lang->phrase('members_bday_short'));
        } else {
            $row['birthday'] = $lang->phrase('members_na');
        }
    }
    if (!empty($row['pic']) && !file_exists($row['pic'])) {
        $row['pic'] = '';
    }
    if (isset($row['lastvisit'])) {
        $row['lastvisit'] = iif($row['lastvisit'] > 0, gmdate($lang->phrase('dformat1'), times($row['lastvisit'])), $lang->phrase('members_na'));
    }
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:31,代碼來源:members.php

示例4: BoardSelect


//.........這裏部分代碼省略.........
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['state'] = BOARD_STATE_LOCKED;
                    $forum['topics'] = '-';
                    $forum['replies'] = '-';
                    $forum['l_topic'] = false;
                    $forum['l_topic_full'] = '';
                } else {
                    if ($slog->isForumRead($forum['id'], $forum['l_date']) || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                        $forum['state'] = BOARD_STATE_OLD;
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['state'] = BOARD_STATE_NEW;
                        $forum['new'] = true;
                    }
                    if (!empty($forum['l_topic'])) {
                        if (isset($prefix[$forum['id']][$forum['l_prefix']]) && $forum['l_prefix'] > 0) {
                            $lang->assign('prefix', $prefix[$forum['id']][$forum['l_prefix']]['value']);
                            $forum['l_prefix'] = $lang->phrase('showtopic_prefix_title');
                        } else {
                            $forum['l_prefix'] = '';
                        }
                        if (strxlen($forum['l_topic']) > $config['lasttopic_chars']) {
                            $forum['l_topic_full'] = $forum['l_prefix'] . $forum['l_topic'];
                            $forum['l_topic'] = subxstr($forum['l_topic'], 0, $config['lasttopic_chars']);
                            $forum['l_topic'] .= "...";
                        } else {
                            $forum['l_topic_full'] = '';
                        }
                        $forum['l_date'] = str_date($lang->phrase('dformat1'), times($forum['l_date']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replies'] = numbers($forum['replies']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] != 0) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_LOCKED;
                                }
                            } else {
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:67,代碼來源:function.viscacha_frontend.php

示例5: eval

         $vote['voted'] = $row['aid'];
     }
     // Create element in array with name (+ member id as key) at the selected answer
     $vote['voter'][$row['aid']][$row['mid']] = $memberdata[$row['mid']];
 }
 if ($vote['results'] == false) {
     // When we only show the form to submit/change a vote
     ($code = $plugins->load('showtopic_vote_prepared')) ? eval($code) : null;
     $inner['vote_result'] = $tpl->parse("showtopic/vote");
 } else {
     // Show the results
     foreach ($vote['entries'] as $key => $row) {
         if ($row['votes'] > 0) {
             $row['percent'] = $row['votes'] / $vote['count'] * 100;
             if (strstr($row['percent'], '.') > 0) {
                 $row['percent'] = numbers($row['percent'], 1);
             }
         } else {
             $row['percent'] = 0;
         }
         $vote['entries'][$key] = $row;
         // Make comma separated string from array of users
         // Keys: (0 = Voter separated by comma, 1,2,3,... = Voter name with id as key)
         if (count($vote['voter'][$row['id']]) > 0) {
             $vote['voter'][$row['id']][0] = implode(', ', $vote['voter'][$row['id']]);
         } else {
             $vote['voter'][$row['id']][0] = '-';
         }
     }
     if ($my->vlogin && $my->p['voting'] == 1 && $info['status'] == 0) {
         $vote['phrase'] = iif($vote['voted'] > 0, 'vote_change_option', 'vote_go_form');
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:31,代碼來源:showtopic.php

示例6: BoardSelect


//.........這裏部分代碼省略.........
                $forum['id2'] = $forum['id'];
            }
            $id = array_search(trim($forum['lname']), $memberdata);
            if (is_id($id)) {
                $forum['lname'] = array($forum['lname'], $id);
            } else {
                $forum['lname'] = array($forum['lname'], 0);
            }
            if ($forum['btopic_id']) {
                $forum['tid'] = $forum['btopic_id'];
            } else {
                $forum['tid'] = $forum['last_topic'];
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] == 1) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['topics'] = '-';
                    $forum['replys'] = '-';
                    $forum['btopic'] = false;
                } else {
                    if (isset($my->mark['f'][$forum['id']]) && $my->mark['f'][$forum['id']] > $forum['bdate'] || $forum['bdate'] < $my->clv || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['new'] = true;
                    }
                    if ($forum['btopic']) {
                        if (strxlen($forum['btopic']) >= 40) {
                            $forum['btopic'] = substr($forum['btopic'], 0, 40);
                            $forum['btopic'] .= "...";
                        }
                        $forum['bdate'] = str_date($lang->phrase('dformat1'), times($forum['bdate']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replys'] = numbers($forum['replys']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] == 1) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                }
                            } else {
                                if (isset($my->mark['f'][$sub_cache[$forum['id']][$i]['id']]) && $my->mark['f'][$sub_cache[$forum['id']][$i]['id']] > $sub_cache[$forum['id']][$i]['bdate'] || $sub_cache[$forum['id']][$i]['bdate'] < $my->clv || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $forums[] = $forum;
            }
        }
        if (count($forums) > 0) {
            $tpl->globalvars(compact("cat", "forums"));
            ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
            echo $tpl->parse("categories");
        }
    }
    return $found;
}
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:101,代碼來源:function.viscacha_frontend.php

示例7: removeOldImages

     $db->query("UPDATE {$db->pre}postratings SET mid = '0' WHERE mid = '{$user['id']}'");
     // Step 10: Set post ratings from member to guests-group II
     $db->query("UPDATE {$db->pre}postratings SET aid = '0' WHERE aid = '{$user['id']}'");
     // Step 11: Delete pic
     removeOldImages('uploads/pics/', $user['id']);
     // Step 12: Delete user himself
     $db->query("DELETE FROM {$db->pre}user WHERE id = '{$user['id']}'");
     // Step 13: Delete user's custom profilefields
     $db->query("DELETE FROM {$db->pre}userfields WHERE ufid = '{$user['id']}'");
     $cache = $scache->load('memberdata');
     $cache = $cache->delete();
     ($code = $plugins->load('managemembers_delete_end')) ? eval($code) : null;
     ok($lang->phrase('member_deleted'), 'members.php' . SID2URL_1);
 } elseif ($_GET['action'] == 'edit') {
     $lang->group("timezones");
     $chars = numbers($config['maxaboutlength']);
     BBProfile($bbcode);
     ($code = $plugins->load('managemembers_edit_start')) ? eval($code) : null;
     if (empty($user['template'])) {
         $user['template'] = $config['templatedir'];
     }
     if (empty($user['language'])) {
         $user['language'] = $config['langdir'];
     }
     $user['icq'] = iif(empty($user['icq']), '', $user['icq']);
     // Settings
     $loaddesign_obj = $scache->load('loaddesign');
     $design = $loaddesign_obj->get();
     $mydesign = $design[$user['template']]['name'];
     $loadlanguage_obj = $scache->load('loadlanguage');
     $language = $loadlanguage_obj->get();
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:31,代碼來源:managemembers.php

示例8: sprintf

	echo $tpl->parse("header");
	echo $tpl->parse("menu");

	if ($db->num_rows($result) == 1) {
		$row = $slog->cleanUserData($db->fetch_object($result));

		$days2 = null;
		if ($config['showpostcounter'] == 1) {
			$days2 = $row->posts / ((time() - $row->regdate) / 86400);
			$days2 = sprintf("%01.2f", $days2);
			if ($row->posts < $days2) {
				$days2 = $row->posts;
			}
		}

		$row->posts = numbers($row->posts);

		$row->p = $slog->StrangerPermissions($row->groups, true);
		$row->level = $slog->getStatus($row->groups);

		$row->regdate = gmdate($lang->phrase('dformat2'), times($row->regdate));
		if ($row->lastvisit > 0) {
			$row->lastvisit = str_date($lang->phrase('dformat1'), times($row->lastvisit));
		}
		else {
			$row->lastvisit = $lang->phrase('profile_never');
		}

		BBProfile($bbcode);
		$bbcode->setSmileys(1);
		$bbcode->setReplace(0);
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:31,代碼來源:profile.php

示例9: foreach

				<div class="form-group">
					<table class="table table-striped table-bordered bootstrap-datatable responsive">
						<thead>
							<tr>
								<th class="col-md-2">Account</th>
								<th class="col-md-2">Amount</th>
								<th class="col-md-3">Remark</th>
							</tr>
						</thead>
						<tbody>
						<?php 
//print_mz($detail);
foreach ($detail as $isi) {
    if ($pay) {
        $isi['id'] = 0;
        $isi['debit'] = numbers($isi['total']);
        $isi['remark'] = $isi['desc'];
        $isi['ref'] = $isi['invoice'];
        $isi['kurs'] = 1;
    } elseif ($costruck) {
        $truck = GetValue('code', 'master_truck', array('id' => 'where/' . $isi['truck']));
        if ($truck == 0) {
            $truck = GetValue('name', 'master_vendor', array('id' => 'where/' . $val['vendor']));
            $mess = 'Penyewaan Truck Client ' . $truck . " Periode " . $val['period'];
        } else {
            $mess = 'Pembayaran Truck ' . $truck . " Periode " . $val['period'];
        }
        $isi['id'] = 0;
        $isi['kredit'] = $isi['amount'];
        $isi['remark'] = $mess;
        $isi['kurs'] = 1;
開發者ID:abdulghanni,項目名稱:gsm,代碼行數:31,代碼來源:input.php

示例10: get_error

 /**
  * Gets the correct error message.
  *
  * Methoed tries to use $lang-Object. If not available, hardcoded english phrases will be used.
  *
  * @return	string		error message
  */
 function get_error()
 {
     if ($this->error == null) {
         return false;
     }
     $lang = new lang();
     $lang->group("classes");
     switch ($this->error) {
         case UPLOAD_ERR_FILE_INDEX:
             $message = $lang->phrase('upload_error_noupload');
             break;
         case UPLOAD_ERR_FILE_SIZE:
             $lang->assign('mfs', formatFilesize($this->max_filesize));
             $message = $lang->phrase('upload_error_maxfilesize');
             break;
         case UPLOAD_ERR_IMAGE_WIDTH:
         case UPLOAD_ERR_IMAGE_HEIGHT:
             $lang->assign('mih', $this->max_image_height > 0 ? numbers($this->max_image_height) : $lang->phrase('upload_unspecified'));
             $lang->assign('miw', $this->max_image_width > 0 ? numbers($this->max_image_width) : $lang->phrase('upload_unspecified'));
             $message = $lang->phrase('upload_error_maximagesize');
             break;
         case UPLOAD_ERR_FILE_TYPE:
             $lang->assign('aft', implode(', ', $this->file_types));
             $message = $lang->phrase('upload_error_wrongfiletype');
             break;
         case UPLOAD_ERR_COPY:
             $message = $lang->phrase('upload_error_noaccess');
             break;
         case UPLOAD_ERR_FILE_EXISTS:
             $message = $lang->phrase('upload_error_fileexists');
             break;
         default:
             $message = $lang->phrase('upload_error_default');
     }
     if (!empty($this->file['name'])) {
         return "{$this->file['name']}: {$message}";
     } else {
         return $message;
     }
 }
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:47,代碼來源:class.upload.php

示例11: writeHello

<?php

include 'functions.php';
writeHello();
writeMsg('hello');
writeMsg('byebye');
writeMsgTo('Cemre', 'Function are cool!');
writeMsgTo('Henk');
$result = numbers(5, 7);
echo 'The outcome of 5 + 7 = ' . $result . '<br/>';
$result = calcRect(5, 7);
echo 'The area of a rectangle of 5 and 7 =' . $result . '<br/>';
?>

<br>
Exercise 2 BMI:
<form action="bmicalculator.php" method="post">
Lengte in M : <input type="text" name="lengte"></input>
Gewicht in kg : <input type="text" name="gewicht"></input>
<input type="submit" value="Bereken BMI"></input>
</form>

//$bmi = weight / (height * height);
開發者ID:Cemre61,項目名稱:bap,代碼行數:23,代碼來源:index.php

示例12: numbers

    ## No version info. I'll lie and hope for the best.
    $version = '5.0.0';
}
## Old PHP version detected. EJECT! EJECT! EJECT!
if (!version_compare($version, '5.2.0', '>=')) {
    return JError::raise(E_ERROR, 500, 'PHP 4.x, 5.0 and 5.1 is no longer supported by RD-Media.', 'The version of PHP used on your site is obsolete and contains known security vulenrabilities. Moreover, it is missing features required by Ticketmaster to work properly or at all. Please ask your host to upgrade your server to the latest PHP 5.2 or 5.3 release. Thank you!');
}
## Starting a session.
$session =& JFactory::getSession();
## Gettig the orderid if there is one.
$ordercode = $session->get('ordercode');
## If there none.. Create a session for the order process.
if ($ordercode == '') {
    ## Creating an ordernumber for the client.
    ## This will be 8 numbers.
    $numbers = numbers();
    $session->set('ordercode', $numbers);
}
## Require the base controller
require_once JPATH_COMPONENT . DS . 'controller.php';
## Require specific controller if requested
if ($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}
## Create the controller
$classname = 'TicketmasterController' . ucfirst($controller);
開發者ID:novalnetuser,項目名稱:Jeremiah-s-Ranch,代碼行數:31,代碼來源:ticketmaster.php

示例13: BoardSelect

function BoardSelect($board = 0)
{
    global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins;
    $found = false;
    $sub_cache = $forum_cache = $last_cache = array();
    $categories_obj = $scache->load('categories');
    $cat_cache = $categories_obj->get();
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $index_moderators = $scache->load('index_moderators');
    $mod_cache = $index_moderators->get();
    ($code = $plugins->load('forums_query')) ? eval($code) : null;
    // Fetch Forums
    $result = $db->query("\n\tSELECT\n    \tf.id, f.name, f.description, f.opt, f.optvalue, f.parent, f.topics, f.replies, f.last_topic, f.invisible,\n    \tt.topic as l_topic, t.id as l_tid, t.last as l_date, u.name AS l_uname, t.last_name AS l_name, f.id AS l_bid\n    FROM {$db->pre}forums AS f\n        LEFT JOIN {$db->pre}topics AS t ON f.last_topic=t.id\n        LEFT JOIN {$db->pre}user AS u ON t.last_name=u.id\n    ORDER BY f.parent, f.position\n\t", __LINE__, __FILE__);
    $keys = array('l_topic' => null, 'l_tid' => null, 'l_date' => null, 'l_uname' => null, 'l_name' => null, 'l_bid' => null);
    if ($db->num_rows($result) == 0) {
        $errormsg = array('There are currently no boards to show. Pleas visit the <a href="admin.php' . SID2URL_1 . '">Admin Control Panel</a> and create some forums.');
        $errorurl = $js_errorurl = '';
        $tpl->globalvars(compact("js_errorurl", "errorurl", "errormsg"));
        echo $tpl->parse('main/error');
        return $found;
    }
    while ($row = $db->fetch_assoc($result)) {
        $row['name'] = $gpc->prepare($row['name']);
        $row['l_uname'] = $gpc->prepare($row['l_uname']);
        $row['l_name'] = $gpc->prepare($row['l_name']);
        $row['bid'] = $cat_cache[$row['parent']]['parent'];
        // Caching for Subforums
        if (!empty($row['bid'])) {
            $sub_cache[$row['bid']][] = $row;
        }
        // Caching the Forums
        if ($row['bid'] == $board) {
            $forum_cache[$row['parent']][] = $row;
        }
        $last_cache[$row['id']] = $row;
        ($code = $plugins->load('forums_caching')) ? eval($code) : null;
    }
    // Work with the chached data!
    foreach ($cat_cache as $cat) {
        $forums = array();
        if (isset($forum_cache[$cat['id']]) == false) {
            continue;
        }
        foreach ($forum_cache[$cat['id']] as $forum) {
            $found = true;
            $forum['new'] = false;
            $forum['show'] = true;
            // Subforendaten vererben (Letzter Beitrag, Markierung)
            if (isset($sub_cache[$forum['id']])) {
                $substats = SubStats($forum['topics'], $forum['replies'], $forum['id'], $sub_cache);
                $forum['topics'] = $substats[0];
                $forum['replies'] = $substats[1];
            }
            // Letzter Beitrag
            $last = $last_cache[$forum['id']];
            if (isset($sub_cache[$forum['id']])) {
                foreach ($substats[2] as $last_bid) {
                    $sub = $last_cache[$last_bid];
                    if ($last['l_date'] < $sub['l_date'] && check_forumperm($sub)) {
                        $last = $sub;
                    }
                }
            }
            $forum = array_merge($forum, array_intersect_key($last, $keys));
            if (is_id($forum['l_name']) && isset($memberdata[$forum['l_name']])) {
                $forum['l_name'] = array($forum['l_uname'], $forum['l_name']);
            } else {
                $forum['l_name'] = array($forum['l_name'], 0);
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] != 0) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['topics'] = '-';
                    $forum['replies'] = '-';
                    $forum['l_topic'] = false;
                } else {
                    if (isset($my->mark['f'][$forum['id']]) && $my->mark['f'][$forum['id']] > $forum['l_date'] || $forum['l_date'] < $my->clv || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['new'] = true;
                    }
                    if (!empty($forum['l_topic'])) {
                        if (strxlen($forum['l_topic']) > $config['lasttopic_chars']) {
                            $forum['l_topic'] = substr($forum['l_topic'], 0, $config['lasttopic_chars']);
                            $forum['l_topic'] .= "...";
                        }
                        $forum['l_topic'] = $gpc->prepare($forum['l_topic']);
                        $forum['l_date'] = str_date($lang->phrase('dformat1'), times($forum['l_date']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replies'] = numbers($forum['replies']);
            // Moderatoren
//.........這裏部分代碼省略.........
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:101,代碼來源:function.viscacha_frontend.php

示例14: numbers

        echo $k;
    }
}
function numbers()
{
    for ($m = 1; $m < 9; $m++) {
        echo $m;
    }
}
function pass($pass)
{
    echo md5($pass);
}
convert();
echo "<pre>";
numbers();
echo "</pre>";
convert2();
if (empty($_POST['submit'])) {
    echo "<form action='probba17.php' method='post'>";
    echo "<p>user name</p>";
    echo "<input type='text' name='username' placeholder='enter some name...'>";
    echo "<p>password </p>";
    echo "<p><input type='password' name='password' placeholder='enter the pss...'></p>";
    echo "<input type='submit' name='submit' value='go'>";
    echo "</form>";
} else {
    echo "<pre>";
    pass($_POST['password']);
    echo "</pre>";
}
開發者ID:cvexa,項目名稱:onemanarmy,代碼行數:31,代碼來源:probba17.php


注:本文中的numbers函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。