Support

Home Forums Event Espresso Premium Staff Email

Staff Email

Posted: October 4, 2012 at 4:25 am

Viewing 8 reply threads


Aura Software

October 4, 2012 at 4:25 am

Is there any way with the ESPRESSO_STAFF shortcode I can show email address?
Also, how about hiding fields that aren’t populated?

thanks,

Rob


Dean

October 4, 2012 at 6:35 am

Hi Rob,

Looking at the shortcode, you cannot currently split the details up into one or the other.

I think it should be an easy fix to make the fields not display if they are empty, I will suggest that to the devs.

Regarding email, it isn’t being pulled over for some reason, once more i’ll get a dev to look inot it for a fix in the next update.


Aura Software

October 5, 2012 at 2:50 am

awesome thanks. What sort of time horizon is that likely to be? If it’s the next couple of weeks then I’ll wait otherwise I’ll figure out a workaround somehow.


Dean

October 5, 2012 at 3:17 am

Hey Rob,

It should be in the next update which is due soon (read a few weeks)

Here’s the code I came up with, which goes in the includes/shortcodes.php, its just basic if statements.

  //Build the additional details
            if ($show_staff_details != false) {
                $html .= $inside_wrapper_before;
                $html .= isset($meta['organization']) ? __('Company:', 'event_espresso') . ' ' . stripslashes_deep($meta['organization']) . '<br />' : ''; 
                if ($show_staff_titles != false) {
                    $html .= isset($meta['title']) ? __('Title:', 'event_espresso') . ' ' . stripslashes_deep($meta['title']) . '<br />' : '';
                }

            if($meta['industry'] != NULL ){
                $html .= isset($meta['industry']) ? __('Industry:', 'event_espresso') . ' ' . stripslashes_deep($meta['industry']) . '<br />' : '';
                     }
            if($meta['city'] != NULL ){      
                $html .= isset($meta['city']) ? __('City:', 'event_espresso') . ' ' . stripslashes_deep($meta['city']) . '<br />' : '';
            }
            if($meta['country'] != NULL ){
                $html .= isset($meta['country']) ? __('Country:', 'event_espresso') . ' ' . stripslashes_deep($meta['country']) . '<br />' : '';
            }
            if($meta['website'] != NULL ){
                $html .= isset($meta['website']) ? __('Website:', 'event_espresso') . ' <a href="' . stripslashes_deep($meta['website']) . '" target="_blank" rel="nofollow">' . stripslashes_deep($meta['website']) . '</a><br />' : '';
            }
            if($meta['twitter'] != NULL ){
                $html .= isset($meta['twitter']) ? __('Twitter:', 'event_espresso') . ' <a href="http://twitter.com/#!/' . stripslashes_deep($meta['twitter']) . '" target="_blank" rel="nofollow">@' . stripslashes_deep($meta['twitter']) . '</a><br />' : '';
            }
            if($meta['phone'] != NULL ){
                $html .= isset($meta['phone']) ? __('Phone:', 'event_espresso') . ' ' . stripslashes_deep($meta['phone']) . '<br />' : '';
            }
$html .= $inside_wrapper_after;


Aura Software

October 5, 2012 at 7:28 am

ok, nice one. Looking at your code, I wonder if those $meta != NULL checks are working. When I view the staff, all the fields appear regardless of whether they are set or not


Dean

October 5, 2012 at 7:35 am

Hey Rob,

This isnt the code in the plugin its what I am putting forward to be included, I thought I’d put it here in case you wanted to you it as is or as a base to change the shortcode.


Aura Software

October 5, 2012 at 7:44 am

oops, sorry misunderstood you. yeah, I think I’ll go that way – it’s so simple I don’t really need to wait for the release. thx


Aura Software

October 9, 2012 at 3:21 am

Hi Dean,

I’ve implemented this and it worked well. The only slight gotcha is that email isn’t stored in the $meta, it’s in aseparate column in the db. So, I had to change the SQL statement and add an extra couple of lines to your code for that.


Dean

October 9, 2012 at 3:24 am

Hey,

Thanks for the feedback, I’ll get that relooked at so we can add it into the core next update.

Viewing 8 reply threads

The support post ‘Staff Email’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso