Jump to content
edendom

Guide To Build An Index Page With Arylia Galleries

Recommended Posts

edendom    1

Here is a template if you want to build a page with arylia. (with some bootstrap 3 codes)

Galleries limit 4 you can change to what you need. On this DB request I order it by date Desc (ORDER BY createDate DESC).

You must change the Database details to match your Database and 'yourdomain' string of course

 

<?php

// Reads the data from the DB limited by the items per page view
mysql_connect("localhost", "DB username", "DB Password") or die("Could not connect: " . mysql_error());
mysql_select_db("DB name");


$galsResult = mysql_query("SELECT galleryUrl, createDate, description, galleryName, gallerySlug FROM builder_galleries ORDER BY createDate DESC LIMIT 4".$limit_str); while($thisGallery = mysql_fetch_assoc($galsResult)) {

    ?>
                            <div class="col-md-6 col-sm-6">
                           
                                    
                                    <a href="<?= $thisGallery["galleryUrl"] ?>"><img width="100%" height="auto" src="http://www.yourdomain.com<?= substr($thisGallery["galleryUrl"], 0, strrpos($thisGallery["galleryUrl"], "/")) ?>/thumbs/preview.jpg" alt="<?=$thisGallery["galleryName"] ?>" /></a>
                                        
                                        
                                       
                                        <p>
                                          <h4><a  title="<?=$thisGallery["galleryName"] ?>" href="<?= $thisGallery["galleryUrl"] ?>"><?=short ($thisGallery["galleryName"],50) ?></a></h4>                                         
                                         <? echo date('F j, Y',strtotime($thisGallery["createDate"])); ?><br>
                                      <?= $thisGallery["description"] ?><br>
                                      
                                   </p>
                                   
                             </div>       

                                
                                <? }  ?>
                                
                           
Hope this could help some ;) Edited by edendom

Share this post


Link to post
Share on other sites
edendom    1

Excellent, thanks for your contribution.

 

I've moved your tip to the Arylia Tips and Tricks section.

Ok thanks ;)

I forgot to say that it could be filtered by sideId, in SQL request just add

WHERE siteId='14'

of course change the site Id, it could be find when you're on 'manage' sponsor page when you are over the 'edit' tag for a site, be carefull it's site Id not Sponsor Id e.g. (hope to be clear sorry for my bad English)

SELECT galleryUrl, createDate, galleryName, galleryId, gallerySlug FROM builder_galleries WHERE siteId='14' ORDER BY createDate DESC LIMIT 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×