/** * Returns array of common values used in all Email Templates * @return array */ protected function _defaultValues() { return array( 'copyrightDate' => date('Y'), 'siteUrl' => cpfc_home_url(), 'privacyPolicyUrl' => cpfc_home_url(CPFC_MEMBERS_PRIVACY_POLICY_URL), 'facebookUrl' => get_field('emails_facebook_url', 'option'), 'twitterUrl' => get_field('emails_twitter_url', 'option'), 'youtubeUrl' => get_field('emails_youtube_url', 'option'), ); }
</td> </tr> <tr> <td align="center" width="100%" style="padding-bottom: 0px; background-color: #f2f2f2; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <table width="640" bgcolor="#ffffff" cellspacing="0" cellpadding="0" border="0" align="center" class="deviceWidth"> <tr> <td width="20"></td> <td width="600"> <table cellspacing="0" cellpadding="0" border="0" align="center" width="600" class="deviceWidth" bgcolor="#ffffff" style="border-bottom:4px solid #d92400;"> <tr> <td width="100%" height="10" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td align="center"><a href="<?php echo cpfc_home_url(); ?>" name="logo" target="_blank"><img alt="Crystal Palace FC" src="<?php echo get_template_directory_uri(); ?>/assets/images/emails/logo.png" width="100" height="118" style="display: block; border: none; margin: 0; padding: 0;" /></a></td> </tr> <tr> <td width="100%" height="10" style="font-size: 1px; line-height: 1px;"></td> </tr> </table> <table cellspacing="0" cellpadding="0" border="0" align="center" width="600" class="deviceWidth" bgcolor="#0051a2"> <tr> <td align="center" height="40"> </td> </tr> </table> <!-- Main Content Area --> <table cellspacing="0" cellpadding="0" border="0" align="center" width="600" class="deviceWidth" bgcolor="#ffffff">
/** * Run image process * @param string $imageUrl The External URL * @return string New Image path */ public function processImage($imageUrl, $saveToDB = false) { $imageurl = $imageUrl; $imageurl = stripslashes($imageurl); $uploads = wp_upload_dir(); $post_id = isset($_GET['post_id'])? (int) $_GET['post_id'] : 0; $ext = pathinfo( basename($imageurl) , PATHINFO_EXTENSION); $newfilename = $this->customFilename ? $this->customFilename . "." . $ext : basename($imageurl); // If file already exists locally then use that one if (file_exists($uploads['path'] . '/' . str_replace('--', '-',$newfilename))) { return $uploads['url'] . '/' . str_replace('--', '-',$newfilename); } $filename = wp_unique_filename($uploads['path'], $newfilename, $unique_filename_callback = null); $wp_filetype = wp_check_filetype($filename, null); $fullPathFilename = $uploads['path'] . '/' . $filename; $webPath = $uploads['url'] . '/' . $filename; // Remove remote path $webPath = str_replace(cpfc_home_url(), '', $webPath); $webPath = '/' . ltrim($webPath, '/'); try { if ( !substr_count($wp_filetype['type'], "image") ) { throw new \Exception( basename($imageurl) . ' is not a valid image. ' . $wp_filetype['type'] . '' ); } $image_string = $this->fetchImage($imageurl); $uploadPath = $fileSaved = file_put_contents($uploads['path'] . "/" . $filename, $image_string); if ( !$fileSaved ) { throw new \Exception("The file cannot be saved."); } if ($saveToDB) { $attachment = array( 'post_mime_type' => $wp_filetype['type'], 'post_title' => preg_replace('/\.[^.]+$/', '', $filename), 'post_content' => '', 'post_status' => 'inherit', 'guid' => $uploads['url'] . "/" . $filename ); $attach_id = wp_insert_attachment( $attachment, $fullPathFilename, $post_id ); if ( !$attach_id ) { throw new \Exception("Failed to save record into database."); } require_once(ABSPATH . "wp-admin" . '/includes/image.php'); $attach_data = wp_generate_attachment_metadata( $attach_id, $fullPathFilename ); wp_update_attachment_metadata( $attach_id, $attach_data ); return $attach_id; } return $webPath; } catch (\Exception $e) { echo $e->getMessage() . PHP_EOL; } return false; }
public function checkAuth() { $this->connect(); // Check to ensure that the access token was successfully acquired. if ($this->_client->request('/me')) { $htmlBody = <<<END <h3>Access to Vimeo Account - Authorised</h3> <p>You are able to fetch Vimeo data as required.<p> END; } else { $redirectUrl = filter_var(cpfc_home_url(CPFC_MEMBERS_VIMEO_AUTH_URL), FILTER_SANITIZE_URL); $state = mt_rand(); Session::set('state', $state); $authUrl = $lib->buildAuthorizationEndpoint($redirectUrl, 'public private', Session::get('state')); $htmlBody = <<<END <h3>Authorization Required</h3> <p>You need to <a href="$authUrl">authorize access</a> before proceeding.<p> END; } echo $htmlBody; }
<td width="100%" height="30" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">Dear <?php echo $User->getFirstName(); ?>,</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">We received a request to send you a verification email. To verify your email address, click on the link below:</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td align="center"><a href="<?php echo cpfc_home_url(CPFC_MEMBERS_REGISTRATION_VERIFICATION_URL) . '?code=' . $User->getVerificationCode(); ?>" name="confirm_button" target="_blank"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/emails/confirm.png" alt="Confirm your email" width="253" height="44" style="display: block; border: none; margin: 0; padding: 0;" /></a></td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">If you have already verified your registration, just ignore this email.</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">Regards,</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td>
<div class="form-block-wrap form-group"> <label for="password" class="control-label hidden">Password <?php echo $form->indicateRequired('password'); ?></label> <input class="form-control" type="password" name="password" id="password" placeholder="Your password" data-bv-notempty="true" data-bv-notempty-message="A password is required and cannot be empty" data-bv-identical="true" data-bv-identical-field="confirmPassword" data-bv-identical-message="Passwords do not match" data-bv-different="true" data-bv-different-field="username" data-bv-different-message="The password cannot be the same as username" /> <a href="<?php echo cpfc_home_url(CPFC_MEMBERS_FORGOTTEN_PASSWORD_URL); ?>">Forgotten your password?</a> </div> </div> <div class="col-sm-4"> <div class="logged"> <label for="long-login">Keep me logged in</label> <input type="checkbox" name="long_login" id="long-login"value="1" checked /> </div> <div class="form-group submit"> <input type="submit" class="btn" name="login_submit" value="Login" /> </div> </div> </div> </fieldset> </form> <a href="#" class="login-btn"><span>Login</span></a> </div> </div> <?php } ?> <div class="container"> <?php $logoImage = get_field('header_logo', 'option'); ?> <a href="<?php echo cpfc_home_url(); ?>" class="logo"><img src="<?php echo isset($logoImage['url']) ? $logoImage['url'] : ''; ?>" alt="<?php echo isset($logoImage['alt']) ? $logoImage['alt'] : ''; ?>"></a> </div> </header>
<td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">Welcome to Crystal Palace FC Digital Membership.</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">Your account has been successfully created. To verify your registration, click on the link below:</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" style="background:#f2f2f2; padding-top:15px;padding-bottom:15px;color:#4d4d4d; text-align:center;font-family:Arial, sans serif; font-size:14px; line-height:20px"><span class="wrap"><a href="<?php echo cpfc_home_url(CPFC_MEMBERS_REGISTRATION_VERIFICATION_URL) . '?code=' . $User->getVerificationCode(); ?>">Verify your registration</a></span></td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">Regards,</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">The Crystal Palace FC Membership Team</td> </tr> <tr> <td width="100%" height="30" style="font-size: 1px; line-height: 1px;"></td>
<p><?php echo cpfc_truncate_copy($newsArticle1->post_content, $characterCount); ?></p> </div> <?php } ?> </div> </div> </div> </div> <div class="col-md-6 hidden-xs hidden-sm"> <?php if ($mainVideo) { ?> <div class="visible-xs"> <div class="videoWrapper"> <iframe src="//player.vimeo.com/video/<?php echo $mainVideo['video_id']; ?>" width="100%" height="258" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> </div> </div> <div class="hidden-xs"> <a href="<?php echo cpfc_home_url(CPFC_MEMBERS_VIEW_CAROUSEL_VIDEO_URL); ?>?id=<?php echo $mainVideo['video_id']; ?>" data-video-id="<?php echo esc_attr($mainVideo['video_id']); ?>" data-heading="<?php echo esc_attr($mainVideoInfo['title']); ?>" data-description="<?php echo esc_attr($mainVideo['description']); ?>" class="view-carousel-video"> <span> <img src="<?php echo $mainVideoInfo['localImage']; ?>" class="img-responsive"/> <i class="icon-play-circled2"></i> </span> </a> </div> <?php } ?> </div> </div> </div>
<?php //News Item Template // Can't access News Items if not logged-in as Member or Administrator if (!\CPFCMembers\Auth::isLoggedIn() && !\CPFCMembers\Auth::isAdmin()) { wp_redirect(cpfc_home_url(CPFC_MEMBERS_HOME_URL, CPFC_MEMBERS_HTTP_MODE), 301); exit(); } get_header(); $homepageId = 8; $newsItems = get_posts(array( 'post_type' => 'news', 'posts_per_page' => 2, 'post__not_in' => array(get_the_ID()), )); $feedUrl = get_field('rss_feed_url', 'option'); $rssFeedItems = false; if ($feedUrl) { $rss = new \CPFCMembers\Rss_Feed($feedUrl); $rssFeedItems = $rss->fetchFromCache(2); } $characterCount = (int) get_field('news_item_related_items_preview_character_count', 'option'); ?> <div id="sb-site" class="bg-gradient"> <?php
<div class="sb-offsite"> <?php wp_nav_menu( array( 'menu' => 'external', 'theme_location' => 'external', 'depth' => 1, 'container' => '', 'container_class' => '', 'menu_class' => '', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker()) ); ?> </div> <ul> <li><a href="<?php echo cpfc_home_url(CPFC_MEMBERS_UPDATE_DETAILS_URL); ?>">My Details</a></li> <li><a href="<?php echo cpfc_home_url(CPFC_MEMBERS_LOGOUT_URL); ?>">Logout</a></li> </ul> </nav> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="<?php echo get_template_directory_uri(); ?>/bower_components/jquery/dist/jquery.min.js"><\/script>')</script> <script type='text/javascript' src="//wurfl.io/wurfl.js"></script> <script src="<?php echo get_template_directory_uri(); ?>/assets/scripts/plugins.js"></script> <script src="<?php echo get_template_directory_uri(); ?>/assets/scripts/main.js"></script> <script src="<?php echo get_template_directory_uri(); ?>/assets/scripts/lunametrics-youtube-v7.gtm.min.js"></script>
/** * Logout process and redirect */ protected function _logout() { \CPFCMembers\Auth::logout(); wp_redirect(cpfc_home_url(CPFC_MEMBERS_HOME_URL, CPFC_MEMBERS_HTTP_MODE), 301); exit(); }
<?php $ctaCopy = get_field("data_capture_notifications_{$detail}_cta_copy", 'option'); ?> <div class="member-alert"> <div class="container"> <p><?php the_field("data_capture_notifications_{$detail}_copy", 'option'); ?> <?php if ($ctaCopy) { ?><a href="<?php echo cpfc_home_url(CPFC_MEMBERS_DATA_CAPTURE_URL) . '?details=' . $detail; ?>" id="data-capture-panel" class="btn"><?php echo htmlentities($ctaCopy); ?></a> <?php } ?></p> </div> </div>
<td width="100%" height="30" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">Dear <?php echo $User->getFirstName(); ?>,</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">We received a request to change your password. To create a new password, click on the link below:</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px"><a href="<?php echo cpfc_home_url(CPFC_MEMBERS_PASSWORD_RESET_URL) . '?code=' . $User->getResetPasswordCode(); ?>" target="_blank" style="color:#0051a2;font-weight:bold;text-decoration:none;">Reset Your Password</a></td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">If you don’t want to reset your password, just ignore this email and your password will remain the same.</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td> </tr> <tr> <td height="5px" class="copyblock" style="color:#4d4d4d; text-align:left;font-family:Arial, sans serif; font-size:14px; line-height:20px">Regards,</td> </tr> <tr> <td width="100%" height="20" style="font-size: 1px; line-height: 1px;"></td>