×This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!
first of all thanks for this great tool, i've been planning to add user functions to my site but it was too much of a hassle, userspice just made it doable in less than a day.
one thing i'm having a problem with rn is connecting to 2 different databases, i've checked the forum and found an old thread for ver4.3 about the same thing, tried that
Quote:$db1 = DB::getDB(['db1name']);
$db2 = DB::getDB(['db2name']);
and this error came up
Quote:SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
i've read around and i think there's something i'm doing wrong when using the code above.
both databases are on the same server and use same user, so that's probably not the problem.
one thing may be important to point out is that the code completely stops executing after the error, the rest of the page doesn't load.
the page i'm using the code on is the users\account.php page, i'm trying to use an external database (different from the one used by userspice) to get and display data.
Probably a basic question, but its got me stumped. I did my dev work on localhost, then transferred onto a site. Its now up and running, but when a user registers and is asked to verify their email the link is like below:
Can anyone tell me how I change this to my sites domain name? I looked at all the settings but couldnt see anything. I tried editing the init.php file but that breaks the site, as I expected it would.
I wanted to change the menu for all menu-items left and all user function on right.
So I changed the file : dbnav.php in the user template directory
In function : customItemString() starting at line 6.
All menu-items from db with a display-order>=10000 will be right aligned based on following setting:
else {
// THIS is a typical menu link. What do you want it to look like?
// Note that this is in here twice to deal with if the link has http in it for a link to another website
$fix = $menuItem['link'];
if(substr($fix,0,4) == "http"){$e = 1;}else{$e=0;}
if($e == 1){
//It works the same for bootstrap 3 and 4 by default, but yourt template might want something other than li tags
Hello everyone.
I currently have a database called wall. If contains a record of a text post, OR a picture post, OR a picture and a text post. So there should be 1 of 3 outputs from my SELECT. But right now, my SELECT statement only returns one row at a time, which is fine if someone only posts a text post, or if someone only posts a picture post, but in the case that they post a picture AND text at the same time (the same td) then I need those 2 rows returned so I can process them TOGETHER.
My current SELECT statement: SELECT rowId, td, filename, userId, deleted FROM wall ORDER BY td DESC
As you can see, the output returns a row containing either a row with a record of a text post, or a row containing a record of a picture post. This is good IF people only post a text post OR a picture post, but if they post a text AND a picture post, my current SELECT statement won't know because it only returns EITHER a text post OR a picture post, but it doesn't yet return the possibility of a text AND a picture post.
Output possibility 1) a single row that is a text post row
rowId td filename userId deleted
103 1556377530 ../users/wall/2019/04/1556377530.5411.txt 11 0
(I will display this as a text only post)
Output possibility 2) a single row that is a picture post row
rowId td filename userId deleted
91 1556345000 ../users/wall/2019/04/1556345000.6300.png 1 0
(I will display this as a picture posted without a text message associated with the picture)
Output possibility 3) 2 rows that contains both the text row and the picture row as a set
rowId td filename userId deleted
107 1556377561 ../users/wall/2019/04/1556377561.1218.txt 11 0
106 1556377561 ../users/wall/2019/04/1556377561.1218.png 11 0
(I will show this as a picture that goes with some associated text)
So I need a SELECT statement that returns either 1 row with a text post if there is not an associated picture post with that same td (time in seconds), or 1 row with a picture post if there is not an associated text post with that same td (time in seconds), or 2 rows with a text post AND a picture post with the same td (time in seconds). Then I can show EITHER the text post if there was no picture posted with the text, or a picture post if there was no text posted with it, or the text AND picture because they were posted at the same time as a set.
I have thought about obfuscating my JS code on the client side to prevent people to copy a JS program. I have discovered that there were expensive Javascript offers online. First of all, I have tried several free JS obfuscation websites. But then, I have been able to hack my own code by using de-obfuscation codes. I also thought that it was theoretically possible to debug my own obfuscated code in a browser and watch the variables. Since the variable content aren't encrypted it is easy to understand how it works looking at the variables because there are numbers, text and strings. Do you think it is possible to reverse engineer a JS code this way? So, I have decided to deploy the most important part of my code on NodeJS even if it is going to cost me more money using a server to do the job that I intended to do on the client side. Do it make sense? What are your thoughts?
I need to redirect after login based on user name ?
Let's say if user John log in he would be redirected to /john/index.php if
User Michael log in he would be redirected to /micahel/index.php
There should be a 1 to 1 mirror between users and usersc so that if we wanted to make changes to the code, or say an image, it wouldn't disrupt future upgrades because new code goes in users.
Besides editing the main UserSpice code (which will later break the edits and may impact future upgrades), what is the best way to cause UserSpice to pull from every directory in usersc instead of users?