function __destruct()
{
- if($this->_connection === NULL)
+ if ($this->_connection === NULL) {
return;
+ }
- # Commit any changes before closing
+ // Commit any changes before closing
$this->_commit();
- # Just close the connection if no link-resource was passed and b8 created it's own connection
- if($this->config['connection'] === NULL)
+ // Just close the connection if no link-resource was passed and b8 created it's own connection
+ if ($this->config['connection'] === NULL) {
mysql_close($this->_connection);
+ }
$this->connected = FALSE;
protected function _get_query($tokens, $uid)
{
- # Construct the query ...
-
- if(count($tokens) > 0) {
+ // Construct the query ...
+ if (count($tokens) > 0) {
$where = array();
}
$where = 'term IN ("' . implode('", "', $where) . '")';
- }
-
- else {
+ } else {
$token = dbesc($token);
$where = 'term = "' . $token . '"';
}
- # ... and fetch the data
+ // ... and fetch the data
- $result = q('
- SELECT * FROM spam WHERE ' . $where . ' AND uid = ' . $uid );
+ $result = q('SELECT * FROM `spam` WHERE ' . $where . ' AND `uid` = ' . $uid );
$returned_tokens = array();
- if(count($result)) {
- foreach($result as $rr)
+ if (dbm::is_result($result)) {
+ foreach ($result as $rr) {
$returned_tokens[] = $rr['term'];
+ }
}
$to_create = array();
- if(count($tokens) > 0) {
+ if (count($tokens) > 0) {
foreach($tokens as $token)
if(! in_array($token,$returned_tokens))
$to_create[] = str_tolower($token);
}
- if(count($to_create)) {
+ if (count($to_create)) {
$sql = '';
- foreach($to_create as $term) {
- if(strlen($sql))
+ foreach ($to_create as $term) {
+ if (strlen($sql)) {
$sql .= ',';
- $sql .= sprintf("(term,datetime,uid) values('%s','%s',%d)",
- dbesc(str_tolower($term))
+ }
+ $sql .= sprintf("(`term`,`datetime`,`uid`) VALUES('%s','%s',%d)",
+ dbesc(str_tolower($term)),
dbesc(datetime_convert()),
intval($uid)
);
- q("insert into spam " . $sql);
+ }
+ q("INSERT INTO `spam` " . $sql);
}
return $result;
* @param string $count
* @return void
*/
-
protected function _put($token, $count, $uid) {
$token = dbesc($token);
$count = dbesc($count);
* @param string $count
* @return void
*/
-
protected function _update($token, $count, $uid)
{
$token = dbesc($token);
* @param string $token
* @return void
*/
-
protected function _del($token, $uid)
{
$token = dbesc($token);
* @access protected
* @return void
*/
-
protected function _commit($uid)
{
}
}
-
-?>
\ No newline at end of file
if (x($_POST,"page_logs")) {
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
- $logfile = (x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : '');
- $debugging = ((x($_POST,'debugging')) ? true : false);
- $loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0);
+ $logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : '');
+ $debugging = ((x($_POST,'debugging')) ? true : false);
+ $loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0);
set_config('system','logfile', $logfile);
set_config('system','debugging', $debugging);
if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
$a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
}
- if(x($a->profile,'openidserver'))
+ if (x($a->profile,'openidserver')) {
$a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
- if(x($a->profile,'openid')) {
+ }
+ if (x($a->profile,'openid')) {
$delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'https://' . $a->profile['openid']);
$a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
}
// site block
- if((! $blocked) && (! $userblock)) {
+ if ((! $blocked) && (! $userblock)) {
$keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords);
if(strlen($keywords))
$datequery2 = escape_tags($a->argv[$x]);
} else {
$datequery = escape_tags($a->argv[$x]);
+ }
} else {
$category = $a->argv[$x];
}