edendom Posted October 24, 2014 Share Posted October 24, 2014 (edited) 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 October 24, 2014 by edendom Link to comment Share on other sites More sharing options...
Robert Posted October 28, 2014 Share Posted October 28, 2014 Excellent, thanks for your contribution. I've moved your tip to the Arylia Tips and Tricks section. Link to comment Share on other sites More sharing options...
edendom Posted October 29, 2014 Author Share Posted October 29, 2014 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now