Author Topic: Can I add images to blog posts?  (Read 4353 times)

Chaze

  • Prime Member
  • ****
  • Posts: 158
  • Karma: +0/-0
  • Be Happy
    • Fast Web Hosting
Can I add images to blog posts?
« on: June 10, 2009, 11:12:17 AM »
I want to pump up the blog option and get people to use them more. Is there a way to have images added to blog posts? Just a remote url code. Like a picture hosted with www.hostive.com or www.flickr.com for example.
Charles Yarbrough
Fast Web Host - WebHost.pro
My Blog

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2971
  • Karma: +210/-7
    • Maverick Webworks
Re: Can I add images to blog posts?
« Reply #1 on: June 10, 2009, 02:31:33 PM »
If what you want to do is create another bbcode button that allows the user to include a URL link to an image (much like how the "hyperlink" button works), this will require some custom coding. The bbcode for images isn't included in the code by default for security reasons, but it's fairly easy to add into the code, most of the work is in creating a means for the user to use the code, such as including a special bbcode button for images. There are a few factors that needs to also be taken into consideration, such as restricting the size of the image so it fits into your blog space, some people will link to an image that's huge which could break your page layout. Do you want to allow images in the comments or just in the main blog post. Do you want options for text-wrap.

Now you're probably wondering what security risks could there be by allowing links to images. Well some using the Etano script may decide to allow non-members to post comments in the blogs and bbcode images could have some potential of being exploited, which I assume is one of the reasons why images were not included in the default code.

I included images in my blogs, but the route I took was hosting the images myself and included my own script that handles the image uploads especially for the blogs and once the upload is complete it produces the appropriate bbcode link for them to copy and paste into their blog field. The upload script I created also restricts the width of the image and also the max file size they can upload. I also only wanted images to be allowed by the creator in the original blog post and not by those leaving comments, therefore I didn't want an image bbcode button included in the default string of buttons used for posting and leaving comments.

Including images in blogs isn't black & white, there's a variety of variables and scenarios to consider that suits your needs and wants, which I also assume is another reason images weren't included by default. So what you'll need to do is figure out exactly how you want it to function and contact Dan for a quote.


Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Chaze

  • Prime Member
  • ****
  • Posts: 158
  • Karma: +0/-0
  • Be Happy
    • Fast Web Hosting
Re: Can I add images to blog posts?
« Reply #2 on: June 10, 2009, 02:43:56 PM »
Wow cool so you have a upload button for adding images to blogs? That would be better! Especially if it would size the image automatically.
Charles Yarbrough
Fast Web Host - WebHost.pro
My Blog

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2971
  • Karma: +210/-7
    • Maverick Webworks
Re: Can I add images to blog posts?
« Reply #3 on: June 10, 2009, 05:01:35 PM »
It's actually an upload image link that opens up a popup window that has an upload form. It allows the user to browse their system and select an image to upload. It has two selections for image alignment (text-wrap and no-wrap). It doesn't re-size their images, it simply rejects images that are wider than 450px and/or are larger than 60kb's (as an example).

Once the upload is complete, depending on the image alignment they selected, it provides the appropriate bbcode for them to copy and paste into their blog field that looks something like this ....

[img=http://www.mysite.com/blogimges/12265527711829_myphoto.jpg]

I didn't want to bother allowing people to upload ridiculous sized images from their digital cameras just because they are too lazy to re-size them for the web. There's plenty of free software around these days that makes it real easy for people to re-size their photos for the web that does a much better job than using my server's PHP GD to handle the re-sizing of super large digital images.

Is my solution the ideal method? Probably not, but it works fine for my purposes and is better than some solutions I've seen.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

admin2

  • Guest
Re: Can I add images to blog posts?
« Reply #4 on: June 12, 2009, 12:30:19 AM »
We created bbcode buttons for images and videos in blog posts for another customer. So, indeed, it is possible.

Chaze

  • Prime Member
  • ****
  • Posts: 158
  • Karma: +0/-0
  • Be Happy
    • Fast Web Hosting
Re: Can I add images to blog posts?
« Reply #5 on: June 12, 2009, 11:03:15 AM »
We created bbcode buttons for images and videos in blog posts for another customer. So, indeed, it is possible.

What is the bb caode for images I tried

But it just showed the code.
Charles Yarbrough
Fast Web Host - WebHost.pro
My Blog

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2971
  • Karma: +210/-7
    • Maverick Webworks
Re: Can I add images to blog posts?
« Reply #6 on: June 12, 2009, 01:04:28 PM »
[img=http://www.mysite.com/blogimges/12265527711829_myphoto.jpg]

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

strawberries90

  • Veteran Member
  • *****
  • Posts: 466
  • Karma: +17/-0
Re: Can I add images to blog posts?
« Reply #7 on: June 12, 2009, 01:33:33 PM »

admin2

  • Guest
Re: Can I add images to blog posts?
« Reply #8 on: June 13, 2009, 02:26:18 AM »
Straw, it was unrelated. That was no script or database bug or software error. Your whole server crashed and broke your mysql database.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: Can I add images to blog posts?
« Reply #9 on: September 13, 2012, 04:06:42 PM »
I understand that this is a very old thread, but I'm curious to try this out at my site.
I also understand that you guys are both very busy and probably not able to take on additional jobs for customizations like this.
With that said, what are the steps involved to go about using Maverick's idea where the user would upload a file?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2971
  • Karma: +210/-7
    • Maverick Webworks
Re: Can I add images to blog posts?
« Reply #10 on: September 13, 2012, 04:35:10 PM »
Off hand I don't remember how I did it as I no longer have the site that I implemented on. My method worked ok for uploading and adding photos to blogs but it had one issue, if the blog was deleted the photos weren't deleted from the server along with it.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

holeepassion

  • Confirmed Member
  • **
  • Posts: 4
  • Karma: +0/-0
Re: Can I add images to blog posts?
« Reply #11 on: May 02, 2016, 07:32:07 AM »
I think upload image in blogs should be a standard ? Otherwise, the blogs look dull in my humble opinion. Any solutions ?