I´m in need of a seperate box for my custim_index page.
I want to show some thumbs of the Tidypics plugin in a seperate box but i have no clue what to do.
I used (recently) Vasco´s Mainpage Widget based Intex but since i moved to a newer custom index i dont need it.
Here is the code Vasco used in his plugin to show the latest Images (which wont work in my custom_index):
if (is_plugin_enabled('tidypics')){
$limit = get_plugin_setting('tidypics_num_items','vazco_mainpage');
if (!isset($limit) || !$limit) $limit = 30;
$images = get_entities('object','image',0,0,$limit, false, false);
?>
<div class="index_box">
<h2><?php echo elgg_echo("custom:tidypics"); ?></h2>
<div class="search_listing">
<?php
if(isset($images)) {
$counter = 0;
echo '<div class="frontpage_tidypics_box">';
foreach($images as $image){
$counter +=1;
if ($counter == 6){
$counter = 0;
echo "</div>";
echo '<div class="frontpage_tidypics_box">';
}
echo "<div class=\"tidypics_index\">";
echo elgg_view("vazco_mainpage/tidypics/icon", array(
'mimetype' => $image->mimetype
,'thumbnail' => $image->thumbnail
,'file_guid' => $image->guid
,'link' => $image->getUrl()
,'size' => 'small'
));
echo "</div>"; //tidypics_index
}
echo '</div>';
}else{
echo elgg_echo('vazco_mainpage:tidypics:noactivity');
}
?>
</div>
</div>
<?php }?>
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- skypanther@skypanther
skypanther - 0 likes
- itmanvn@itmanvn
itmanvn - 0 likes
- Zeronix@Zeronix
Zeronix - 0 likes
- skotmiller@skotmiller
skotmiller - 0 likes
- Zeronix@Zeronix
Zeronix - 0 likes
- itmanvn@itmanvn
itmanvn - 0 likes
- skotmiller@skotmiller
skotmiller - 0 likes
- itmanvn@itmanvn
itmanvn - 0 likes
- rogal@rogal
rogal - 0 likes
- jaxcatz@jaxcatz
jaxcatz - 0 likes
You must log in to post replies.Here's what i did:
In custom_index/index.php, before the elgg_view_layout() call, add:
$photos = list_entities('object','image',0,4,false, false, false);
In custom_index/views/default/canvas/layouts/new_index.php, add the following where you want the pictures to show up:
I don't recall where I got that code from. The problem I have with the above is that I get not just the thumbnail, but also the user, date, title, etc. I'd love to get just the thumbs so that it was more like the new users box where you get just their avatars. I haven't explored yet how to get that to work though.
You can see this in action at www.sharedphotons.com
Tim
Hi skypanther,
I tried your code but nothing returned on the index page. It's show only: No photos available.
area7 is empty.
I had no luck with that script.
The one i posted above is what you are searching for (displaying small thumbs (30) in a box.
I hope someone can help us in this.
I hired vazco add this onto my index.
You can see my actual progress on the Tab on http://pixel4tune.de/social/
But like skypanther said before: only icons would be better and we could display more images.
what does vazco means?
vazco
Hi all, this should works
Edit mod/custom_index/views/default/canvas/layouts/new_index.php, add the following where you want the pictures to show up
This Code works for me perfectly:
<?php
}
if (is_plugin_enabled('tidypics')) {
?>
<!-- display latest photos -->
<div class="index_box">
<h2><a href="<?php echo $vars['url']; ?>pg/photos/world/"><?php echo elgg_echo("Najnowsze Zdięcia"); ?></a></h2>
<div class="contentWrapper">
<?php
echo tp_get_latest_photos(12);
?>
</div>
</div>
________________________________________________________________________
You can see result of this code on my frontpage
Hi rogal
can u please help me by telling how to implement this code ? where to post it ?
PLeas Im a total newbie in here :)