View Single Post
Old 2018-04-17, 02:22 PM   #10
Toby
Lonewolf Internet Sales
 
Toby's Avatar
 
Join Date: Mar 2005
Location: Houston
Posts: 4,826
Send a message via ICQ to Toby
Here's code from my Latex Vixens site...
It pulls 2 new galleries, by date_approved DESC
It pulls 3 old galleries by Rand()
It then pulls 30 most recent galleries by date_displayed DESC
Code:
{* PULL THE 2 MOST RECENT NEW GALLERIES FROM THE DATABASE *}
{galleries
var=$galleries
type=permanent
format=any
getnew=true
allowused=true
description=true
preview=true
amount=2
previewsize=135x180
category=MIXED
sponsor=any
order=date_approved DESC
reorder=date_approved DESC}
{foreach var=$gallery from=$galleries counter=$counter}
        <td align="center"><a href="TGPX/click.php?id={$gallery.gallery_id|urlencode}&u={$gallery.gallery_url|urlencode}"><img src="{phpcode} echo str_replace("http://www.latex-vixens.com/", "", "{$gallery.preview_url|htmlspecialchars}"); {/phpcode}" width="135" height="180" border="1" alt="{$gallery.description|htmlspecialchars}"></a><br><span class="style8">{phpcode}  echo strtoupper("{$gallery.date_displayed|tdate::'j-M-Y'}") {/phpcode} </span></td>
{/foreach}
{* PULL 3 RANDOM NEW GALLERIES FROM THE DATABASE *}
{galleries
var=$galleries
type=permanent
format=any
getnew=true
allowused=true
description=true
preview=true
amount=3
previewsize=135x180
category=MIXED
sponsor=any
order=RAND()
reorder=date_displayed DESC}
{foreach var=$gallery from=$galleries counter=$counter}
        <td align="center"><a href="TGPX/click.php?id={$gallery.gallery_id|urlencode}&u={$gallery.gallery_url|urlencode}"><img src="{phpcode} echo str_replace("http://www.latex-vixens.com/", "", "{$gallery.preview_url|htmlspecialchars}"); {/phpcode}" width="135" height="180" border="1" alt="{$gallery.description|htmlspecialchars}"></a><br><span class="style8">{phpcode}  echo strtoupper("{$gallery.date_displayed|tdate::'j-M-Y'}") {/phpcode} </span></td>
{/foreach}
      </tr>
      <tr>
{* PULL THE 30 MOST RECENT USED GALLERIES FROM THE DATABASE *}
{galleries
var=$galleries
type=permanent
format=any
getnew=false
allowused=false
description=true
preview=true
amount=30
previewsize=135x180
category=MIXED
sponsor=any
order=date_displayed DESC
reorder=date_displayed DESC}
{* DISPLAY ALL OF THE GALLERIES *}
{foreach var=$gallery from=$galleries counter=$counter}
        <td align="center"><a href="TGPX/click.php?id={$gallery.gallery_id|urlencode}&u={$gallery.gallery_url|urlencode}"><img src="{phpcode} echo str_replace("http://www.latex-vixens.com/", "", "{$gallery.preview_url|htmlspecialchars}"); {/phpcode}" width="135" height="180" border="1" alt="{$gallery.description|htmlspecialchars}"></a><br><span class="style8">{phpcode}  echo strtoupper("{$gallery.date_displayed|tdate::'j-M-Y'}") {/phpcode} </span></td>
{insert counter=$counter location=+5 max=25}
</tr><tr>
{/insert}
{/foreach}
      </tr>
    </table>
That fills the first 7 rows. I then have 3 more sections of 7 rows (35 galleries each) also order by date_displayed DESC

Last edited by Toby; 2018-04-17 at 02:26 PM..
Toby is offline   Reply With Quote