Ejemplo n.º 1
0
 function copyAlbum($db, $albumId, $newParentId)
 {
     $result = $db->query('SELECT name, ownerId, description FROM albums WHERE id="' . $albumId . '"');
     if (!empty($result)) {
         $album = mysql_fetch_array($result);
         $ownerId = $album['ownerId'];
         $insert_sql_string = 'INSERT INTO albums (parentAlbumId, ownerId, name, created, modified, description) VALUES ("' . $newParentId . '",' . $ownerId . ',"' . $album["name"] . '", CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(), "' . $album["description"] . '" )';
         $db->query($insert_sql_string);
         $newAlbumId = mysql_insert_id();
         copyPhoto($db, $albumId, $newAlbumId);
         $childAlbums = $db->query('SELECT * FROM albums WHERE parentalbumid="' . $albumId . '"');
         if (!empty($childAlbums)) {
             while ($childAlbum = mysql_fetch_array($childAlbums)) {
                 copyAlbum($db, $childAlbum['id'], $newAlbumId);
             }
         }
         return $newAlbumId;
     }
 }
Ejemplo n.º 2
0
  Coppermine version: 1.5.0
  $HeadURL$
  $Revision:  $
  $LastChangedBy:  $
  $Date:  $
**********************************************/
define('IN_COPPERMINE', true);
require 'include/init.inc.php';
if (isset($_POST['exportSubmit'])) {
    $_POST['exportType'] == 'html' ? initHTMLExport($_POST['album'], $_POST['directory']) : initPhotoCopy($_POST['album'], $_POST['directory']);
} else {
    if (isset($_GET['album']) && isset($_GET['path']) && isset($_GET['page'])) {
        exportThumbnailPage();
    } else {
        if (isset($_GET['id']) && isset($_GET['dir'])) {
            copyPhoto($_GET['id'], $_GET['dir']);
        } else {
            pageheader($section, $meta_keywords);
            starttable('60%', 'Chose an Album');
            ?>
    <tr><td>&nbsp;</td></tr>
    <tr>
    <form action='<?php 
            echo $_SERVER['PHP_SELF'];
            ?>
' method='POST'>
    <td>
    Export Type:<br/>
    <input type='radio' name='exportType' value='html'>Formatted HTML</input> <input type='radio' name='exportType' value='img'>Images Only</input><br/><br/>
    Select a Album:
    <select name='album' class='listbox'>
Ejemplo n.º 3
0
define('EXPORT_PHP', true);
require 'include/init.inc.php';
js_include('js/jquery.js');
js_include('js/jquery.cluetip.js');
if (!GALLERY_ADMIN_MODE) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
pageheader($lang_export_php['export']);
if ($superCage->post->keyExists('exportSubmit')) {
    $superCage->post->getAlpha('exportType') == 'html' ? initHTMLExport($superCage->post->getInt('album'), $superCage->post->getEscaped('directory')) : initPhotoCopy($superCage->post->getInt('album'), $superCage->post->getEscaped('directory'));
} else {
    if ($superCage->get->keyExists('album') && $superCage->get->keyExists('path') && $superCage->get->keyExists('page')) {
        exportThumbnailPage($superCage->get->getInt('album'), $superCage->get->getInt('page'), $superCage->get->getEscaped('path'));
    } else {
        if ($superCage->get->keyExists('id') && $superCage->get->keyExists('dir')) {
            copyPhoto($superCage->get->getInt('id'), $superCage->get->getEscaped('dir'));
        } else {
            echo '<form action="export.php" method="POST">';
            $options = '';
            $result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY `title`");
            while ($album = mysql_fetch_assoc($result)) {
                $options .= "<option value=\"{$album['aid']}\">{$album['title']}</option>";
            }
            starttable('-1', $lang_export_php['export'] . '&nbsp;' . cpg_display_help('f=export.htm&amp;as=export&amp;ae=export_end', '600', '450'), 2);
            echo <<<EOT

\t<tr>
\t\t<td class="tableb">
\t\t\t{$lang_export_php['export_type']}
\t\t</td>
\t\t<td class="tableb">