本文整理汇总了PHP中loader::db方法的典型用法代码示例。如果您正苦于以下问题:PHP loader::db方法的具体用法?PHP loader::db怎么用?PHP loader::db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类loader
的用法示例。
在下文中一共展示了loader::db方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* render Add Blog dialog
*/
public function render()
{
if ($_REQUEST['akID']) {
$akID = $_REQUEST['akID'];
if ($_REQUEST['akID']) {
if ($_REQUEST['akID'] == 'same_tags') {
$key = CollectionAttributeKey::getByHandle('tags');
$akID = $key->getAttributeKeyID();
}
}
$html = '<fieldset>';
$db = loader::db();
$r = $db->execute("SELECT * FROM atSelectOptions WHERE akID = ?", array($akID));
while ($row = $r->fetchrow()) {
$id = $row['ID'];
$options[$id] = $row['value'];
}
if (is_array($options)) {
foreach ($options as $key => $option) {
$html .= '<input type="checkbox" name="fields[]" value="' . $option . '">' . $option . '<br/>';
}
}
$html .= '</fieldset>';
//print json_encode($options);
print $html;
exit;
}
}
示例2: removeExpired
/**
* Removes old entries for the supplied type
*/
protected function removeExpired($type)
{
$lifetime = '5184000';
// 60 days
do {
if ($type == UVTYPE_CHANGE_PASSWORD) {
$lifetime = USER_CHANGE_PASSWORD_URL_LIFETIME;
break;
}
if ($type == UVTYPE_LOGIN_FOREVER) {
$lifetime = USER_FOREVER_COOKIE_LIFETIME;
break;
}
break;
} while (false);
$db = loader::db();
$db->query('DELETE FROM UserValidationHashes WHERE type = ? AND uDateGenerated <= ?', array($type, $lifetime));
}
示例3: explode
<div id="type_results">
<center class="ajax_block_loader" style="display: none;"><img src="<?php
echo Loader::helper('concrete/urls')->getBlockTypeAssetsURL($bt, 'ajax-loader.gif');
?>
" alt="loading"/></center>
</div>
<?php
echo $fm->hidden('ccID', $c->getCollectionID());
if ($fields) {
$field_array = explode(',', $fields);
?>
<fieldset class="existing_fields">
<?php
if ($akID && $akID != 'same_tags') {
$html = '';
$db = loader::db();
$r = $db->execute("SELECT * FROM atSelectOptions WHERE akID = {$akID}");
while ($row = $r->fetchrow()) {
$id = $row['ID'];
$options[$id] = $row['value'];
}
foreach ($options as $key => $option) {
$html .= '<input type="checkbox" name="fields[]" value="' . $option . '"';
if (in_array($option, $field_array)) {
$html .= 'checked=checked';
}
$html .= '>' . $option . '<br/>';
}
echo $html;
}
?>