How to add an image of a K2 article using BF?

  • Colombiamed
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0

Colombiamed created the topic: How to add an image of a K2 article using BF?

Hello:
How to add an image of a K2 article using BF?
#240484
  • TheMuffinMan
  • TheMuffinMan's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 8405
  • Karma: 164
  • Thank you received: 669

TheMuffinMan replied the topic: How to add an image of a K2 article using BF?

Hi,

I am not a K2 expert, but do you want to post an image uploaded with BF into a K2 article or display an image of a K2 article in your form?

Regards,
Markus

===========================
If you are happy, please leave us a small review here to keep us motivated:
(Please turn off your VPN and local Apache prior reviewing as your review might get blocked)

⭐⭐⭐⭐⭐ BreezingForms: extensions.joomla.org/extension/contacts...orms/breezing-forms/
⭐⭐⭐⭐⭐ ContentBuilder: extensions.joomla.org/extension/authorin...tion/contentbuilder/

===========================
Satisfied?
Get a membership!
===========================
#240486
  • Colombiamed
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0

Colombiamed replied the topic: How to add an image of a K2 article using BF?

Thanks
I want to post an image uploaded with BF into a K2 article.
#240534
  • TheMuffinMan
  • TheMuffinMan's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 8405
  • Karma: 164
  • Thank you received: 669

TheMuffinMan replied the topic: How to add an image of a K2 article using BF?

Hi,

sounds like a job for the Integrator of BreezingForms then. Please see:

crosstec.org/en/support/online-documenta...-the-integrator.html

If this should be a new article upon every submission, using an "Insert" rule would apply. To update an article, an "Update" rule would.

In both cases, you would need to inject appropriate HTML code in the content column of the article to display the image, of course.

I can imagine K2 got its own quirks to create new articles but as long as it uses only one table that hold its articles, it should be well possible (with some work).

Before you try this on your live site, I would suggest to run it in a test environment, because especially the Update rules could potentially harm your existing conetnt if not used properly.

Regards,
Markus

===========================
If you are happy, please leave us a small review here to keep us motivated:
(Please turn off your VPN and local Apache prior reviewing as your review might get blocked)

⭐⭐⭐⭐⭐ BreezingForms: extensions.joomla.org/extension/contacts...orms/breezing-forms/
⭐⭐⭐⭐⭐ ContentBuilder: extensions.joomla.org/extension/authorin...tion/contentbuilder/

===========================
Satisfied?
Get a membership!
===========================
#240544
The following user(s) said Thank You: Colombiamed
  • Colombiamed
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0

Colombiamed replied the topic: How to add an image of a K2 article using BF?

Thanks:
I found this in
"Image name is not stored in the database.
In the original setup when you upload an image it is saved with a filename that includes the id of the K2 item/article that it belongs to. Therefore no data is stored in database, when image is needed on the website, the code just looks for the image with the filename that contains the item/article id.
The actual filenames of images look a bit odd because they are hashed, or encoded, by K2 when you upload them. For example image37.jpg can become something like 23438aesd2348swrtujh2341184.jpg. But K2 can still read the actual id (37 in this example) from that hashed/coded filename."

A file is named Image105 (with md5 hashing) and is stored in the proper directory.

When k2 tries to load an item image it tells it to just go out and get md5(item105) and see it.

There are multiple copies of the k2 item images in all different sizes so you can change the size that displays, and also, the source files are also stored.


www.joomlaworks.net/forum/k2-en/24906-wh...in-database?start=10
And also, K2 storage the images in this location: /httpdocs/media/k2/items/src
#240830
  • TheMuffinMan
  • TheMuffinMan's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 8405
  • Karma: 164
  • Thank you received: 669

TheMuffinMan replied the topic: How to add an image of a K2 article using BF?

Hi,

you would do that in a smilar fashion like I described in the other post.
To determine the pate of the final file, you would pick the actual value from submissions, apply md5 over it and look it up in the folder, something like this:
$k5path = JPATH_SITE . 'media/k2/items/src/' . md5( str_replace('.jpg','',basename( $field_value ) ) ) . '.jpg'; // the actual filename

This code is just for illustration to show the principle. It will need adjustments based on the file extension, but that's then basically how I would look up the resulting file and where it is stored in K2.

===========================
If you are happy, please leave us a small review here to keep us motivated:
(Please turn off your VPN and local Apache prior reviewing as your review might get blocked)

⭐⭐⭐⭐⭐ BreezingForms: extensions.joomla.org/extension/contacts...orms/breezing-forms/
⭐⭐⭐⭐⭐ ContentBuilder: extensions.joomla.org/extension/authorin...tion/contentbuilder/

===========================
Satisfied?
Get a membership!
===========================
#240842
Moderators: ForumSupport
Time to create page: 0.051 seconds

We Are Doing Our Part

Massive discounts on all of our extension subscription plans to help you and your business in these times.

Get Your Subscription Here

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

We are doing our part and support your business with extremely low prices -- For example 6-Months-Subscription for only $9 USD. For as long as necessary.

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!