Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 17    Views: 93

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
02/06/14 08:25 AM (11 years ago)

Workflow Advice Needed

Hey guys, Hoping you can help me out with some suggestions on how I should proceed in my app. I'm using a combination of plugins that have some issues, and trying to find the right combo. Here's the situation. GOAL: Have my app display pictures, but still use the Tabbar Utility plugin. My app really needs the colored tab icons which tabbar utility provides. PROBLEM 1: Tabbar Utility plugin is incompatible with thumbviewer plugin. After loading a thumbviewer image screen and pressing the back button, tabbar utility crashes. It's a known issue, and cannot be fixed by the author of either tabbar utility plugin nor the author of thumbviewer plugin. It wasn't from a lack of trying, so my hats off to both authors for giving it a try. PROBLEM 2: MacImage Gallery apparently also has a known issue, where none of the tool bars show up in a tabbed layout. It only shows the image. Looks too naked. It doesn't display the previous, next, share, save, etc buttons, nor the title bar. There is a work around for creating these functions in an action sheet, but the screen would still look naked and the user would have to swipe to see the functions. PROBLEM 3: I could upload all of my images to Flickr and use Chris's Flickr Images plugin, but it looks too much like a menu screen, like menu with image, which my app already uses a bit too much of, and I don't want the whole app to look like a "list". Really need the photos to display like one of the other two plugins above. So... how would some of you tackle this problem? The colored icons really are a must, as my app looks 10 times worse without them, so I really don't want to give up tabbar utility plugin, unless there is a way to hard code the colored icons without having thumbviewer plugin crashing it when viewing an image. Even if there was a way to change the plugin to automatically reload instantly upon crashing the tabbar, that would work too... I just couldn't figure out how to do it.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/06/14 08:52 AM (11 years ago)
What about one of Kittsy's plugins?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 09:05 AM (11 years ago)
Hmmm... the only one I see that would possibly work by Kittsy would be Mosaic Menu... which I didn't realize until just now that it could be used as an image gallery. I thought it was more of a menu type of plugin. Hard to tell by the description or screenshots how it would display as an image gallery (and a little expensive to "just buy it and see")... is it possible to layout the thumbnail images more in like a grid fashion that in the mosaic "puzzle style" pattern? Basically, my app has about 250 sections, and each section has it's own sub-set of photos of about 10-20 photos each, so I'd need to be able to create multiple instances of the Mosaic Menu screen, with each one showing some sort of thumbnails or something (preferably in a grid fashion, like thumbviewer), and basically function like the the other two gallery plugins do. I would also need to retrieve the images from a dataURL... is there a script available to do so, or worst case easy flickr integration? I prefer a php script on my own server over flickr, but could upload everything to flickr as a last resort. Would this plugin fit the bill?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/06/14 09:08 AM (11 years ago)
You can set each image to have its own size (2 blocks by 2 blocks), (2x4), etc. so definitely possible to do a grid. If used as an image gallery, clicking an image will blow it up real nice. Not sure if you can use a dataURL for connecting to a pho script, but probably. The other I was thinking of was the carousel plugin.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 09:17 AM (11 years ago)
I might give Mosaic Menu a try then. I already have Carousel, and use it for some of my smaller menus in my menu drill down process, but when adding a carousel item, you choose which screen it loads... so wouldn't I have to create a screen for each image that way? I don't see a way to have it load a directory of images or an image directly, like a photo viewer, unless there is a way using the dataURL Also Chris, I sent you an email a few days ago about possibly doing a custom plugin for me... a really easy one... not sure if you got the email or not.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/06/14 10:01 AM (11 years ago)
Would an html solution for displaying photos work for you? You could call that from html doc or custom url or html pro?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 10:07 AM (11 years ago)
Not really... I have about 250 sections, each with 10-20 images... so 2500-5000 images total. That's a lot of html screens ;) I could possibly use some sort of html/php image gallery script and point a customurl to it, but would have to modify it so the users can't jump section to section via the page, and would prefer it to be native... but as a last resort, it could be an option. Would just like to give the users some additional options, like swiping for next/previous, save image, email image, etc
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/06/14 10:16 AM (11 years ago)
I had this in mind http://www.photoswipe.com/ It has been used in the past by some of us and does swipe, but sounds like you have a more heavyweight idea than I did! Good luck with your search, let us know what you find that works. Cheers, Alan
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
02/06/14 10:28 AM (11 years ago)
Photoswipe is great and works well with flickr. I use it in my android apps until a native gallery comes out :) Too bad all of the other plugins aren't compatible.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 10:32 AM (11 years ago)
Yeah, I might have to give that a try. I'm trying to get Mosaic Menu working as a photo gallery right now, but having trouble figuring out what to use for the dataurl... the flickr url that I use for macimage gallery doesn't work, and I have a php script that I use with thumbviewer plugin, but no such script for mosaic menu.
 
EdReyes
Lost but trying
Profile
Posts: 574
Reg: Oct 21, 2013
location unknow...
17,640
like
02/06/14 10:41 AM (11 years ago)
wow 5000 images, how big of a download do you estimate that to be?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 10:45 AM (11 years ago)
lol, they are not included in the app bundle, they are downloaded on demand, so no file size worries. Each section only has 10-20 images, and each image is only about 50k, so for example with thumb viewer plugin, when viewing the section, all 10-20 thumbnail images download in less than 2 seconds, and the images load in the background pretty much as fast as a user can navigate to them, so there is no delay.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 12:59 PM (11 years ago)
Looks like I'm able to use Mosaic Menu. Thanks for the suggestion Chris. I was able to modify the php script that I used with thumbviewer to feed the proper JSON to mosaic, and now the data URL works perfectly with it, so I won't have to make individual screen or upload to flickr or anything. I'll just have to recreate all of my thumbviewer screen in Mosaic, but easy compared to the other alternatives. Thanks to everyone for all the suggestions and help!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
02/06/14 01:05 PM (11 years ago)
awesome! great news, it would be nice to see that hack if you're willing to share :) if not i understand totally!
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 01:11 PM (11 years ago)
Wasn't really a hack, so much as modifying and adding a few lines to the PHP script. The original script was modded by Danny to work with ThumbViewer. It has been further modified by me to work with my mosaic menu setup. The script below will show thumbnails in a 2x2 format grid, and will hard code the title next to the share button as "Share of Save This Photo" instead of having individual titles (as preferred with my setup). The title on the thumbnail is also turned off. Replace YOURDOMAIN and YOURIMAGEDIRECTORY in the URL's to your own. Just drop the php file in the same directory as your images, and for your data URL, point to the php file. Here is what I used for the script: -------------------------------------------------------------------------------- <?php /* Sample Image Output --------------------------------------------- 04/29/2010 - Created by David Book, buzztouch.com. 05/01/2013 - Modified version by PSMDanny for showing images with ThumbViewer Plugin. 02/06/2014 - Further modified by Angry Ninja for use with Mosaic Menu to serve images as a gallery, instead of using ThumbViewer. Shows image thumbnails in 2x2 fashion (2 images per row, unlimited rows), titles on thumbnails turned off, and title hard coded next to share/save button as "Share or Save This Photo" instead of individual titles per image. Re-save this file with a .PHP extention and place in on your PHP enabled web-server */ ///////////////////////////////////////////////////////////////// // SET THESE 2 VARIABLES TO YOUR NEEDS //The URL to prepend to images file names. Do not include the trailing slash (/) $urlToThisDirectory = "http://www.YOURDOMAIN.com/YOURIMAGEDIRECTORY"; //writeable image directory. It's assumed that this script is in the same directory as the images. $imageDirPath = "."; ///////////////////////////////////////////////////////////////// //when outputting images for an Image Gallery each image needs a unique BT_itemId, use this function to create one function fnCreateGuid(){ $RandomStr_1 = md5(microtime()); $RandomStr_2 = md5(microtime()); $randomString = substr($RandomStr_2, 4, 4) . substr($RandomStr_1, 0, 15); return $randomString; } ///////////////////////////////////////////////////////////////////////////////////////////////////////// //GET requests with a deviceId should output all the images in the directory. //This JSON output is used to power an Image Gallery Screen. //start the JSON output $JSON = "{\"childItems\":["; //loop all the files in this directory and add image files to the JSON if(is_dir($imageDirPath)){ if($handle = opendir($imageDirPath)){ while (false !== ($file = readdir($handle))) { if(strlen($file) > 4){ //image files must end with .jpg, .jpgeg or .png $ext = substr(strrchr($file, '.'), 1); //get rid of invalid returns in file name $file = str_replace("\n\r", "", $file); $file = str_replace("\n", "", $file); $file = str_replace("\r", "", $file); if(strtoupper($ext) == "JPG" || strtoupper($ext) == "JPEG" || strtoupper($ext) == "PNG"){ $JSON .= "\n{\"itemId\":\"" . strtoupper(fnCreateGuid()) . "\","; $JSON .= "\"itemType\":\"AK_mosaicMenu\", "; $JSON .= "\"titleText\":\"Share or Save This Photo\", "; $JSON .= "\"mosaicType\":\"6\", "; $JSON .= "\"size\":\"10\", "; $JSON .= "\"showTitle\":\"0\", "; $JSON .= "\"imageTitle\":\"" . $file . "\","; $JSON .= "\"imageURL\":\"" . $urlToThisDirectory . "/" . $file . "\"},"; } } } } //remove the comma after last image so JSON is valid $JSON = trim($JSON); if(substr(strtoupper($JSON), (strlen($JSON) - 1), 1) == ","){ $JSON = substr($JSON, 0, strlen($JSON) - 1); } //end the JSON $JSON .= "\n]}"; //print the output echo $JSON; exit(); } ///////////////////////////////////////////////////////////////////////////////////////////////////////// ?>
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
02/06/14 01:27 PM (11 years ago)
Thanks! I appreciate it.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
02/06/14 01:34 PM (11 years ago)
No problem, hopefully it helps someone else out there. :)
 
EdReyes
Lost but trying
Profile
Posts: 574
Reg: Oct 21, 2013
location unknow...
17,640
like
02/06/14 01:42 PM (11 years ago)
Thanks for the share, cant wait to see the finished results
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.