TOPIC:

How to add an image of a K2 article using BF? 8 months 2 weeks ago #240484

  • Topic Author
  • Colombiamed
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
Hello:
How to add an image of a K2 article using BF?

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

How to add an image of a K2 article using BF? 8 months 2 weeks ago #240486

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 807
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

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

How to add an image of a K2 article using BF? 8 months 2 weeks ago #240534

  • Topic Author
  • Colombiamed
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
Thanks
I want to post an image uploaded with BF into a K2 article.

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

How to add an image of a K2 article using BF? 8 months 2 weeks ago #240544

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 807
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
The following user(s) said Thank You: Colombiamed

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

How to add an image of a K2 article using BF? 8 months 1 week ago #240830

  • Topic Author
  • Colombiamed
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
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

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

How to add an image of a K2 article using BF? 8 months 1 week ago #240842

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 807
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.

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.048 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!