Permalink
Browse files

fixes #1 : export user comments

  • Loading branch information...
plegall committed Nov 20, 2017
1 parent 5ae019b commit abc49ffb9c3d3df3e667e8e425445cd0de30387b
Showing with 37 additions and 1 deletion.
  1. +33 −0 admin.php
  2. +2 −1 admin.tpl
  3. +1 −0 language/en_UK/plugin.lang.php
  4. +1 −0 language/fr_FR/plugin.lang.php
View
@@ -97,6 +97,39 @@
fputcsv($output, $row);
}
}
if ('comments' == $_GET['type'])
{
$query = '
SELECT
id,
image_id,
date,
author,
email,
author_id,
anonymous_id,
website_url,
validated,
validation_date,
content
FROM '.COMMENTS_TABLE.'
ORDER BY id
;';
$result = pwg_query($query);
$is_first = true;
while ($row = pwg_db_fetch_assoc($result))
{
if ($is_first)
{
fputcsv($output, array_keys($row));
$is_first = false;
}
fputcsv($output, $row);
}
}
exit();
}
View
@@ -9,4 +9,5 @@ fieldset p {text-align:left;margin:0;}
</div>
<a href="{$EXPORT_DATA_ADMIN}&amp;type=albums">{'Export albums'|@translate}</a>
| <a href="{$EXPORT_DATA_ADMIN}&amp;type=photos">{'Export photos'|@translate}</a>
| <a href="{$EXPORT_DATA_ADMIN}&amp;type=photos">{'Export photos'|@translate}</a>
| <a href="{$EXPORT_DATA_ADMIN}&amp;type=comments">{'Export comments'|@translate}</a>
@@ -2,4 +2,5 @@
$lang['Export Data'] = 'Export Data';
$lang['Export albums'] = 'Export albums';
$lang['Export photos'] = 'Export photos';
$lang['Export comments'] = 'Export comments';
?>
@@ -2,4 +2,5 @@
$lang['Export Data'] = 'Extraction de données';
$lang['Export albums'] = 'Extraire les albums';
$lang['Export photos'] = 'Extraire les photos';
$lang['Export comments'] = 'Extraire les commentaires';
?>

0 comments on commit abc49ff

Please sign in to comment.