Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

photoUpload

8 years 1 month ago
Licenses:
JomSocial Expired

Hello there,

I am using jomsocial with ReadyBytes JSPT as platform of my site. I m using a registration form made by me with Breezing Forms extension where I create a jomsocial album during the user submission.
I would like to call, at the end of submission, the jomsocial modal upload page to let my users send their pictures to the album setted during registration.
At this point I already have a new user ID and the album ID, and the directory already exists in the server, so my problem is how could I call the jomsocial modal upload page through PHP code and let the user send photos? (PS:the user is not logged in yet as he just finished the registration)
I am ataching an image showing the page I am talking about,

Thanks in advance

Attachments:
8 years 1 month ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi,

Its hard to upload new photos before user is not login yet, because you will be redirected since that modal page is forbidden for guest. This trick is not easy you need hack jomsocial core code.

but anyway to call the modal for upload photos you can use this code (I think you already know):

joms.api.photoUpload('ID', '', '');


thank you

8 years 1 month ago
Licenses:
JomSocial Expired

Hello Dimas,

Thank you for your fast response!

I have few questions to take a decision if I will workaround, hack or something else.... I really would like to make users upload photos during registration!!

1) If I use Breezing Forms upload features to upload the user photos would I have any re-size image problems with jomsocial? I was wondering to use jomsocial upload feature to avoid settings problems, but I don´t know if they(problems) will really exist.

2) You think could I login the user by code after registration, open the jomsocial modal page and logoff by code when the user finish the upload and close the modal page?

3) If I hack the Jomsocial core code, which file should I go?

4) If the user is already logged, the statements bellow would be sufficient to open the modal window (of course changing ID for the user Album ID value!)

require_once JPATH_ROOT.'/components/com_community/libraries/core.php';
joms.api.photoUpload('ID', '', '');

Once more, thank you for your attention!

8 years 1 month ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

well, I can say this is very tricky, I cant help you too much / I cant provide you the pointer because this is hard to achived..

you have plan to required photos for new user, right? I suggest you use the plugin for this, please check this www.jomsocial.com/addons/applications/jo...ess-jspc-by-joomlaxi , this plugin developed by joomlaxi, maybe you can contact them for further information

8 years 1 month ago
Licenses:
JomSocial Expired

Hello Dimas,

I already know JSPC from readybytes. I bought JSPT and it comes together in a bundle, but this is not what I need, because my
site won´t be a community. My end user will mostly make registration by smartphone and it is important to do everything in one step!

I understood you can´t help me pointing where to hack jomsocial, and I already discarded this option.

I am thinking in a workaround where at the end of registration the user will be logged in by code (this is ready) and redirected
to this page:




Could you answer my questions number 4 and 1? I have to decide if I will do this workaround or use Breezing Form upload feature based in your answer...
Thanks in advance!

Attachments:
8 years 1 month ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi,

I see, i think this is proper solution
- use 3rd party to automatic login like this www.jomsocial.com/addons/core-enhancemen...o-login-and-redirect
- and redirect at the end of registration process, open this file components/com_community/views/register/view.html.php change this function registerSucess()

I hope it will help :)

8 years 1 month ago
Licenses:
JomSocial Expired

Hello Dimas,

I did the code to auto login the user just after registration through my custom form.
My question is:

How do I use this javascript funtion

joms.api.photoUpload('ID', '', '');
inside my php code?

I have the user album Id (I created it during custom registration), and my site users are not allowed to create new albums.

I do know a little PHP and almost nothing of javascript, but I think it is just a problem of sintax...

Could you help me?

Thanks in advance.

8 years 1 month ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

You need the trigger for this, and only can be done from html / template side..eg :

<a href="javascript:void(0)" onclick="joms.api.photoUpload('ID', '', '');">Upload photo</a>
or open the modal automatically after browser ready :
$( document ).ready(function() {
   joms.api.photoUpload('ID', '', '');
});

thank you!

8 years 1 month ago
Licenses:
JomSocial Expired

Hello Dimas,

Thank you for the code in the last post.

As I said before I am using Breezing Forms to do my custom login. The first option you gave to start the modal page through a button in my form worked well, but unfortunately I will need to use the second option starting it when the end user submit the form (Motive: the modal page has a button linking to other pages after the user upload images).
Breezing Forms extension has several points of insertion of code (before form, after form, etc) where I tried this code:

echo   '<script>      
$( document ).ready(function() {joms.api.photoUpload();});

</script>'; 

However nothing happens and the error that apears in browser console is:
complemento-do-registro:890 Uncaught TypeError: $(...).ready is not a function

Do I have to load any complementar library to make it work?

Thanks in advance

8 years 1 month ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

You need to load jquery library freamwork, do you know to do it right? :)

8 years 1 month ago
Licenses:
JomSocial Expired

Hi Dimas,
It wasn´t Jquery library, following Breezing Form support sugestion. I changed the expression to this:

echo   "<script >JQuery( document ).ready(function() {joms.api.photoUpload('116','','');});</script>";

and the error in the chrome changed to this:
Uncaught TypeError: Cannot read property 'photoUpload' of undefined
(anonymous function) @ complemento-do-registro:3538
j                                   @ jquery.min.js:2
kfireWith                      @ jquery.min.js:2
m.extend.ready           @ jquery.min.js:2
J                                  @ jquery.min.js:2

Then I tried this to check if the Jquery command was working:
echo   "<script >JQuery( document ).ready(function() {console.log( 'Working!' );});</script>";
And it worked good...
Now It is not recognizing property 'photoUpload'. Maybe any other library that should be load?

Thanks in advance

8 years 1 month ago
Licenses:
JomSocial Expired

Hello Dimas
I put this code in a javascript insertion point of breezing form:

JQuery( document ).ready(function() {joms.api.photoUpload('116','','');});

and the error in console was:
 Uncaught TypeError: Cannot read property 'prepare' of undefined                     bundle.js?_=1460647683105:7
(anonymous function)         @ bundle.js?_=1460647683105:7
photoUpload                       @ bundle.js?_=1460647683105:9
(anonymous function)         @ complemento-do-registro:927
j                                           @ jquery.min.js:2
k.add                                   @ jquery.min.js:2
m.fn.ready                           @ jquery.min.js:2
ff_complemento_submitted @ complemento-do-registro:927
onload                                 @ complemento-do-registro:896

I think I am almost there. Is there any other auxilar library besides bundle.js?

Thanks in advance

8 years 1 month ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Please make sure you already loaded all Jomsocial javascript library :

  <script src="/jomsocial/components/com_community/assets/release/js/loader.js" type="text/javascript"></script>
  <script src="/jomsocial/components/com_community/assets/release_32/js/bundle.js" type="text/javascript"></script>
  <script src="/jomsocial/components/com_community/assets/vendors/toolkit.min.js" type="text/javascript"></script>
  <script src="/jomsocial/media/jui/js/jquery.min.js" type="text/javascript"></script>
  <script src="/jomsocial/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
  <script src="/jomsocial/media/jui/js/jquery-migrate.min.js" type="text/javascript"></script>
  <script src="/jomsocial/media/jui/js/bootstrap.min.js" type="text/javascript"></script>
</script><script type="text/javascript" src="/jomsocial/plugins/system/jomsocial.system/pc_includes/ajax_1.5.pack.js"></script>

thank you!

8 years 1 month ago
Licenses:
JomSocial Expired

Hi Dimas,

Almost there!

Still missing one library as you can see in the bellow console error log:

bundle.js?_=1460733125214:1 Uncaught TypeError: Cannot read property 'match' of undefined
Tthe file loader.js is calling a function named match() and the file bundle.js can not resolve the function location.

All others file loading correctly!
Thanks in advance

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW