Gallery / Upload / Feu [udt]

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
Ramms

Gallery / Upload / Feu [udt]

Post by Ramms »

Hello,

I found a post that talked about this udt here:

http://forum.cmsmadesimple.org/viewtopi ... w=previous

To work this is what I did as Modified:

Code: Select all

$gCms = cmsms();

$modops = cmsms()->GetModuleOperations();
$uploads = $modops->get_module_instance('Uploads');
$gallery = $modops->get_module_instance('Gallery');
$feu = $modops->get_module_instance('FrontEndUsers');
$feu_user = $feu->LoggedInID();

$db = cmsms()->GetDB();

$filepath = "membres/". $feu_user ."/";
$filename = $params['name'];
$title = $params['summary'];
$comment = $params['description'];


$query = "SELECT fileid FROM " . cms_db_prefix() . "module_gallery WHERE filepath='membres/' AND filename='" . $feu_user . "/' LIMIT 1";
$galleryid = $db->getOne( $query );

if (!$galleryid) {return 'Errror';}

$query = "INSERT INTO " . cms_db_prefix() . "module_gallery
            (fileid, filename, filepath, filedate, fileorder,
             active, defaultfile, galleryid, title, comment)
             VALUES (0, ?, ?, NOW(), ?, ?, ?, ?, ?, ?)";

$dbresult = $db->Execute( $query, array (
                                    $filename,
                                    $filepath,
    0,1,0,
                                    $galleryid,
                                    $title,
                                    $comment));
                      
I want to know what I just optimized to make lighter.

I also like to know how suitable the function module offered AddToFileDB gallery.

Thank you for your help
Locked

Return to “Modules/Add-Ons”