[plugin] extendedView - display custom user attributes

3rd party code for phpList

[plugin] extendedView - display custom user attributes

Postby eerne » 4:06pm, Tue 02 Jun, 2009

Hi

I wrote a plugin "extendedView" to display custom attributes in the users view. The attributes that should be displayed, can be chosen with checkboxes.

development
===========

The code is a modified version of admin/users.php , it is still a bit messy, for example i commented parts that i didn't need.

BETA
====

It is still beta please be careful when using it. It runs well for us. Although I only tried it as superuser. There could be a bug when you are not a superuser.

features
========

- "users view" that displays email and custom attributes in a table
- any attributes can be visualized by selecting their checkbox
- additional filter option: by list
- option of how many entries to display
- parses all fields and makes real links out of "www." or "http://"
- multiple users can be selected and added to any list
- dropped pagination

Installation
============

Add plugin directory to phplist by changing config.php on line 568
define("PLUGIN_ROOTDIR","../../myPlugins");
in my case the myPlugin directory is next to the phplist directory list/

note
====

In order to display anything on default and to search in all users it is required to have a list with all users. This list should be made default by specifying it on the line 53 in myPlugins/extendedView/main.php

$filterlistid = '1'; // config: list with all users

A list with the default attributes can can be set on line 93

if($showAttributes==array(0)){ $showAttributes = array(1, 2, 3, 5, 8, 11, 16); } // configuration to show default attributes

Enjoy
=====

Please feel free to use this plugin under the comon phplist licence (if i remember correctly it's GNU GPL)

Best

Enrique Erne
Attachments
myPlugins.zip
extendedView-BETA
(8.96 KiB) Downloaded 442 times
eerne
phpList newbie
 
Posts: 1
Joined: 3:04pm, Tue 02 Jun, 2009

Re: [plugin] extendedView - Display Custom User Attributes

Postby dcphosting services » 5:23am, Fri 05 Jun, 2009

Good day to you Eerne,

I downloaded and installed your extendedView contribution last night. Thank you, your labors are appreciated.

I didn't have many problems getting your plugin to work, other than the typical directory differences. When I first opened the extendedView page, mySQL complained of three database syntax errors (repeatedly). Using the page to search users by specified criteria worked flawlessly.

I figured my errors in opening the page were from the script being changed, maybe a version difference, or something simple like that. Since I *** ******** ***** to try and keep the baddies out, I wasn't tooo worried about the errors. But, mySQL errors should be fixed. I changed admin error_reporting to E_ALL. I defined undefined variables (or just increased the size of the commented out sections).

Yet there was one mySQL error I kept getting because the query always returned an empty array. Because I don't work with these scripts often enough to remember what I learned about them in the previous scripting session, I wasted several hours playing around and getting nowhere. To make the problem 'go away', decided to add a default search. I changed likes 67 - 73:
Code: Select all
} else {
   $_SESSION["userlistfilter"]["find"] = "";
   $_SESSION["userlistfilter"]["findby"] = "";
}

$find = $_SESSION["userlistfilter"]["find"];
$findby = $_SESSION["userlistfilter"]["findby"];
to
Code: Select all
} else {
   $_SESSION["userlistfilter"]["find"] = "doug";
   $_SESSION["userlistfilter"]["findby"] = "name";
}
      $find = $_SESSION["userlistfilter"]["find"];
      $findby = $_SESSION["userlistfilter"]["findby"];
      $findtables = ", {$tables["user_attribute"]}, {$tables["listuser"]} ";
      $findfield = $tables["user_attribute"] . ".value, {$tables["user"]}.bouncecount";
      $findfieldname = "name";
      $findbyselect  = $tables["user_attribute"] . ".userid = {$tables["user"]}.id AND {$tables["user_attribute"]}.attributeid = '2' AND {$tables["user_attribute"]}.value LIKE '%{$find}%' AND {$tables["listuser"]}.userid = {$tables["user"]}.id AND {$tables["listuser"]}.listid = '1'"
Appending limit='6' to $findbyselect would keep the list short. The search term 'doug' can be changed to anything more appropriate works too. There may be better ways of doing this but it work. The page is served up error free every time now.

This is a great little mod. Thank you.
dcphosting services
PL Nut
 
Posts: 17
Joined: 2:58pm, Fri 17 Mar, 2006
Location: Princeton, Minnesota

Re: [plugin] extendedView - display custom user attributes

Postby johntrot » 11:32pm, Thu 01 Jul, 2010

Excellent... your plugin is fantastic!

No need for edits, just the default list and attributes as you mentioned.

I have been looking for this for a very long time. Just not putting in the right key words in search I guess.

My heart-felt thanks for a great job. :D
John B
johntrot
PL Geek
 
Posts: 71
Joined: 8:28pm, Fri 01 Apr, 2005

Re: [plugin] extendedView - display custom user attributes

Postby TheLightning » 8:24pm, Sun 08 Aug, 2010

Thanks for this very good plugin, works fine on v 2.10.12, and quite easy to install.
The problem is that I'm completly addicted to ExtendedView, and I can't make it work with Phplist v 2.11.05.
Maybe I've missed something like: "works only with 2.10.12 version", but if there is a way to use it with the last release of phplist (v 2.11.05), I would be very glad to know it !
I've tried many configurations, but since I've upgrade to v 2.11.05, the plugin is invisible.
Do I have to edit something different in the configuration that I've used with v 2.10.12 ?
If someone makes it work with v 2.11.05, please tell me.
(sorry if it's hard to understand me, english is not my native language...(I'm french!)
Anyway, thanks in advance for any help! :cry:
TheLightning
phpList newbie
 
Posts: 1
Joined: 11:33am, Sat 07 Aug, 2010

Re: [plugin] extendedView - display custom user attributes

Postby Dragonrider » 9:36pm, Sun 08 Aug, 2010

Please bear in mind that 2.11.x versions are Beta test releases, not sufficent stable for live sites and probably quite different from 2.10.x version.
My sites:- http://wharfedalefestival.co.uk, http://ilkleygardeners.org.uk, http://emergencyaid.net, http://dragonrider.co.uk
Latest phpList version is now 3.0.12 (3 February 2015) and requires a minimum of MySQL 5.0 and PHP 5.3.x
Dragonrider
Moderator
 
Posts: 3460
Joined: 6:58am, Sun 02 Jul, 2006
Location: Ilkley, West Yorkshire, United Kingdom

Re: [plugin] extendedView - display custom user attributes

Postby MFeyissa » 7:27am, Tue 07 Dec, 2010

Hi all,

Can I use this Plugin on Debian Linux?
Thanks
MFeyissa
phpList newbie
 
Posts: 1
Joined: 7:19am, Tue 07 Dec, 2010


Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 2 guests