Page 3 of 33
Re: Announcement: New plug-in SuperSizer
Posted: Fri Oct 30, 2009 8:17 pm
by applejack
What is the output of {$event.fields.Photo}
Re: Announcement: New plug-in SuperSizer
Posted: Fri Oct 30, 2009 8:23 pm
by mfal55
Hmmm, not sure what you're exactly asking, but I'll give it a try.
The $event.fields.Photo is a custom field within CG Calendar and I have it in an upcoming list template. Here is the events listing page, where I'm trying to integrate the supersizer tag:
http://tinyurl.com/ykor95e
Thanks so much for helping!
Re: Announcement: New plug-in SuperSizer
Posted: Fri Oct 30, 2009 8:31 pm
by JeremyBASS
try
{assign var=Photo value=$event.fields.Photo}
{supersizer path="uploads/images/events/$Photo" alt=$event.event_title}
that should work if is the call... Now no size mean 25% of org...
Re: Announcement: New plug-in SuperSizer
Posted: Fri Oct 30, 2009 8:35 pm
by mfal55
Wooo hoo! You're a rockstar - thanks so so much to both of you!
Re: Announcement: New plug-in SuperSizer
Posted: Fri Oct 30, 2009 8:48 pm
by JeremyBASS
grand, glad to see it works now

helping is karam for the soul...
cheers
Jeremy
Re: Announcement: New plug-in SuperSizer
Posted: Fri Oct 30, 2009 8:50 pm
by mfal55
Well then you have a ton of good karma! I see you helping a lot on here... many many thanks.

Re: Announcement: New plug-in SuperSizer
Posted: Sat Oct 31, 2009 7:37 pm
by JeremyBASS
New params ... these I think will really make this super flexable. In fact if you don't need a simple on the fly gallery maker here...
- stripTag (optional) - stripTag take a full img tag passed in by the param path="" and makes it usable for SuperSizer ( true/false )
- URL (optional) - - just sizes and outputs the url. you could use this in and XML output, lets say to make a map icon for CGGoogleMaps thru a CGFeedmaker output of a kml/xml
- Subdir (optional) - Create Subfolders -- Organize your photos from within the SuperSizerTmp folder (Subdir=$oneuser.id or Subdir="foo/bar")
EXAMPLE
Subdir is good for FEU if you plan on have many users that have many photos... 10K users with 5 photos would be alot to manage if you do and approval on them.
(TIP: FEU has an error with the thumb size were if set to 0 you can't upload... so set it high till it's fixed)
From CGUserdirectory of FEU
Code: Select all
{* properties *}
{foreach from=$oneuser.properties item='onepropvalue' key='propname'}
<div class="row" style="margin: 0.5em;">
<div style="width: 49%; float: left;">{$properties.$propname.prompt}:</div>
<div style="width: 49%; float: left;">
{if $properties.$propname.type == 6}
{* image <img src="{$file_location}/{$onepropvalue}" width="100"/>*}
{*test of the stripTag*}
{assign var=1 value='<img class="test of things" src="uploads/feusers/'}
{assign var=2 value='" width="100" alt=""/>'}
{supersizer path="$1$onepropvalue$2" width="100" alt="" Subdir=$oneuser.id stripTags="true"}
{*normal use is path="uploads/feusers/$onepropvalue" as {$file_location} includes the domain and schema*}
{else}
{$onepropvalue}
{/if}
</div>
</div>
{/foreach}
Re: Announcement: New plug-in SuperSizer
Posted: Sat Oct 31, 2009 10:48 pm
by JeremyBASS
Version RC 0.4
Ok... I had to add these to.. so a new release... sorry I know it was fast thou I bet know one even noticed lol... Ok..
Assign (optional) - Assign the output (return the smarty assignment) Use in conjunction with out without URL
debugIT (optional) - Get an array of the pre and post images... the original and the resized
( true/false ) This information is required for any support
Also here is a live example of what this plugin can do...
http://www.corbensproducts.com/blog/exp ... sizer.html
The code that produces it to...
Code: Select all
{* properties *}
{foreach from=$oneuser.properties item='onepropvalue' key='propname'}
<div class="row" style="margin: 0.5em;">
<div style="width: 49%; float: left;">{$properties.$propname.prompt}:</div>
<div style="width: 49%; float: left;">
{if $properties.$propname.type == 6}
<h3>Original image (FEU Made)</h3>
<img src="{$file_location}/{$onepropvalue}" width="100"/>
<br/>
{assign var=sizeWAS value="/home/public_html/corbensproducts.com/uploads/feusers/$onepropvalue"}
Size is: {$sizeWAS|filesize} bytes
<h3>Resized image (SuperSizer Made)</h3>
{supersizer path="uploads/feusers/$onepropvalue" width="100" alt="" Subdir=$oneuser.id}
<br/>{supersizer path="uploads/feusers/$onepropvalue" width="100" alt="" Subdir=$oneuser.id URL=true Assign="sizeIS"}
Size is: {$sizeIS|replace:"http://www.corbensproducts.com/":"/home/public_html/corbensproducts.com/"|filesize} bytes
<br/>
<h3>So output is</h3>
{supersizer path="uploads/feusers/$onepropvalue" width="100" alt="" Subdir=$oneuser.id URL=true}
<br/>
<h3>From</h3>
{$file_location}/{$onepropvalue}
<br/>{else}
{$onepropvalue}
{/if}
</div>
</div>
{/foreach}
Re: Announcement: New plug-in SuperSizer
Posted: Sat Oct 31, 2009 11:29 pm
by JeremyBASS
So you want a Gallery... this is how... This is
Super Basic and should give you an idea but in a more complex version you'd make the thumbs to the display image all for a "lightbox" type set up...
http://www.corbensproducts.com/blog/exp ... ample.html
Code: Select all
{assign var=Files value="uploads/feusers/*.jpg"|glob}
{foreach from=$Files item='File'}
{supersizer path="$File" width="100" alt="" Subdir="Example_CALENDAR_event_id" URL=true Assign="MainPic"}
<a href="{$MainPic}" >{$MainPic}</a>
{/foreach}
If this don't make sense think building a gallery from the ground up or folder out.
SO. . .If you had had a 100 images in there you would have got a 100 links. Add more params and well you got a album that you could set on any asset like a FEU profile, or a Calendar events etc...
Also the wiki is updated now too...
http://wiki.cmsmadesimple.org/index.php ... supersizer
Cheers
Jeremy
Re: Announcement: New plug-in SuperSizer
Posted: Wed Nov 04, 2009 11:25 pm
by mfal55
Hi Jeremy,
Thanks for replying before... I gave the supersizer a shot in Cataloger and sadly I just can't figure out the correct set up. I thought I couldn't do something like I would for the Calendar module, or like what you're doing for the gallery, but I'm not putting the pieces in the right places.... feeling a little stupid at the moment! I was hoping I could figure it out on my own. :-[ Alas...
Here is my code:
Code: Select all
<ul id="artistlist">
{section name=numloop loop=$items}
<li><a href="{$items[numloop].link}"><img src="{$items[numloop].image}" title="{$items[numloop].title}" alt="{$items[numloop].title}"/></a>
<h4>{$items[numloop].title}</h4>
</li>
{/section}
</ul>
I did various tries at this... all of which are wrong (can you tell I'm not a php person?

)
Code: Select all
<ul id="artistlist">
{section name=numloop loop=$items}
{assign var=artist value=$items[numloop].image}
<li><a href="{$items[numloop].link}">{supersizer path="$artist" alt="{$items[numloop].title}" width="100px" Quality="100"}</a>
<h4>{$items[numloop].title}</h4>
</li>
{/section}
</ul>
I know you're busy, so if you have a free moment...
Re: Announcement: New plug-in SuperSizer
Posted: Thu Nov 05, 2009 12:30 am
by JeremyBASS
mfal55 wrote:
Hi Jeremy,
Thanks for replying before... I gave the supersizer a shot in Cataloger and sadly I just can't figure out the correct set up. I thought I couldn't do something like I would for the Calendar module, or like what you're doing for the gallery, but I'm not putting the pieces in the right places.... feeling a little stupid at the moment! I was hoping I could figure it out on my own. :-[ Alas...
Here is my code:
Code: Select all
<ul id="artistlist">
{section name=numloop loop=$items}
<li><a href="{$items[numloop].link}"><img src="{$items[numloop].image}" title="{$items[numloop].title}" alt="{$items[numloop].title}"/></a>
<h4>{$items[numloop].title}</h4>
</li>
{/section}
</ul>
I did various tries at this... all of which are wrong (can you tell I'm not a php person?

)
Code: Select all
<ul id="artistlist">
{section name=numloop loop=$items}
{assign var=artist value=$items[numloop].image}
<li><a href="{$items[numloop].link}">{supersizer path="$artist" alt="{$items[numloop].title}" width="100px" Quality="100"}</a>
<h4>{$items[numloop].title}</h4>
</li>
{/section}
</ul>
I know you're busy, so if you have a free moment...
close.. try
{supersizer path=$artist alt=$items[numloop].title width="100px" Quality="100"}
if that don't work... what is $artist ? you may need to add the param stripTag ... there are also example in the FAQ of the wiki
Cheers
Jeremy
Re: Announcement: New plug-in SuperSizer
Posted: Thu Nov 05, 2009 1:42 am
by mfal55
Hey Jeremy - thanks for your help. Unfortunately, that didn't work... The closest I got to it working was if I did this:
Code: Select all
<ul id="artistlist">
{section name=numloop loop=$items}
<li><a href="{$items[numloop].link}">{supersizer path=items[numloop].image alt=$items[numloop].title width="100px" Quality="100"}</a>
<h4>{$items[numloop].title}</h4>
</li>
{/section}
</ul>
I don't get any errors (which I did with every other try), but the image doesn't appear (just the alt tag). The one I posted with $artist was from me thinking I needed to set a variable... but I know I was doing it wrong. Argh.
FYI - without the supersizer plugin, this is the normal, working code for Cataloger (for reference)... I just don't know where Supersizer fits in:
Code: Select all
<ul id="artistlist">
{section name=numloop loop=$items}
<li><a href="{$items[numloop].link}"><img src="{$items[numloop].image}" title="{$items[numloop].title}" alt="{$items[numloop].title}"/></a>
<h4>{$items[numloop].title}</h4>
</li>
{/section}
</ul>
I stumbled onto something else as I was doing this... you had suggested including stripTag. I went to put it in and realized that I was using an earlier version of your Supersizer. So I downloaded the latest, but I received an error when using it. I originally was using it within CG Cal (thanks to you!) and it was working fine until I replaced the file. This is the error I received:
Warning: substr_compare() [function.substr-compare]: The length cannot exceed initial string length in /home/content/c/r/i/crimsonlaurel/html/dev/plugins/function.supersizer.php on line 413.
So now I really don't know what I'm doing wrong... Any thoughts?
Re: Announcement: New plug-in SuperSizer
Posted: Thu Nov 05, 2009 1:53 am
by JeremyBASS
you know I don't know why I suggested strip tag... that is for when you passing in the path....
try
{assign var=artist value=$items[numloop].image}
{assign var=TheTitle value=$items[numloop].title }
{supersizer path="$artist" alt="$TheTitle" width="100px" Quality="100"}
That should be right... I so read your last post wrong and must have been thinking of something else lol...
Re: Announcement: New plug-in SuperSizer
Posted: Thu Nov 05, 2009 2:14 am
by JeremyBASS
also what is {$artist} print out after the assignment?
Re: Announcement: New plug-in SuperSizer
Posted: Thu Nov 05, 2009 3:02 am
by mfal55
Hey again - no, didn't work

This resulted in the same as before... I get the spot for the image and the alt tag, but no image.
So, $artist was the variable name I made up for the {assign var=...} bit - like you did with TheTitle. It was supposed to be the variable for the $items[numloop].image tag that Cataloger supplies. If I'm understanding your question correctly, I put the {$artist} tag at the bottom of my screen to see what it prints out and it prints out the path to the last cataloger image on the page.
I feel like I'm heading in the right direction.... but something is just missing.
Again, many thanks for your help