本文整理汇总了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)) {