Jump to content
LemmeCheck.Info

Guide To Build An Index Page With Arylia Galleries


edendom
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. policies