Announcement

  •  » Engine
  •  » Developer Documentation

#1 2016-12-26 02:37:45

reddn
Member
DC, USA
2015-09-29
30

Developer Documentation

Dev team,

Could anyone write a short synopsis of the layout of piwigo.  I do not know the Smarty framework, but mostly learn by seeing the output and the code and going from there.  I can write raw php, and also play with arduino/esp8266.  I just have trouble trying to figure out the structure.

The way I have the wife and my phone is to upload all of our pictures from our phones to my FreeNAS (where i run piwigo in a jail).  I will script (and post as a howto for others) how to setup automated sync on specific directories, or might write a page to do this.  I prefer cron calling a piwigo script every few minutes to accomplish this.  I also do not like how the page/broswer has to stay active to accomplish 'large' tasks, like pre-building thumbnails, maybe add that as a cron background check.  I personally like all images to have a prebuilt medium for speed.

Either way.  I have already built a php app for myself that organizes all of my pdf files that i scan (all of my bills, and anyting in the mail i receive).  My scanner uploads to a folder and the cron job scans it, md5's it, moves it and puts it in the db. 

I will attach my current scripts here.  I have 3
-add date_creation for pictures that have the date in the filename (multiple styles work)
-add md5 of files into the database (need to make a column 33 char long in piwigo_images named md5sum)
-copies images that have 'illegal' characters.  some of mine have parentheses '()'.  it copies them in to the same directory replacing the parentheses  with a dash. it also adds the path to a table in the database so i can later delete the copies once piwigo accepts the filenames.  (note: i can not just rename the file as my syncing app on the phone will just copy the picture again)

Piwigo version: 2.8.3
PHP version: 5.6
MySQL version: ?
Piwigo URL: http://none

Offline

 

#2 2016-12-26 03:59:19

reddn
Member
DC, USA
2015-09-29
30

Re: Developer Documentation

The adddatecreated.php does not stop looking for the other patterns if it finds one matching pattern in the filename.  I haven't had the issue myself, but it could find multiple patterns. I suggest doing 'dry runs'/simulations on my scripts. it should have code to show what will happen if you actually run it.

ETA: I can not upload the scripts.  I will put them on my github.  https://github.com/reddn/piwigoScripts

Last edited by reddn (2016-12-26 07:05:54)

Offline

 
  •  » Engine
  •  » Developer Documentation

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact