We have imported the old Joomla content into K2. In the original content the article image was simply placed inline using the html editor, but although the images do show up, they don't look at all like those handled by K2 using the tab image > browse server. K2 images looks much better.

Since we have about 1000 articles I would like to make a script that can convert the images to the "K2 way". My main problem here is that I can't figure out how K2 stores this image information. I have tried comparing two mysql dumps, before and after adding an image, but I have not been able to determine which tables are involved.

So my question is: How and where is K2 article image informartion handled?

Of course, if there already exists a solution that can do this kind of conversion, I would like to know that as well.

有帮助吗?

解决方案

Even after logging and analyzing all SQL queries I still can't find where in the DB K2 image info is stored. And there is a reason why: It doesn't use the DB at all.

Images are stored in

/media/k2/items/cache/

/media/k2/items/src/

using the md5 sum of the K2 item ID as the base of the filename. It then looks on the fly for images in these folders to display when you browse the articles.

There is a bit more info here:

Where does k2 componet store its images in the database?

I have now made a script that will convert embedded images to K2 external images.

其他提示

Easily way to get original image instead of resized for K2 item, for example:

$image=str_replace("cache","src",$item->image);
$image=str_replace(array("_XS","_S","_M","_L","_XL"),"",$image);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top