• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[XFR] User Albums

Status
Not open for further replies.
I would like to increase the number of photos featured on the "Latest Images" block on the home page to eight. In addition, I would like to constrain each one to 75px x 75px to keep things nice and clean. Attached is the look I'm going for. How would I go about doing this? Thank you for this great add-on!

EDIT: Thank you boban, I scrolled right past your post. Exactly what I needed, thank you.

View attachment 16024
how did you get the square thumb nails?
 
Suggestion:
If a image is reported, show also the image and not only the description.
Problem is, if the image have no description, you don't see ANYTHING and you need to go to the conent.
 
I kept on getting duplicated user comments, so I tried adding a comment to my own image and It seems when you hit the submit, it send the coment, but does not refresh/update the page, thus making the user believe it did not submit and hitting submit twice.

Anyone else encountered this? Any ETA for the next version Pepelac?

For next version I would like to suggest a couple of things if I may;

Allow comment replies and likes

Thanks!

Further more while testing the comment system, when you hit Post comment, it gives you an Unspecified Error, but the comment is still posted, which you can see that by refreshing the page. So if the user clicks it until it works you'll have numerous duplicated comments.
 
Further more while testing the comment system, when you hit Post comment, it gives you an Unspecified Error, but the comment is still posted, which you can see that by refreshing the page. So if the user clicks it until it works you'll have numerous duplicated comments.

Did you upload the file comments.js to /js/xfru/useralbums/comments.js ?
 
Considering the original poster of this thread and I assume developer hasnt been on since the 10th of may, does anyone know if this is still being developed?
hm, i'd like to know this too.

it's a great add-on and it can be a very nice basis for really many other add-on ideas^^
 
This add-on is great.
That's why i'm using it as base for another add-on.

Could you pls add a template hook in template xfr_useralbums_image_view inside the image tools popup, to be able to add own menu entries?

thx
 
Could someone please post what the stock xfr_useralbums_forum_list_latest_images.css looks like unedited. I have messed mine up and reverting does not fix it.
 
I have two questions.

1. Where are the thumbnails and images stored?

2. I don't see a photo when in "table view". I only see the album icon. When in grid view, I see the latest photo posted to the album. Can this be applied to table view as well?

Thank you much
 
1. Where are the thumbnails and images stored?

Thumbnails: data/xfru/useralbums

Images: internal_data/xfru/useralbums/images
Images file extension .data

2. I don't see a photo when in "table view". I only see the album icon. When in grid view, I see the latest photo posted to the album. Can this be applied to table view as well?

Edit Template: xfr_useralbums_album_list_item

Find

PHP:
<a href="{xen:link "useralbums/view", $album}" class="coverIcon">
            <xen:if is="{$album.cover_image_id}">
            <xen:else />
                    <img src="@albumNoCoverIconPath" width="48" height="48" />
            </xen:if>
            </a>

Replace:
PHP:
<a href="{xen:link "useralbums/view", $album}" class="coverIcon">
            <xen:if is="{$album.last_image_id}">
                    <img src="{$album.image.thumbnailUrl}" alt="{$album.image.title}"/>
            <xen:else />
                    <img src="@albumNoCoverIconPath" width="48" height="48" />
            </xen:if>
            </a>

You can also delete the line just below if you want too:
PHP:
<xen:if is="{$album.user_id} == {$visitor.user_id}"><xen:avatar user="$visitor" size="s" img="true" class="miniMe" title="" /></xen:if>

But do not forget that the cover image will be in one of the next version. It is already in the database and template.
 
But do not forget that the cover image will be in one of the next version. It is already in the database and template.

Thank you very much! Now I just have some additional formatting to take care of. Might have some additional questions for you.

Luke
 
But do not forget that the cover image will be in one of the next version. It is already in the database and template.

Okay, viewing the album list as a whole works great. But when you view your own album list or another users album list, the photos do not show.
 
Okay, viewing the album list as a whole works great. But when you view your own album list or another users album list, the photos do not show.

If you really want it you may have to modify some php files :)

First edit php file Albums.php /library/XfRu/UserAlbums/Model/Albums.php
Find around line 72 public function getUserAlbums($userId, $fetchOptions = array())

Find in the function around line 88:
PHP:
$sql = '
            SELECT album.*
                ' . $options['selectFields'] . '
            FROM xfr_useralbum AS album' . $options['joinTables'] . '
            WHERE album.user_id = ' . $this->_getDb()->quote($userId) . $conditions . '
            '.$options['orderBy'].'
        ';

Replace:
PHP:
$sql = '
            SELECT album.*
                ' . $options['selectFields'] . ',
                image_data.data_id AS image_data_id, image_data.file_hash AS image_file_hash
            FROM xfr_useralbum AS album' . $options['joinTables'] . '
            LEFT JOIN xfr_useralbum_image AS image ON image.image_id = album.last_image_id
            LEFT JOIN xfr_useralbum_image_data AS image_data ON image_data.data_id = image.data_id
            WHERE album.user_id = ' . $this->_getDb()->quote($userId) . $conditions . '
            '.$options['orderBy'].'
        ';

Second edit php file Albums.php /library/XfRu/UserAlbums/ControllerPublic/Albums.php

Finde around line 133 public function actionList()

In the function find around line 154:
$albumsModel = $this->getAlbumsModel();
Just add above:
PHP:
 $imagesModel = $this->getImagesModel();
:

Few line down find:
PHP:
foreach ($albums as &$a)
        {
            $a['canEditAlbum'] = $albumsModel->isAlbumEditable($a);
            $a = $albumsModel->prepareAlbum($a);
        }

Replace:
PHP:
foreach ($albums as &$a)
        {
            $a['canEditAlbum'] = $albumsModel->isAlbumEditable($a);
            $a = $albumsModel->prepareAlbum($a);
            if ($a['last_image_id'])
            {
                $a['image'] = array(
                    'thumbnailUrl' => $imagesModel->getImageThumbnailUrl(array('data_id' => $a['image_data_id'], 'file_hash' => $a['image_file_hash'])),
                    'image_id' => $a['last_image_id'],
                    'title' => $a['last_image_filename']
                );
            }
        }

One image :) Do you think it's worth it?
 
One image :) Do you think it's worth it?
Absolutely! I like to run a clean/complete ship. I want my users to enjoy my forum to the fullest and that means repairing any holes they might see.

boban, thank you very much for your help on this. Your instructions are some of the clearest I've had on any forum. I will let you know how the latest one works out.

Luke
 
Did anyone succeed in this?
I've been playing with this for weeks. It was not too difficult to setup a xenporta block and pull some random images from the database. Unfortunately, I've been struggling with how to properly display the images in the middle column of a dynamic or liquid design; the images don't wrap properly. The website linked above (slruser.com) is using an albums xenporta module, but their design uses as static width.
 
Status
Not open for further replies.
Back
Top Bottom