*/
public function validateDatabaseAccess() {
parent::validateDatabaseAccess();
-
+
$sql = "SELECT COUNT(*) FROM ".$this->databasePrefix."core_like";
$statement = $this->database->prepareStatement($sql);
$statement->execute();
if (in_array('com.woltlab.wcf.user.avatar', $this->selectedData) || in_array('com.woltlab.wbb.attachment', $this->selectedData) || in_array('com.woltlab.wcf.conversation.attachment', $this->selectedData)) {
if (empty($this->fileSystemPath) || !@file_exists($this->fileSystemPath . 'conf_global.php')) return false;
}
-
+
return true;
}
*/
public function getQueue() {
$queue = array();
-
+
// user
if (in_array('com.woltlab.wcf.user', $this->selectedData)) {
if (in_array('com.woltlab.wcf.user.group', $this->selectedData)) {
$queue[] = 'com.woltlab.wcf.conversation';
$queue[] = 'com.woltlab.wcf.conversation.message';
$queue[] = 'com.woltlab.wcf.conversation.user';
-
+
if (in_array('com.woltlab.wcf.conversation.attachment', $this->selectedData)) $queue[] = 'com.woltlab.wcf.conversation.attachment';
}
}
// board
if (in_array('com.woltlab.wbb.board', $this->selectedData)) {
- $queue[] = 'com.woltlab.wbb.board';
+ $queue[] = 'com.woltlab.wbb.board';
$queue[] = 'com.woltlab.wbb.thread';
$queue[] = 'com.woltlab.wbb.post';
}
if (in_array('com.woltlab.wbb.like', $this->selectedData)) $queue[] = 'com.woltlab.wbb.like';
}
-
+
return $queue;
}
$profileFields[] = $row;
}
}
-
+
// prepare password update
$sql = "UPDATE wcf".WCF_N."_user
SET password = ?
WHERE userID = ?";
$passwordUpdateStatement = WCF::getDB()->prepareStatement($sql);
-
+
// get users
$sql = "SELECT pfields_content.*, members.*, profile_portal.*
FROM ".$this->databasePrefix."members members
while ($row = $statement->fetchArray()) {
$this->boardCache[$row['parent_id']][] = $row;
}
-
+
$this->exportBoardsRecursively();
}
*/
protected function exportBoardsRecursively($parentID = -1) {
if (!isset($this->boardCache[$parentID])) return;
-
+
foreach ($this->boardCache[$parentID] as $board) {
ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id'], array(
'parentID' => ($board['parent_id'] != -1 ? $board['parent_id'] : null),
while ($row = $statement->fetchArray()) {
$threadIDs[] = $row['tid'];
}
-
+
// get tags
$tags = $this->getTags('forums', 'topics', $threadIDs);
-
+
// get threads
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('topics.tid IN (?)', array($threadIDs));
-
+
$sql = "SELECT topics.*
FROM ".$this->databasePrefix."topics topics
".$conditionBuilder;
$conditionBuilder->add('tag_meta_app = ?', array($app));
$conditionBuilder->add('tag_meta_area = ?', array($area));
$conditionBuilder->add('tag_meta_id IN (?)', array($objectIDs));
-
+
// get taggable id
$sql = "SELECT tag_meta_id, tag_text
FROM ".$this->databasePrefix."core_tags
$string = preg_replace('~<a.*?href=(?:"|\')([^"]*)(?:"|\')>(.*?)</a>~is', '[url=\'\\1\']\\2[/url]', $string);
// smileys
- $string = preg_replace('~<img src=\'[^\']+\' class=\'bbc_emoticon\' alt=\'([^\']+)\' ?/?>~is', '\\1', $string);
+ $string = preg_replace('~<img src=\'[^\']+\' class=\'bbc_emoticon\' alt=\'([^\']+)\' ?/?>~is', '\\1', $string);
// images
$string = preg_replace('~<img[^>]+src=["\']([^"\']+)["\'][^>]*/?>~is', '[img]\\1[/img]', $string);
*/
public function getQueue() {
$queue = array();
-
+
// user
if (in_array('com.woltlab.wcf.user', $this->selectedData)) {
if (in_array('com.woltlab.wcf.user.group', $this->selectedData)) {
$queue[] = 'com.woltlab.wcf.user';
if (in_array('com.woltlab.wcf.user.avatar', $this->selectedData)) $queue[] = 'com.woltlab.wcf.user.avatar';
}
-
+
// board
if (in_array('com.woltlab.wbb.board', $this->selectedData)) {
$queue[] = 'com.woltlab.wbb.board';
if (in_array('com.woltlab.wbb.attachment', $this->selectedData)) $queue[] = 'com.woltlab.wbb.attachment';
}
-
+
return $queue;
}
*/
public function validateDatabaseAccess() {
parent::validateDatabaseAccess();
-
+
$sql = "SELECT COUNT(*) FROM ".$this->databasePrefix."kunena_users";
$statement = $this->database->prepareStatement($sql);
$statement->execute();
if (in_array('com.woltlab.wcf.user.avatar', $this->selectedData) || in_array('com.woltlab.wbb.attachment', $this->selectedData)) {
if (empty($this->fileSystemPath) || !@file_exists($this->fileSystemPath . 'libraries/kunena/model.php')) return false;
}
-
+
return true;
}
SET password = ?
WHERE userID = ?";
$passwordUpdateStatement = WCF::getDB()->prepareStatement($sql);
-
+
// get users
$sql = "SELECT kunena_users.*, users.*,
(
while ($row = $statement->fetchArray()) {
$this->boardCache[$row['parent_id']][] = $row;
}
-
+
$this->exportBoardsRecursively();
}
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
-
+
foreach ($this->boardCache[$parentID] as $board) {
ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id'], array(
'parentID' => ($board['parent_id'] ?: null),
'description' => $board['description'],
'isClosed' => $board['locked'] ? 1 : 0
));
-
+
$this->exportBoardsRecursively($board['id']);
}
}
$quoteCallback = new Callback(function ($matches) {
$username = str_replace(array("\\", "'"), array("\\\\", "\'"), $matches[1]);
$postID = $matches[2];
-
+
$postLink = LinkHandler::getInstance()->getLink('Thread', array(
'application' => 'wbb',
'postID' => $postID,
'forceFrontend' => true
)).'#post'.$postID;
$postLink = str_replace(array("\\", "'"), array("\\\\", "\'"), $postLink);
-
+
return "[quote='".$username."','".$postLink."']";
});
}
public function exportUserOptions($offset, $limit) {
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('name NOT IN (?)', array(self::$knownProfileFields));
-
+
$sql = "SELECT *
FROM ".$this->databasePrefix."profilefields
".$conditionBuilder."
'message' => self::fixBBCodes(StringUtil::decodeHTML($row['message_text']), $row['bbcode_uid']),
'time' => $row['message_time'],
'attachments' => $row['attachments'],
- 'enableSmilies' => $row['enable_smilies'],
+ 'enableSmilies' => $row['enable_smilies'],
'enableHtml' => 0,
'enableBBCodes' => $row['enable_bbcode'],
'showSignature' => $row['enable_sig']
}
}
}
-
+
/**
* Counts user options.
*/
while ($row = $statement->fetchArray()) {
$this->boardCache[$row['parentid']][] = $row;
}
-
+
$this->exportBoardsRecursively();
}
}
catch (\Exception $e) {
if ($this->readOption('attachfile') == self::ATTACHFILE_DATABASE && $file) @unlink($file);
-
+
throw $e;
}
}
/**
* valid thread sort fields
- * @var array<string>
+ * @var array<string>
*/
protected static $availableThreadSortFields = array('topic', 'username', 'time', 'views', 'replies', 'lastPostTime', 'cumulativeLikes');
while ($row = $statement->fetchArray()) {
$imageIDs[] = $row['photoID'];
}
-
+
// get tags
$tags = $this->getTags('com.woltlab.wcf.user.gallery.photo', $imageIDs);
-
+
// get categories
$categories = array();
$conditionBuilder = new PreparedStatementConditionBuilder();
if (!isset($categories[$row['objectID']])) $categories[$row['objectID']] = array();
$categories[$row['objectID']][] = $row['categoryID'];
}
-
+
// get images
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('user_gallery.photoID IN (?)', array($imageIDs));
-
+
$sql = "SELECT user_gallery.*
FROM wcf".$this->dbNo."_user_gallery user_gallery
".$conditionBuilder;
WHERE eventID = ?
ORDER BY startTime";
$firstEventDateStatement = $this->database->prepareStatement($sql, 1);
-
+
$sql = "SELECT participation_to_user.*, participation.eventID
FROM wcf".$this->dbNo."_calendar_event_participation_to_user participation_to_user
LEFT JOIN wcf".$this->dbNo."_calendar_event_participation participation
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('objectTypeID = ?', array($this->getObjectTypeID('com.woltlab.wcf.label.object', $objectType)));
$conditionBuilder->add('objectID IN (?)', array($objectIDs));
-
+
$sql = "SELECT labelID, objectID
FROM wcf".$this->dbNo."_label_object
".$conditionBuilder;
if (!isset($labels[$row['objectID']])) $labels[$row['objectID']] = array();
$labels[$row['objectID']][] = $row['labelID'];
}
-
+
return $labels;
}
*/
public function getQueue() {
$queue = array();
-
+
// user
if (in_array('com.woltlab.wcf.user', $this->selectedData)) {
$queue[] = 'com.woltlab.wcf.user';
*/
public function validateDatabaseAccess() {
parent::validateDatabaseAccess();
-
+
$sql = "SELECT COUNT(*) FROM ".$this->databasePrefix."posts";
$statement = $this->database->prepareStatement($sql);
$statement->execute();
SET password = ?
WHERE userID = ?";
$passwordUpdateStatement = WCF::getDB()->prepareStatement($sql);
-
+
// get users
$sql = "SELECT *
FROM ".$this->databasePrefix."users
while ($row = $statement->fetchArray()) {
$this->categoryCache[$row['parent']][] = $row;
}
-
+
$this->exportBlogCategoriesRecursively();
}
*/
protected function exportBlogCategoriesRecursively($parentID = 0) {
if (!isset($this->categoryCache[$parentID])) return;
-
+
foreach ($this->categoryCache[$parentID] as $category) {
ImportHandler::getInstance()->getImporter('com.woltlab.blog.category')->import($category['term_id'], array(
'title' => StringUtil::decodeHTML($category['name']),
while ($row = $statement->fetchArray()) {
$entryIDs[] = $row['ID'];
}
-
+
// get tags
$tags = array();
$conditionBuilder = new PreparedStatementConditionBuilder();
if (!isset($categories[$row['object_id']])) $categories[$row['object_id']] = array();
$categories[$row['object_id']][] = $row['term_id'];
}
-
+
// get entries
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('post.ID IN (?)', array($entryIDs));
-
+
$sql = "SELECT post.*, user.user_login
FROM ".$this->databasePrefix."posts post
LEFT JOIN ".$this->databasePrefix."users user
WHERE post_type = ?
AND post_status IN (?, ?, ?, ?, ?, ?)
)
- ORDER BY ID";
+ ORDER BY ID";
$statement = $this->database->prepareStatement($sql, $offset, $limit);
$statement->execute(array('_wp_attached_file', 'attachment', 'post', 'publish', 'pending', 'draft', 'future', 'private', 'trash'));
while ($row = $statement->fetchArray()) {
*/
public function validateDatabaseAccess() {
parent::validateDatabaseAccess();
-
+
$sql = "SELECT COUNT(*) FROM xf_template_compiled";
$statement = $this->database->prepareStatement($sql);
$statement->execute();
));
}
}
-
+
/**
* Counts threads.
*/
));
}
}
-
+
/**
* Counts labels.
*/