*
* @return void
*/
-// public function createPages($requiredPages)
-// {
-// foreach($requiredPages as $requiredPage => $requiredPageInfo) {
-// $trimmedName = GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$requiredPageInfo['underscored_title'];
-// if ($requiredPageInfo['parent'] == 'associate') {
-// $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_ASSOCIATE_ID);
-// } else if ($requiredPageInfo['parent'] == 'membersonly') {
-// $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID);
-// } else if (is_numeric($requiredPageInfo['parent'])) {
-// $postParent = $requiredPageInfo['parent'];
-// } else {
-// $postParent = '0';
-// }
-// $existingPost = get_post(get_option($trimmedName));
-// $newSlug = sanitize_title($requiredPageInfo['title']);
-// $existingSlug = $this->verify_post_slug($newSlug);
-//
-//
-// // If a post with the ID set in the option does not exist
-// if ( !$existingPost) {
-//
-// // If the new slug corresponds to an already existent page, yet the ID option does not exist,
-// // then it's either the first time this plugin is run on an outdated site or somehow the ID was
-// // deleted. Either way, replace the option value with whatever is the ID of the page matching
-// // that slug. The slug is checked by translating the page title.
-// if ($newSlug == $existingSlug) {
-// $existingID = $this->get_post_id_by_slug($newSlug);
-// update_option($trimmedName, $existingID);
-// // Otherwise create a new page
-// } else {
-// // Put together the new page, then update the option with the new ID
-// $templateUsed = isset($requiredPageInfo['template']) ? $requiredPageInfo['template'] : 'index.php';
-// $new_id = $this->insertReqPage(
-// $requiredPageInfo['title'],
-// $requiredPageInfo['content'],
-// 'publish',
-// 'page',
-// '1',
-// $templateUsed,
-// $postParent
-// );
-// update_option($trimmedName, $new_id);
-//
-// // Make extra page if members only is created
-// if ($new_id == get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID)) {
-// $this->insertReqPage(
-// 'Members Only Sample Subpage',
-// 'This page will automatically be locked to Members Only with the members-only-template',
-// 'publish',
-// 'page',
-// '1',
-// $templateUsed,
-// $new_id
-// );
-//
-// }
-// }
-// } else {
-// // No page created
-// }
-// }
-//
-// }
-
-// public function insertReqPage($pTitle = '--bad page--', $pContent = '', $pPublish = 'publish', $pType = 'page', $pAuthor = '1', $pTemplate = 'index.php', $pParent = '0')
-// {
-// $new_page = array(
-// 'post_title' => $pTitle,
-// 'post_content' => $pContent,
-// 'post_status' => $pPublish,
-// 'post_type' => $pType,
-// 'post_author' => $pAuthor,
-// 'page_template' => $pTemplate ,
-// 'post_parent' => $pParent
-// );
-// return wp_insert_post($new_page);
-// }
-
-
-// public function get_post_data($needle = 1, $valueField = 'post_name', $needleField = 'ID')
-// {
-// $value = $this->wpdb->get_var("SELECT $valueField FROM ".$this->wpdb->posts." WHERE $needleField = '".$needle."'");
-// return $value;
-// }
-
-// public function verify_post_slug($postName)
-// {
-// $value = $this->wpdb->get_var("SELECT post_name FROM ".$this->wpdb->posts." WHERE post_name = '".$postName."'");
-// return $value;
-// }
-
-// public function get_post_id_by_slug($postName)
-// {
-// $value = $this->wpdb->get_var("SELECT ID FROM ".$this->wpdb->posts." WHERE post_name = '".$postName."'");
-// return $value;
-// }
+ public function createPages($requiredPages)
+ {
+ foreach($requiredPages as $requiredPage => $requiredPageInfo) {
+ $option = GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$requiredPageInfo['underscored_title'];
+ if ($requiredPageInfo['parent'] == 'associate') {
+ $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_ASSOCIATE_ID);
+ } else if ($requiredPageInfo['parent'] == 'membersonly') {
+ $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID);
+ } else if (is_numeric($requiredPageInfo['parent'])) {
+ $postParent = $requiredPageInfo['parent'];
+ } else {
+ $postParent = '0';
+ }
+
+
+ // If the new slug corresponds to a page already existent, then it's
+ // either the first time this plugin is run on an outdated site or
+ // somehow the ID was deleted. Either way, replace the option value
+ // with whatever is the ID of the page matching that slug. The slug
+ // is checked by translating the page title.
+ $newSlug = sanitize_title($requiredPageInfo['title']);
+ $existingSlug = $this->verify_post_slug($newSlug);
+ if ($newSlug == $existingSlug) {
+ $existingID = $this->get_post_id_by_slug($newSlug);
+ update_option($option, $existingID);
+ }
+ $existingPost = get_post(get_option($option));
+ // If a post with the ID set in the option does not exist
+ if ( !$existingPost) {
+
+
+ // Put together the new page, then update the option with the new ID
+ $templateUsed = isset($requiredPageInfo['template']) ? $requiredPageInfo['template'] : 'index.php';
+ $new_id = $this->insertReqPage(
+ $requiredPageInfo['title'],
+ $requiredPageInfo['content'],
+ 'publish',
+ 'page',
+ '1',
+ $templateUsed,
+ $postParent
+ );
+ update_option($option, $new_id);
+
+ // Make extra page if members only is created
+ if ($new_id == get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID)) {
+ $this->insertReqPage(
+ 'Members Only Sample Subpage',
+ 'This page will automatically be locked to Members Only with the members-only-template',
+ 'publish',
+ 'page',
+ '1',
+ $templateUsed,
+ $new_id
+ );
+
+ }
+ } else {
+ // No page created
+ }
+ }
+
+ }
+
+ public function insertReqPage($pTitle = '--bad page--', $pContent = '', $pPublish = 'publish', $pType = 'page', $pAuthor = '1', $pTemplate = 'index.php', $pParent = '0')
+ {
+ $new_page = array(
+ 'post_title' => $pTitle,
+ 'post_content' => $pContent,
+ 'post_status' => $pPublish,
+ 'post_type' => $pType,
+ 'post_author' => $pAuthor,
+ 'page_template' => $pTemplate ,
+ 'post_parent' => $pParent
+ );
+ return wp_insert_post($new_page);
+ }
+
+
+ public function get_post_data($needle = 1, $valueField = 'post_name', $needleField = 'ID')
+ {
+ $value = $this->wpdb->get_var("SELECT $valueField FROM ".$this->wpdb->posts." WHERE $needleField = '".$needle."'");
+ return $value;
+ }
+
+ public function verify_post_slug($postName)
+ {
+ $value = $this->wpdb->get_var("SELECT post_name FROM ".$this->wpdb->posts." WHERE post_name = '".$postName."'");
+ return $value;
+ }
+
+ public function get_post_id_by_slug($postName)
+ {
+ $value = $this->wpdb->get_var("SELECT ID FROM ".$this->wpdb->posts." WHERE post_name = '".$postName."'");
+ return $value;
+ }
/**
*
{apply_filters('glm-member-db-front-members-list-memberTop', '', $m.id)}
<!-- Member Logo - Medium and up-->
+ <div class="glm-member-list-data small-12 columns">
{if $m.logo && $settings.list_show_logo}
<div class="glm-member-list-image-wrapper right small-12 medium-4 columns">
- <div class="glm-member-list-image-border" style="background: url('{$glmPluginMediaUrl}/images/{$settings.list_logo_size}/{$m.logo}') no-repeat; background-size: cover; background-position: center center; height: 250px;">
+ <div class="glm-member-list-image-border" style="background: url('{$glmPluginMediaUrl}/images/{$settings.list_logo_size}/{$m.logo}') no-repeat; background-size: contain; background-position: center center; height: 250px;">
</div>
</div>
{/if}
- <div class="glm-member-list-data small-12 medium-8 columns">
- <div class="glm-member-list-active-info small-12 columns">
+
+ <div class="glm-member-list-active-info small-12 medium-8 columns">
<!-- Member name, address, and basic information -->
{apply_filters('glm-member-db-front-members-list-memberInfoTop', '', $m.id)}
<h4 class="glm-member-title">
{if $m.region && $settings.list_show_region}<div><b>Region:</b> {$m.region}</div>{/if}
<div class="glm-member-list-links">
- {if $m.url && $settings.list_show_url}<a id='glm-member-list-website-link' href="{$m.url}"{if $settings.list_show_url_newtarget} target="_blank"{/if}>Website</a>{/if}
+ {if $m.url && $settings.list_show_url}<a id='glm-member-list-website-link' href="{$m.url}"{if $settings.list_show_url_newtarget} target="_blank"{/if}>Visit Website</a>{/if}
{if $m.email && $settings.list_show_email}<a href="mailto:{$m.email}">Email</a>{/if}
</div>
- <div class="socialtest">
- {apply_filters('glm-member-db-front-members-list-memberDetailBottom', '', $m.id)}
- Social:{apply_filters('glm-member-db-front-members-social-list', '', $m.id)}
+ <div class="glm-member-list-socials">
+ {apply_filters('glm-member-db-front-members-social-list', '', $m.id)}
</div>
- </div>
<div class="glm-member-list-description small-12 columns">
<div>
{/if}
</div>
</div>
+ {apply_filters('glm-member-db-front-members-list-memberDetailBottom', '', $m.id)}
+ </div>
+
<!-- Laury - This is the one that should go underneath all the address and description area -->
{apply_filters('glm-member-db-front-members-list-memberDataBelow', '', $m.id)}