In a Pagesetter publication type, it's not atypical for me to have up to 20 or so image upload fields. If the images aren't resized before the publication submission, in most cases, the submission fails.
Is there a way to do some sort of asynchronous upload for images? Perhaps some PFM?
If anyone willing to diddle something up to fix this, let me know $
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Pagesetter Image Upload Fields
-
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: May 31, 2010
- Posts: 404
-
- Rank: Moderator
- Registered: Mar 15, 2005
- Last visit: May 30, 2010
- Posts: 1077
-
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 07, 2010
- Posts: 507
It' possible. Look at how Pagesetter stores your image data in the column in mysql, you'll need to create a bulk query to update your publication records to insert that info. Then look at how Pagesetter renames your files in the upload folder, and rename your images to match; the file names consist of the publication type and pid, ending in .dat. The images aren't converted themselves, just renamed.
You may have better luck though submitting your images one at a time so you don't get timeout issues. -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: May 31, 2010
- Posts: 404
bronto
It' possible. Look at how Pagesetter stores your image data in the column in mysql, you'll need to create a bulk query to update your publication records to insert that info. Then look at how Pagesetter renames your files in the upload folder, and rename your images to match; the file names consist of the publication type and pid, ending in .dat. The images aren't converted themselves, just renamed.
You may have better luck though submitting your images one at a time so you don't get timeout issues.
If I was the end user, I would just resize the images and Bob's your uncle.
I would like to have a non-technical end user to have the ability to just upload their images all at once.
I'm sure there's some sort of javascript ditty that could be bashed into submission for this purpose.
Unfortunately, this is beyond my 1337 skillz, so if anyone is willing to jump in, let me know what you think it's worth. -
- Rank: Developer
- Registered: Sep 22, 2005
- Last visit: May 20, 2010
- Posts: 292
-
- Rank: Moderator
- Registered: Mar 15, 2005
- Last visit: May 30, 2010
- Posts: 1077
-
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
If timeout is the problem you could simply add a 'set_time_limit(0)', probably in pagesetter_user_pubedit(). -
- Rank: Softmore
- Registered: May 22, 2004
- Last visit: Apr 03, 2010
- Posts: 451
Quote
swfupload needs to hooked into PS for some serious winnage.
+1!
I just took a look at SWFUpload... whoa!
http://demo.swfupload.org/v220/applicationdemo/index.php
Often I have publications that require images but I am never sure of how many images I need... sure, in the past I've created 30 image fields and just run Smarty template checks to display only fields with images but really- having 30 fields when you only need 3 images stinks... and visa versa when you need 40 images but only have 30 fields... well, up the river...
I haven't played with SWFUpload but methinks it "should" be possible to use the SWFUpload code in a pgForms template and to create a custom Pagesetter workflow action to use PHP to take the uploaded files (they go somewhere right?), rename then a la Pagesetter (pid.tid.revision.dat) (thumbnails might be a bit trickier....?) and then update a Pagesetter field (say, "images") with all the image names in a comma or semicolon separated string... then in the template we can use some Smarty to loop through that field with all the file names and display them... that way we can add as many images as we so choose without having to use Pagesetter's built-in system...
Sound good...? Any thoughts?
I might try and play with this after the Holiday weekend (I have to sit on the beach and drink some beers!)
-J
--
Burnham Racing
Illinois Cycling Association -
- Rank: Moderator
- Registered: Mar 15, 2005
- Last visit: May 30, 2010
- Posts: 1077
Quote
I might try and play with this after the Holiday weekend (I have to sit on the beach and drink some beers!
I'll buy you a beer! OMG! -
- Rank: Developer
- Registered: Feb 17, 2005
- Last visit: May 21, 2010
- Posts: 684
remmingtonshowdown
Sound good...? Any thoughts?
Yes: first of all Pagesetter relations. If the amount of images linked to a publication is dynamic you should rather create a separate publication type that holds an image and use a 1-n relationship. Though you can only create the relations once the main publication has been created. Now I'd rather recommend something stronger while you think about that
Cheers -
- Rank: Softmore
- Registered: May 22, 2004
- Last visit: Apr 03, 2010
- Posts: 451
Well, the idea is to be able to upload as many images as one likes and have them associated with a particular publication instance... It seems that making another publication and using relations is a bit backwards, no?
Isn't there an upload module that hooks into other modules... does that work with Pagesetter...?
Really, we should just come up with a guppy plugin, or better yet a pgForms plugin :) that will allow us to upload a dynamic number of images and have them stored as a string in a Pagesetter field...
It's not that I dislike Pagesetter's upload system- I just find it amazingly limiting... partisularly for such a flexible product.
Or- if we're shooting for the stars- why not a plugin that allows the uploading of a dynamic number of photos into a new Mediashare gallery that is associated with the publication... from within the pagesetter/pgForms upload interface...
-J
--
Burnham Racing
Illinois Cycling Association -
- Rank: Developer
- Registered: Sep 22, 2005
- Last visit: May 20, 2010
- Posts: 292
I think relations is probably the best way to do it.
First, you create your 'master' document. Then in your document template, you have an inline publist to list all files associated with the master, and a "Add file" link to create a 'file document" with the relation field pre-set to the current document. -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: May 31, 2010
- Posts: 404
I thought about the relations route, but for my purposes (real estate) I want to keep all images withing the Pagesetter publication. That way, deleting the document deletes all of the images as well.
With relations, the realtor would have to manually delete each and every photo by hand. Not an option :)
Something that might work would be to have the images upload in the background to a temp directory and populate the image upload field with the location of the newly uploaded local file. Just an idea.
ccandreva
Can you describe what you mean by "asynchronous upload" ?
Several uploading at the same time. -
**unknown user**
- Rank: Expert
- Registered: Mar 16, 2002
- Last visit: Apr 02, 2010
- Posts: 1208
I have been eyeing JSupload: http://gwtupload.alc…pload/JsUpload.html
It basically does what Darryl suggested -- it uploads the files into a hidden iframe. Once you select the first file to upload, it immediately starts the upload and you can continue to add more uploads to the queue.
We just need to figure out how to get PS/pgForm to recognize the uploaded files and insert them into the appropriate fields. Looking at the docs, I don't think it would be too horribly difficult for someone with at least half an idea of how to do it. http://code.google.c…pload_Documentation -
- Rank: Softmore
- Registered: May 22, 2004
- Last visit: Apr 03, 2010
- Posts: 451
Thanks Wendell- I'll have to take a look at JSupload...
For me having the photos not deleted isn't an issue but I do understand you concern...
Ultimately if the uploaded images follow the Pagesetter naming convention (or even not though it would be harder) a custom workflow could be created to also delete the images... but that's a rather long solution...
Really, the way I see it happening is to tear out the Pagesetter upload system and replace it with JSUpload or SWFUpload or another code set of similar function... thats a lot of work though.. I'm not sure I have the time or the skillset to surgically go at Pagesetter... I'm more of a cannon to kill a mosquito kind of guy ;)
Maybe it would be wise to leave Pagesetter alone and focus on adapting/modifying/growing the mediashaare plugin so that from within a Pagesetter creation template (a pgForms template) a user could upload any number of images into a Mediashare gallery and then have that gallery "tagged" with the pid & tid of the publication. Then a simple "inline" gallery could be inserted into the publication referencing the pid & tid...
I hacked a similar solution a while back- instead of the topics field for the Mediashare gallery I stuck in a list of all existing publications:
Code
<!--[elfisk_topicSelector2 id="keywords"]-->
And then I replaced line 61 to the end in mediashare/elfisk/plugind/function.elfisk_topicSelector with this and saved it as function.elfisk_topicSelector2
Code
function smarty_function_elfisk_topicSelectorGetTopics()
{
pnModDBInfoLoad('Pagesetter');
list($dbconn) = pnDBGetConn();
$pntable =& pnDBGetTables();
$topicsTable = $pntable['pagesetter_pubdata4'];
$topicsColumn = $pntable['pagesetter_pubdata4_column'];
$sql = "SELECT pg_pid, pg_field12 FROM pn_pagesetter_pubdata4 ORDER BY pg_field12";
$result = $dbconn->execute($sql);
if ($dbconn->errorNo() != 0)
{
echo 'Elfisk "GetTopics" failed: ' . $dbconn->errorMsg() . " while executing: $sql";
return null;
}
$topics = array();
for (; !$result->EOF; $result->MoveNext())
{
$topics[] = array('id' => intval($result->fields[0]),
'title' => $result->fields[1]);
}
$result->Close();
return $topics;
}
And in the "Create album" template view, now instead of having a list of topics (which of course isn't needed in zikula) you have a list of all publication titles of a particular publication (in my case it's hardcoded to pub4...)
And in the full template of publication 4 I have:
Code
Which uses the key $race (the same field as pg_field12 above) to call Mediashare's list API and create a list of the images... Of course I did have to hack the Mediashare list API so that it could accept a value rather than the default 5... but that's a whole other bunch of hacks...
ANyway, now a user creates a publication and then creates an album and assigns it to the previously created publication and in the publication full template the thumbnails (using lightbox) are displayed...
SO....
Couldn't we just make a Mediashare plugin to do this...
;)
--
Burnham Racing
Illinois Cycling Association
- Moderated by:
- Support
