Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#91 2013-12-29 14:16:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,505
Website GitHub

Re: smd_user_manager: keep large user bases under control

Dragondz wrote #277622:

it seems that the query is too complex!

Yes, it’s a pretty hideous query. Since my current plugin version (0.21) is for 4.5.x only, I wonder if you could try this modified code in your version and report back if it fixes the problem. First of all, take out your SQL_BIG_SELECTS line. Then, delete lines 325 – 331 inclusive (the lines with $fields and $clause defined). In place of those removed lines, put this code instead:

// The fields that make up the real and computed columns
	$fields = 'txu.user_id,
		txu.name,
		txu.RealName,
		txu.email,
		txu.privs,
		unix_timestamp(txu.last_access) as last_login,
		(
			SELECT count(*)
			FROM textpattern
			WHERE AuthorID = txu.name
			GROUP BY AuthorID
		) AS article_count,
		(
			SELECT count(*)
			FROM txp_image
			WHERE author = txu.name
			GROUP BY author
		) AS image_count,
		(
			SELECT count(*)
			FROM txp_file
			WHERE author = txu.name
			GROUP BY author
		) AS file_count,
		(
			SELECT count(*)
			FROM txp_link
			WHERE author = txu.name
			GROUP BY author
		) AS link_count';
	$clause = ' FROM '.PFX.'txp_users as txu';

I’ve not profiled it, but that query will probably be less heavy on the ol’ server as it doesn’t do any JOINs, just a bunch of single-row SubSelects. If you could try that version and report back if it works, I’d be very grateful.

If it works fine, I can actually remove the GROUP BYs as well, but I’ve left them in for the moment because it affects the current searching feature. To put it bluntly I put some hacky crap in the code to detect if you were searching for ‘0’ to get round the fact that my awful SQL returned NULLs. If the above query works, I can remove the GROUP BY which will return true ‘0’ values for any people with no assets to their name and I can then remove the kludge code too, which will make me a much happier chappy.

Thanks in advance for any feedback.

Last edited by Bloke (2013-12-29 14:17:57)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#92 2013-12-31 11:41:59

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,559
Website GitHub Twitter

Re: smd_user_manager: keep large user bases under control

Hi stef thanks for the code correction, i havent seen it till i got your mail, i tryed it and it wotks without error.

Thanks stef and big hat and happy new year.

Offline

#93 2014-07-07 04:06:05

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: smd_user_manager: keep large user bases under control

I propose this slightly modified version:

smd_user_manager_v0.21_es-es_textpack.txt

#@smd_um
#@language es-es
smd_um_active => Usuarios actualmente conectados:
smd_um_active_timeout => Desconectar a los usuarios después de (segundos)
smd_um_admin_group => Grupo protegido de administradores
smd_um_article_count => Artículos
smd_um_based_on => basado en
smd_um_chp_lbl => Cambiar contraseña
smd_um_file_count => Ficheros
smd_um_grp_affected => . Usuarios afectados: {num}
smd_um_grp_created => Grupo "{name}" creado
smd_um_grp_deleted => Grupo eliminado
smd_um_grp_exists => El grupo ya existe, su ID de privilegios es {id}
smd_um_grp_lbl => Grupos
smd_um_grp_new => Nuevo nombre de grupo
smd_um_grp_new_name => nombre
smd_um_grp_saved => Información de grupo actualizada
smd_um_heading_grp => Grupos de usuarios
smd_um_heading_prf => Preferencias del gestor de usuarios
smd_um_heading_prv => Privilegios de usuarios
smd_um_heading_usr => Gestión de usuarios
smd_um_hierarchical_groups => Asumir grupos jerárquicos (niveles)
smd_um_image_count => Imágenes
smd_um_link_count => Enlaces
smd_um_max_search_limit => Límite máximo de resultados en búsqueda de usuarios
smd_um_name_required => Se requiere un nombre
smd_um_new_user => Nuevo usuario
smd_um_pass_change_error => Contraseña NO guardada
smd_um_pass_length => Longitud de contraseña (caracteres)
smd_um_prf_lbl => Preferencias
smd_um_prv_created => Área de privilegios "{area}" creada
smd_um_prv_exists => Área de privilegios ya existe
smd_um_prv_lbl => Privilegios
smd_um_prv_new => Nuevo área de privilegios
smd_um_prv_saved => Privilegios actualizados
smd_um_prv_smd_um => Imposible crear privilegios para smd_user_manager
smd_um_reset => [R]
smd_um_self_alter => Permitir cambiar privilegios a smd_um
smd_um_sel_all => Selecciona esta área completa, luego marca (c), desmarca (u) o invierte (t) la selección
smd_um_sel_grp => Selecciona este grupo, luego marca (c), desmarca (u) o invierte (t) la selección
smd_um_sel_prv => Selecciona este área, luego marca (c), desmarca (u) o invierte (t) la selección
smd_um_sel_reset => Reajustar: todas las áreas marcadas volverán a sus valores por defecto después de guardar
smd_um_settings => Preferencias
smd_um_tab_name => Gestor de usuarios
smd_um_tbl_installed => Tablas instaladas
smd_um_tbl_not_installed => Tablas no instaladas
smd_um_tbl_not_removed => Tablas no eliminadas
smd_um_tbl_removed => Tablas eliminadas
smd_um_user_count => Usuarios en este grupo:
smd_um_usr_lbl => Usuarios

Offline

#94 2016-01-09 17:16:22

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: smd_user_manager: keep large user bases under control

Subscribed to thread. ;)

Offline

#95 2017-12-02 07:47:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,397
Website GitHub Mastodon Twitter

Re: smd_user_manager: keep large user bases under control

I am trying to change the staff writer privileges by allowing them read/write/edit access to the articles images and files tabs. All works Ok except for files as the upload GUI is not showing. Does anyone have any ideas?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#96 2017-12-02 08:47:59

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: smd_user_manager: keep large user bases under control

I have trouble mixing smd_user_manager and rah_change_passwords after updating a site to 4.6.2. Nothing appears at backend to change users password under smd_user_manager screen.

Does anybody has experience the same issue? I asked for help at rah_change_passwords thread (and also sent a private to Gocom) but nobody answered : -(

The plugins markup looks sort, so perhaps someone with knowledge can fix it easily for do it operative under 4.6.2


<txp:rocks/>

Offline

#97 2018-02-03 13:18:16

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: smd_user_manager: keep large user bases under control

@Bloke
Are you planning to publish an updated version of this plugin for 4.6.2 and later?
I’m asking, because with this plugin I could probably resolve the problem described in this threat:
Strange behaviour of <txp:php> inside article body

Last edited by whocarez (2018-02-03 13:18:33)

Offline

#98 2018-04-17 17:22:24

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 727
Website Mastodon

Re: smd_user_manager: keep large user bases under control

Having an error in 4.7beta3 with smd_user_manager 0.21 upon defining new group i get

Fatal error: Uncaught Error: Call to undefined function mysql_affected_rows() in /home/kliklak/public_html/mixnix/textpattern/lib/txplib_misc.php(1826) : eval()'d code:1285 Stack trace: #0 /home/kliklak/public_html/mixnix/textpattern/lib/txplib_misc.php(1826) : eval()'d code(689): smd_um_upsert_lang('mugger', 'mugger') #1 /home/kliklak/public_html/mixnix/textpattern/lib/txplib_misc.php(1826) : eval()'d code(177): smd_um_groups() #2 /home/kliklak/public_html/mixnix/textpattern/lib/txplib_misc.php(1945): smd_um_dispatcher('smd_um', 'smd_um_groups') #3 /home/kliklak/public_html/mixnix/textpattern/index.php(261): callback_event('smd_um', 'smd_um_groups', 0) #4 {main} thrown in /home/kliklak/public_html/mixnix/textpattern/lib/txplib_misc.php(1826) : eval()'d code on line 1285


A hole turned upside down is a dome, when there’s also gravity.

Offline

#99 2018-04-17 17:31:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,505
Website GitHub

Re: smd_user_manager: keep large user bases under control

Yes, I’m partway through this one, sorry. For a quick fix, see the Converting to mysqli post.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#100 2018-04-17 17:39:20

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 727
Website Mastodon

Re: smd_user_manager: keep large user bases under control

Thanx, Stef!

(Edit: Not many mysql calls in there to be converted to mysqli)

Last edited by jayrope (2018-04-17 17:56:24)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#101 2018-06-06 12:11:58

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: smd_user_manager: keep large user bases under control

Hi Stef,

I was hoping I wouldn’t need to worry about this again, but I had to resurrect a site that has user man installed. I updated the site from 4.6.2 to 4.7. All content still outputs correctly on the frontside, but I observe the following problems on the admin-side…

  • If in context of the Admin menu, the User Manager label reads correctly as ‘User manager’. But if in context of any other admin-side menu, it reads ‘smd_um_tab_name’.
  • Same situation with ‘Bio config’; looks okay in the Extensions menu context, but looks like ‘smd_bio_admin_tab’ anywhere else.

I’m guessing those are not plugin-related, exactly, but maybe just some style thing somewhere.

  • When in users list, I get a Undefined when hovering over names.
  • When clicking a given user to open the profile view (i.e. ‘Edit user’ view), I only see the following fields, display as written here:
    • login_name
    • real_name
    • Email
    • privileges

The panel header is also showing as ‘edit_user’. In fact most headers and labels in the User Manager context are showing like that.

The only major problem is that I don’t seem to have access to the bio profile fields to edit any information, even though it’s displaying on the front-side.

Btw, you have an account in this site. I could give you a shout via email if you want to look at it at leisure.

Offline

#102 2018-06-06 13:02:06

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,232
Website GitHub

Re: smd_user_manager: keep large user bases under control

Destry, just an off-chance idea: Can you look in your database manually (post-update) manually and see what it says in the table txp_prefs under the entry version.

I spent a long time trying to debug something similar today and it turned out I still had 4.5.7 in there after the upgrade to 4.7.1. Manually correcting that to 4.7.1 (or 4.7.0) resolved the wrong plugin strings immediately.


TXP Builders – finely-crafted code, design and txp

Offline

#103 2018-06-06 13:42:43

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: smd_user_manager: keep large user bases under control

I have ’4.7.0’.

But, I am surprised to find I have 53 tables in this database. I don’t know when that happened, but I must have double-loaded two different databases and didn’t realize it.

There seems to be a number of duplicate tables with a prefix ‘wd’, which is something I used many years ago. Then there’s a few obsolete plugin tables too, apparently.

EDIT:

Down to a respectable 24 tables now and nothing blew up. Will be 23 after I have shortcodes rolled in and smd_macro removed. Would be about 19 (the default number?) if I ever find an alternative display process for author profiles and remove the smd_user_man and smd_bio tables. No rush on that, though.

Anyway, problem still stands with accessing bio data in admin-side.

Offline

#104 2018-06-09 01:04:52

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: smd_user_manager: keep large user bases under control

I removed bios from the site, de-installed the plugins. I’m good. No help needed.

Offline

#105 2018-12-21 21:15:20

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: smd_user_manager: keep large user bases under control

I found a problem using smd_user_manager. As I previously reported at this thread, I can’t access to Admin > Languages when smd_user_manager is active. Don’t know what could be causing that behavior, probably is not the plugin it self, it must be a combination of circumstances but the fact is there, when I switch it of languages works like a charm.


<txp:rocks/>

Offline

Board footer

Powered by FluxBB