Keyword

Where K2 store articles images in database?

  • Enrico Fiorani
  • Enrico Fiorani's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #90470 by Enrico Fiorani
Where K2 store articles images in database? was created by Enrico Fiorani
Hi all, I'm new here.A little question: where K2 store articles images in database? 
I've search a lot in the tables with no lucky.

I know that the images are stored in media folder, but how about data?

Thank you very much!

Please Log in or Create an account to join the conversation.

  • Enrico Fiorani
  • Enrico Fiorani's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #90471 by Enrico Fiorani
Replied by Enrico Fiorani on topic Where K2 store articles images in database?
Ok, I've found a post that talk about stores the images as a "mld(5) of the item id". What that mean please?
There's a way to upload articles images via FTP and change the file name according to K2 system?
Obviously I rename all the file before upload, but how I've to rename all the files?

Help please!

Please Log in or Create an account to join the conversation.

  • Enrico Fiorani
  • Enrico Fiorani's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #90472 by Enrico Fiorani
Replied by Enrico Fiorani on topic Where K2 store articles images in database?
Again me :)
Sorry but I've found a solution.
My goal was upload all the images via csv/excel.
I've edited a couple of files and remove all the md5 (LOL not mdl(5) as reported in the post I've found!) calls in the source code both in admin part and front end part of K2 and now I can upload the images using the articles id as image name (plus the size suffix for the images).

A question: why using an md5 encr. for image name?
Thank you and sorry for the garbage of posts.
Admin can close discussion.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #90473 by Alan Sparkes
Replied by Alan Sparkes on topic Where K2 store articles images in database?
This is puzzling - where is the link between the itemid and the image?
Are you saying that it is done dynamically ?

eg the image filename 'fc34f61d23b74be53ee07d469bd32064_M.jpg' is a hash with the item id in it?

This sounds an odd approach - especialy given SEO image potential or human readable needs on pics.

Dev team comment?

Please Log in or Create an account to join the conversation.

  • Enrico Fiorani
  • Enrico Fiorani's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #90474 by Enrico Fiorani
Replied by Enrico Fiorani on topic Where K2 store articles images in database?
Alan Sparkes said:This is puzzling - where is the link between the itemid and the image? Are you saying that it is done dynamically ?

eg the image filename 'fc34f61d23b74be53ee07d469bd32064_M.jpg' is a hash with the item id in it?

This sounds an odd approach - especialy given SEO image potential or human readable needs on pics.

Dev team comment?


Hi Alan, I can almost say yes at all your questions :)
I'll wait for a final Dev Team replay about this and yes "This sounds an odd approach" :)

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #90475 by Ben Chesters
Replied by Ben Chesters on topic Where K2 store articles images in database?
Hi, does anyone have an answer to this, I cannot see a trace of any of my images in the sql database?! Where are they!

Alan Sparkes said:
This is puzzling - where is the link between the itemid and the image? Are you saying that it is done dynamically ?

eg the image filename 'fc34f61d23b74be53ee07d469bd32064_M.jpg' is a hash with the item id in it?

This sounds an odd approach - especialy given SEO image potential or human readable needs on pics.

Dev team comment?

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #90476 by william white
Replied by william white on topic Where K2 store articles images in database?
see this post
After investigating how the item image name is generated I found this in administrator/components/com_k2/views/item/view.html.php:if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_L.jpg'))$item->image = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg';This means that the hash is generated from the word "Image" (with capital I), followed by the item ID. For example if we have a content item id 72 the hash is taken from "Image72" its generated using md5('Image72') (returns d6086de322f98f66cc694f32ea284557), so the filename will be d6086de322f98f66cc694f32ea284557.jpg.Hope this will help somebody who is looking for the same thing as me in the future.

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #90477 by Ben Chesters
Replied by Ben Chesters on topic Where K2 store articles images in database?
Hi, which table does this informtion reside in within mysql? Thanks for your help!

William White said:
see this postAfter investigating how the item image name is generated I found this in administrator/components/com_k2/views/item/view.html.php:if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_L.jpg'))$item->image = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg';This means that the hash is generated from the word "Image" (with capital I), followed by the item ID. For example if we have a content item id 72 the hash is taken from "Image72" its generated using md5('Image72') (returns d6086de322f98f66cc694f32ea284557), so the filename will be d6086de322f98f66cc694f32ea284557.jpg.Hope this will help somebody who is looking for the same thing as me in the future.

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #90478 by william white
Replied by william white on topic Where K2 store articles images in database?
"This means that the hash is generated from the word "Image" (with capital I), followed by the item ID"

not in the table

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #90479 by Ben Chesters
Replied by Ben Chesters on topic Where K2 store articles images in database?
I see, it is just that I am trying to import 300 pages to a site and need to place the file paths into the database, sounds like this is not going to be possible. :( Unless anyone knows of a way to do this? Thanks for your help as well, appreciate it.

William White said:
"This means that the hash is generated from the word "Image" (with capital I), followed by the item ID"

not in the table

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum