PDA

View Full Version : snippets stuff


wkitty42
11th of June 2007 (Mon), 17:25
how would one go about using the snippets or existing routines to display newest or random thumbs or microthumbs from a specific gallery?

for example, in the default eE style, the left column shows the ten latest photos... this is easily changed to ten random photos... now, when one selects a group of exhibits, how can we display only randoms from that group?

i've not had any real chance to even attempt to dig into it yet and am hoping that someone, especially pekka ;), would have the answer...

triadib
12th of June 2007 (Tue), 03:07
Hi,

if you want to realize it with snippets first take a look at:
http://photography-on-the.net/forum/showthread.php?p=3208044#post3208044

Within the snippet script there is a parameter $exhibition which is default set to "all".
Insert a specific exhibition number and you will get only photos out of this exhibition.

The other solution (I think you mentioned about this) is to edit templates/pages/ee_2_default/index/default_XHTML_content.php and the following section:


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<td valign="top" class="ee_column_left">
<span class="ee_css_paragraph_bold"><?php print $latest_photos_header_html; ?></span>
<br class="clear" /><br class="clear" />
<?php ee_latest_photos("10","thumb"); ?>


The function ee_latest_photos (last line in the section above) is defined as:
function ee_latest_photos($amount="10",$viewtype="text",$exhibition="",$viewdelimiter="<br />")

As you can see, only two parameters were set in the template. Simply insert:

<?php ee_latest_photos("10","thumb","<exhibition_number(s) delimited by ,>"); ?>


If you want to use random photos instead, use the following function:

function ee_random_photos($amount="10",$viewtype="text",$exhibition="",$viewdelimiter="<br />")


<?php ee_random_photos("10","thumb","<exhibition_number(s) delimited by ,>"); ?>


Hope it helps
Regards from Germany
Dirk

wkitty42
16th of June 2007 (Sat), 05:14
that's close, dirk... i thank you for the research and time... the problem, however, is that we can create groups but these two functions only give the option of "all" or "exhibits by numbers"... i guess what i'm needing is a function that can determine the current group and then feed the exhibit numbers of that group to the above functions...

hummm... looks like i'll have to dig in and go root out the code that figures the group's exhibits from the existing code... you know, when you choose a group, and you have, say, four exhibits in that group... you see those four exhibits listed and some random photos from them... i'm wanting to fix the left column so that it restricts the photos to those in the current group...

wkitty42
23rd of June 2007 (Sat), 23:46
bump!

does anyone have any ideas on the original question? pekka? is new code required?

timned88
16th of November 2007 (Fri), 23:21
this is easily changed to ten random photos...



ok, how does one do this? please explain....

timned88
16th of November 2007 (Fri), 23:50
never mind... found it here
http://photography-on-the.net/forum/showthread.php?t=223821