// On delete: check if confirmation has been given\r
if ( ($action == 'delete') && (requestVar('confirmation') != 'yes') )\r
{\r
- self::batchAskDeleteConfirmation('comment',$selected);\r
+ self::batchAskDeleteConfirmation('comment', $selected);\r
}\r
\r
self::pagehead();\r
* @param integer $itemid ID for item\r
* @return void\r
*/\r
- static private function deleteOneItem($itemid)\r
+ static public function deleteOneItem($itemid)\r
{\r
global $member, $manager;\r
\r
* @param integer $commentid ID for comment\r
* @return void\r
*/\r
- static private function deleteOneComment($commentid)\r
+ static public function deleteOneComment($commentid)\r
{\r
global $member, $manager;\r
\r
* @param void\r
* @return void\r
*/\r
- static private function deleteOneTeamMember($blogid, $memberid)\r
+ static public function deleteOneTeamMember($blogid, $memberid)\r
{\r
global $member, $manager;\r
\r
* @param String $catid category id for deleting\r
* @return Void\r
*/\r
- static private function deleteOneCategory($catid)\r
+ static public function deleteOneCategory($catid)\r
{\r
global $manager, $member;\r
\r
* @params Integer $memberid member id\r
* @return String null string or error messages\r
*/\r
- static private function deleteOneMember($memberid)\r
+ static public function deleteOneMember($memberid)\r
{\r
global $manager;\r
\r
* @param void\r
* @return void\r
*/\r
- static private function deleteOnePlugin($pid, $callUninstall = 0)\r
+ static public function deleteOnePlugin($pid, $callUninstall = 0)\r
{\r
global $manager;\r
\r
$selected = requestIntArray('batch');
$action = requestVar('batchaction');
-
+
switch ( $this->skintype )
{
case 'batchitem':
// walk over all selectedids and perform action
foreach ( $selected as $selectedid )
{
+ echo $selectedid;
$error = '';
$selectedid = intval($selectedid);
case 'delete':
if ( $this->skintype != 'batchteam' )
{
- $error = Admin::deleteaction($selectedid);
+ $error = call_user_func_array(array('Admin', $deleteaction), array($selectedid));
}
else
{
}
break;
case 'move':
- $error = Admin::moveaction($selectedid, $destid);
+ $error = call_user_func_array(array('Admin', $moveaction), array($selectedid));
break;
case 'setadmin':
// always succeeds
$template = ob_get_contents();
ob_end_clean();
- echo Template::fill($template, $data);
- return;
}
+ echo Template::fill($template, $data);
+ return;
}
/**
$restriction = 78 - strlen($header) - strlen($footer) ;\r
\r
$encoded_words = array();\r
- for ( $i = 0; $i < self::strlen($string); $i++ )\r
+ for ( $i = 0; $i < i18n::strlen($string); $i++ )\r
{\r
if ( self::$scheme == 'B' )\r
{\r
$letters = '';\r
}\r
\r
- $letter = self::substr($string, $i, 1);\r
+ $letter = i18n::substr($string, $i, 1);\r
$expected_length = strlen($letters) + strlen($letter) * 4 / 3;\r
\r
if ( $expected_length > $restriction )\r
\r
$letters .= $letter;\r
\r
- if ( $i == self::strlen($string) - 1 )\r
+ if ( $i == i18n::strlen($string) - 1 )\r
{\r
$encoded_text = self::b_encoder($letters);\r
$encoded_words[] = "{$header}{$encoded_text}{$footer}";\r
\r
$encoded_text .= $encoded_letter;\r
\r
- if ( $i == self::strlen($string) - 1 )\r
+ if ( $i == i18n::strlen($string) - 1 )\r
{\r
$encoded_words[] = "{$header}{$encoded_text}{$footer}";\r
break;\r
private static $dateFormat = '\'%Y-%m-%d %H:%M:%S\'';
/**
+ * DB::setConnectionInfo()
* Set the information to connect to the database, it will attempt to connect.
* @param string $engine Engine
* @param string $host Host
}
/**
+ * DB::disConnect()
* Disconnect the connection to the database.
*/
public static function disConnect()
}
/**
+ * DB::getExecCount()
* To get the number of times you run the statement.
* @return int Number of executions
*/
}
/**
+ * DB::formatDateTime()
* The value converted to a format that can be passed to the database datetime.
* @param int $timestamp UNIX timestamp
* @param int $offset timestamp offset
}
/**
+ * DB::getValue()
* Gets the value of the first column of the first row of the results obtained in the statement.
* @param string $statement SQL Statement
* @return mixed Result value. If the call fails, it will return FALSE.
{
if ( self::$dbh == null ) return FALSE;
self::$execCount++;
- $stmt = &self::$dbh->query($statement);
- if ( $result = $stmt->fetch(PDO::FETCH_NUM) )
+ $result = self::showErrorDisplay(self::$dbh->query($statement));
+ if ( $row = $result->fetch(PDO::FETCH_NUM) )
{
- return $result[0];
+ return $row[0];
}
return FALSE;
}
/**
+ * DB::getRow()
* Gets the first row of the results obtained in the statement.
* @param string $statement SQL Statement
* @return array Result row. If the call fails, it will return FALSE.
{
if ( self::$dbh == null ) return FALSE;
self::$execCount++;
- return self::$dbh->query($statement)->fetch(PDO::FETCH_BOTH);
+ $result = self::showErrorDisplay(self::$dbh->query($statement));
+ return $result->fetch(PDO::FETCH_BOTH);
}
/**
+ * DB::getResult()
* Gets the set of results obtained in the statement.
* @param string $statement SQL Statement
* @return PDOStatement Result set object. If the call fails, it will return FALSE.
{
if ( self::$dbh == null ) return FALSE;
self::$execCount++;
- return self::$dbh->query($statement);
+ return self::showErrorDisplay(self::$dbh->query($statement));
}
/**
+ * DB::execute()
* Execute an SQL statement and return the number of affected rows.
* @param string $statement SQL Statement
* @return int number of rows that were modified or deleted by the SQL statement you issued.
{
if ( self::$dbh == null ) return FALSE;
self::$execCount++;
- return self::$dbh->exec($statement);
+ return self::showErrorDisplay(self::$dbh->exec($statement));
+ }
+
+ /**
+ * DB::showErrorDisplay()
+ * On the display query execution result query has an error in the case of FALSE.
+ * @param mixed $result Query execution result
+ * @return mixes Query execution result
+ */
+ private static function showErrorDisplay($result)
+ {
+ global $CONF;
+ if ( array_key_exists('debug', $CONF) && $CONF['debug'] )
+ {
+ if ( $result === FALSE )
+ {
+ $err = self::getError();
+ print('mySQL error with query $query: ' . $err[2]);
+ }
+ }
+ return $result;
}
/**
+ * DB::getError()
* Gets the error information associated with the last operation.
* @return array Error info
*/
}
/**
+ * DB::quoteValue()
* Quotes a string for use in a query.
* @param string $value Value to quote
* @return string Quoted value
}
/**
+ * DB::getInsertId()
* Get the value of the ID of the rows that are inserted at the end.
* @return string ID of the row
*/
}
/**
+ * DB::getAttribute()
* Gets the attribute of the database.
* @return string Attribute
*/