Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorGurnk
    • CommentTimeMar 30th 2008 edited
     # 1
    Hey,

    Is there an addon, or a way to allow the user to upload an image, the have the image displayed by the discussion listing? I've downloaded the attachment extension, but I'm so new to Vanilla, I had no idea how to mod it to show the thumbnail on the discussion(grid I think its called) page.

    Any help would be much appreciated. Thanks. :)
    • CommentAuthorfysicsluvr
    • CommentTimeMar 30th 2008 edited
     # 2
    There is an addon that does this for categories called CategoryIcons. You will have to look at how it adds it to the category grid, and then modify it to do the same for discussions; then allow the user to upload the desired icon with the Attachments 2 addon. (This is an interesting idea btw.)

    You should move this into the "Addon Requests" category, because it will require a bit more than a little tweak to accomplish this. (It needs to be its own addon)
    • CommentAuthorGurnk
    • CommentTimeMar 30th 2008 edited
     # 3
    Ah sorry, didn't notice that category.

    I saw category Icons, and I'll have to mess around with it a bit. is there any documentation about how the whole system is setup? It looks quite different to anything I've ever used before.

    EDIT: Okay so I see the category extension just adds some CSS to each ID. I could do that for the discussion list, but how would I know which thumbnail to get?

    Thanks!
    • CommentAuthorfysicsluvr
    • CommentTimeMar 30th 2008
     # 4
    Are you fluent in php?

    Here's the documentation on creating addons. If you do get this figured out and working; be sure to upload it to the addon repository
    • CommentAuthorGurnk
    • CommentTimeMar 30th 2008
     # 5
    I'm okay in PHP. I can make an image upload in normal PHP, so maybe I'll see what I can do. :)

    It actually shouldn't be that hard. Just add them to a database, then for each listing, get the one labeled with the corresponding ID from the database. I just don't know how to write it to match Vanilla. I'll have to check out that documentation.
    • CommentAuthorGurnk
    • CommentTimeMar 30th 2008
     # 6
    Changed the category. :)
    • CommentAuthorfysicsluvr
    • CommentTimeMar 30th 2008 edited
     # 7
    You could consider making it role/permission based (see the documentation for more info on that).

    You also may find that it conflicts with multi file upload (if you go the attachments addon route), so you may consider not using the attachments addon (do what works) but you should take a look at its code for ideas. (such as making it an admin option as to where the files are uploaded to; and storing the path to the thumbnails in the db; etc.)

    Also, since you're new to Vanilla, you probably don't know much about dictionary definitions and languages. Look at the documentation for info on that, and also look at some of the other (preferably the more recent ones) addons for examples.
    • CommentAuthorGurnk
    • CommentTimeMar 30th 2008
     # 8
    Alright, I got something that will work. Not totally sure if it was the right way, but its fine for now.

    The only problem now is the Attachments Mod. I thought it made thumbnails, then links to the main image. But now its just resizing them to the specified size. Maybe it never made thumbnails. :/

    If not, do you know how I could keep the original and make a thumbnail?

    Thanks.
    • CommentAuthorGurnk
    • CommentTimeMar 30th 2008
     # 9
    It looks like only the old version of attachments uses thumbnails. I need thumbnails, but I also need the database of version 2. :/
    • CommentAuthorGurnk
    • CommentTimeMar 30th 2008
     # 10
    Alright I think I got it. :) Thanks for all the help.
    • CommentAuthorfysicsluvr
    • CommentTimeMar 30th 2008
     # 11
    I don't think attachments ever did thumbnails?

    you could look at what AccountPictures does to resize images when they're uploaded. (why do you need to keep the original full-size image?)

    I think it does something with javascript. (may I suggest using mootools and the mootools addon instead of replicating the js [account pictures doesn't do this, but if you need to use any javascript in your addon, I would recommend doing it with one of the js library addons (mootools or jQuery), so that the same code isn't replicated in multiple addons])
    • CommentAuthorfysicsluvr
    • CommentTimeMar 30th 2008 edited
     # 12
    Also, I saw this at some point. You should consider using it as well, for some nice beveled edges. (you could do this as a separate addon for all embedded images; and be sure to keep it from beveling other images that are outside of a comment [such as advertisements or banners])

    I'll put this in a separate addon request.

    EDIT: here it is.
Add your comments
    Username Password
  • Format comments as