Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Image URL in JR5
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 07/28/13 17:42 
I used the form designer to add an image upload field to "create a new page" ie: mysite.com/page/create. How do i get the url to the image i selected while creating the page. I used {debug} but only got the image name not the full path.

Where is the template file that is used in mysite.com/profileName/audio?

How can i disable audio/video streaming and download for visitors. I want the buttons to be there but redirects to login page (if not logged in).

Thanks alot

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 07/29/13 05:09 
If you've purchased the Super Pack, you can embed any image from your site when creating a "Page" by using the "Insert Media" button on the text editor, its the second button from the right at the top of the editor.



This button allows you to embed anything that is on your site into the text editor.

Hope this helps,
Douglas


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 07/29/13 08:27 
I decided to use the form designer because i need to show a thumbnail of the image beside the post in home page. So i needed to get the url. Using the method you described adds the image link to the post, which might be difficult to extract.

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 07/29/13 09:48 
This is actually a mod that Micheal built for the text editor, it allows you to embed images that you may have already uploaded to your profile gallery. They can be resized and positioned. Is that not what your looking to do?


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 07/29/13 10:39 
Thanks for your reply but that is not what i want to do.

What i want is this: In the nova skin, In the section where you have latest articles, instead of displaying the profile pic along side the article, I want to display a new and unique image for that post along side the article. Just like a normal blog.

Thanks a lot.

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 07/29/13 18:33 
What you want is this function:

Code
 {jrCore_module_function function="jrImage_display" module="jrPage" type="page_donkey" class="iloutline" item_id=$item._item_id size="small" crop="auto"}


This particular one is setup for an image added to a page.

When you add an extra image using the form designer, you have to give it a name. its that name you use in the type="" section.

So if you added an image to the blogs the code would be:

Code
 {jrCore_module_function function="jrImage_display" module="jrBlog" type="blog_XXXXXXXXXXX" class="iloutline" item_id=$item._item_id size="small" crop="auto"}


The item_id="" is the item id of the blog post. The other stuff is just formatting. so the barest example would be:

Code
{jrCore_module_function function="jrImage_display" module="jrPage" type="page_donkey" item_id=$item._item_id size="small"}



_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
slimtugo



Joined: 19 May 2013
Posts: 78

Posted: 07/30/13 01:37 
Thanks it worked

Back to top
gcuezy



Joined: 29 Jul 2009
Posts: 306

Posted: 07/30/13 17:01 
Is there any function or other way to just pull back the value of the field (ie the URL)? I'm trying to setup a profile background image to allow a bit of customization.

Any ideas?

EDIT: I see that the field I made becomes a value, but as an example, the image path just brings back the file name. How can I build a path to the actual location?

Back to top
gcuezy



Joined: 29 Jul 2009
Posts: 306

Posted: 07/30/13 17:25 
So I opened the image and built it this way -
<img src="{$jamroom_url}/profile/image/profile_banner/{$profile_banner_access}/800" />

seems that it gets it's own url and a banner access number? Does this integer just increase with each upload? (image 1, image 2, image 3, etc)...

I really wish there was some documentation already. Confused

Back to top
gcuezy



Joined: 29 Jul 2009
Posts: 306

Posted: 07/30/13 17:26 
I don't have any other accounts setup but that actually seems like the user id. So, since it's a single image field, it uses that created path with the /user_id/ and the size.

Right track?

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 07/30/13 19:00 
shouldn't need to build any url's that function should do it for you.

If you created a blog image field with an image uploader on it, then you would have had to call it something.

What you called it is what you use to retrieve it.

The best documentation there is right now is looking at other examples of working code.

Each of the functions is documented with a documentation block at the top of the function.

That function is at: smarty_function_jrImage_display. Its on line 1044 of:
/modules/jrImage/include.php

and the image url is generated with this line:

Code
$url = "{$_conf['jrCore_base_url']}/{$url}/image/{$params['type']}/{$params['item_id']}/{$params['size']}";


so you shouldn't need to figure out the url, just use the function.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
gcuezy



Joined: 29 Jul 2009
Posts: 306

Posted: 07/31/13 04:09 
The function returns an actual image tag though. I found no example of the url only. This is useful if I want to set a background image, link directly, or setupba custom modal window.

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 07/31/13 18:09 
If you want to build the image url yourself, of course you can.


Code
{jrCore_module_url module="jrGallery" assign="murl"}


will give you the module url. the site admin can change it so this is a safe way to get it.

Then you have:
{$jamroom_url}/{$murl}/image/(whatever you called it)/(the item id of the item its associated with)
so perhaps:
{$jamroom_url}/{$murl}/image/gallery_image/3


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
gcuezy



Joined: 29 Jul 2009
Posts: 306

Posted: 08/09/13 04:50 
Awesome, so the item_id in this case would be the profile id since I added this field to the user profiles... correct?

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 08/09/13 20:55 
sounds right. test a few of the urls and you'll know for sure.

Everything in a datastore has an _item_id.

Take a look in phpmyadmin. At first, its really weird if your used to constructing SQL queries and tables, then once it stops being weird, it becomes really useful.

There are 2 tables for any datastore. eg, for profile:
* jr_profile_item
* jr_profile_item_key

If you look in jr_profile_item it will just look like:

Code
_item_id
1
2
3
4
5
6

and on first glance, all you can think is "Huh?" Confused
Then you look in jr_profile_item_key and its
_item_id | key | index | value

Which is very strange coming from the traditional setup of
band_id | band_name | band_???? |

The _item_id corresponds to all of the values that also have the same _item_id. And this means you get an unlimited amount of 'band_???' type entries without changing the database.

Once this sinks in, it goes from "Huh?" to "aaaaahhhhh!! cool!!!" Smile


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

12Next >
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.