* License: All right reserved
*/
define('GLM_HUBSPOT_PLUGIN_PATH_FILE', __FILE__);
+define('GLM_HUBSPOT_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('GLM_HUBSPOT_DB_VERSION', '0.0.1');
define('GLM_HUBSPOT_DB_VERSION_OPTION_NAME', 'glm_hubspot_db_version');
define('GLM_HUBSPOT_TABLE', 'glm_hubspot_feed');
--- /dev/null
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
{
$path = plugin_dir_path(__FILE__);
$this->check_for_updates();
- //echo '<pre>$this->feed_data: ' . print_r( $this->feed_data, true ) . '</pre>';
+ $title = $this->feed_data->objects[0]->html_title;
+ $image_url = $this->feed_data->objects[0]->featured_image;
+ $content = $this->feed_data->objects[0]->post_body;
+ $url = $this->feed_data->objects[0]->published_url;
+
+// echo '<pre>$this->feed_data: ' . print_r( $this->feed_data, true ) . '</pre>';
+ include_once GLM_HUBSPOT_PLUGIN_DIR . '/views/frontPage.php';
}
+
/**
* check_for_updates
--- /dev/null
+<?php
+
+echo '<div class="hubspot-container">'
+ . '<div class="hubspot-title">'
+ . '<a href="' .$url .'">'
+ . '<h1>' . $title. '</h1>'
+ . '</a>'
+ . '</div>'
+ . '<a class="image-link" href="' .$url .'">'
+ . '<div class="hubspot-featured-image" style="margin: 0 auto;width: 200px; height: 200px;background: url('. $image_url . ') no-repeat center center;">'
+ . '</div>'
+ . '</a>'
+ . '<div class="hubspot-blog">' . $content . '</div>'
+ . '<a href="' .$url .'"> Read More </a>'
+ . '</div>';
+ ?>
+
+<script type="text/javascript">
+
+ var blog = jQuery('.hubspot-blog');
+ var image_link = jQuery(".image-link");
+ var image = jQuery(".hubspot-featured-image");
+ var blog_characters = blog.text().length;
+
+ image.css("margin-bottom", "20px").css("background-size", "cover");
+ image_link.css("display", "block").css("width", "200px");
+ blog.find('img').remove();
+
+ if(blog_characters > 600){
+ blog.text(blog.text().substring(0,600) + '...');
+ }
+
+</script>
\ No newline at end of file