gallery script

Permalink 1 user found helpful
I'm not a PHP developer by any standard, but since I cannot seem to find a script or add on that I want to do this I am attempting to write my own.
What I am trying to do is take the first file in each fileset and create a thumbnail for it, then display the thumbnails for all filesets.
So far I have this:
<?php
function createThumbs() {
   Loader::helper('concrete/file');
    Loader::model('file_attributes');
    Loader::library('file/types');
    Loader::model('file_list');
    Loader::model('file_set');
   Loader::helper('image');
       $fileSet = FileSet::getMySets($user = 'jessica');
      foreach ($fileSet as $fileList) {
         $fileList = new FileList(); 
         $firstFile = $fileList[0];
         $fileID = $firstFile->getByID();
         $imgPath = $firstFile->getPath();
         $thumbsDir = 'DIR_REL/thumbs/';

There doesn't seem to be any errors, but it doesn't do anything.
Concrete5's documentation seems rather minimal (compared to something like Wordpress that I am more familiar working with.)
For example, I can't seem to find anywhere that Concrete5 lists its included functions like FileList(); and their uses.
Help making the abomination of code up there work or a resource that explains Concrete5's functions would be helpful.

 
cjramki replied on at Permalink Reply
cjramki
Did you mean $fileList = new FileList();

The FileList() is the object of the class. This class is written in
yoursite/concrete/core/models/file_list.php


Database table retrieving and storing functions are written in model.
You may want to write specific model for each table... It is better way to manipulate the data.
What are all the possibilities to retrieve the data from the database for your site, you can write function for each operation.
You can just load this model in your controller like...
Loader::model('modelname')

then you can just call the function of model and use it any controller.