Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#325 2009-09-12 00:30:24
Re: mem_self_register
Manfre wrote:
mem_self_register has not been tested with Textpattern 4.2.
It appears to be working in TXP 4.2. I kept the default settings of not using alternate database and also did not choose to use address or phone fields. Used this: <txp:mem_self_register_form form="self_register_form" />
and it did add a new user.
Textpattern version: 4.2.0 (r3275)
Last Update: 2009-09-01 01:42:00/2009-08-28 19:31:19
Document root: /Applications/MAMP/htdocs
$path_to_site: /Applications/MAMP/htdocs/sdfasdfsf.dev
Textpattern path: /Applications/MAMP/htdocs/asdfasdfasdf.dev/textpattern
Permanent link mode: section_id_title
upload_tmp_dir: /Applications/MAMP/tmp/php
Temporary directory path: /Applications/MAMP/htdocs/asdfasdf.dev/textpattern/tmp
Site URL: localhost:8888/asdfasdfasdf.dev
PHP version: 5.2.6
GD Image Library: version bundled (2.0.34 compatible), supported formats: GIF, JPG, PNG
Server TZ: America/Los_Angeles
Server Local Time: 2009-09-11 17:24:53
DST enabled?: 0
Automatically adjust DST setting?: 0
Time Zone: (+61200)
MySQL: 5.0.41
Locale: en_US.UTF-8
Server: Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
Apache version: Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
PHP Server API: apache2handler
RFC 2616 headers:
Server OS: Darwin 8.11.1
Active plugins: smd_bio-0.3, wet_babble-0.2m, ign_password_protect-0.5b9, mem_self_register-0.9.1, mem_form-0.5.4
Admin-side theme: remora 4.2.0
.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
<IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /relative/web/path/
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* – [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
————————————
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#326 2009-09-12 02:25:30
Offline
#327 2009-09-15 09:29:07
Re: mem_self_register
renobird wrote:
Manfre,
I finally have a reason to use this plugin. Wow! this thing is amazing! Thanks so much for all the hard work.
Quick question:
In the setup there are options for “add_address_field” and “add_phone_field”…how do I access those? Is there a way for the user to self edit them?
Ideally I’d love to have access to those fields from the the ADMIN > USERS tab? Anyone done that?
Thanks Again!
—
Tom
I have a similar interest. That is to use the self edit tag to update other fields with a users profile. Is this possible?
I’ve been making heavy use of smd_bio lately and it provides a lot of new profile fields some of which I’d like to have the user update using mem_self_edit.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#328 2009-09-15 09:47:39
Re: mem_self_register
whaleen wrote:
I have a similar interest. That is to use the self edit tag to update other fields with a users profile. Is this possible?
From memory (may be wrong here) I think mem_self_edit is ‘fixed’ in that the other fields you can edit —phone, address, etc — are hard-coded in the plugin.
If you want to allow people to edit stuff in smd_bio then I think you’ll have to roll your own solution using mem_form / mem_simple_form. I haven’t had time to play with it but would like to experiment one day.
In theory, the smd_bio_meta table contains everything you need to dynamically create a mem_simple_form to allow client-side updating of bio info. If it doesn’t then I want to know where the shortcomings are so I can try and address them!
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#329 2009-09-15 10:02:42
Re: mem_self_register
If you want to allow people to edit stuff in smd_bio then I think you’ll have to roll your own solution using mem_form / mem_simple_form. I haven’t had time to play with it but would like to experiment one day.
I can’t believe I haven’t come across mem_simple_form yet! Thanks! I hope I can make this thing work.
In theory, the smd_bio_meta table contains everything you need to dynamically create a mem_simple_form to allow client-side updating of bio info. If it doesn’t then I want to know where the shortcomings are so I can try and address them!
I shall post my progress if I have the brain power left to make any. :)
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#330 2009-09-15 13:28:52
Re: mem_self_register
I have a similar interest. That is to use the self edit tag to update other fields with a users profile. Is this possible?
I’ve been making heavy use of smd_bio lately and it provides a lot of new profile fields some of which I’d like to have the user update using mem_self_edit.
Yes, mem_self_register will let you use any field in the txp_user or ign_users table. The only requirement is to add the fields to the table and then provide a form input with the table’s field name.
To display any field in the user table, you can use <txp:mem_profile var="field_name" />
Offline
#331 2009-09-15 19:01:33
Re: mem_self_register
Yes, mem_self_register will let you use any field in the txp_user or ign_users table.
Ah but alas, the table I’m want to update/create stuff in is called smd_bio. This is good news for other sites I work on though.
Couple new questions for those in the know:
- Is a portion of the mem_self_register plugin code likely to point to a selectable third table in the future; or, is it easily modifiable or likely that you’ll (Manfre) make it so?
- Some of the fields in tables I want to update hold multiple comma separated values? Can these be managed from say, a form containing multi_select fields?
- Am I better off making use of mem_simple_form? If so see question number 2 again.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#332 2009-09-15 19:37:05
Re: mem_self_register
1. Table name is returned from the function mem_get_user_table_name, which you could easily modify. I didn’t know there was a 3rd user table option, so making this configurable might make sense.
2. This would require a new mem_form compatible function to provide a field for CSV values.
3. mem_simple_form will probably be easier for you to use, but it also relies upon mem_form so my #2 answer applies here.
Offline
#333 2009-09-15 19:49:59
Re: mem_self_register
Manfre wrote:
I didn’t know there was a 3rd user table option
Just fyi, smd_bio is not an entire user table, merely an extension of the existing one where the extra fields are associated with the txp_user table via the login name. It doesn’t alter the core table nor does it duplicate anything other than the login name; kind of a hybrid solution.
Whether having the mem_get_user_table_name configurable makes sense in the light of this new info nugget I don’t know.
Last edited by Bloke (2009-09-15 19:50:33)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#334 2009-09-15 19:51:56
Re: mem_self_register
Stef, thanks for the input.
Josh, you can’t use mem_self_register since it requires all the user information to be in the user table. You’ll have to use mem_simple_form.
Offline
#335 2009-09-15 20:11:22
Re: mem_self_register
Some of the fields in tables I want to update hold multiple comma separated values? Can these be managed from say, a form containing multi_select fields?
2. This would require a new mem_form compatible function to provide a field for CSV values.
I’ve been trying something similar recently. Until such a function exists (would be desirable), you can use a javascript (or jquery or similar) workaround and a trick. In your mem_form you make your own multiple select form element and directly after it a mem_form_hidden element with the name attribute name="string_your-db-field-name"
(in the version below custom_2) and no content.
e.g. something like this in your mem_form form:
<label for="multiselect">Multiselect label</label>
<select id="multiselect" name="multiselect" multiple="multiple">
<option value="1">First option</option>
<option value="2">Second option</option>
<option value="3">Third option</option>
</select>
<txp:mem_form_hidden name="string_custom_2" value="" label="" />
You then use javascript/jquery to intercept the submit form event and transfer the choices made in the multiple select into the waiting empty mem_form_hidden element for processing as a normal string. You need to first convert the output array from the multiple select into a comma-separated list, then pass this value into the waiting empty mem_form_hidden element. With jquery it looks something like this:
<script type="text/javascript" src="http://mydomain.com/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("form").submit(function() {
var options_list = [];
options_list = $.map($('#multiselect :selected'), function(e) { return $(e).val(); })
$("input[name=string_custom_2]").val(options_list);
});
});
</script>
Hope that helps.
TXP Builders – finely-crafted code, design and txp
Offline
#336 2009-09-15 21:09:57
Re: mem_self_register
Manfre wrote:
1. Table name is returned from the function mem_get_user_table_name, which you could easily modify. I didn’t know there was a 3rd user table option, so making this configurable might make sense.
Bloke wrote:
Whether having the mem_get_user_table_name configurable makes sense in the light of this new info nugget I don’t know.
I would say yes, but I don’t know if that’s something for everybody. I’m afraid I’m in over my head if I start hacking through mem_self_register.php
, or for that matter; the whole mem suite. I wish I could offer a suggestion.
Manfre wrote:
2. This would require a new mem_form compatible function to provide a field for CSV values.
Jakob’s idea will help. I’m assuming a can use this method to Update a table field. The trick then when a user is editing their existing user detail(s) is to have the edit form draw from their existing details and for example: present a number of checkboxes, some of which are selected from a previous choice they made. They could then choose more boxes or uncheck some. Now when updating the field you would just write over the whole thing with a new comma separated list.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline