Hi guys, first of all i want to say that this task i think it's a little bit advanced and may be considered custom mod. i fully understand.
All i need is some general help pointing me to the right direction and if what i need involves just small code change and you guys don't mind to share the solution, i will be really happy, if not will have our programmer take a look at it.
So, let's begin ....
Currently EasyDiscuss lack a feature where we can define custom sizes for image attachments ("EasyBlog-Style" if you want

)
By Default all attachments are uploaded into 2 sizes:
1. Original size
2. Thumb size
The thumb size is defined and controlled into this location
/administrator/components/com_easydiscuss/tables.php
by this line of code (around line 995 in the above file)
$image->resizeToFill( 160 , 120 );
Now, because we try to pull-off a new modern and fresh design for our discussions pages that goes way beyond the plain "old" list of topics we need to retrieve the first attachment of a post in a size s little bigger than default 160x120 configuration.
What i did, was this (and i think was the wrong approach)
I modified the above file "/administrator/components/com_easydiscuss/tables.php"
and setup the thumb size like this
$image->resizeToFill( 400 , 300 );
Now, all created thumbs will be at 400x300 size. This approach was wrong because ALL the attachment will have thumbs created at this size, thus generating performance speed problems for topics with a lot of images.
In our own designed layout, we retrieved the first attachment thumb file like this
1. First we queried the first attachment of the post
require_once( DISCUSS_HELPERS . DIRECTORY_SEPARATOR . 'helper.php' );
$db = DiscussHelper::getDBO();
$query = 'SELECT * FROM ' . $db->nameQuote( '#__discuss_attachments' ) . ' '
. 'WHERE ' . $db->nameQuote( 'uid' ) . '=' . $db->Quote( $post->id ) . ' '
. 'AND ' . $db->nameQuote( 'mime' ) . '=' . $db->Quote( 'image/jpeg' ) . ' '
. 'LIMIT 1';
$db->setQuery( $query );
$post_img = $db->loadObjectList();
$img_id = $post_img[0]->id;
2. Second we displayed the image file into our design, using the thumb size
<?php if ( $post_img ) {?>
<img width="100%" alt="<?php echo $post->title; ?>" data-src="/<?php echo JURI::root() . 'index.php?option=com_easydiscuss&controller=attachment&task=displayFile&tmpl=component&size=thumb&id=' . $img_id;?>" src="/<?php echo $this->baseurl ?>/assets/image/green.jpg" data-toggle="unveil" class="unveiled">
<?php } else { ?>
<img width="100%" alt="<?php echo $post->title; ?>" data-src="/<?php echo $this->baseurl ?>/assets/image/green.jpg" src="/<?php echo $this->baseurl ?>/assets/image/green.jpg" data-toggle="unveil" class="unveiled">
<?php } ?>
This approach, like i said before is wrong because all our thumbs will have 400x300 size, and we need ONLY the first one to have this size.
So, here comes my question.
1. How do you advice it's the best approach to have some "custom" attachment sizes implemented and displayed in our design ? (we need only the first attachment uploaded to have some different custom size)
Basically we will keep the default EasyDiscuss "thumb" size .. but let's say we will create only for first uploaded image attachment a custom "cover" size and retrieve this "cover" size for first attachment in our layout design like above.
2. Do you know any quick solution for this ?
3. Do you think that the best option is to create a joomla custom plugin that will "hardwire" into your attachment thumb creating process, without hacking the core post.php file ?
Hope i didn't eat too much from your time with this.
I need some general advice to pass to our programmer or, if this can be easy with just few lines of code implemented and are you willing to share it, i will be the happiest person on earth
Thanks guys !