本文整理匯總了PHP中misc::calculate_new_popularity方法的典型用法代碼示例。如果您正苦於以下問題:PHP misc::calculate_new_popularity方法的具體用法?PHP misc::calculate_new_popularity怎麽用?PHP misc::calculate_new_popularity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類misc
的用法示例。
在下文中一共展示了misc::calculate_new_popularity方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
exit;
}
}
}
if (!$data) {
$base_instance->show_message('Link not found');
exit;
}
$link_id = $data[1]->ID;
$added = $data[1]->datetime;
$url = $data[1]->url;
$user_of_link = $data[1]->user;
$popularity = $data[1]->popularity;
$frequency = $data[1]->frequency;
$last_visit = $data[1]->last_visit;
$visits = $data[1]->visits;
$speed = $data[1]->speed;
if (!$link_id) {
echo 'Link ID Error. Please log in again.';
exit;
}
$new_popularity = $misc_instance->calculate_new_popularity($popularity);
$base_instance->query("UPDATE {$base_instance->entity['LINK']['MAIN']} SET visits=visits+1,popularity={$new_popularity},last_visit='{$datetime}' WHERE ID='{$link_id}'");
if (preg_match('/https:\\/\\//', $url)) {
$url2 = $url;
} elseif (preg_match('/ftp:\\/\\//', $url)) {
$url2 = $url;
} else {
$url2 = 'http://' . $url;
}
echo '<meta http-equiv="refresh" content="0; URL=' . $url2 . '">';