Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 05:53:04 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155518 Posts in 21712 Topics by 7738 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1] 2 3 4   Go Down
Print
Author Topic: New Module "UserExtend"  (Read 11120 times)
beatjost

Offline Offline

Posts: 66


« on: September 06, 2009, 05:20:06 PM »

I have written a new module, which lets you store additional information for users (like address, phone, birthdate and freefields if whised -> config.php). The administration is in the admin-tools section and it's rather ment for backend purpose than to publish, but it might be suitable for a droplet or something... Available in English, Polish, Dutch, Norwegian and German. Also a zip available for frontend, so a logged in user may change its own data (post below).



Habe ein neues Modul geschrieben, welches zusätliche Informationen zu den Benutzern speichert (wie Adresse, Telefon, Geburtstag und freie Felder falls erwünscht -> config.php). Die Verwaltung erfolgt via Admin-Tools. Das Modul ist eher für den Backend-Bereich gedacht als für die Webseite, eignet sich aber wohl auch als Basis für ein Droplet... Aktuell in Deutsch, Holländisch, Norwegisch, Polnisch und Englisch verfügbar. Zusätzlich auch ein Zip für das Frontend verfügbar, so können eingeloggte Benutzer ihre Daten selber ändern (Post unten).






Download:
Admin-Modul (Version 2.0)
Frontend-Replacement WB2.8.3
(oder versions)
Admin-Modul (Version 1.4)
Frontend-Replacement WB2.8

Details: (AMASP)
Modul
« Last Edit: March 15, 2012, 01:43:05 PM by beatjost » Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #1 on: September 06, 2009, 07:24:00 PM »

Just tried it, good work  wink

What I dont like is that only admin can change/view/update these info..there is no frontend interaction...and user cant change this data himself

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
beatjost

Offline Offline

Posts: 66


« Reply #2 on: September 07, 2009, 03:18:27 AM »

This would be a nice enhancement for the next version. I think the best place would be in the preference section, so each logged in user could change his detail information.

I just did not know how to change this form automatically within the install script... Did anybody have ideas?
Logged
snark
Guest
« Reply #3 on: September 07, 2009, 07:02:07 AM »

firts of all, I think this is really great stuff

1: I agree on what crnogorac081 says about the option for people to let them change their own extra's

2: Now all users are displayed in one big list but when using different groups in a website it would be very nice to have those users sorted.

3: It would also be very handy if the table that contains the info is sortable alphabethically not only on username but on the other fields too.
It is quite simple to add some code to make this possible

on http://www.cssjuice.com/16-sortable-table-techniques/ you will find lots of possibillities




Logged
beatjost

Offline Offline

Posts: 66


« Reply #4 on: September 08, 2009, 07:33:39 PM »

firts of all, I think this is really great stuff

1: I agree on what crnogorac081 says about the option for people to let them change their own extra's

2: Now all users are displayed in one big list but when using different groups in a website it would be very nice to have those users sorted.

3: It would also be very handy if the table that contains the info is sortable alphabethically not only on username but on the other fields too.
It is quite simple to add some code to make this possible

on http://www.cssjuice.com/16-sortable-table-techniques/ you will find lots of possibillities


=> Sorting ist now implemented, also the group is displayed. The frontend interaction is planned... wink

Logged
beatjost

Offline Offline

Posts: 66


« Reply #5 on: September 09, 2009, 09:39:21 AM »

Some pre-version of a frontend action for user extended data has been created. It's a droplet which should be placed on a private site. this allows a logged in user to change those data.

After saving the record the redirection links to an empty page  embarassed - does anybody know how to solve this?

Download Droplet: http://www.beatjost.heliohost.org/user_extend_fontend-droplet.zip
=> only with new version of UserExtend from 09.09.09...
« Last Edit: September 09, 2009, 10:11:57 AM by beatjost » Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #6 on: September 09, 2009, 12:35:33 PM »

it doesnt have to be on private pages, you can set this code:
Code:
if ($_SESSION['USERNAME'] != NULL ) {

// User is loged in, then put code below..

}

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
beatjost

Offline Offline

Posts: 66


« Reply #7 on: September 10, 2009, 10:51:38 PM »

To add the extended field in frontend for the registerd user, just replace the files in the zip-archive for wb2.8.
This will show an extra block with those fields (Backend prefs are not done by now...)

Download Frontend 2.8: http://www.beatjost.heliohost.org/wb_account_2-8.zip

Download Frontend 2.7: http://www.beatjost.heliohost.org/wb_account_2-7.zip

« Last Edit: September 11, 2009, 04:54:41 PM by beatjost » Logged
snark
Guest
« Reply #8 on: September 11, 2009, 06:05:26 AM »

and for 2.7... will this work too?

Logged
beatjost

Offline Offline

Posts: 66


« Reply #9 on: September 11, 2009, 04:51:32 PM »

and for 2.7... will this work too?

I've added a 2.7 version, but not tested since I do not have this version anymore, but the files were mainly identically... please backup before testing. A short post about success or not would be nice  wink
Logged
Hans>NULL

Offline Offline

Posts: 1389


« Reply #10 on: September 11, 2009, 06:28:26 PM »

Hallo.
Gibt's 'ne List-Möglichkeit aller Benutzer des UserExtend, ohne Änderungsmöglichkeit, nur zur Info, also auch nur für eingeloggte Benutzer/Mitglieder.
Gruß, Hans>NUL
Logged

/dev/null Ort ohne Wiederkehr
mr-fan

Offline Offline

Posts: 1556


WWW
« Reply #11 on: September 11, 2009, 07:59:56 PM »

hi jost,

Hallo.
Gibt's 'ne List-Möglichkeit aller Benutzer des UserExtend, ohne Änderungsmöglichkeit, nur zur Info, also auch nur für eingeloggte Benutzer/Mitglieder.
Gruß, Hans>NUL

könnte man das nicht mit dem modul "user-search" verbinden und ein "user-admin" daraus machen??

modul gibts hier:
http://www.websitebakers.com/pages/admin/admin-tools/user-search.php

also die suche nach den mitglieder daten + anzeige der daten aus deinem "extend" mod

wäre echt ein geniales teil - das user search hab ich fast auf jeder seite im einsatz!

mfg martin

Ps.: (schöne hochzeitsbilder - gratuliere nachträglich  wink )
Logged

 
beatjost

Offline Offline

Posts: 66


« Reply #12 on: September 11, 2009, 08:11:02 PM »

Hallo.
Gibt's 'ne List-Möglichkeit aller Benutzer des UserExtend, ohne Änderungsmöglichkeit, nur zur Info, also auch nur für eingeloggte Benutzer/Mitglieder.
Gruß, Hans>NUL

Aktuell gibt es keine solche Liste, ist aber relativ einfach möglich mit einem Droplet... (Beispiel unten).

Code:
// direct access prevention
if (defined('WB_PATH') == false) {
    exit("Cannot access this file directly");
}

if ($_SESSION['USERNAME'] == NULL ) {
  return "Not logged in!";
}

// load Language file
if (LANGUAGE_LOADED) {
    if (!file_exists(WB_PATH . '/modules/userextend/languages/' . LANGUAGE . '.php')) {
        require_once(WB_PATH . '/modules/userextend/languages/EN.php');
    } else {
        require_once(WB_PATH . '/modules/userextend/languages/' . LANGUAGE . '.php');
    }
}

// access database and obtain users table
$query = "SELECT * FROM `" . TABLE_PREFIX . "user_extend` e JOIN `" . TABLE_PREFIX . "users` u ON e.user_id=u.user_id JOIN `" . TABLE_PREFIX . "groups` g ON g.group_id=u.group_id ORDER BY u.display_name";
$results = $database->query($query);

$output;

$output = "<h2>" . $MUSEREXT_TEXT['HEADING'] . "</h2>";
$output .= "<table border=0>";
$output .= "<tr><th align='left'>".$MUSEREXT_TEXT['USR1']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD1']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD2']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD3']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD5']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD6']."</th><th align='left'>".$MUSEREXT_TEXT['USR2']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD8']."</th></tr>";

$i = 0;
$color;

// write out table with the usernames
while ($row = $results->fetchRow()) {
  if ($i % 2) {
      $color = "#FFFFFF";
  } else {
      $color = "#CCCCCC";
  }

  $output .= "<tr bgcolor='" . $color . "'><td>";
  $output .=  $row["display_name"] . "</td><td>" . $row["address"] . "</td><td>" . $row["zipcode"] . "</td><td>" . $row["city"] . "</td><td>" . $row["phone"] . "</td><td>" . $row["mobile"] . "</td>";
  $output .=  "<td><a href=\"mailto:" . $row["email"] . "\" title=\"" . $row["email"] . "\">" . $row["email"] . "</a></td>";
  $output .=  "<td><a href='" . $row["website"] . "' target='_new'>" . $row["website"] . "</a></td>";
  $i++;
}
$output .= "</table>";

return $output;
Logged
Hans>NULL

Offline Offline

Posts: 1389


« Reply #13 on: September 11, 2009, 09:29:55 PM »

Toll, funktioniert wie gewünscht.
Ist denn schon Weihnachten?

Eines fehlt noch. Habe beim Versuch ID oder CLASS zuzuordnen (CSS)  leider PHP-Fehler bekommen.
Gibt's 'nen Tip, wie ich das korrekt einfügen kann. Habe den Eindruck, dass es an doppelten "" scheitert, aber "keine Ahnung", da kein Coder.


<edit>Hab's nun doch schon mal mit dem Titel etc. hinbekommen (Denkfehler, was sonst). Doch die Werte für Tabelle. und Schrift, die über $color gesetzt werden, stehen noch aus. Da werde ich mich jetzt auch versuchen, aber eigentlich "hört's spätestens hier für mich auf   sad  Jemand, der sich auskennt, macht sowas in 5 Minuten fertig</edit>

Gruß, Hans>NUL

Edit: Ich war mal mutig und es klappt. Klassen für email und href fehlen noch.
Code:
// direct access prevention
if (defined('WB_PATH') == false) {
    exit("Cannot access this file directly");
}

if ($_SESSION['USERNAME'] == NULL ) {
  return "Not logged in!";
}

// load Language file
if (LANGUAGE_LOADED) {
    if (!file_exists(WB_PATH . '/modules/userextend/languages/' . LANGUAGE . '.php')) {
        require_once(WB_PATH . '/modules/userextend/languages/EN.php');
    } else {
        require_once(WB_PATH . '/modules/userextend/languages/' . LANGUAGE . '.php');
    }
}

// access database and obtain users table
$query = "SELECT * FROM `" . TABLE_PREFIX . "user_extend` e JOIN `" . TABLE_PREFIX . "users` u ON e.user_id=u.user_id JOIN `" . TABLE_PREFIX . "groups` g ON g.group_id=u.group_id ORDER BY u.display_name";
$results = $database->query($query);

$output;

$output = "<div id=uelthead>" . $MUSEREXT_TEXT['HEADING'] . "</div>";
$output .= "<table border=0>";
$output .= "<tr class=uelt><th align='left'>".$MUSEREXT_TEXT['USR1']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD1']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD2']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD3']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD5']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD6']."</th><th align='left'>".$MUSEREXT_TEXT['USR2']."</th><th align='left'>".$MUSEREXT_TEXT['FIELD8']."</th></tr>";

$i = 0;
$css;
// write out table with the usernames
while ($row = $results->fetchRow()) {
  if ($i % 2) {
      $css = "class=ueltact";
  } else {
      $css = "class=ueltpass";
  }

  $output .= "<tr " . $css . "><td>";
  $output .=  $row["display_name"] . "</td><td>" . $row["address"] . "</td><td>" . $row["zipcode"] . "</td><td>" . $row["city"] . "</td><td>" . $row["phone"] . "</td><td>" . $row["mobile"] . "</td>";
  $output .=  "<td><a href=\"mailto:" . $row["email"] . "\" title=\"" . $row["email"] . "\">" . $row["email"] . "</a></td>";
  $output .=  "<td><a href='" . $row["website"] . "' target='_new'>" . $row["website"] . "</a></td>";
  $i++;
}
$output .= "</table><br />";

return $output;
Wenn man schon soweit ist, stellt sich die Frage nach 'ner frontend.css
« Last Edit: September 12, 2009, 01:55:56 PM by Hans>NULL » Logged

/dev/null Ort ohne Wiederkehr
bupaje

Offline Offline

Posts: 519


WWW
« Reply #14 on: September 11, 2009, 11:27:09 PM »

Hey this looks very interesting!

I am using Mura a ColdFusion CMS at work. They have a "Class Extension Manager" which provides this type of functionality. It allows extending User/Page/File and other classes with additional strictly typed values which are then available via coding (User.GetValue.MyExt endedAttribute) and 'Extended Attributes" tab for the User/Page/File Admin areas. It has proven very useful and versatile.
Logged

My Blog, My Site
xoanon

Offline Offline

Posts: 19


« Reply #15 on: September 12, 2009, 08:42:45 AM »

firts of all, I think this is really great stuff

1: I agree on what crnogorac081 says about the option for people to let them change their own extra's

2: Now all users are displayed in one big list but when using different groups in a website it would be very nice to have those users sorted.

3: It would also be very handy if the table that contains the info is sortable alphabethically not only on username but on the other fields too.
It is quite simple to add some code to make this possible

on http://www.cssjuice.com/16-sortable-table-techniques/ you will find lots of possibillities







I have implemented a similar user-code functionality on our sports-site, where the end-user can modify their information...  please have a look at http://www.gvaa.eu  login-in as "dummy" password "dummy" (please do not change the password)...   if happy with what you see I can make the code available to the author of the "userExtend" module.... (please note that I have made changes (additions) to 2-3 core programs..
-- contact on am@idx.com.au --
regards
tony



Logged
beatjost

Offline Offline

Posts: 66


« Reply #16 on: September 13, 2009, 07:05:58 PM »

With new version 1.1 also a search is implemented (for username, displayname, email, groupname, city, address or website). Also some smaller bugs had been fixed...
Logged
D. Peeters

Offline Offline

Posts: 128


« Reply #17 on: September 13, 2009, 08:26:38 PM »

I've translated the language file into Dutch. See attachment...
Logged
beatjost

Offline Offline

Posts: 66


« Reply #18 on: September 14, 2009, 08:30:49 AM »

I've translated the language file into Dutch. See attachment...

Thanks!  smiley
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #19 on: September 14, 2009, 12:41:19 PM »

Cool, just tested it.. Working great Smiley

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Hans>NULL

Offline Offline

Posts: 1389


« Reply #20 on: September 14, 2009, 07:04:20 PM »

Leider erhalte ich Fehlermeldungen:
Code:
Notice: Undefined index: param in /www/modules/userextend/tool.php on line 45
Notice: Undefined variable: where in /www/modules/userextend/tool.php on line 49
Notice: Undefined index: param in /www/modules/userextend/tool.php on line 55
Server: PHP as CGI
Gibt's "Serverzustände" zu beachten (z.B. htaccess) ?
Die 1.0 Version lief mal auf wb-portable ohne Probleme.
Gibt's bekannte Konflikte mit anderen Modulen ?
Ein paar Tip's zur Hand? Suchen & Prüfen kann ich dann wieder alleine  grin
Heute ist mein "Blauer Montag", also nur Ausführung und Beschränkung auf das was auf'm Zettel steht.  rolleyes
Gruß, Hans>NUL
Logged

/dev/null Ort ohne Wiederkehr
beatjost

Offline Offline

Posts: 66


« Reply #21 on: September 14, 2009, 09:28:58 PM »

Leider erhalte ich Fehlermeldungen:
Code:
Notice: Undefined index: param in /www/modules/userextend/tool.php on line 45
Notice: Undefined variable: where in /www/modules/userextend/tool.php on line 49
Notice: Undefined index: param in /www/modules/userextend/tool.php on line 55
Server: PHP as CGI
Gibt's "Serverzustände" zu beachten (z.B. htaccess) ?
Die 1.0 Version lief mal auf wb-portable ohne Probleme.
Gibt's bekannte Konflikte mit anderen Modulen ?
Ein paar Tip's zur Hand? Suchen & Prüfen kann ich dann wieder alleine  grin
Heute ist mein "Blauer Montag", also nur Ausführung und Beschränkung auf das was auf'm Zettel steht.  rolleyes
Gruß, Hans>NUL

Hast du alle aktuellen fiels von version 1.1? Ev. zip nochmals überprüfen... Die Fehlermeldung sieht nach der neuen Suchfunktion aus?!
Logged
beatjost

Offline Offline

Posts: 66


« Reply #22 on: September 15, 2009, 08:27:22 AM »

Leider erhalte ich Fehlermeldungen:
Code:
Notice: Undefined index: param in /www/modules/userextend/tool.php on line 45
Notice: Undefined variable: where in /www/modules/userextend/tool.php on line 49
Notice: Undefined index: param in /www/modules/userextend/tool.php on line 55
Server: PHP as CGI
Gibt's "Serverzustände" zu beachten (z.B. htaccess) ?
Die 1.0 Version lief mal auf wb-portable ohne Probleme.
Gibt's bekannte Konflikte mit anderen Modulen ?
Ein paar Tip's zur Hand? Suchen & Prüfen kann ich dann wieder alleine  grin
Heute ist mein "Blauer Montag", also nur Ausführung und Beschränkung auf das was auf'm Zettel steht.  rolleyes
Gruß, Hans>NUL

Hast du alle aktuellen fiels von version 1.1? Ev. zip nochmals überprüfen... Die Fehlermeldung sieht nach der neuen Suchfunktion aus?!

Versuch sonst mal in toolphp folgendes replacement...

  // access database and obtain users table
  $where = "";
  $search = "";
  if (isset($_POST['param']) AND $_POST['param'] != "") {
Logged
Hans>NULL

Offline Offline

Posts: 1389


« Reply #23 on: September 15, 2009, 04:54:51 PM »

Kurze Rückmeldung
Leider erst in ein paar Tagen komme ich wieder dazu.
Werde es so ausführen wie vorgeschlagen.

Gruß, Hans>NUL
Logged

/dev/null Ort ohne Wiederkehr
snark
Guest
« Reply #24 on: September 16, 2009, 08:58:00 AM »

the frontend add works for 2.7 but...

as you have succesfully subsrcibed you can log in but you cannot alter and save the extra info

in stead you are being redirected to the admin side where you get 'no user selected'

option 1 (no admin-rights)
- you cannot save the extra info (notification you have insufficiant rights to be here)


option 2 (subscribersgroup has rights to acces the admin)
- you cannot alter the info rightaway (news subscribers with no page edit rights)
- you are being send to the admin-side
- you have to add your account to the extend list manually
- you can access the other info

I think it should be more like the sample provided by xoanon, in his module the info gets saved in the frontend and the user is not bothered with the admin-side


« Last Edit: September 16, 2009, 09:07:01 AM by snark » Logged
Pages: [1] 2 3 4   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!