ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Access profiles field from forum module?

September 02, 2007 8:22pm

Subscribe [4]
  • #1 / Sep 02, 2007 8:22pm

    JimGoings

    44 posts

    How can I display the contents of a custom profile field in the forums.  For example, we have a field for custom titles, but I don’t know how to get the thread templates to access it.  Just calling it with {customfieldname} doesn’t work.

    Is there documentation on what fields are accessible in the thread view forum template?  Perhaps we can just use an existing profile field and change the name of the field appropriately?

    I don’t want to use a PHP SQL query as that will cause a lot of database load.

    Any other methods?

  • #2 / Sep 04, 2007 1:17pm

    Michael Sigler

    13 posts

    I’m also very curious about how this might be done. I’ve seen a lot of posts on it or with similar request. I’m a little putoff by how inflexible the forums are compared to how flexible the rest of EE is. I love EE for its incredible ease of use, decent docs and examples with the ability to call custom fields pretty much anywhere.

    The forums seem completely contrary to this. I understand its supposed to be for performance sake but yeesh. No custom fields?

  • #3 / Sep 04, 2007 2:50pm

    JimGoings

    44 posts

    Tell me about it.  The forums have been a nightmare to style to match the rest of the site.  I read every other thread on the topic, and I’m just hoping to find an easier way (even if it means using another field in the profile to do it).  Here are the three methods I found so far.

    1) Doing a SQL query with PHP would be bad because it would use a query for every row in a thread.  So a thread with 25 replies would generate 25 seperate queries.

    2) Run the forums through an EE template.  Not sure how much overhead this would actual cause, but server performance is certainly a concern.  Can anyone say (percentage wise) how much overhead difference this would be compared to the forums running outside of the EE templating system?  Would it be possible to run it through the EE system and turn off everything except for the member module (which is what we need to access the custom profile fields right?)

    3) Modify the core php forum files to do what we need.  This is the best performing way to do it, but requires advanced knowledge of PHP and would need to be redone every time EE released an update.  Not ideal at all.

    Jim

  • #4 / Sep 05, 2007 2:21am

    Michael Sigler

    13 posts

    I hate to be a bumper but man, really bummed about this. We have some fun ideas for little nuggets of goodness in our forum. Alas, no custom field queries is squaresville. :(

  • #5 / Sep 05, 2007 3:29pm

    Michael Sigler

    13 posts

    I had another idea on this. So the Member Profile Public View Template in the forums calls the Custom_Profile_Fields template which in turns call the title and description of the custom fields for display.

    We just need to get the index table to recognize the ee tag of {custom_profile_fields} or at least somehow get its functionality into the thread view. I mean we are just trying to get two custom fields anyways.

    {characterclass} and {membertitle}

  • #6 / Sep 05, 2007 6:51pm

    Lisa Wess

    20502 posts

    Hi, Jim - I delete your duplicated post in the technical support forums.  Please do not cross-post, this is the appropriate forum for this question.

    The way I would handle this is by researching if an extension could be built to handle this, and if not, enabling PHP and using a SQL query.  I would avoid hacks at all cost, however, and you are certainly welcome to add a feature request to have custom profile fields available to these particular forum templates.

  • #7 / Sep 05, 2007 8:00pm

    Michael Sigler

    13 posts

    Hi Lisa, thanks for the reply.

    Is this where we would start for grabbing the threads and displaying the custom data?

    http://expressionengine.com/developers/extension_hooks/forum_thread_rows_start/

  • #8 / Sep 05, 2007 8:23pm

    BlackHelix

    226 posts

    Michael Sigler—I’d start there, yes. 

    But in the short run, the fastest way is to just run it through the regular forum template engine, I would imagine.  The hit is pretty tough, but not that tough.  My site, with my forum running through the exp:forum tag still finished in .3 odd seconds, which is still handleable.  I’m running my navigation menu embed in it, so it’s still processing the forum and then my embedded templates. 

    My guess is if you could keep it below a second, it would be well worth it to run it this way.  Yes, the server is hammered… but no more than if you built the forum as a regular template, really. 

    If it’s a custom member data field, and you do run it through the exp:forums tag, you may want to take a look at a plugin I wrote that allows you to use a one line tag (no tag pair needed) to retrieve the field.

  • #9 / Sep 05, 2007 8:45pm

    Michael Sigler

    13 posts

    Vanceone - thanks for the response. So you’re saying that you are just parsing the php through the forum? Do you know what your stats are without parsing the php. A similar site we ran was getting about 30K page views a month at its height. We are expecting similar growth and are very performance conscious. 

    If I understand your plugin correctly, that’s to just simplify calling custom member fields?

  • #10 / Sep 05, 2007 8:48pm

    JimGoings

    44 posts

    Correction… 35K page view per DAY, not month. 😊

  • #11 / Sep 05, 2007 9:02pm

    BlackHelix

    226 posts

    Well, what I’m doing is actually running my forum through the regular template engine, as described in the docs.  If you create a regular template, toss only one tag on it: {exp:forum}, it runs the forum through EE’s regular template engine—thus opening up all of EE’s features.  You could use the php query, but meh, like was said earlier, depending on what you want done, you’d have to run a seperate query for each member…. not so good. 


    right now, my stats show that if I run it regularly through EE’s regular template parser (the exp:forum tag), I’m getting it done in about .31 seconds… give or take a few hundredths.  Running straight through the forum templating engine, I’m getting about .25, .24 or there abouts.  I am only embedding one template, so it’s not adding that much.  If you added a BUNCH of stuff, it would be more, obviously.  Basically speaking, you take the forum loading time and toss it on top of your template loading time.  I’ve seen the forum loading time to be anywhere from .21 to .4, really, depending on the hardware and load.  Your mileage will vary, of course. 


    If all you want is to access the member profile fields, I would suggest you start out with either my plugin or ee’s stuff in the exp:forum tag.  But then, I’d also start working on that extension… 

    My plugin does two major things, only one of which is likely applicable to your situation.  It allows you to get the contents of one member field with just a single tag, not a tag pair.  It’s oriented more towards only one member’s data at a time, however—not necessarily great in a forum page with 20 or more members at a time.

    To try and get all the members info on, say, a thread page, without running a hundred seperate queries would take some work.  Hmmm…  I’d have to work on it a bit.  It’s certainly possible, of course, but I think you’d need a pretty good php guy to finangle this one.

  • #12 / Sep 05, 2007 9:19pm

    JimGoings

    44 posts

    Hi, Jim - I delete your duplicated post in the technical support forums.  Please do not cross-post, this is the appropriate forum for this question.

    Sorry, I wasn’t sure if you EE folks paid as close attention here as you do the TS forums which are supposed locked down to just paying customers. 😊

  • #13 / Sep 05, 2007 9:21pm

    Lisa Wess

    20502 posts

    Hi, Jim - I delete your duplicated post in the technical support forums.  Please do not cross-post, this is the appropriate forum for this question.

    Sorry, I wasn’t sure if you EE folks paid as close attention here as you do the TS forums which are supposed locked down to just paying customers. 😊

    We do moderate all forums, of course.

  • #14 / Sep 05, 2007 9:26pm

    JimGoings

    44 posts

    Couple of questions (as they didn’t get addressed above)...

    1) Are there any concepts of how much of a performance hit (from EE folks perspective) it would be to run the forums through the EE engine vs. on it’s own?  Assume base install for comparison sake.  10%  50% Double?  Triple?

    2) Are there any plans to add the capability to pull custom profile field data into the forums?  For that matter, are there any plans to improve the integration of the forums at the EE itself? 

    They really seem like seperate products to me.  Just when you think you have the hang of how EE works, the forums throw you for a loop.  Hopefully the wiki isn’t as cumbersome. 😊

  • #15 / Sep 05, 2007 9:39pm

    BlackHelix

    226 posts

    I’m no EE rep, but I can answer question number 2 for you:  They won’t say.  Frankly, I have no idea if they have plans or not, but if they do, they won’t say, simply because they don’t give out roadmaps—as frustrating as it has been.  Case in point, they mentioned one thing they are doing over a year ago, which hasn’t been released yet (for valid reasons) and it’s been nothing but a headache because they don’t release junk, and people keep wanting a faster, perfect product.

    The old saying: “faster, better, cheaper—choose two” applies.  And EE picks the “better, cheaper” option.  Rather, it’s the “excellent, reasonably priced and dwarfs comparable systems” option.  But that means no roadmaps or timetables. 

    BTW, that doesn’t mean they are slow—far from it.  Ellislab patches stuff fast—their skills blow mine away, for sure.  Just that they take their time to make sure it works right the first time—none of this “use our users as beta testers” bit. 

    At least, that’s how I understand it. 

    I hope there are some plans, and I imagine there are, because it’s slightly frustrating for me, too.  On the other hand, it’s a place for some entreprenurial developer to get his hands dirty…..

    As for your first question, there’s a link I’ll give you where it’s discussed, and EE people chime in.  Here.  Basically, the answer is, “it depends.”  It depends on traffic, what you are doing, etc.  Some sites like mine don’t see much of a hit.  Others see a pretty major one, I think. 

    And the Wiki is not run through it’s own parser, as far as I know.  So there’s not as many issues.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases