Thread Like Summary
Gizmo, isaac
Total Likes: 2
Original Post (Thread Starter)
by Ruben
Ruben
The initial member search works fine but a error occurs when using a new saved search.
For example I saved a search for all members
when I execute that saved search I get:
Code
Script: /home/sundan21/public_html/forum/admin/membersearch.php
Line: 331
SQL Error: Unknown column 't4.GROUP_ID' in 'where clause'
SQL Error: 1054

Query:
select COUNT(t1.USER_ID)
from ubbt_USERS as t1,
ubbt_USER_PROFILE as t2,
ubbt_USER_DATA as t3

where t1.USER_ID <> '1'
and t1.USER_ID = t2.USER_ID
and t1.USER_ID = t3.USER_ID



and t4.GROUP_ID IN (1) GROUP BY t1.USER_ID,
t1.USER_LOGIN_NAME,
t1.USER_MEMBERSHIP_LEVEL,
t1.USER_DISPLAY_NAME,
t2.USER_REAL_EMAIL,
t2.USER_TOTAL_POSTS,
t1.USER_REGISTRATION_IP,
t1.USER_IS_BANNED,
t1.USER_IS_UNDERAGE,
t2.USER_BIRTHDAY,
t1.USER_REGISTERED_ON,
t3.USER_LAST_POST_TIME,
t3.USER_LAST_IP,
t3.USER_LAST_VISIT_TIME,
t3.USER_LAST_POST
ORDER BY t1.USER_ID ASC
Liked Replies
by isaac
isaac
EDIT 2020-02-09: THIS FIX HAS BEEN UPDATED. THE ORIGINAL FIX WORKED, BUT IT USED A POORLY CRAFTED SQL QUERY, WHICH WOULD OVERWHELM LARGE DATABASES WHEN SEARCHING WITHOUT A GROUP SELECTED. THE FOLLOWING CODE IS THE UPDATED FIX.
---

For UBB.threads 7.7.3 only,

in admin/membersearch.php
around line 280,
FIND:
Code
		$extra .= " and t4.GROUP_ID IN ($g_inlist) ";
		$group = ",{$config['TABLE_PREFIX']}USER_GROUPS as t4";
		$groups = "and t1.USER_ID = t4.USER_ID";
REPLACE WITH:
Code
		$extra .= "AND t4.GROUP_ID IN ($g_inlist) AND t1.USER_ID = t4.USER_ID";


around line 320, AND around line 373,
FIND:
Code
	{$config['TABLE_PREFIX']}USER_DATA as t3
	$group
REPLACE BOTH WITH:
Code
	{$config['TABLE_PREFIX']}USER_DATA AS t3,
	{$config['TABLE_PREFIX']}USER_GROUPS AS t4


around line 325, AND around line 378,
FIND:
Code
	$groups
	$removedlist
	$nomods
	$extra
REPLACE WITH:
Code
AND	t1.USER_ID = t4.USER_ID
	$removedlist
	$nomods
	$extra
1 member likes this
by Ruben
Ruben
I used the revised version change and it works flawless.
Thank you for posting the correction now instead of releasing it on the next version.
1 member likes this
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
3 members (rootman, Gizmo, Nightcrawler), 562 guests, and 186 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)