Jump to content

horst

PW-Moderators
  • Posts

    4,064
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. Hi, here are the first SiteProfile: There is currently some weird behave with the importer. So if you will run into something similar, it is only a intermediate state to create duplicate artists ;-) Also the importer part has to be more justified when it comes to duplicate Tracknames but from different Artists/Albums. - All of it is in a very basic an early state! But if you like to play with it you are welcome. If you do some tweaks (regardless of frontend, backend, module-code) please share it here.
  2. Ah, ok, here a screenshot from explorer: (there are some chars in it, that I wouldn't put there, but that shouldn't affect anything because all strings will be sanitized before they go to the getPage-function)
  3. Hi Apeisa, there is no tracklist as children for albums, I have 4 independent branches (GENRES, ARTISTS, ALBUMS, TRACKS) which contain each of them only children of one type (genre, artist, album, track). The parent of an artist-page is ARTISTS. (And an artist-page has no children!) And when the error occures first, there is only one track (the first one) of that album saved. Hope you understand what I try to say?.?
  4. Hi Wanze, I have checked it, all Titles are exactly the same. It ends up with 6 entries of the same Artist-Title, (but with upcounted name-fileds, -1 -2 -3 -4 -5). That is not what I want. And I really do not understand why it behaves that way. Seems not logical to me. $p = wire('pages')->get("template=$template,title=".wire('sanitizer')->selectorValue($title)); This should get the page, or not?
  5. Yeah! That does it! I think no, here are a screenshot of pages:
  6. Hhm, I stuck with something really confusing. I add pages with API when importing data from ID3-tags of mp3 files. I have an album from amazon with large entries for some ID3-fields: // for the Interpret / Artist it has: Sabine Meyer/Academy Of St Martin-In-The-Fields/Kenneth Sillito $artist = 'Sabine Meyer/Academy Of St Martin-In-The-Fields/Kenneth Sillito'; $title = preg_replace('/[^a-zA-Z0-9 _-]/', '', $artist); // the $title now contains 'Sabine MeyerAcademy Of St Martin-In-The-FieldsKenneth Sillito' I can save the first song which also includes to save the artist with the above $title. This is successful. NOW, when I try to import the second track from that album, it has the same artist (of course). I try to get an existing page with following code: public function getPage($template,$title) { $p = wire('pages')->get("template=$template,title=".wire('sanitizer')->selectorValue($title)); if(0==$p->id) { // create the page $p = new Page(); $p->template = $template; $p->title = $title; $p->name = wire('sanitizer')->name($title); $p->parent = wire('pages')->get('template='.strtoupper($template).'S'); $p->save(); $this->dbModified = true; } return $p; } With the first line of code I should get the allready existing Page, but it returns a NullPage, and when executing the create-page-code afterwards, it crashes when trying to save() the page. The Error is: SO, what is wrong? I have copied the title from the input-field of the artists-page and it is exactly stored as it was sanitized and so, it should match!? Or do I something wrong? (e.g. the above code works well with around 3.000 other files, but not with this ones )
  7. So, - that thing with the Titles (sanitizing but leave spaces, etc) seams to be solved. Also basic stream support is added. The output to the frontend is only a simple menu and information about current page. It's made for coders You may have a look to output (it's a bit like var_dump) and the code in the 2 Templatefiles. That's intended as starting point for your own Frontend creation. There is an own caching mechanism with the LocalAudioFiles-module. It caches the menus and the DB-infos. It refreshes them when DB gets modified or you may permanently disable caching in the modules page. Here are the latest screencast: https://youtu.be/qeT5s013GUE and here without audio for the german audience https://youtu.be/MefyBCDDXrs I want upload the first site profile, but have got an error when importing (Can't save page 0: /genre//: It has empty 'name' field). So I first want to fix that and upload siteprofile after that. (Maybe tomorrow evening)
  8. thank you for the info. I will try it out.
  9. Hi teppo, thanks for the help and the useful link. I have tried with the explanation on that site, but I have solved it only 90% with this query: $q = 'SELECT t1.g_id, t1.g_title, t1.g_summary, t1.g_description FROM g2_Item t1 LEFT JOIN g2_CustomFieldMap t2 ON t1.g_id = t2.g_itemId WHERE t2.g_itemId is NULL AND t1.g_canContainChildren=1'; it returns all rows from t1 that have no matching row in t2. But I want to get all that do not have 3 matching rows in t2: sample data of t1: g_id = 1000, g_summary = 'my summary1' , etc. g_id = 2000, g_summary = 'my summary2' , etc. g_id = 3000, g_summary = 'my summary3' , etc. g_id = 4000, g_summary = 'my summary4' , etc. sample data of t2: g_itemId = 1000, g_field = 'custom_fn1', g_value = 'myValue1' g_itemId = 1000, g_field = 'custom_fn2', g_value = 'myValue2' g_itemId = 1000, g_field = 'custom_fn3', g_value = 'myValue3' g_itemId = 2000, g_field = 'custom_fn1', g_value = 'myValue1' g_itemId = 3000, g_field = 'custom_fn1', g_value = 'myValue1' g_itemId = 3000, g_field = 'custom_fn3', g_value = 'myValue3' The wanted select should return the rows for g_id: 2000, 3000, 4000, because only g_id 1000 has all 3 rows in table t2.
  10. Hi, I'm not sure if I can ask this here because it has nothing to do with PW, so - if is unwanted please tell me. I'm actually working on a old site of mine that runs with Gallery2. There I have added 3 userfields to albums and now have to update all data (300 albums). Because it is so very very slow with updating through its own admin interface, I want to write a short interactive update wizzard script but stuck with the mysql-select query. I need to query two tables in a (old) mysql 4 DB. From the first Table I need this: SELECT g_id,g_title,g_summary,g_description FROM g2_Item WHERE g_canContainChildren=1 But I want only get the rows in result where are not set all data in the second table: the second table (g2_CustomFieldMap) has fields: g_itemId,g_field,g_value g_field can contain: 'custom_fn1','custom_fn2','custom_fn3' for each g_itemId (g_itemId is g_id from first Query) Is it possible to call this all together as one query? Any help from mysql-specialists are welcome
  11. Hi Soma, can this be used in the frontend? I want to use DataTables with my MP3-DB in the frontend with AJAX-Pagination and -Sorting.
  12. Hey, is this new? Cool: mods.pw/3y EDIT: uhm, sorry for beeing OT! Just got excited.
  13. Oh, I haven't thought that one could do it with the standard 4S. But apart from technical details, this one is my favourite because of composition and light ;-)
  14. Hi Marty, good work! (site and photos) This one was shot with pure / native iphone 4S ? Or with an additional lens for close-up range?
  15. Maybe it is an option to search for specific camera that supports iOS? google: ipcamera video codecs for ios or is camera allready there?
  16. here is the little module that adds auto population for single textfields with exif or iptc data: http://processwire.com/talk/topic/3398-working-with-processwire-getting-exif-data-from-images/#entry33552 Many thanks for your kind help Soma!
  17. I have written a little module that extends Somas awesome Images Manager. Also it's written with Somas kind help, (thanks!) It adds auto filling of EXIF or IPTC fields where available on upload of new images through Images Manager. How to use it: You, of course have Images Manager installed and ready to run. Now you have to create some fields that should take your exif data: fieldname prefix is exif_ followed by the original exif-fieldname but lowercase! ( exif_author, exif_copyright, etc.) ALSO you have to create one TextArea field called (by default) image_exif, - this one and ... (not needed, only optional to get the full raw EXIF-data stored) all your exif_fields you have to add to the image-template that is used by Images Manager for creating the new Image Pages. then download and install the ImagesManagerMetadata module. here are a little screencast I've done with it: https://youtu.be/wjhJdT7Tf5Y this is alpha, version 0.0.2 ImagesManagerMetadata.zip
  18. Hi Marc, @ 2) actually your original images are kept without manipulations, so all EXIF is kept with them. (at least this is if you not have set a max-width or max-height with your images, this I actually don't and have to check by myself). With all variations the EXIF is stripped! @ 1) I don't know what Marty does but I'm interested to hear about too. I actually try to auto-populate my page fields with EXIF-data and then do a manually correction where needed. After that there are only Pagefields that get outputted to the frontend. EXIF-data reading is done only once. I have written a little module with somas kind help that adds auto filling of EXIF-data to the Images Manager. I will post here in a few minutes when have uploaded a screencast.
  19. Yep (ich habs) : $options = wire('modules')->getModuleConfigData(wire('modules')->get('ImagesManager'));
  20. Allright , - but getting the ExifFieldname would be of great help if the user changes the default name: function ___setMetaData(Page $page, $file, $fieldnameExif) Many thanks!
  21. Hi, it's me again. It would be really nice if we can have a field for IPTC as well: 'imagesIPTCField' => 'image_iptc', and if you can provide their fieldnames within the hookable method: $this->setMetaData($imagepage, $this->upload_path . $file, $this->options['imagesEXIFField'], $this->options['imagesIPTCField']); public function ___setMetaData(Page $page, $file, $fieldnameExif, $fieldnameIPTC) { If you want to populate IPTC data too: // write iptc data if field exists on page if($page->template->fieldgroup->hasField($this->options['imagesIPTCField'])) { $tmp = getimagesize($file, $info); if(isset($info['APP13'])) { $iptc = iptcparse($info['APP13']); if($iptc) { $page->set($this->options['imagesIPTCField'], json_encode($iptc)); } } }
  22. Exif reading is perfect! We can retrieve the data with $myExifArray = wireDecodeJSON( $myImagePage->image_exif ); EDIT: Your solution is very elegant. The user who wants to get Exifdata may only add a TextareaField to his image-Template! --- But there is something with the Textfield not allright: I use Firefox on Windows
  23. Hi Marty, I'm using that same 'lofi approach', - but waiting for Somas ImagesManager to become beta. Also I've posted a question to him.
  24. Hey Soma, very cool Manager! (it's not the first time I say this, but it can't be said to often ) I want to ask if it is possible and if you find it useful, to include an optional userdefined callback-function that gets invoked in the public function executeUpload() method at line 517. After successful upload and the new ImagePage is saved calling it for example like this: if( ! empty($this->options['userCallbackUpload']) && function_exists($this->options['userCallbackUpload']) ) { ${$this->options['userCallbackUpload']}( $imagepage ); } With this, users may have a simple way to extend imagesPageTemplate with some more fields (e.g. for Exif-data). Yes, actually they allready have this option to extend the template or provide an own, but it would only allow to do a manually populating of fields. With a userCallbackFunction it could be done automatically. Is this not of interest for the ImagesManager himself? You may read Exif-description and IPTC-description fields and populate automatically the ImageDescriptionField. (IPTC has higher priority as EXIF). So, if a user uses IPTC-description the field is allready filled, if not, and Exif-Description is available, this is used. Downside: If there is unwanted text populated, the user has to change it manually. But with nothing populated automatically the user allways has to do it all manually. Maybe it could be an boolean option: 'Yes, do autopopulate the image description' or 'NO' ? EDIT: approved code for reading this I can provide, - as you've said elsewhere: i'm the 'metadata-man'
  25. Hi Marty, Hi MarcC, I'm not sure if I understand the question/s right, but I can point out some things that come to my mind when reading it: The imagesfieldtype currently has only one description field what can collect data. This is a Textfield and can store data up to max 64kB. Depending on what EXifdata you need, it maybe a possible approach to store that with the description field (serialized?). Accompanying resize-methods to the imagesfield needs to create an own imagesfield with this extensions. (Like ThumbnailsModule) But I would prefer to store each image as a page and have all wanted single exif-data on that template as fields. To use images as pages is often discussed here, because it's flexible and scalable. Also Somas ImagesManager could be of interest. So, regardless on how you organize your images, I think it would be pretty usefull if the fields get populated automatically somehow, - at upload for example. Saying that, I actually don't really know how to do it. (I'm PW-newbie (somehow), - hook into upload with a module - ok, but what comes after hooking may be very individual on someones need) --- Note: when applying any Imagemanipulation with GD, every EXIF-data get stripped and is lost! You should not manipulate your original images! --- For reading and sorting Exifdata (and IPTC-data) I can provide some code if wanted.
×
×
  • Create New...