The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
Adding Ajax to userspice - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Adding Ajax to userspice (/showthread.php?tid=683)



Adding Ajax to userspice - rahadi - 08-22-2017

Hi,
I am new to userspice. Already played around with the framework but was wondering how to add ajax to this framework?
I want to know how to use ajax/http calls to userspice? Suppose, I have a login form and want to submit these form's data through javascript to users/login.php file. Should I make changes to login.php file? or what?
Please help. Thanks



Adding Ajax to userspice - Brandin - 08-22-2017

If you're changing core files your best bet is to copy to the into usersc. It will auto-redirect when there is a custom file to replace the same file name. You should be fine to use your AJAX scripts without issues if I'm understanding your question correctly.


Adding Ajax to userspice - rahadi - 08-24-2017

Thanks Brandin. Somehow find a solution, but still I have another issue. I already have a project with the following directory structure:
Myproject
----->js
----->css
----->core
----->includes
----->index.php

and now I want to add userspice as a module to this structure which should look like this:
Myproject
----->js
----->css
----->core
----->includes
-----> userspice
-----> index.php

Now, how to manage my private and public pages by userspice as the z_us_root.php file is inside the userspice directory?
thanks






Adding Ajax to userspice - Brandin - 08-24-2017

So if I'm understanding correctly you want to control files that are outside of this userspice directory you made? You should really have the userspice files in root.


Adding Ajax to userspice - rahadi - 08-25-2017

Yes, that is what i want to control files out of my userspice directory.
What if I only put z_us_root.php file in root directory and other userspice files inside userspice directory that I made? Is it possible to control files out of userspice directory now?


Adding Ajax to userspice - Brandin - 08-25-2017

I imagine it is possible, just worried about the logistical aspect. When calling your init you'll have to use "../userspice/users/init.php" and run your PHP self script. In z_us_root you'll have to use "../core" for example to capture the folder data...I just worry about how this will work wise of page management. @Mudmin, thoughts?