Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: smd_bio : store additional biographical info about your users
Thanks for your answer Stef and for the advices… I’ll look into this direction…
Last edited by hablablow (2011-01-16 23:12:05)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
Just a quick thought related to yesterday’s post: would it be a possible feature to display only certain bio items for certain users, under the user tab: John would only see certain fields, Jacy other fields etc… And certain fields would be visible to all… For each field added this could be an option in a dropdown: visible to John, Jacy or all…
Last edited by hablablow (2011-01-17 11:35:48)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
hablablow wrote:
Just a quick thought related to yesterday’s post: would it be a possible feature to display only certain bio items for certain users
That’s more feasible. And actually a pretty good idea.
But for making it a generic toolset I’m not quite sure how it’d be configured, especially given that you might have 1000+ users on a community site. It would make the page heavy to have a dropdown containing all those names and also quite difficult for an admin to decide who has what — it’d have to be a multi-select dropdown which are not great at the best of times with long lists.
Perhaps a better approach for the plugin might be to optionally tag certain fields with the priv level when the fields are defined. Then you could simply assign John and Jacy to different groups if you wanted them to see different things. That’s more manageable and with TXP 5’s planned improvements to user and rights management (under the hood, so that plugins can add entire user and priv management systems if they wish) it means there’s no limit to the number of groups you can create.
As a proof of concept / short term measure (until I can look into making it an official feature) we could try using jQuery to grab the current user ID and compare it against a static list of fields that you want to be visible for that user, just hiding the other fields. How’s your jQuery?!
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
Re: smd_bio : store additional biographical info about your users
Thanks Stef.
Yes until nothing has been specified for a precise author and for a certain field, it is visible to anyone. The usual dropdown will fit the bill in the case we want to make something only visible to Jacy… If we want to switch 20 users at a time for a certain feature, you could use the abitlity to select multiple authors in a list, in the same fashion as the rss_unlimited _categories does.
Specifying a default user we land on when accessing the user tab would be very crisp as well.
A side question related to your plugin: Is there any reason why a Google maps url will always be cut at a certain length even a higher limit has been specified for a text field ?
For example this url:
http://maps.google.fr/maps?f=q&source=s_q&hl=fr&geocode=&q=le+grand+palais+paris&sll=46.75984,1.738281&sspn=14.077708,27.663574&ie=UTF8&hq=le+grand+palais&hnear=Paris,+Ile-de-France&ll=48.865198,2.313314&spn=0.0033,0.006754&z=18&iwloc=B
Will never make it through and will always be cut at:
http://maps.google.fr/maps?f=q&source=s_q&hl=fr&geocode=&q=le+gr
Is that for security reasons ?
Last edited by hablablow (2011-01-17 12:30:43)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
Bloke wrote:
a simpler alternative is to let your users configure their bio info from the public side using mem_form / mem_simple_form / mem_self_register / rvm_privileged. You can always write a simple admin-side stub (about 3 lines of code) that redirects from Write -> Bio to a page on the public side. With some clever CSS you could even make it look a bit like the admin side — or at least theme them similarly to make it appear more integrated.
Just inspired to brainstorm by this . . .
A while back I vaguely recall a plugin that allowed the use of txp tags on the admin side (in a dashboard type page for example.)
With the new “Home” tab functionality, could there be a way to use smd_bio tags, and mem_form tags to create the desired functionality, and be able to skip the mem_self register, rvm_priviligeged, the redirect, and css look-alike step?
Offline
Re: smd_bio : store additional biographical info about your users
hablablow wrote:
If we want to switch 20 users at a time for a certain feature, you could use the abitlity to select multiple authors in a list, in the same fashion as the rss_unlimited _categories does.
A multi-select list? Too unwieldy for 1000 users. I don’t want to click a few hundred times each time I want to create a user-specific field — imagine if you wanted a field accessible by a few users beginning with ‘a’, some beginning with ‘b’, 25 from the ‘c’ section and so on. Scroll-click-scroll-click-click-click-click-scroll-click…
Using groups (privs) is more elegant, easier to manage and more akin to how people set up user accounts. I’ll look into this when I fix the plugin to address…
Is there any reason why a Google maps url will always be cut at a certain length
… this. It’s a stupid limit imposed in the plugin. Find function smd_bio_meta_add() in the plugin and look for the TODO items. Notice:
if ($type == 'textarea') {
$asize = '4096'; //TODO: Find a way to user specify this
$coltype = 'text';
} else {
$asize = '64'; //TODO: Find a way to user specify this
$coltype = 'varchar';
}
The ‘64’ is the problem. Try increasing that value in the plugin (I think 255 is the maximum a varchar can hold: not sure on that as it might be dependent on your version of MySQL), then deleting your field and recreating it. If you’ve already started using your field, run something like this SQL to change it:
ALTER TABLE MODIFY google_map VARCHAR(255);
(or whatever you named your field).
Sorry about that. I’d forgotten that stupid limit was in there. I must fix that.
maverick
In theory yes. I think mem_admin_parse does it but it’s a function not a tag so you’d need some PHP.
Last edited by Bloke (2011-01-17 15:13:30)
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
Re: smd_bio : store additional biographical info about your users
Crispy stuff, thanks again Stef !
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
Is there any reason why a Google maps url will always be cut at a certain length
Workaround: Use a URL shortening service of your choice for long URLs.
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
Re: smd_bio : store additional biographical info about your users
Switching value to 255 as you said Stef solved the problem.
Is there any chance we can by default land on a specific user’s page when browsing to this tab ?
Markus, of course but the commmon internet user doesn’t know what a url shortening service is and it involves on step +.
Last edited by hablablow (2011-01-17 15:43:21)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
Bloke wrote:
maverick wrote: In theory yes. I think mem_admin_parse does it but it’s a function not a tag so you’d need some PHP.
yep – mem_admin_parse is a get/post function and designed to work w/ other plugins.
aside: I can see potential and possibilities if various pages on the admin side could be customizes using txp/plugin tag . . . for those of us php illiterate . . . not sure if it would be technically possible though . . . anyway
In the meantime, though, jmd_dashboard (derived from asy_dashboard), uses textpattern and plugin tags (via a form named jmd_dashboard). It could be used as is I would think, but might be a bit more elegant if updated to use the new home tab.
Then drop smd_bio tags on the form, mem_form, and it should be good to go?
Offline
Re: smd_bio : store additional biographical info about your users
Are you suggesting Mike that with the use jmd_dashboard + mem_form we could have the smd_bio fields somewhere on a splash page inside Txp ?
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
Not having tried it . . . but in theory it seems like it could work.
jmd_dashboard is supposed to parse any regular txp or plugin tags in its form. So displaying smd_bio tags should be simple enough in theory.
That leaves updating the information. since mem_form is just another plugin, it too should work w/ jmd_dashboard. So if it can do the update, it seems like you would be set.
If you want to use the new home tab feature in Txp 4.3.0:
- net-carver has an unpublished plugin that uses the new home tab.
- esq_adminsplash is mentioned possibly using it in a future update.
- Not sure if Jon-Michael has any plans for jmd_dashboard. You’d need to ask.
Of the three, jmd_dashboard is the only one I know of that is designed to handle txp tags.
Last edited by maverick (2011-01-17 19:16:25)
Offline
Re: smd_bio : store additional biographical info about your users
maverick wrote:
Not having tried it . . . but in theory it seems like it could work.
I see where you’re coming from now (I was being dim earlier). Yes that should work fine. Great idea. Would love to see it running.
Of the three, jmd_dashboard is the only one I know of that is designed to handle txp tags.
Not tried jmd_dashboard but net-carver’s supports tag parsing and Textile (I believe it was based on aro_myadmin: could be wrong).
Last edited by Bloke (2011-01-17 19:29:56)
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
Re: smd_bio : store additional biographical info about your users
Thank you folks.
Mike, correct me again if I’m wrong: in theory, not tried yet, I could build a dashboard page with jmd_dashboard and using smd_bio tags in it… I would then be able to update the bio fields values from this dashboard page without having to browse to the user tab anymore ?
I’m not sure if mem_form is necessary here, in what scenario it would be useful…
Not sure either to understand what you mean by “updating the information”….
Last edited by hablablow (2011-01-17 20:16:40)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
hablablow
I’ve not used mem_form personally. So I’m unable to help w/ the specifics of how to set it up.
jmd_dashboard (and from Stef’s post, net-carver’s unpublished plugin) can parse smd_bio tags. I would imagine it would require a creative use of a conditional (if_author) type tag to only show only the logged in user’s info. That gets you part of the way there.
However, smd_bio tags only allow for output. That’s where mem_form would come in – it gives you the ability to submit updated information back into the database.
The outcome is a customized user profile page. They can only see the information you allow them to see (i.e. their own), and of that information, they can only update the fields you allow them to update (using mem_form).
There is no need to go to Admin -> Users, or even to have access to the Admin tab.
Does that help make it as clear as mud? ;)
Last edited by maverick (2011-01-17 20:29:27)
Offline