本文整理匯總了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;
}
?>