本文整理汇总了PHP中Results类的典型用法代码示例。如果您正苦于以下问题:PHP Results类的具体用法?PHP Results怎么用?PHP Results使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Results类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: launch
/**
* Process incoming parameters and display search results or a record.
*
* @return void
* @access public
*/
public function launch()
{
$params = $this->parseOpenURL();
$searchObject = $this->processOpenURL($params);
// If we were asked to return just information whether something was found,
// do it here
if (isset($_REQUEST['vufind_response_type']) && $_REQUEST['vufind_response_type'] == 'resultcount') {
echo $searchObject->getResultTotal();
return;
}
// Otherwise just display results
$results = new Results();
$results->showResults($searchObject);
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:20,代码来源:OpenURL.php
示例2: postIndex
public function postIndex()
{
$postData = Input::all();
$Qlenght = $postData['questionsLenght'];
$anArr = array();
$total = 0;
$questionArr = [];
for ($i = 0; $i < $Qlenght; $i++) {
$j = $i + 1;
$currentQuestionArr = $postData["currentQuestion{$j}"];
$question = Question::find($currentQuestionArr);
$correctAn = $question->correct_answer;
$questionId = $question->id;
if (isset($postData['optionsRadios' . $j . $questionId])) {
$answer = $postData['optionsRadios' . $j . $questionId];
if ($answer == $correctAn) {
$total = $total + 1;
}
$formOrigin = "quizz";
$questionArr[$questionId] = $answer;
Results::where('user_id', Auth::user()->id)->delete();
} else {
return Redirect::to('backends/dashboard')->withInput()->with('flash_message', 'Please select all option to check answer.');
}
}
$results = Results::create(['user_id' => Auth::user()->id, 'question_quizzler_answer' => json_encode($questionArr), 'active' => 1]);
$total = $total / $Qlenght * 100;
return Redirect::to('backends/dashboard?keyword=' . $formOrigin . "&total=" . $total . "&resultId=" . $results->id)->withInput();
}
开发者ID:imranshuvo,项目名称:QuizzApps,代码行数:29,代码来源:AdminQuizzController.php
示例3: postLoginform
public function postLoginform()
{
$postData = Input::all();
$rules = array('username' => 'required');
$validator = Validator::make($postData, $rules);
if ($validator->fails()) {
return Redirect::to('/login')->withInput()->withErrors($validator);
} else {
$credentials = array('username' => $postData['username'], 'password' => $postData['password']);
if (Auth::attempt($credentials)) {
if (Auth::user()->active == 1) {
if (Auth::user()->user_role_id == 2) {
return Redirect::to('backends/dashboard')->with('flash_message', 'Welcome To : The Quizzler.');
exit;
} else {
$results = Results::where('user_id', Auth::user()->id)->first();
if (isset($results)) {
return Redirect::to('backends/dashboard/viewresult');
exit;
} else {
return Redirect::to('backends/dashboard')->with('flash_message', 'Welcome To : The Quizzler.');
exit;
}
}
} else {
return Redirect::to('/login')->withInput()->with('flash_message', 'Your Username and Password are Invalide.');
exit;
}
} else {
return Redirect::to('/login')->withInput()->with('flash_message', 'Your Username and Password are Invalide.');
exit;
}
}
}
开发者ID:imranshuvo,项目名称:QuizzApps,代码行数:34,代码来源:LoginController.php
示例4: destroy
public function destroy($id)
{
if (\Input::get('bulk_opa_items')) {
$result = Results::find(Input::get('bulk_opa_items')[0]);
$result->delete();
}
return Redirect::to("/admin/surveys/" . $id . "/results");
}
开发者ID:sidis405,项目名称:s-opa,代码行数:8,代码来源:AdminResultsController.php
示例5: getResults
public static function getResults($id)
{
//比赛成绩
$winners = Results::model()->with(array('person', 'person.country', 'round', 'event', 'format'))->findAllByAttributes(array('competitionId' => $id, 'pos' => 1, 'roundId' => array('c', 'f')), array('order' => 'event.rank, round.rank, t.pos'));
$top3 = Results::model()->with(array('person', 'person.country', 'round', 'event', 'format'))->findAllByAttributes(array('competitionId' => $id, 'pos' => array(1, 2, 3), 'roundId' => array('c', 'f')), array('order' => 'event.rank, round.rank, t.pos'));
$all = Results::model()->with(array('person', 'person.country', 'round', 'event', 'format'))->findAllByAttributes(array('competitionId' => $id), array('order' => 'event.rank, round.rank, t.pos'));
$scrambles = Scrambles::model()->with(array('round', 'event'))->findAllByAttributes(array('competitionId' => $id), array('order' => 'event.rank, round.rank, t.groupId, t.isExtra, t.scrambleNum'));
return array('winners' => $winners, 'top3' => $top3, 'all' => $all, 'scrambles' => $scrambles);
}
开发者ID:sunshy360,项目名称:cubingchina,代码行数:9,代码来源:Competitions.php
示例6: getEventsString
public function getEventsString($event)
{
$str = '';
if (in_array($event, $this->events)) {
$str = '<span class="fa fa-check"></span>';
if ($this->best > 0 && self::$sortAttribute === $event && self::$sortDesc !== true) {
$str = self::$sortDesc === true ? '' : '[' . $this->pos . ']' . $str;
$str .= Results::formatTime($this->best, $event);
}
}
return $str;
}
开发者ID:sunshy360,项目名称:cubingchina,代码行数:12,代码来源:Registration.php
示例7: getTestagain
public function getTestagain($userId = 0)
{
$result = Results::where('user_id', $userId)->first();
$result = Results::find($result['id']);
//return $result->active;
if ($result->active == 0) {
$result->active = 1;
} elseif ($result->active == 1) {
$result->active = 0;
}
$result->save();
return Redirect::to('backends/users');
}
开发者ID:imranshuvo,项目名称:QuizzApps,代码行数:13,代码来源:AdminUsersController.php
示例8: main
public function main()
{
if (!isset($_GET['pod_id'])) {
return R('/');
}
$podId = $_GET['pod_id'];
$pod = new Pod($podId);
$args = (array) $pod;
if (A()->isAdmin() && $pod->awaitingPairings()) {
$args['pairUrl'] = U('/pair/', false, ['pod_id' => $podId]);
}
$results = new Results();
foreach ($args['rounds'] as &$round) {
foreach ($round['matches'] as &$match) {
$needsReport = $match['wins'] === null;
$canReport = A()->isAdmin() || $match['playerId'] === S()->id() || $match['opponentId'] === S()->id();
if ($needsReport && $canReport) {
$match['potentialResults'] = $results->potentialResults($match['matchId']);
}
}
}
$args['standings'] = (new Standings($podId))->getStandings();
return T()->pod($args);
}
开发者ID:jthemphill,项目名称:tournament,代码行数:24,代码来源:index.php
示例9: formatSum
private static function formatSum($row)
{
switch ($row['eventId']) {
case '333mbf':
return array_sum(array_map(function ($row) {
$result = $row[0]['average'];
$difference = 99 - substr($result, 0, 2);
return $difference;
}, array($row['first'], $row['second'], $row['third'])));
case '333fm':
return $row['sum'] / 100;
default:
return Results::formatTime($row['sum'], $row['eventId']);
}
}
开发者ID:sunshy360,项目名称:cubingchina,代码行数:15,代码来源:BestPodiums.php
示例10: DataObjectList
/**
* Constructor
*
* If provided, executes SQL query via parent Results object
*
* @param string Name of table in database
* @param string Prefix of fields in the table
* @param string Name of the ID field (including prefix)
* @param string Name of Class for objects within this list
* @param string SQL query
* @param integer number of lines displayed on one screen
* @param string prefix to differentiate page/order params when multiple Results appear one same page
* @param string default ordering of columns (special syntax)
*/
function DataObjectList($tablename, $prefix = '', $dbIDname = 'ID', $objType = 'Item', $sql = NULL, $limit = 20, $param_prefix = '', $default_order = NULL)
{
$this->dbtablename = $tablename;
$this->dbprefix = $prefix;
$this->dbIDname = $dbIDname;
$this->objType = $objType;
if (!is_null($sql)) {
// We have an SQL query to execute:
parent::Results($sql, $param_prefix, $default_order, $limit);
} else {
// TODO: do we want to autogenerate a query here???
// Temporary...
parent::Results($sql, $param_prefix, $default_order, $limit);
}
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:29,代码来源:_dataobjectlist.class.php
示例11: getResultsYear
public function getResultsYear()
{
session_start();
$headers = apache_request_headers();
$token = $headers['X-Auth-Token'];
if (!$headers['X-Auth-Token']) {
header('Invalid CSRF Token', true, 401);
return print json_encode(array('success' => false, 'status' => 400, '1msg' => 'Invalid CSRF Token / Bad Request / Unauthorized ... Please Login again'), JSON_PRETTY_PRINT);
die;
} else {
if ($token != $_SESSION['form_token']) {
header('Invalid CSRF Token', true, 401);
return print json_encode(array('success' => false, 'status' => 400, 'msg' => 'Invalid CSRF Token / Bad Request / Unauthorized ... Please Login again'), JSON_PRETTY_PRINT);
die;
} else {
Results::getResultsYear();
}
}
}
开发者ID:jbagaresgaray,项目名称:ENTRANCE-EXAM,代码行数:19,代码来源:controller.php
示例12: build
public static function build($statistic)
{
$command = Yii::app()->wcaDb->createCommand()->select(array('r.*', 'rs.personName', 'rs.competitionId', 'c.cellName', 'c.cityName', 'c.year', 'c.month', 'c.day'))->leftJoin('Persons p', 'r.personId=p.id AND p.subid=1')->where('r.countryRank=1 AND rs.personCountryId="China"');
$rows = array();
foreach (Results::getRankingTypes() as $type) {
$cmd = clone $command;
$cmd->from(sprintf('Ranks%s r', ucfirst($type)))->leftJoin('Results rs', sprintf('r.best=rs.%s AND r.personId=rs.personId AND r.eventId=rs.eventId', $type == 'single' ? 'best' : $type))->leftJoin('Competitions c', 'rs.competitionId=c.id');
foreach ($cmd->queryAll() as $row) {
$row['type'] = $type;
if (isset($rows[$type][$row['eventId']])) {
$temp = $rows[$type][$row['eventId']];
if ($temp['year'] > $row['year'] || $temp['month'] > $row['month'] || $temp['day'] > $row['day']) {
continue;
}
}
$row = self::getCompetition($row);
$rows[$type][$row['eventId']] = $row;
}
}
$rows = array_merge(array_values($rows['single']), array_values($rows['average']));
usort($rows, function ($rowA, $rowB) {
$temp = $rowA['year'] - $rowB['year'];
if ($temp == 0) {
$temp = $rowA['month'] - $rowB['month'];
}
if ($temp == 0) {
$temp = $rowA['day'] - $rowB['day'];
}
if ($temp == 0) {
$temp = strcmp($rowA['personName'], $rowB['personName']);
}
return $temp;
});
$rows = array_slice($rows, 0, self::$limit);
//person days event type result record competition
$columns = array(array('header' => 'Yii::t("statistics", "Person")', 'value' => 'Persons::getLinkByNameNId($data["personName"], $data["personId"])', 'type' => 'raw'), array('header' => 'Yii::t("statistics", "Days")', 'value' => 'CHtml::tag("b", array(), floor((time() - strtotime(sprintf("%s-%s-%s", $data["year"], $data["month"], $data["day"]))) / 86400))', 'type' => 'raw'), array('header' => 'Yii::t("common", "Event")', 'value' => 'Yii::t("event", Events::getFullEventName($data["eventId"]))'), array('header' => 'Yii::t("common", "Type")', 'value' => 'Yii::t("common", ucfirst($data["type"]))'), array('header' => 'Yii::t("common", "Result")', 'value' => 'Results::formatTime($data["best"], $data["eventId"])'), array('header' => 'Yii::t("common", "Records")', 'value' => '$data["worldRank"] == 1 ? "WR" : ($data["continentRank"] == 1 ? "AsR" : "NR")'), array('header' => 'Yii::t("common", "Competition")', 'value' => 'CHtml::link(ActiveRecord::getModelAttributeValue($data, "name"), $data["url"])', 'type' => 'raw'));
return self::makeStatisticsData($statistic, $columns, $rows);
}
开发者ID:sunshy360,项目名称:cubingchina,代码行数:38,代码来源:OldestStandingRecords.php
示例13: die
* @copyright (c)2009-2015 by Francois Planque - {@link http://fplanque.com/}
* Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
*
* @package evocore
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
global $Blog;
// Create query
$SQL = new SQL();
$SQL->SELECT('t.*, IF( tb.itc_ityp_ID > 0, 1, 0 ) AS type_enabled');
$SQL->FROM('T_items__type AS t');
$SQL->FROM_add('LEFT JOIN T_items__type_coll AS tb ON itc_ityp_ID = ityp_ID AND itc_coll_ID = ' . $Blog->ID);
// Create result set:
$Results = new Results($SQL->get(), 'ityp_');
$Results->title = T_('Item/Post/Page types') . get_manual_link('managing-item-types');
// get reserved and default ids
global $default_ids;
$default_ids = ItemType::get_default_ids();
/**
* Callback to build possible actions depending on post type id
*
*/
function get_actions_for_itemtype($id)
{
global $default_ids;
$action = action_icon(T_('Duplicate this Post Type...'), 'copy', regenerate_url('action', 'ityp_ID=' . $id . '&action=new'));
if (!ItemType::is_reserved($id)) {
// Edit all post types except of not reserved post type
$action = action_icon(T_('Edit this Post Type...'), 'edit', regenerate_url('action', 'ityp_ID=' . $id . '&action=edit')) . $action;
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_itemtypes.view.php
示例14: SQL
$group_filtered_SQL = new SQL();
$group_filtered_SQL->SELECT('cgr_ID AS ID, cgr_name AS name, COUNT(cgu_user_ID) AS count_users');
$group_filtered_SQL->FROM('T_messaging__contact_groups');
$group_filtered_SQL->FROM_add('LEFT JOIN T_messaging__contact_groupusers ON cgu_cgr_ID = cgr_ID');
$group_filtered_SQL->WHERE('cgr_ID = ' . $DB->quote($g));
$group_filtered_SQL->WHERE_and('cgr_user_ID = ' . $current_User->ID);
$group_filtered_SQL->GROUP_BY('cgr_ID');
$group_filtered = $DB->get_row($group_filtered_SQL->get());
}
// Create result set:
if ($Settings->get('allow_avatars')) {
$default_order = '--A';
} else {
$default_order = '-A';
}
$Results = new Results($select_SQL->get(), 'mct_', $default_order, NULL, $count_SQL->get());
$Results->title = T_('Contacts list');
if (is_admin_page()) {
// Set an url for manual page:
$Results->title .= get_manual_link('contacts-list');
}
/**
* Callback to add filters on top of the result set
*
* @param Form
*/
function filter_contacts(&$Form)
{
global $item_ID;
$Form->text('s', get_param('s'), 30, T_('Search'), '', 255);
$Form->select_input('g', get_param('g'), 'get_contacts_groups_options', T_('Group'));
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_contact_list.view.php
示例15: ob_flush
* Created on Jul 4, 2007
*
* Author: Andrew Nelson
* Processes the input from home.html
*/
$action = $_POST["operation"];
if ($action != null && $action != "") {
if ($action == "generate") {
$fileName = $_POST["saveFile"];
$runs = $_POST["runs"];
if ($fileName != null && $fileName != "") {
echo "Generating Your Results. Please be Patient<br />";
ob_flush();
flush();
include "results.php";
$result = new Results();
$result->runTests($runs);
$result->writeXML($fileName);
echo "Your file has been saved to {$fileName}<br />";
echo "<a href = 'home.php'>Run the Tool Again</a><br />";
return;
} else {
echo "You must input a file name!<br />";
}
}
if ($action == "compare") {
$fileOne = $_POST["firstFile"];
$fileTwo = $_POST["secondFile"];
if ($fileOne != null && $fileOne != "" && $fileTwo != null && $fileTwo != "") {
if (!file_exists($fileOne)) {
echo "The first specified file doesn't exist<br/>";
开发者ID:AkimBolushbek,项目名称:wordpress-soc-2007,代码行数:31,代码来源:home.php
示例16: utf8_strtolower
// Filter by start date
$SQL->WHERE_and('emlog_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
$count_SQL->WHERE_and('emlog_timestamp >= ' . $DB->quote($datestart . ' 00:00:00'));
}
if (!empty($datestop)) {
// Filter by end date
$SQL->WHERE_and('emlog_timestamp <= ' . $DB->quote($datestop . ' 23:59:59'));
$count_SQL->WHERE_and('emlog_timestamp <= ' . $DB->quote($datestop . ' 23:59:59'));
}
if (!empty($email)) {
// Filter by email
$email = utf8_strtolower($email);
$SQL->WHERE_and('emlog_to LIKE ' . $DB->quote($email));
$count_SQL->WHERE_and('emlog_to LIKE ' . $DB->quote($email));
}
$Results = new Results($SQL->get(), 'emlog_', 'D', $UserSettings->get('results_per_page'), $count_SQL->get());
$Results->title = T_('Sent emails') . get_manual_link('sent-emails');
/**
* Callback to add filters on top of the result set
*
* @param Form
*/
function filter_email_sent(&$Form)
{
global $datestart, $datestop, $email;
$Form->date_input('datestartinput', $datestart, T_('From date'));
$Form->date_input('datestopinput', $datestop, T_('To date'));
$Form->text_input('email', $email, 40, T_('Email'));
}
$Results->filter_area = array('callback' => 'filter_email_sent', 'presets' => array('all' => array(T_('All'), $admin_url . '?ctrl=email&tab=sent')));
$Results->cols[] = array('th' => T_('ID'), 'order' => 'emlog_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'right', 'td' => '$emlog_ID$');
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_email_sent.view.php
示例17: load_funcs
load_funcs('regional/model/_regional.funcs.php');
// Get params from request
$s = param('s', 'string', '', true);
// Create query
$SQL = new SQL();
$SQL->SELECT('ctry_ID, ctry_code, ctry_name, curr_shortcut, curr_code, ctry_enabled, ctry_preferred, ctry_status, ctry_block_count');
$SQL->FROM('T_regional__country');
$SQL->FROM_add('LEFT JOIN T_regional__currency ON ctry_curr_ID=curr_ID');
$SQL->ORDER_BY('*, ctry_code ASC');
if (!empty($s)) {
// We want to filter on search keyword:
// Note: we use CONCAT_WS (Concat With Separator) because CONCAT returns NULL if any arg is NULL
$SQL->WHERE('CONCAT_WS( " ", ctry_code, ctry_name, curr_code ) LIKE "%' . $DB->escape($s) . '%"');
}
// Create result set:
$Results = new Results($SQL->get(), 'ctry_', '-D');
$Results->title = T_('Countries') . get_manual_link('regional-countries-tab');
/*
* STATUS TD:
*/
function ctry_td_enabled($ctry_enabled, $ctry_ID)
{
$r = '';
$redirect_ctrl = param('ctrl', 'string', 'countries');
if ($ctry_enabled == true) {
$r .= action_icon(T_('Disable the country!'), 'bullet_full', regenerate_url('ctrl,action', 'ctrl=countries&action=disable_country&ctry_ID=' . $ctry_ID . '&redirect_ctrl=' . $redirect_ctrl . '&' . url_crumb('country')));
} else {
$r .= action_icon(T_('Enable the country!'), 'bullet_empty', regenerate_url('ctrl,action', 'ctrl=countries&action=enable_country&ctry_ID=' . $ctry_ID . '&redirect_ctrl=' . $redirect_ctrl . '&' . url_crumb('country')));
}
return $r;
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_country_list.view.php
示例18: die
*
* @package admin
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
global $blog, $admin_url, $UserSettings;
// Create result set:
$SQL = new SQL();
$SQL->SELECT('SQL_NO_CACHE ivc_ID, ivc_code, ivc_expire_ts, ivc_source, ivc_grp_ID, grp_name, grp_level');
$SQL->FROM('T_users__invitation_code');
$SQL->FROM_add('INNER JOIN T_groups ON grp_ID = ivc_grp_ID');
$count_SQL = new SQL();
$count_SQL->SELECT('SQL_NO_CACHE COUNT( ivc_ID )');
$count_SQL->FROM('T_users__invitation_code');
$Results = new Results($SQL->get(), 'ivc_', '-D', $UserSettings->get('results_per_page'), $count_SQL->get());
$Results->title = T_('Invitation codes') . get_manual_link('invitation-codes-list');
/*
* Table icons:
*/
if ($current_User->check_perm('users', 'edit', false)) {
// create new group link
$Results->global_icon(T_('Create a new invitation code...'), 'new', '?ctrl=invitations&action=new', T_('Add invitation code') . ' »', 3, 4, array('class' => 'action_icon btn-primary'));
}
$Results->cols[] = array('th' => T_('ID'), 'order' => 'ivc_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'right', 'td' => '$ivc_ID$');
$Results->cols[] = array('th' => T_('Expires'), 'order' => 'ivc_expire_ts', 'td_class' => 'shrinkwrap', 'td' => '$ivc_expire_ts$');
$Results->cols[] = array('th' => T_('Group'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'order' => 'grp_name', 'td' => '$grp_name$ ($grp_level$)');
$Results->cols[] = array('th' => T_('Code'), 'order' => 'ivc_code', 'td' => $current_User->check_perm('users', 'edit', false) ? '<a href="' . $admin_url . '?ctrl=invitations&action=edit&ivc_ID=$ivc_ID$"><b>$ivc_code$</b></a>' : '$ivc_code$');
$Results->cols[] = array('th' => T_('Code'), 'order' => 'ivc_code', 'td' => '<a href="' . get_secure_htsrv_url() . 'register.php?invitation=$ivc_code$">' . T_('Link') . '</a>');
$Results->cols[] = array('th' => T_('Source'), 'order' => 'ivc_source', 'td' => '$ivc_source$');
if ($current_User->check_perm('users', 'edit', false)) {
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_invitation.view.php
示例19: param
/**
* Needed by functions
* @var LinkOwner
*/
global $LinkOwner;
global $AdminUI, $current_User;
// Override $debug in order to keep the display of the iframe neat
global $debug;
$debug = 0;
if (empty($Blog)) {
$Blog =& $LinkOwner->get_Blog();
}
// Name of the iframe we want some actions to come back to:
param('iframe_name', 'string', '', true);
$SQL = $LinkOwner->get_SQL();
$Results = new Results($SQL->get(), 'link_');
$Results->title = T_('Attachments');
/*
* Sub Type column
*/
function display_subtype(&$row)
{
if (empty($row->file_ID)) {
return '';
}
global $current_File;
// Instantiate a File object for this line:
$current_File = new File($row->file_root_type, $row->file_root_ID, $row->file_path);
// COPY!
// Flow meta data into File object:
$current_File->load_meta(false, $row);
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_link_list.view.php
示例20: die
* Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
*
* @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
*
* @package admin
*
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
* @author efy-asimo: Attila Simo.
*
* @version $Id: _broken_posts.view.php 3328 2013-03-26 11:44:11Z yura $
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
$SQL = new SQL();
$SQL->SELECT('post_ID, post_title, post_main_cat_ID, post_canonical_slug_ID');
$SQL->FROM('T_items__item');
$SQL->WHERE('post_main_cat_ID NOT IN (SELECT cat_ID FROM T_categories )');
$Results = new Results($SQL->get(), 'broken_posts_');
$Results->title = T_('Broken items with no matching category');
$Results->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Results->cols[] = array('th' => T_('Item ID'), 'th_class' => 'shrinkwrap', 'td_class' => 'small center', 'order' => 'post_ID', 'td' => '$post_ID$');
$Results->cols[] = array('th' => T_('Title'), 'th_class' => 'nowrap', 'order' => 'post_title', 'td' => '$post_title$', 'td_class' => 'small');
$Results->cols[] = array('th' => T_('Main Cat ID'), 'th_class' => 'shrinkwrap', 'order' => 'post_main_cat_ID', 'td' => '$post_main_cat_ID$', 'td_class' => 'small center');
$Results->cols[] = array('th' => T_('Canoncical Slug ID'), 'th_class' => 'shrinkwrap', 'order' => 'post_canonical_slug_ID', 'td' => '$post_canonical_slug_ID$', 'td_class' => 'small center');
$Results->display(array('page_url' => regenerate_url('blog,ctrl,action,results_' . $Results->param_prefix . 'page', 'action=' . param_action() . '&' . url_crumb('tools'))));
if ($current_User->check_perm('options', 'edit', true) && $Results->get_num_rows()) {
// display Delete link
$redirect_to = regenerate_url('action', 'action=del_broken_posts&' . url_crumb('tools'));
echo '<p>[<a href="' . $redirect_to . '">' . T_('Delete these posts') . '</a>]</p>';
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_broken_posts.view.php
注:本文中的Results类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论