Skip to content

Commit

Permalink
[Kunena#26] Agora: Fix avatar gallery and subscriptions import
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Aug 28, 2011
1 parent 2b46fcd commit 5e1ef9e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
4 changes: 4 additions & 0 deletions administrator/components/com_kunenaimporter/CHANGELOG.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

KunenaImporter 1.7.0-DEV

28-August-2011 Matias
# [#26] Agora: Fix avatar gallery import
# [#26] Agora: Fix subscriptions import

25-August-2011 Matias
# [#20] Add support for Joomla 1.7: make user creation to work

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@

require_once( JPATH_COMPONENT . '/models/export.php' );

/**
* Agora Exporter Class
*
* Exports data from Agora Forum.
* @todo Configuration import needs some work
* @todo Forum ACL not exported (except for moderators)
* @todo Uploaded avatars are not supported
* @todo Ranks not exported
* @todo Some emoticons may be missing (images/db are not exported)
*/
class KunenaimporterModelExport_Agora extends KunenaimporterModelExport {
/**
* Extension name ([a-z0-9_], wihtout 'com_' prefix)
* Extension name without prefix
* @var string
*/
public $extname = 'agora';
Expand Down Expand Up @@ -408,6 +418,7 @@ public function &exportUserprofile($start=0, $limit=0) {
$avatar = $profile->id.'.gif';
} else {
$avatar_path = '';
$avatar = '';
}
$profile->avatar = $avatar;
$profile->copypath = $avatar_path;
Expand Down Expand Up @@ -499,16 +510,17 @@ public function &exportPollsOptions($start=0, $limit=0) {
}

public function countSubscriptions() {
$query = "SELECT COUNT(*) FROM `#__agora_subscriptions`";
$query = "SELECT COUNT(*) FROM #__agora_subscriptions";
return $this->getCount ( $query );
}

public function &exportSubscriptions($start = 0, $limit = 0) {
$query = "SELECT
w.topic_id AS thread,
u.jos_id AS userid
FROM `#__agora_subscriptions` AS w
LEFT JOIN `#__agora_users` AS u ON w.user_id=u.id";
u.jos_id AS userid,
w.emailed AS future1
FROM #__agora_subscriptions AS w
INNER JOIN #__agora_users AS u ON w.user_id=u.id";
$result = $this->getExportData ( $query, $start, $limit );
return $result;
}
Expand Down Expand Up @@ -565,11 +577,11 @@ public function &exportAvatarGalleries($start = 0, $limit = 0) {
protected function &getAvatarGalleries() {
static $galleries = false;
if ($galleries === false) {
$copypath = JPATH_ROOT.'/components/com_agora/img/pre_avatars';
$path = JPATH_ROOT.'/components/com_agora/img/pre_avatars';
$galleries = array();
$files = JFolder::files($copypath, '\.(?i)(gif|jpg|jpeg|png)$', true);
foreach ($files as $file) {
$galleries[$file] = "{$copypath}/{$file}";
$folders = JFolder::folders($path);
foreach ($folders as $folder) {
$galleries[$folder] = "{$path}/{$folder}";
}
}
return $galleries;
Expand Down

0 comments on commit 5e1ef9e

Please sign in to comment.