当前位置: 首页>>代码示例>>PHP>>正文


PHP Options::userGet方法代码示例

本文整理汇总了PHP中Options::userGet方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::userGet方法的具体用法?PHP Options::userGet怎么用?PHP Options::userGet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Options的用法示例。


在下文中一共展示了Options::userGet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

	<th>Group</th>
	<th>First Name</th>
	<th>Surname</th>
	<th>Birthdate</th>
      </tr>
    </thead>
    <tbody>
<?php 
        foreach ($users as $id => $values) {
            echo "<tr>" . nl();
            echo "<td>" . $values['username'] . "</td>" . nl();
            echo "<td><a class='btn' href='mailto:" . $values['email'] . "?subject=Hi There'>Send Email</i></a></td>" . nl();
            echo "<td>" . $values['group'] . "</td>" . nl();
            echo "<td>" . Options::userGet($id, 'firstName') . "</td>" . nl();
            echo "<td>" . Options::userGet($id, 'surname') . "</td>" . nl();
            $dob = Options::userExists($id, 'dateOfBirth') ? time2str(Options::userGet($id, 'dateOfBirth')) : '';
            echo "<td>" . $dob . "</td>" . nl();
            echo "</tr>" . nl();
        }
    }
    ?>

    </tbody>
  </table>
    
<?php 
    if (isset($pager)) {
        echo $pager;
    }
    // Print Pager
} else {
开发者ID:repsycle,项目名称:baseline,代码行数:31,代码来源:users.php

示例2: foreach

					<br />
					<div class="alert alert-error">
						<strong>Warning</strong>
						<br />
						Changing your password will log you out
					</div>
				</div>
			</div>
<!-- Default settings above, now for the dynamic fields -->
<?php 
$options = Options::getList(false, 'User Settings');
if (!empty($options)) {
    foreach ($options as $option => $value) {
        $type = $value['type'];
        // Get the user specific values from the Options_users table
        $val = Options::userGet($userId, $option);
        $label = camelcase2space($option);
        echo '<div class="control-group">' . nl();
        echo '	<label class="control-label" for="' . $option . '">' . $label . '</label>' . nl();
        echo '	<div class="controls">' . nl();
        if ($type == 'input') {
            echo '<input type="text" class="input-xlarge" id="' . $option . '" name="' . $option . '" value="' . $val . '">' . nl();
        }
        if ($type == 'textarea') {
            echo '<textarea class="textarea input-xxlarge" id="' . $option . '" name="' . $option . '">' . $val . '</textarea>' . nl();
        }
        if ($type == 'bool') {
            echo bool_select($val, $option);
        }
        if ($type == 'date') {
            echo mdy($val, $option, 'd m y');
开发者ID:repsycle,项目名称:baseline,代码行数:31,代码来源:settings.php

示例3: date

         $mm = $_POST[$dateOption . $dmy[1]];
     } else {
         $mm = 1;
     }
     if (isset($_POST[$dateOption . $dmy[2]])) {
         $yyyy = $_POST[$dateOption . $dmy[2]];
     } else {
         $yyyy = date('Y', time());
     }
     //echo $dd . "/" . $mm . "/" . $yyyy;
     $timestamp = mktime(0, 0, 0, $mm, $dd, $yyyy);
     //echo date('r', $timestamp);
     // Check if the options exists, then if the value compares otherwise update it.
     if (Options::exists($dateOption)) {
         // Compare the posted value to the value in the DB and update it if neccesarry
         if (htmlspecialchars(Options::userGet($userId, $dateOption)) !== htmlspecialchars($timestamp)) {
             // Set the option to the new value
             Options::userSet($userId, $dateOption, $timestamp);
             $changes = true;
         }
     }
 }
 if (isset($_POST['action']) && $_POST['action'] == 'Save Changes') {
     // These are the 2 static things in your account a password and a email address
     if (isset($_POST['user-email']) && $Error->email($_POST['user-email'], false) && $_POST['user-email'] !== $u->email) {
         $u->email = $_POST['user-email'];
         $u->update();
         Activation::remove($userId);
         $link = full_url_to_script('activate.php') . "?action=activate&code=" . Activation::generate($userId) . "&id=" . $userId;
         Emailtemplate::setBaseDir('./assets/email_templates');
         $html = Emailtemplate::loadTemplate('reactivate', array('title' => 'Reactivation Email', 'prettyName' => Options::get('prettyName'), 'name' => $u->username, 'siteName' => Options::get('emailName'), 'activationLink' => $link, 'footerLink' => Options::get('siteName'), 'footerEmail' => Options::get('emailInfo')));
开发者ID:repsycle,项目名称:baseline,代码行数:31,代码来源:settings.php

示例4: fix_slashes

    $_REQUEST = fix_slashes($_REQUEST);
    $_COOKIE = fix_slashes($_COOKIE);
}
// Load our config settings
$Config = Config::getConfig();
// Run the options and install functions, this would be if there are no information present in the db
require DOC_ROOT . '/includes/install.inc.php';
// Check for installation and create the tables needed
require DOC_ROOT . '/includes/options.inc.php';
// Get the options from the DB
// Store session info in the database?
if (Config::get('useDBSessions') === true) {
    DBSession::register();
}
// Initialize our session
session_name('spfs');
session_start();
// Initialize current user
$Auth = Auth::getAuth();
// This dynamically creates the options variables except for the User Settings
foreach (Options::getList(false, false, "WHERE `group`!='User Settings'") as $option => $values) {
    ${$option} = $values['value'];
}
// This dynamically creates the User Variables
if ($Auth->loggedIn()) {
    foreach (Options::getList(false, 'User Settings') as $option => $val) {
        ${$option} = Options::userGet($Auth->id, $option);
    }
}
// Object for tracking and displaying error messages
$Error = Error::getError();
开发者ID:repsycle,项目名称:baseline,代码行数:31,代码来源:master.inc.php


注:本文中的Options::userGet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。