By Matt Binz on Friday, 07 April 2017
Posted in Technical Issues
Replies 9
Likes 0
Views 287
Votes 0
We are trying to a few things on our site.
1. we want to move all the images off our site and host them on Amazon S3 storage
We have moved the first folder called "images" on our Siteground server and made a new called "hhhimages" on Amazon

1. We need to change all the links in all of our content to change any link of any image in our blogs to the new Amazon links.
we dont want to have the original file on our server we want to delete it after.

I tried replacing the link in my Easyblog posts to images it found them in the blog intro and content tables but not in the code below.

<a class="eb-post-image-cover eb-image-popup-button" href="//http://www.mysite.com/images/easyblog_articles/2537/Why-Homeschooling-work_20161221-220337_1.png" title="Why Homeschooling Works" target="_blank" style="
background-image: url('//http://www.mysite.com/images/easyblog_articles/2537/b2ap3_large_Why-Homeschooling-work_20161221-220337_1.png');
width: 560px;
height: 560px;"></a>

Easyblog is creating new resized images with new names
As a result I cant replace my images from my server to amazon?

How do I change these image links and paths so I can move my images to Amazon?
Hi there,

Regarding the image that you've mention in the code block, I believe those images are your blog post's cover image. We do not store the cover image in either intro column or content column. We actually generate the image path and 'attached' the cover image into the blog post.

What you can do is to edit this file 'JOOMLA/components/com_easyblog/themes/wireframe/blogs/latest/post.cover.php' and consider the below approach:

Edit the line 25:

<img itemprop="image" src="<?php echo $post->getImage($this->config->get('cover_size', 'large'));?>" alt="<?php echo $this->escape($post->title);?>" />


with:


<?php
$imagePath = $post->getImage($this->config->get('cover_size', 'large'));
$imagePath = str_replace(JURI::root(), 'YOUR_S3_DOMAIN', $imagePath);
?>
<img itemprop="image" src="<?php echo $imagePath;?>" alt="<?php echo $this->escape($post->title);?>" />


You will need to do the same for all the place that calling $post->getImage().

Hope this help and have a nice day!
Sam
·
Friday, 07 April 2017 23:26
·
0 Likes
·
0 Votes
·
0 Comments
·
I tried that on my staging site it had no effect.
Could it be because the image I am trying to change and load from Amazon is located somewhere else as you stated below?
"You will need to do the same for all the place that calling $post->getImage()."

The image is written in this code
<img class="attachment wp-att-2377 centered aligncenter" src="http://www.thehomescholar.com/blog/wp-content/uploads/2010/01/woman-college.jpg" alt="woman-college" width="400" height="266">

I changed it in the database to be
<img class="attachment wp-att-2377 centered aligncenter" src="https://hhhblogs.s3.amazonaws.com/woman-college.jpg" alt="woman-college" width="400" height="266" />


It shows in the database table but not the browser?

In the setings tab in Easyblog it shows CDN is this where i change it?
https://gyazo.com/31435bffbe77134ba2c105ab20da22b5

Or can i do a redirect in .htaccess from
http://www.thehomescholar.com/blog/wp-content/uploads/
to
https://hhhblogs.s3.amazonaws.com/
·
Wednesday, 12 April 2017 05:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

<img class="attachment wp-att-2377 centered aligncenter" src="http://www.thehomescholar.com/blog/wp-content/uploads/2010/01/woman-college.jpg"; alt="woman-college" width="400" height="266">


Regarding the above, it seems like the image path is an external path to another site. Did you import the blog posts from your wordpress site? Changing the external image path to your S3 will not help as the physical image file is coming from external source.

Correct me if I've mis-understand the above.
Please advise.
Sam
·
Wednesday, 12 April 2017 13:55
·
0 Likes
·
0 Votes
·
0 Comments
·
1. Yes we did import these from a Wordpress folder inside of our original Joomla root folder.

2. Yes it is coming from our original site however we have moved all the same images to our Amazon S3 folder so there would be no problem.


3. Can you read again my previous post and answer the questions from it please?
·
Thursday, 13 April 2017 01:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Matt,

Thanks for the clarification.

3. Can you read again my previous post and answer the questions from it please?


I apologise for not answering your previous message. Please see below answer for your inquiries.

It shows in the database table but not the browser?


Are you changing the image path from #__easyblog_post table? If yes, then I'm afraid that is not the correct db table to change. The image path is storing in #__easyblog_revisions table in 'content' column. Currently this 'content' is storing the json strings of the post contents. If you want to change the image path from database, you should change in this table too.

In the setings tab in Easyblog it shows CDN is this where i change it?
https://gyazo.com/31435bffbe77134ba2c105ab20da22b5


Currently this CND settings is used for EasyBlog's css files and javascripts files only. If you want to host the css and js files on a CDN, then yes, this is the correct setting.


Or can i do a redirect in .htaccess from http://www.thehomescholar.com/blog/wp-content/uploads/
to
https://hhhblogs.s3.amazonaws.com/


Yes, you can do a redirection to your S3 when requesting an image to your old wordpress site. In fact, i think this is the faster and easier way to fix your image source issue.

Hope this help and have a nice day!
Sam
·
Thursday, 13 April 2017 11:03
·
0 Likes
·
0 Votes
·
0 Comments
·
1.Now that we have rectified all previous blog posts to pull from Amazon how do we permanently or easily tell Easyblog to pull all future images we insert in Easyblog posts to pull from our Amazon server?


If we enter an image now it currently places it in /images/easyblog_articles see screencap below
https://gyazo.com/dc76dde76fa695aeaaf39cce60dbf3d5
We need this to be changed to
https://hhhblogs.s3-us-west-2.amazonaws.com/easyblog_articles


2. This is the code below
Which table are these images found?

<div class="eb-image eb-post-thumb is-center" itemprop="image" itemscope="" itemtype="https://schema.org/ImageObject">

<a class="eb-post-image-cover eb-image-popup-button" href="//http://www.homehighschoolhelp.com/images/easyblog_articles/2543/Open-house---square.jpg" title="Open House in February with Fun Treats Every Day!" target="_blank" style="
background-image: url('//http://www.homehighschoolhelp.com/images/easyblog_articles/2543/b2ap3_large_Open-house---square.jpg');
width: 560px;
height: 560px;"></a>
</div>

Thank you
·
Friday, 14 April 2017 23:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Matt Binz,

I am sorry for the delay of this reply.

1.Now that we have rectified all previous blog posts to pull from Amazon how do we permanently or easily tell Easyblog to pull all future images we insert in Easyblog posts to pull from our Amazon server?


Currently EasyBlog do not support 'pushing/pulling' images to / from Amazon S3 server. What I can think of is, let the image store in the current way and, write a php script and in the php script you will manually pushed the new images stored in your local server to your S3 server and also to replace the blog post content the image path to your S3 server. You can then schedule a cron job to execute this php script periodically.


2. This is the code below: Which table are these images found?


The image that you are referring should be the cover image for the blog post and you can find the image at table jos_easyblog_post under 'image' column. The php file that populate the cover image is located at 'JOOMLA/components/com_easyblog/themes/wireframe/blogs/entry/post.cover.php'

Hope this help and have a nice day!
Sam
·
Wednesday, 19 April 2017 17:45
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post