Project

General

Profile

Feature #19793 ยป 0010099_v3.patch

Administrator Admin, 2009-03-09 15:19

View differences:

ChangeLog (Revision 5162)
2009-03-09 Oliver Hader <oliver@typo3.org>
* Fixed bug #10099: Use TYPO3_DB->exec_SELECTcountRows() to determine the number of rows
2009-03-08 Stanislas Rolland <typo3@sjbr.ca>
* Fixed issue #10635: htmlArea RTE: Two typos in the manual
t3lib/class.t3lib_admin.php (Revision 5162)
$pid_list_tmp = preg_replace('/^\-1,/','',$pid_list_tmp);
}
$count = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, 'pid IN ('.$pid_list_tmp.')');
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($count)) {
$list[$table]=$row[0];
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $table, 'pid IN ('.$pid_list_tmp.')');
if ($count) {
$list[$table] = $count;
}
$count = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, 'pid IN ('.$pid_list_tmp.')'.t3lib_BEfunc::deleteClause($table));
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($count)) {
$list_n[$table]=$row[0];
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $table, 'pid IN ('.$pid_list_tmp.')' . t3lib_BEfunc::deleteClause($table));
if ($count) {
$list_n[$table] = $count;
}
}
}
t3lib/class.t3lib_install.php (Revision 5162)
$statements['drop_table'][md5($statement)] = $statement;
}
// count:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, '');
list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $table);
$statements['tables_count'][md5($statement)] = $count?'Records in table: '.$count:'';
} else {
$statement = 'CREATE TABLE '.$table." (\n".implode(",\n",$whole_table)."\n)";
t3lib/class.t3lib_treeview.php (Revision 5162)
$res = $this->getDataInit($uid);
return $this->getDataCount($res);
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(*)',
$this->table,
$this->parentField.'='.$GLOBALS['TYPO3_DB']->fullQuoteStr($uid, $this->table).
t3lib_BEfunc::deleteClause($this->table).
t3lib_BEfunc::versioningPlaceholderClause($this->table).
$this->clause // whereClauseMightContainGroupOrderBy
);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
return $row[0];
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
$this->table,
$this->parentField . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($uid, $this->table) .
t3lib_BEfunc::deleteClause($this->table) .
t3lib_BEfunc::versioningPlaceholderClause($this->table) .
$this->clause // whereClauseMightContainGroupOrderBy
);
}
}
t3lib/class.t3lib_befunc.php (Revision 5162)
* @return string Output string (or integer count value if no msg string specified)
*/
public static function referenceCount($table, $ref, $msg = '') {
// Look up the path:
if ($table=='_FILE') {
if (t3lib_div::isFirstPartOfStr($ref, PATH_site)) {
$ref = substr($ref, strlen(PATH_site));
} else return '';
// Look up the path:
list($res) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'count(*) as count',
'sys_refindex',
'ref_table='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_refindex').
' AND ref_string='.$GLOBALS['TYPO3_DB']->fullQuoteStr($ref, 'sys_refindex').
' AND deleted=0'
);
$condition = 'ref_string='.$GLOBALS['TYPO3_DB']->fullQuoteStr($ref, 'sys_refindex');
} else {
return '';
}
} else {
// Look up the path:
list($res) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'count(*) as count',
'sys_refindex',
'ref_table='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_refindex').
' AND ref_uid='.intval($ref).
' AND deleted=0'
);
$condition = 'ref_uid=' . intval($ref);
}
return $res['count'] ? ($msg ? sprintf($msg, $res['count']) : $res['count']) : '';
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'*',
'sys_refindex',
'ref_table=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_refindex') .
' AND ' . $condition .
' AND deleted=0'
);
return ($count ? ($msg ? sprintf($msg, $count) : $count) : '');
}
......
}
// Check if sys_refindex is empty
list($count) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('count(*) as rcount', 'sys_refindex', '1=1');
if (!$count['rcount']) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'sys_refindex');
if (!$count) {
$url = 'sysext/lowlevel/dbint/index.php?&id=0&SET[function]=refindex';
$warnings["backend_reference"] = sprintf(
$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.backend_reference'),
t3lib/class.t3lib_page.php (Revision 5162)
// If a shortcut mode is set and no valid page is given to select subpags from use the actual page.
$searchUid = intval($row['shortcut'])?intval($row['shortcut']):$row['uid'];
}
$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', $searchField.'='.$searchUid.$this->where_hid_del.$this->where_groupAccess.' '.$addWhere, '', $sortField);
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res2)) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
'pages',
$searchField . '=' . $searchUid .
$this->where_hid_del .
$this->where_groupAccess .
' ' . $addWhere
);
if (!$count) {
unset($row);
}
$GLOBALS['TYPO3_DB']->sql_free_result($res2);
} elseif ($row['doktype'] == 4 && $checkShortcuts) {
// Neither shortcut target nor mode is set. Remove the page from the menu.
unset($row);
t3lib/class.t3lib_div.php (Revision 5162)
public static function makeRedirectUrl($inUrl,$l=0,$index_script_url='') {
if (strlen($inUrl)>$l) {
$md5 = substr(md5($inUrl),0,20);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('md5hash', 'cache_md5params', 'md5hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($md5, 'cache_md5params'));
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'*',
'cache_md5params',
'md5hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($md5, 'cache_md5params')
);
if (!$count) {
$insertFields = array(
'md5hash' => $md5,
'tstamp' => time(),
t3lib/class.t3lib_fullsearch.php (Revision 5162)
$qp = $GLOBALS['TYPO3_DB']->searchQuery(array($swords), $list, $table);
// Count:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, $qp.t3lib_BEfunc::deleteClause($table));
list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $table, $qp . t3lib_BEfunc::deleteClause($table));
if($count || $showAlways) {
// Output header:
$out.='<strong>TABLE:</strong> '.$GLOBALS['LANG']->sL($conf['ctrl']['title']).'<BR>';
t3lib/class.t3lib_tcemain.php (Revision 5162)
$tableList = array();
foreach (array_keys($GLOBALS['TCA']) as $table) {
if (!in_array($table,$allowedArray)) { // If the table is not in the allowed list, check if there are records...
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, 'pid='.intval($page_uid));
$count = $GLOBALS['TYPO3_DB']->sql_fetch_row($mres);
if ($count[0]) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', $table, 'pid=' . intval($page_uid));
if ($count) {
$tableList[]=$table;
}
}
......
// Do check:
if ($prevTitle != $checkTitle || $count<100) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', $table, 'pid='.intval($pid).' AND '.$field.'='.$GLOBALS['TYPO3_DB']->fullQuoteStr($checkTitle, $table).$this->deleteClause($table), '', '', '1');
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$rowCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
$table,
'pid=' . intval($pid) .
' AND ' . $field . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($checkTitle, $table) .
$this->deleteClause($table)
);
if ($rowCount) {
return $this->getCopyHeader($table,$pid,$field,$value,$count+1,$checkTitle);
}
}
......
$inList = trim($this->rmComma(trim($inList)));
if ($inList && !$this->admin) {
foreach (array_keys($GLOBALS['TCA']) as $table) {
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, 'pid IN ('.$inList.')'.t3lib_BEfunc::deleteClause($table));
$count = $GLOBALS['TYPO3_DB']->sql_fetch_row($mres);
if ($count[0] && ($this->tableReadOnly($table) || !$this->checkModifyAccessList($table))) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
$table,
'pid IN (' . $inList . ')' . t3lib_BEfunc::deleteClause($table)
);
if ($count && ($this->tableReadOnly($table) || !$this->checkModifyAccessList($table))) {
return FALSE;
}
}
typo3/class.db_list.inc (Revision 5162)
* @see makeQueryArray()
*/
function setTotalItems($queryParts) {
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(*)',
$queryParts['FROM'],
$queryParts['WHERE']
);
list($rCount) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result);
$this->totalItems = $rCount;
$this->totalItems = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'*',
$queryParts['FROM'],
$queryParts['WHERE']
);
}
/**
typo3/mod/tools/em/class.em_index.php (Revision 5162)
$tablesNA = array();
foreach($tablesArray as $tN) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $tN, '');
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $tN);
if (!$GLOBALS['TYPO3_DB']->sql_error()) {
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$tables[$tN]='<tr><td>&nbsp;</td><td><a href="'.htmlspecialchars('index.php?CMD[dumpTables]='.rawurlencode($tN).'&CMD[showExt]='.$extKey).'" title="Dump table \''.$tN.'\'">'.$tN.'</a></td><td>&nbsp;&nbsp;&nbsp;</td><td>'.$row[0].' records</td></tr>';
$tables[$tN]= '<tr><td>&nbsp;</td><td><a href="' .
htmlspecialchars('index.php?CMD[dumpTables]=' . rawurlencode($tN) . '&CMD[showExt]=' . $extKey) .
'" title="Dump table \'' . $tN . '\'">' . $tN . '</a></td><td>&nbsp;&nbsp;&nbsp;</td><td>' .
$count . ' records</td></tr>';
} else {
$tablesNA[$tN]='<tr><td>&nbsp;</td><td>'.$tN.'</td><td>&nbsp;</td><td>Did not exist.</td></tr>';
}
typo3/mod/tools/em/class.em_xmlhandler.php (Revision 5162)
}
// Fetch count
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) as cnt', 'cache_extensions', $where);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$this->matchingCount = $row['cnt'];
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'cache_extensions', $where);
$this->matchingCount = $count;
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'cache_extensions', $where, '', $order, $offset.','.$limit);
$this->extensionsXML = array();
typo3/sysext/cms/web_info/class.tx_cms_webinfo_lang.php (Revision 5162)
* @return integer Number of content elements from the PID where the language is set to a certain value.
*/
function getContentElementCount($pageId,$sysLang) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(*)',
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
'tt_content',
'pid='.intval($pageId).
' AND sys_language_uid='.intval($sysLang).
t3lib_BEfunc::deleteClause('tt_content').
'pid=' . intval($pageId) .
' AND sys_language_uid=' . intval($sysLang) .
t3lib_BEfunc::deleteClause('tt_content') .
t3lib_BEfunc::versioningPlaceholderClause('tt_content')
);
list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
return $count ? $count : '-';
}
}
typo3/sysext/cms/layout/class.tx_cms_layout.php (Revision 5162)
}
}
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'pages', 'pid='.intval($pid).$qWhere);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
if ($row[0]) {
$this->plusPages[$pid]=$row[0];
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'pages', 'pid=' . intval($pid) . $qWhere);
if ($count) {
$this->plusPages[$pid] = $count;
}
}
return $theRows;
......
case 'days':
$timespan = mktime (0,0,0)+intval($fParts[1])*3600*24;
// Page hits
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(*)',
'sys_stat',
$this->stat_select_field.'='.intval($row['uid']).'
AND tstamp>='.intval($timespan).'
AND tstamp<'.intval($timespan+3600*24)
);
list($number) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$number = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'*',
'sys_stat',
$this->stat_select_field . '=' . intval($row['uid']) .
' AND tstamp >=' . intval($timespan) .
' AND tstamp <' . intval($timespan + 3600 * 24)
);
if ($number) {
// Sessions
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
......
* @return integer Number of records.
*/
function numberOfRecords($table,$pid) {
global $TCA;
$c=0;
if ($TCA[$table]) {
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, 'pid='.intval($pid).t3lib_BEfunc::deleteClause($table).t3lib_BEfunc::versioningPlaceholderClause($table));
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($result)) {
$c=$row[0];
}
if ($GLOBALS['TCA'][$table]) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
$table,
'pid=' . intval($pid) .
t3lib_BEfunc::deleteClause($table) .
t3lib_BEfunc::versioningPlaceholderClause($table)
);
}
return $c;
return intval($count);
}
/**
......
if ($this->pI_showStat && t3lib_extMgm::isLoaded('sys_stat')) {
// Counting total hits:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'sys_stat', 'page_id='.intval($rec['uid']));
$rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
if ($rrow[0]) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'sys_stat', 'page_id=' . intval($rec['uid']));
if ($count) {
// Get min/max
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('min(tstamp) AS min,max(tstamp) AS max', 'sys_stat', 'page_id='.intval($rec['uid']));
......
if ($GLOBALS['BE_USER']->check('tables_select',$tName) && (t3lib_extMgm::isLoaded($tName)||t3lib_div::inList('fe_users,tt_content',$tName) || isset($this->externalTables[$tName]))) {
// Make query to count records from page:
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $tName, 'pid='.intval($id).t3lib_BEfunc::deleteClause($tName).t3lib_BEfunc::versioningPlaceholderClause($tName));
list($c) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result);
$c = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
$tName,
'pid=' . intval($id) .
t3lib_BEfunc::deleteClause($tName) .
t3lib_BEfunc::versioningPlaceholderClause($tName)
);
// If records were found (or if "tt_content" is the table...):
if ($c || t3lib_div::inList('tt_content',$tName)) {
typo3/sysext/cms/layout/db_layout.php (Revision 5162)
}
// Find if there are ANY languages at all (and if not, remove the language option from function menu).
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'sys_language', ($BE_USER->isAdmin()?'':'hidden=0'));
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'sys_language', ($BE_USER->isAdmin() ? '' : 'hidden=0'));
if (!$count) {
unset($this->MOD_MENU['function']['2']);
}
......
* @return void
*/
function getNumberOfHiddenElements() {
$q_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'tt_content', 'pid='.intval($this->id).' AND sys_language_uid='.intval($this->current_sys_language).t3lib_BEfunc::BEenableFields('tt_content',1).t3lib_BEfunc::deleteClause('tt_content').t3lib_BEfunc::versioningPlaceholderClause('tt_content'));
list($q_count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($q_res);
return $q_count;
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
'tt_content',
'pid=' . intval($this->id) .
' AND sys_language_uid=' . intval($this->current_sys_language) .
t3lib_BEfunc::BEenableFields('tt_content', 1) .
t3lib_BEfunc::deleteClause('tt_content') .
t3lib_BEfunc::versioningPlaceholderClause('tt_content')
);
}
/**
typo3/sysext/cms/tslib/class.tslib_fe.php (Revision 5162)
// Now it's investigated if the raw page-id points to a hidden page and if so, the flag is set.
// This does not require the preview flag to be set in the admin panel
$idQ = t3lib_div::testInt($this->id) ? 'uid='.intval($this->id) : 'alias='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->id, 'pages').' AND pid>=0'; // pid>=0 added for the sake of versioning...
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('hidden', 'pages', $idQ.' AND hidden!=0 AND deleted=0');
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'pages', $idQ . ' AND hidden!=0 AND deleted=0');
if ($count) {
$this->fePreview = 1; // The preview flag is set only if the current page turns out to actually be hidden!
$this->showHiddenPage = 1;
}
typo3/sysext/cms/tslib/class.tslib_content.php (Revision 5162)
function checkPid($uid) {
$uid = intval($uid);
if (!isset($this->checkPid_cache[$uid])) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'uid='.intval($uid).$this->enableFields('pages').' AND doktype NOT IN ('.$this->checkPid_badDoktypeList.')');
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$this->checkPid_cache[$uid] = 1;
} else {
$this->checkPid_cache[$uid] = 0;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
'pages',
'uid=' . intval($uid) .
$this->enableFields('pages') .
' AND doktype NOT IN (' . $this->checkPid_badDoktypeList . ')'
);
$this->checkPid_cache[$uid] = (bool)$count;
}
return $this->checkPid_cache[$uid];
}
typo3/sysext/cms/tslib/class.tslib_fetce.php (Revision 5162)
*
* @param string The database table to check
* @param string The fieldname from the database table to search
* @param string The value to search for.
* @param integer The hash value to search for.
* @return integer The number of found rows. If zero then no "double-post" was found and its all OK.
* @access private
*/
function checkDoublePostExist($table,$doublePostField,$key) {
$where = $doublePostField.'='.$key;
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, $where);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
return $row[0];
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'*',
$table,
$doublePostField . '=' . $key
);
}
/**
typo3/sysext/tstemplate/ts/index.php (Revision 5162)
function getCountCacheTables($humanReadable) {
$out = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(id)',
'cache_pages',
''
);
list($out['cache_pages']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$out['cache_pages'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_pages');
$out['cache_pagesection'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_pagesection');
$out['cache_hash'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_hash');
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(id)',
'cache_pagesection',
''
);
list($out['cache_pagesection']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'count(id)',
'cache_hash',
''
);
list($out['cache_hash']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
if ($humanReadable) {
$newOut = array();
foreach ($out as $k => $v) {
typo3/sysext/indexed_search/mod/index.php (Revision 5162)
$recList=array();
reset($tables);
while(list(,$t)=each($tables)) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $t, '');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$recList[] = array($this->tableHead($t), $row[0]);
$recList[] = array(
$this->tableHead($t),
$GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $t)
);
}
return $recList;
}
......
$recList[] = array($this->tableHead("TYPO3 pages"), count($items));
// TYPO3 pages:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_phash', 'data_page_id!=0');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$recList[] = array($this->tableHead("TYPO3 pages, raw"), $row[0]);
$recList[] = array(
$this->tableHead("TYPO3 pages, raw"),
$GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_phash', 'data_page_id!=0')
);
// External files, unique
$items = array();
......
$recList[] = array($this->tableHead("External files"), $row[0]);
// External files
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_phash', 'data_filename!=\'\'');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$recList[] = array($this->tableHead("External files, raw"), $row[0]);
$recList[] = array(
$this->tableHead("External files, raw"),
$GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_phash', 'data_filename!=\'\'')
);
return $recList;
}
......
* @return [type] ...
*/
function getNumberOfSections($phash) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_section', 'phash='.intval($phash));
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
return $row[0];
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_section', 'phash=' . intval($phash));
}
/**
......
* @return [type] ...
*/
function getNumberOfFulltext($phash) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_fulltext', 'phash='.intval($phash));
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
return $row[0];
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_fulltext', 'phash=' . intval($phash));
}
/**
typo3/sysext/indexed_search/class.indexer.php (Revision 5162)
*/
function submitFile_grlist($hash) {
// Testing if there is a gr_list record for a non-logged in user and if so, there is no need to place another one.
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('phash', 'index_grlist', 'phash='.intval($hash).' AND (hash_gr_list='.$this->md5inthash($this->defaultGrList).' OR hash_gr_list='.$this->md5inthash($this->conf['gr_list']).')');
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'phash',
'index_grlist',
'phash=' . intval($hash) .
' AND (hash_gr_list=' . $this->md5inthash($this->defaultGrList) .
' OR hash_gr_list=' . $this->md5inthash($this->conf['gr_list']) . ')'
);
if (!$count) {
$this->submit_grlist($hash,$hash);
}
}
......
* @return void
*/
function is_grlist_set($phash_x) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('phash_x', 'index_grlist', 'phash_x='.intval($phash_x));
return $GLOBALS['TYPO3_DB']->sql_num_rows($res);
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'phash_x',
'index_grlist',
'phash_x=' . intval($phash_x)
);
}
/**
typo3/sysext/indexed_search/class.crawler.php (Revision 5162)
foreach($runningIndexingConfigurations as $cfgRec) {
// Look for ended processes:
list($queued_items) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'count(*) AS count',
$queued_items = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'*',
'tx_crawler_queue',
'set_id='.intval($cfgRec['set_id']).' AND exec_time=0'
'set_id=' . intval($cfgRec['set_id']) . ' AND exec_time=0'
);
if (!$queued_items['count']) {
if (!$queued_items) {
// Lookup old phash rows:
$oldPhashRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
typo3/sysext/install/mod/class.tx_install.php (Revision 5162)
// Get cache_imagesizes info
if (isset ($tables['cache_imagesizes'])) {
$cleanupType['cache_imagesizes'] = 'Clear cached image sizes only';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('COUNT(*) AS icount', 'cache_imagesizes', '');
$resArr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc ($res);
$cachedImageSizesCounter = intval ($resArr['icount']);
$cachedImageSizesCounter = intval($GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'cache_imagesizes'));
} else {
$this->message($headCode,'Table cache_imagesizes does not exist!',"
The table cache_imagesizes was not found. Please check your database settings in Basic Configuration and compare your table definition with the Database Analyzer.
......
// Getting number of static_template records
if ($whichTables['static_template']) {
$res_static = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'static_template', '');
list($static_template_count) = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_static);
$static_template_count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'static_template');
}
$static_template_count=intval($static_template_count);
......
$username = 'admin';
$pass = 'password';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'be_users', 'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr($username, 'be_users'));
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
'be_users',
'username=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($username, 'be_users')
);
if (!$count) {
$insertFields = array(
'username' => $username,
'password' => md5($pass),
......
if ($table!='--div--') {
$table_c = TYPO3_OS=='WIN' ? strtolower($table) : $table;
if ($whichTables[$table_c]) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, '');
list($countEntries[$table]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$countEntries[$table] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $table);
// Checkboxes:
$checkBoxes[]= '<input type="checkbox" name="TYPO3_INSTALL[database_clearcache]['.$table.']" id="TYPO3_INSTALL[database_clearcache]['.$table.']" value="1"'.($this->INSTALL['database_clearcache'][$table]||$_GET['PRESET']['database_clearcache'][$table]?' checked="checked"':'').'> <label for="TYPO3_INSTALL[database_clearcache]['.$table.']"><strong>'.$table.'</strong> ('.$countEntries[$table].' rows) - '.$labelArr[$table].'</label>';
}
......
* @return [type] ...
*/
function isBackendAdminUser() {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'be_users', 'admin=1');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
return current($row);
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'be_users', 'admin=1');
}
/**
......
* @return [type] ...
*/
function isStaticTemplates() {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'static_template', '');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
return current($row);
return $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'static_template');
}
/**
    (1-1/1)