× 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!

Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 1,007
» Latest member: kavitasinghji
» Forum threads: 1,324
» Forum posts: 7,787

Full Statistics

Online Users
There are currently 81 online users.
» 0 Member(s) | 79 Guest(s)
Bing, Google

Latest Threads
How to use hasPerm
Forum: UserSpice 4.4
Last Post: mudmin
07-20-2019, 02:45 PM
» Replies: 1
» Views: 4,556
Session issue? What I sho...
Forum: UserSpice 4.4
Last Post: Parth
07-17-2019, 05:06 PM
» Replies: 4
» Views: 4,417
Email Error
Forum: UserSpice 4.4
Last Post: Brandin
07-17-2019, 04:47 PM
» Replies: 1
» Views: 2,032
{ Missing Text } after up...
Forum: UserSpice 4.4
Last Post: Brandin
07-16-2019, 04:23 PM
» Replies: 22
» Views: 16,170
Best Practice Info
Forum: New to UserSpice?
Last Post: Brandin
07-16-2019, 11:55 AM
» Replies: 1
» Views: 4,512
Force to use 2FA -always-
Forum: UserSpice 4.4
Last Post: Brandin
07-12-2019, 12:43 PM
» Replies: 1
» Views: 1,991
e-mail not verifying
Forum: UserSpice 4.4
Last Post: LBC
07-10-2019, 11:34 AM
» Replies: 31
» Views: 25,407
changes to navigation.php...
Forum: UserSpice 4.4
Last Post: mudmin
07-07-2019, 10:46 AM
» Replies: 2
» Views: 2,530
Duplicated files in /user...
Forum: UserSpice 4.4
Last Post: mudmin
07-07-2019, 10:44 AM
» Replies: 1
» Views: 1,939
problems after update
Forum: UserSpice 4.4
Last Post: mudmin
07-05-2019, 10:13 AM
» Replies: 13
» Views: 10,003

  multiple database connection
Posted by: Hade - 04-30-2019, 10:10 PM - Forum: UserSpice 4.4 - Replies (3)

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.

  new page what files to include..
Posted by: maxikz - 04-29-2019, 07:18 PM - Forum: UserSpice 4.4 - Replies (1)

what files in php to include for new php files outside of userspice pages.

  Domain used for emails
Posted by: andy - 04-29-2019, 11:56 AM - Forum: UserSpice 4.4 - Replies (3)

Hi All

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.



  Split menu items (left & right sorting)
Posted by: PeterAarts - 04-28-2019, 08:27 PM - Forum: Modifications and Hackery - Replies (1)

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

$itemString.='<li class="nav-item"><a class="nav-link" href="'.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['display_order'].' '.$menuItem['label'].'</a></li>';
if ($menuItem['display_order']==10000){ $itemString.='</ul><ul class="navbar-nav ml-auto">'; }
$itemString.='<li class="nav-item"><a class="nav-link" href="'.US_URL_ROOT.$menuItem['link'].'"><span class="'.$menuItem['icon_class'].'"></span> '.$menuItem['label'].'</a></li>';

Attached Files Thumbnail(s)

  How To: SELECT 1 or 2 rows depending on a DISTINCT single row
Posted by: Malatesa - 04-27-2019, 04:01 PM - Forum: Modifications and Hackery - Replies (5)

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

The output from my current SELECT statement:

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
105 1556377556 ../users/wall/2019/04/1556377556.0624.txt 11 0
104 1556377556 ../users/wall/2019/04/1556377556.0624.png 11 0
103 1556377530 ../users/wall/2019/04/1556377530.5411.txt 11 0
102 1556377522 ../users/wall/2019/04/1556377522.3709.txt 11 0
101 1556377393 ../users/wall/2019/04/1556377393.0412.txt 11 0
99 1556377380 ../users/wall/2019/04/1556377380.8744.png 11 0
100 1556377380 ../users/wall/2019/04/1556377380.8744.txt 11 0
98 1556375783 ../users/wall/2019/04/1556375783.454.txt 11 0
97 1556375751 ../users/wall/2019/04/1556375751.5567.txt 11 0
96 1556375751 ../users/wall/2019/04/1556375751.5567.png 11 0
95 1556345197 ../users/wall/2019/04/1556345197.4695.txt 1 0
94 1556345197 ../users/wall/2019/04/1556345197.4695.png 1 0
93 1556345018 ../users/wall/2019/04/1556345018.6357.txt 1 0
92 1556345018 ../users/wall/2019/04/1556345018.6357.png 1 0
91 1556345000 ../users/wall/2019/04/1556345000.6300.png 1 0

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.

Any suggestions welcome.

  Is Javascript obfuscation useless?
Posted by: StormyBed - 04-26-2019, 05:07 AM - Forum: Off-topic Discussions - Replies (1)

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?

  Can't login as admin after installation
Posted by: joemons - 04-25-2019, 08:53 AM - Forum: UserSpice 4.4 - Replies (1)

I already tried reinstalling and it says I have all system requirements. I am using this on 000webhosting.com

After installing userpice 4.4, whenever I try logging in

it says If this continues to happen, please contact the administrator. Whenever I try to register an account it says the same thing as well.

This only happens when using chrome canary

Photo Redirect After Login based on Username
Posted by: maxikz - 04-23-2019, 07:39 PM - Forum: UserSpice 4.4 - Replies (12)

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

  users and userc not mirrors
Posted by: Malatesa - 04-23-2019, 04:42 PM - Forum: UserSpice 4.4 - Replies (8)

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.

The first thing that I'd try to change is the logo.png file in https://witches.community/users/images/logo.png
If I create https://witches.community/usersc/images/logo.png the refresh does not pull from the usersc/images directory, it pulls from users/images

Is that expected behavior?

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?

  upgrade from 4.2.3 to 4.4.09
Posted by: steev - 04-22-2019, 04:27 PM - Forum: UserSpice 4.4 - No Replies

upgrade from 4.2.3 to 4.4.09

Do I have to upgrade in stages, using each patch to jump to the next ?