News:

Wondering if this will always be free?  See why free is better.

Main Menu

Custom View of Attachments

Started by Bugo, January 19, 2011, 10:19:22 PM

Previous topic - Next topic

Bugo

Link to Mod

This mod adds two new methods of placing of thumbnails under posts: in line (with names) and in line (w/o names).

Spoogs


lala1

great mod! thank you!

there is one little problem with the attachment positioning, see image

Bugo

#3
Try updated version.

aw06

Yesterday i see where this mod could work on 1.1.x ,, now i come to download and install it i see only 2.0 supported  :-\ can you please provide the edits for manual install on 1.1.13 please ...
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bugo

Sorry, I don't want to support SMF 1.1.x anymore. But you can update your forum to SMF 2.0 RC5 ;)

aw06

Quote from: Bugo on February 12, 2011, 06:40:38 AM
Sorry, I don't want to support SMF 1.1.x anymore. But you can update your forum to SMF 2.0 RC5 ;)

Trust mi,... That is not an option right now or any time soon

All i need is the edits to install it .. it could be installed on 1.1.x up  to yesterday, i am sorry i never saved the edits in a notepad file or something ..

Please assist, i really need this installed on my 1.1.x forum ASAP

Could you perhaps send me that version [Although i downloaded it yesterday, just never had the time to install it] with instructions via pm .. or leave it on the mod site and mark as outdated..
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

I managed to get it installed as i had downloaded the version for 1.1.x .. how do i get a space between the images like you have it in the example ?? My images are touching..
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bugo

Have you seen settings of this mod? Screenshot from SMF 2, although...
You can change a space between the images manually, with option "padding" (see CSS rules).

aw06

Quote from: Bugo on February 12, 2011, 10:28:54 AM
Have you seen settings of this mod? Screenshot from SMF 2, although...
You can change a space between the images manually, with option "padding" (see CSS rules).

in which css file do i add that rule ? and how ?
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bugo

I think you have to read info about Firebug... at first.

aw06

Quote from: Bugo on February 12, 2011, 10:35:28 AM
I think you have to read info about Firebug... at first.

Ok, it pointed me to style.css in my theme .. where do i add the padding to put the space between the images ?
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bugo


aw06

Quote from: Bugo on February 12, 2011, 11:23:02 AM
Use Firebug...

:( FireBug confusing me ... not really showing me how to do it
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

#14
Can i not add a hmtl space code [ ] or a padding somewhere in the code below ???

// Custom View of Attachments
if (!empty($modSettings['custom_view_attachments'])) {
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb']) {
// Begin
echo '', ($modSettings['custom_view_attachments'] != 0) ? '<div style="float: left; min-height: ' . ($modSettings['attachmentThumbHeight'] - 10) . 'px; padding-top: 0.1em">' : '';

// Highslide Image Viewer Installed?
if (function_exists('highslide_images'))
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" class="highslide" rel="highslide"><img src="', $attachment['thumbnail']['href'], '" alt="', $attachment['name'], '" id="thumb_', $attachment['id'], '"', ($modSettings['custom_view_attachments'] != 0) ? ' title="' . $attachment['size'] . ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' (' . $txt['custom_view_attachments_views'] . $attachment['downloads'] . ')' . '"' : '',' border="0" /></a><br /><div class="highslide-heading">', $context['subject'], '</div>';
// Simple Mode
else
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="' , ($context['user']['is_logged']) ? $attachment['thumbnail']['javascript'] : "alert('" . $txt['logintoviewimg'] . "'); return false;" , '"><img src="', $attachment['thumbnail']['href'], '" alt="', $attachment['name'], '" id="thumb_', $attachment['id'], '"', ($modSettings['custom_view_attachments'] != 0) ? ' title="'. $attachment['size']. ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' (' . $txt['custom_view_attachments_views'] . $attachment['downloads'] . ')' . '"' : '',' border="0" /></a>&nbsp;<br />';

}
else
echo '
<div style="float: left; padding-top: 0.1em"><img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';

if ($modSettings['custom_view_attachments'] != 2)
echo '
<img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;<a href="' . $attachment['href'] . '" title="' . $attachment['title'] . '">' . $attachment['name'] . '</a> ';
}
else
echo '
<div style="clear: both"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;<a href="' . $attachment['href'] . '" ' , ($context['user']['is_logged']) ? '' : 'onclick="alert(' . "'" . $txt['login2download'] . "'); return false; " . '"' , '>' . $attachment['name'] . '</a> ';

if ($attachment['is_image'] && ($modSettings['custom_view_attachments'] != 0))
echo '&nbsp;</div>';
else
echo '(' . $attachment['size'] . ' ~ ' . (!$attachment['is_image'] ? $txt['custom_view_attachments_downloads'] : $txt['custom_view_attachments_views']) . $attachment['downloads'] . ')</div>';
}
else {

{

if ($attachment['thumbnail']['has_thumb'])

echo '

<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" class="highslide" rel="highslide"><img src="', $attachment['thumbnail']['href'], '" alt="' , $attachment['name'] , '" id="thumb_', $attachment['id'], '" border="0" /></a><br /><div class="highslide-heading">' , $context['subject'] , '</div>';

else

echo '

<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';

}

echo '

<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (' . $attachment['size'] . ' ~ ' . (!$attachment['is_image'] ? $txt['custom_view_attachments_downloads'] : $txt['custom_view_attachments_views']) . $attachment['downloads'] . ')<br />';} // Happy End ~ Custom View of Attachments

}



echo '

</div>';

}



echo '

</td>

</tr><tr>

<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

OK, this line seems to control what i want to edit ..

echo '', ($modSettings['custom_view_attachments'] != 0) ? '<div style="float: left; min-height: ' . ($modSettings['attachmentThumbHeight'] - 10) . 'px; padding-top: 0.5em">' : '';

When i add a right padding i can no longer adjust the top padding ... please advise..

My code looks like this

echo '', ($modSettings['custom_view_attachments'] != 0) ? '<div style="float: left; min-height: ' . ($modSettings['attachmentThumbHeight'] - 10) . 'px; padding-top: 0.5em' . 'px; padding-right: 1.5em">' : '';
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bugo

Quote from: Bugo on February 12, 2011, 06:40:38 AM
Sorry, I don't want to support SMF 1.1.x anymore. But you can update your forum to SMF 2.0 RC5 ;)

aw06

This is really a shame .. if i had only come for supprt a few days earlier .. tsk tsk
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

lala1

Quote from: Bugo on January 23, 2011, 04:59:50 AM
Try updated version.

Tried. Something changed for sure. Can you crop a part of the thumbnail in order to make them all same size? It should display it better then.

Thanks,
lala

Bugo


aw06

Quote from: lala1 on February 15, 2011, 04:46:05 AM
Quote from: Bugo on January 23, 2011, 04:59:50 AM
Try updated version.

Tried. Something changed for sure. Can you crop a part of the thumbnail in order to make them all same size? It should display it better then.

Thanks,
lala

This is how i did it .. works like a charm
http://www.simplemachines.org/community/index.php?topic=421677.msg2949881#msg2949881
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

9083ja

Hello,

I install custom view of attachment package for smf 2.0.1, but when i select to view attachments horizontally and apply then i can't see attachments.
When can i do ?

Regards !!

Bugo


9083ja

Quote from: Bugo on December 14, 2011, 03:22:50 AM
Did you install New Hooks package?

ok, thanks, now i can see attachment horizontally correctly ;-), it can be posible to add a funtion to adjust images horizontally automatically depending on a user resolution ?

thanks and regards !

djoos5

I am needing help with your mod please.

I am running SMF 2.0.2 and I did the following:

- Uploaded the Subs-CustomView.php to my /Sources folder
- Uploaded the CustomView.english.php to my /Themes/default/languages/ folder
- Uploaded the Hooks.php file to my main directory called /boards
- Uploaded the install.xml file to my main directory called /boards
- Uploaded the package-info.xml file to my main directory called /boards

I then ran the Hooks.php and it came up with a white page that says, "Database changes are complete! Please wait..." and nothing else.

I then went to view my boards and all of the attachments have disappeared and the layout is out of whack.

Any suggestions would be a big help.

Thanks


djoos5

Thank you for the reply - and let me start by saying I am not a modder, programmer, or anything. I would say I am a tinkerer with my boards, and I do that with very careful understanding of the instructions that are given in the Mods section.

So, no, I did not install the New_hooks package and the question I have now is where do I install it? In what folder of SMF software? Does it go in the same folder with the Hooks.php file? Does install.xml and package-info.xml need to be in that folder, too?

I appreciate your MOD very much, having used the version prior to your current update, but now the instructions for install are very vague.

Bugo

Use Package Manager for install.

distante

Hello Bugo! thanks for this mod I found it very useful especially when I used with "highslide 4 smf" and ILA mod's.

But, I have a problem with the compatibility of "Custom..." and ILA(http://custom.simplemachines.org/mods/index.php?mod=2481)

ILA mod adds some attachments to the post in self if the user put the code for this, when the attach is in inside the post, the attach below the post isn't showed.

But when I set "Custom..." in Default, all work fine, but if I set it to display the attachments in horizontal way, all the attachments are showed. Since you are using hooks and I don't really quite now how the hooks works, I can't figure out what to change in order to both mods can coexist.

Can you give me a hand?

Regards!

Bugo

#29
Try this file.

distante

It Worked Perfect Bugo!!

I will look what you did to try to learn something about the hooks hehe

Thanks a lot!

Fearless Freap

Not that it makes much difference to me, I have an issue with your mod and another one.  I have just installed 2.0.2 and it turns out if you have CVA installed and the Thank-o-matic mod installed, the page crashes.  Even with the hooks update in place.  I value your mod over the other so I uninstalled Thank-o-Matic.  I don't understand why this isn't a standard option in SMF (no offense to you and your mod) as an option to condense space.

It might prove frustrating to anyone else who might have it already in place.  The pictures will show up if you leave them as they would show up normally in the forum, but when you try to post them in a line (with or without names) they disappear.

Again, I love the mod.  Thanks!

Iomega0318

Is there a way to have this mod only work on images and not other uploads?
I would love for it to show images like how it is on the link below at the top with all other downloads listed normally beneath the images.. sort of how this mod works:
http://custom.simplemachines.org/mods/index.php?mod=771

Other than that it works great! You can see a good example here with 40 images!
http://www.uofreeshards.net/index.php?topic=195.0
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

pols1337

Help!  I'm getting a double view of my custom view of attachments.  How do I fix this?

Arvacon

Quote from: Fearless Freap on February 19, 2012, 02:03:32 PM
Not that it makes much difference to me, I have an issue with your mod and another one.  I have just installed 2.0.2 and it turns out if you have CVA installed and the Thank-o-matic mod installed, the page crashes.  Even with the hooks update in place.  I value your mod over the other so I uninstalled Thank-o-Matic.  I don't understand why this isn't a standard option in SMF (no offense to you and your mod) as an option to condense space.

It might prove frustrating to anyone else who might have it already in place.  The pictures will show up if you leave them as they would show up normally in the forum, but when you try to post them in a line (with or without names) they disappear.

Again, I love the mod.  Thanks!

I have the same issue here.
I did the same thing, I uninstalled thank-o-matic and now I don't get the below error anymore.

Parse error: syntax error, unexpected 'elseif' (T_ELSEIF) in H:\wamp\www\********\Themes\default\Display.template.php on line 544

But it must be a solution for these two to work together, isn't it?

I found that at line 544 there was this code before:

elseif (($message['thank_you_post']['post'] && !$message['thank_you_post']['locked']) || (($message['thank_you_post']['lock'] || $message['thank_you_post']['delete']) && $message['thank_you_post']['isThankYouPost']))

but after I uninstalled the thank-o-matic, now it is this one at the same line:

// ILA in line attachment changes

if (!isset($context['ila_dont_show_attach_below']) || !array_key_exists($attachment['id'], $context['ila_dont_show_attach_below']))
{

// End ILA in line attachment changes


I hope these info to help you find a solution, as I am not a programmer..

Mick.


Arvacon

Is there any way to make this mod align automatically the attached images in line, when you view them in different screen resolution?
For example when I have a screen with 1024x768 I see 3 pics in line and then another 3 under them but when I change the resolution at 1280x1024 you see the pics also 3 in line and with big spaces between them, so if you upload 20 pictures, they will be in 7 lines vertically..

I will upload 2 pics with what I mean, to clarify the things.

Arvacon

Hi guys, happy new year to everyone.
I know that the above problem must not be so difficult to solve, but I have searched everywhere and can't find a real solution.
Pictures will be an important part for my forum, as the members need to introduce their structures, so imagine if someone needs upload more than 20 pics in a row, his post will be almost 1 page long because of the way that the pictures not going in line as they should  be..

If someone has any solution, or if this has been written somewhere else, please let me know with a link, about where is a solution already given, to solve this problem by reading this.

I hope somebody can help solve this problem soon, as this is a real issue for my forum.  :-[

Bugo

There is option "Max attachments per line" in mod's settings. Doesn't it help you?

Arvacon

#39
Hi Bugo, thanks for your reply.
Actually that doesn't help, as if the pictures are a lot, you will can see them only if you move the bar under them, even if you use big resolution as at the below pictures, so the user feels tired to always have to move the bar to see them. Imagine if you have 20 or 30 pictures there, that will be annoying.
Is there any code that I can put at your mod to make them fit to every resolution without the need of bar, so to be visible as grid?

Bugo

Do you want only the small spaces between attachments? Just open Subs-CustomView.php, find
<table width="90%">
and remove width attribute.

Arvacon

Actually I want my attachment pictures to look like at this forum's post http://www.cnchobby.gr/forum/default.aspx?g=posts&m=20208#post20208 .
Try to zoom-in, zoom-out and you will understand what I mean.
I did the change that you said at the code, but that is not exactly what I need.
If you can't open the above link, tell me to take some screen shots for you.

Bugo


Arvacon

Friend I don't know how to thank you!
At my local installation it workes like charm!  :D

Thank you very much  :)
I will test it at my live forum too and if there is any problem, I will inform you.

Grettings from Greece!
Kostas

Arvacon

Hi Bugo.
I noticed that when you have 1024x768 resolution, it keeps have an uncompleted space at the right side, when it could be filled with pictures too.
That happens at the other resolutions too, but it seems vividly at the above resolution, as the pictures follow two vertical series instead of 3.
Is there any way to correct this too? 

Arvacon

#45
Finally I found a problem  :(
The appearance of the posts doesn't looks correct now. This had happen again when I first installed your mod, but after I installed the new hooks, everything was fine.
What do I need to change to fix this and the above post's problem too?


Hristo

Quote from: Arvacon on January 04, 2013, 02:36:53 PM
...when it could be filled with pictures too.
....
Is there any way to correct this too?
No, there is no enough space for another image. I have no access to your forum, but I'm sure this can be fixed with some small css tweaks. Just use your browser's dev tool to check the left and right attached images margin, then apply it in your theme's index.css.


Arvacon

#47
I think there is space for another image, it just need to be closer to each other as it happens when you have the default Subs-CustomView.php file and you choose "Max attachments per line" = 3
(as at the bellow photo).

Edit: I forgot to mention that I found also that the text at posts, when it has a lot of letters, it seems as at the photo, with a bar under them too, but I don't know if this is because of this mod or any other mod.
Just in case this is easy to be fixed or this mod cause it, if you have any solution for this too, I would appreciate if you could help about this too.
  Finally this is not an issue of this mod, it is just happening when you have lot of letters in a row, without meaning. When you have words and documents, everything works fine, as they mention here http://www.simplemachines.org/community/index.php?topic=488069.0

Edit2: I found that when I have the new Subs-CustomView.php file installed at my forum, except from the problems at the template's appearance, the quick edit function's save button doesn't respond. If I replace this file with the default one, the template and the quick edit are fine. Maybe these info help u more.

Bugo


Arvacon

#49
I tried it just now and it seems the template problem solved.
Also the pictures now can auto aligned.
I just see a small problem when you have different size pictures at the same post, as it seems at the screen shots bellow. Actually that is not so big problem, but it would be nice if you could correct it too (by the way, if you have same size pictures, everything looks in line as at "same size" photos bellow).
Thank you for your time, I really appreciate it.

Edit: I made some corrections at the picture's names.

Calaad

Hello,

I just add this mod to my forum. Last version of forum, last version of mod.

When i select "in the line" with or without filename, attachments just disappear. They're back when i select "In column". I install new hook without any change.

I've custom theme, could it be the source of the problem ?

Thank by advance and for the work done !

Calaad.

Bugo

What theme are you using? SMF version?

Calaad

#52
Hello,

I'm using an homemade theme, based on curved. My SMF version is 2.0.4.

If it can help, i join a screenshot of my installed extension.

Bugo

Try New Hooks 0.3, and select "Install in Other Themes" (homemade) on install.

Calaad

It works !

Thanks a lot Bugo ! :)

madvex

#55
Quote from: Bugo on March 01, 2013, 05:20:14 AM
Try New Hooks 0.3, and select "Install in Other Themes" (homemade) on install.

In SMF 2.0.5 the New Hooks 0.3 file is a must.

As others reported, I also had the horizontal setting causing all attachments to disappear.  The New Hooks file install rectified those issues.
Some manual tweaks for padding in the CSS it works great!

Excellent mod! Thanks!

PS: The manual CSS tweak I performed for the padding is as follows:
In your current theme CSS folder, edit "index.css" as follows:

Find:
.attachments div {
padding: 0 0.5em;
}


Replace with:
.attachments div {
  padding: 2em 1em;
}


I'd recommend using firebug and play with the settings before making the actual edit so you can see the effects in real-time.
Or, you can comment out the old lines if you want to easily revert.

Advertisement: