本文整理匯總了PHP中DBUtils::fromUId方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBUtils::fromUId方法的具體用法?PHP DBUtils::fromUId怎麽用?PHP DBUtils::fromUId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBUtils
的用法示例。
在下文中一共展示了DBUtils::fromUId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
<?php
require '../../config.php';
$failSilently = true;
require _PATH . 'include/database/DBUtils.class.php';
require _PATH . 'include/database/DBLogger.class.php';
require _PATH . 'include/database/DBConnection.class.php';
if (isset($_GET['t']) && isset($_GET['p'])) {
if (isset($_GET['i'])) {
$track = intval(DBUtils::fromUId($_GET['i'], _BASE_MULTIPLIER));
} else {
$track = 0;
}
// Adds an entry
DBLogger::addGlobalHit($_GET['p'], $track);
header('Location: ' . $_GET['t']);
return false;
} else {
header('Location: ' . _SITE_URL . '/woops');
}
示例2: header
<?php
require _PATH . 'include/database/DBUtils.class.php';
require _PATH . 'include/database/DBLogger.class.php';
require _PATH . 'include/database/DBConnection.class.php';
// We retrieve the base_id and check it is correct :
$base_id = DBUtils::fromUId($request, _BASE_MULTIPLIER);
if ($base_id != intval($base_id)) {
// Looks like the ID is not good
header('Location: ' . _SITE_URL . '/404');
exit;
}
// Retrieves the item
$item = DBUtils::retrieveItem($base_id);
if (!$item) {
header('Location: ' . _SITE_URL . '/404');
}
// We add a hit
DBLogger::addHit($base_id);
// Checks if we want to display an album or a track
if ($action == 'track') {
$requestedType = _TABLE_TRACK;
$complementaryShortCode = '/a/';
} else {
if ($action == 'album') {
$requestedType = _TABLE_ALBUM;
$complementaryShortCode = '/t/';
}
}
// Is the requested type correct ?
if (intval($item['type']) != intval($requestedType)) {