Home › Forums › Calendar Products › Events Calendar PRO › Single event and social locker
- This topic has 2 replies, 2 voices, and was last updated 11 years, 2 months ago by
Barry.
-
AuthorPosts
-
January 23, 2015 at 2:24 pm #936897
Evgenii Rybak
ParticipantHello.
I need your advice and help.I have installed the plugin Indeed Social Share & Locker Pro, which lock the content by using php code:
<?php echo do_shortcode(“[indeed-social-locker sm_list=’fb,li,tw,go1′ sm_template=’ism_template_3′ sm_list_align=’horizontal’ sm_display_counts=’false’ sm_display_full_name=’true’ locker_template=2 sm_d_text='<h2>This content is locked</h2> <p>Share This Page To Unlock The Content!</p> ‘ ism_overlock=’default’ ]
[/indeed-social-locker]”);?>I need to lock the Event meta from single event (tribe_events_single_event_meta_primary_section and tribe_events_single_event_meta_secondary_section)
You can see here:
http://prntscr.com/5w74pvif I understand correctly, it is necessary to modify the file meta.php.
I override this template in my own theme by creating a file at [my-theme]/tribe-events/modules/meta.php.
After that i added php code in meta.php like this:<?php echo do_shortcode(“[indeed-social-locker sm_list=’fb,li,tw,go1′ sm_template=’ism_template_3′ sm_list_align=’horizontal’ sm_display_counts=’false’ sm_display_full_name=’true’ locker_template=2 sm_d_text='<h2>This content is locked</h2> <p>Share This Page To Unlock The Content!</p> ‘ ism_overlock=’default’ ]
do_action( ‘tribe_events_single_event_meta_secondary_section_start’ );
tribe_get_template_part( ‘modules/meta/venue’ );
tribe_get_template_part( ‘modules/meta/map’ );do_action( ‘tribe_events_single_event_meta_secondary_section_end’ );
[/indeed-social-locker]”);?>
The Locker did his job, and the Locker window appears on the page.
You can see here:
http://prntscr.com/5vbph2But after shared, for example, via twitter, locker window disappears, and below it was an line of code. It looks like a php variable inside the locker tag shortcode have not been performed.
Is it even possible to make a lock the Event meta from single event? What am I doing wrong?
Please tell me the correct file used for the modification?How can I do to lock the event meta from single event?
Thank you very much for help.
January 23, 2015 at 5:09 pm #936952Barry
MemberHi!
It’s always tricky to help with third party integration issues, but I think the strategy I might try in this case is as follows:
- Override modules/meta.php as you have done
- Before the first real line of code, add an ob_start() call
- After the final line of code (which triggers the tribe_events_single_meta_after action) add something like this:
do_shortcode( '[locker]' . ob_get_clean() . '[/locker]' );Obviously correct and adjust to include the actual shortcode and the various parameters you used originally – the basic idea here being to capture the meta information in an output buffer (using ob_start() and ob_get_clean()).
I can’t guarantee it will work, but it could be worth a shot and if nothing else might give you a different way to tackle the problem 🙂
Good luck!
February 9, 2015 at 6:27 am #940898Barry
MemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Single event and social locker’ is closed to new replies.
