Integrating with S2Member
-
I’m attempting to integrate All Video Gallery with S2Member and was hoping someone here might be able to help with an issue I’m having. The site I’m working on is https://www.miracleofyoga.com. When users log in they are first directed to a videos page. When they click one of the videos it pulls it up using All Video Gallery. In the player.php file I decided the add some custom PHP to inject an S2Member shortcode for displaying a video for paid Level 1 users and a thumbnail video image for those who are not Level 1 members. The problem is that when a user clicks to the individual video page the WordPress bar at the top disappears like they are not logged in and the video displays as the thumbnail image. If the person refreshes the page the bar reappears and the video is watchable. Any advice?
Here’s the code (hope the formatting doesn’t look too bad):
$sel_video = mysql_fetch_array(mysql_query("select * from wp_allvideogallery_videos where slug = '".$_REQUEST['slg']."'")); $result .= do_shortcode('[s2If current_user_can(access_s2member_level1)]'.'<video id="example_video_1" class="video-js vjs-default-skin" controls width="640" height="480" poster="'.$sel_video['preview'].'" preload="auto" data-setup="{}"> <source type="video/mp4" src="'.$sel_video['video'].'"> </video>'.'[/s2If]'.'[s2If !current_user_can(access_s2member_level1)]'.'<a href="https://www.miracleofyoga.com/moy-subscription/"><img src="https://miracleofyoga.com/wp-content/uploads/2013/07/yoga-video-preview.jpg" /></a>'.'[/s2If]'); return $result;
- The topic ‘Integrating with S2Member’ is closed to new replies.