0) { $message = sprintf(esc_html__( 'aimojo: %s ' , 'aimojo'), $af_errors); } af_update_url(); update_option("af_post_type_posts", "true"); //setting default to turn on affinitomics for pages update_option("af_post_type_pages", "true"); //setting default to turn on affinitomics for posts update_option("af_post_type_products", "true"); //setting default to turn on affinitomics for posts } if (strlen($message) > 0) { bail_on_activation( $message ); } } function plugin_deactivation( ) { //TODO: } function days_since_activation() { if( !get_option( "af_install_date" ) ) { //setup the install date option update_option("af_install_date", current_time( 'timestamp' )); } $install_time = get_option("af_install_date"); $days = current_time( 'timestamp' ) - $install_time; $days = floor($days / 86400); //how many days since first installed return $days; } function check_registration_remaining() { $elapsed = days_since_activation(); if ($elapsed >= 30) { $af_key = af_verify_key(); $af_cloud_url = af_verify_provider(); $status_request = curl_request($af_cloud_url . "/api/account_status?user_key=" . $af_key); $status_response = json_decode($status_request, true); $account_status_type = $status_response['data']['account_type']; if($account_status_type == 'Anonymous') { return false; } } return true; } function bail_on_activation( $message, $deactivate = true ) { ?>

$plugin ) { if ( $plugin === $akismet ) { $plugins[$i] = false; $update = true; } } if ( $update ) { update_option( 'active_plugins', array_filter( $plugins ) ); } } exit; } function my_script_enqueuer() { wp_enqueue_script( 'jquery' ); $plugins_ajax_script_url = plugins_url( 'affinitomics_ajax_script.js', __FILE__ ); wp_register_script( "affinitomics_ajax_script", $plugins_ajax_script_url, array('jquery') ); wp_localize_script( 'affinitomics_ajax_script', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ))); wp_enqueue_script( 'affinitomics_ajax_script' ); } function custom_restore_function($post_ID) { $the_key = af_verify_key(); $af_cloud_url = af_verify_provider(); $url = get_permalink($post_ID); $request = curl_request($af_cloud_url . "/api/restore_resource?user_key=" . $the_key . '&uid=' . $post_ID . '&url=' . $url); } add_action('untrash_post', 'custom_restore_function'); /* Ensure pages have category IDs for server compatability. We'll want to document in the help file that we have this effect on a person's wordpress install. */ function add_categories_to_pages() { register_taxonomy_for_object_type( 'category', 'page' ); } add_action( 'init', 'add_categories_to_pages' ); /* Page Types to Apply Affinitomics */ $screens = array(); // if (get_option('af_post_type_affinitomics','true') == 'true') $screens[] = 'archetype'; if (get_option('af_post_type_posts','false') == 'true') $screens[] = 'post'; if (get_option('af_post_type_pages','false') == 'true') $screens[] = 'page'; if (get_option('af_post_type_products','false') == 'true') $screens[] = 'product'; if (get_option('af_post_type_projects','false') == 'true') $screens[] = 'project'; if (get_option('af_post_type_listings','false') == 'true') $screens[] = 'listing'; add_action('admin_menu', 'remove_extra_submenu_items'); function remove_extra_submenu_items() { global $submenu; unset($submenu["edit.php?post_type=archetype"][10]); unset($submenu["edit.php?post_type=archetype"][5]); } function af_verify_key() { $af_key = get_option('af_key'); if (!isset($af_key) || $af_key == "") { $af_cloud_url = af_verify_provider(); $request = curl_request($af_cloud_url . "/api/anon_key"); $response = json_decode($request, true); $af_key = $response['data']['anon_key']; update_option( 'af_key' , $af_key ); } return $af_key; } function af_check_for_errors(){ $the_key = af_verify_key(); $af_cloud_url = af_verify_provider(); $request = curl_request($af_cloud_url . "/check_for_errors?user_key=" . $the_key); $response = json_decode($request, true); update_option( 'af_errors' , $response['data']['af_errors'] ); update_option( 'af_error_code' , $response['data']['af_error_code'] ); } function af_verify_provider() { $af_cloud_url = get_option('af_cloud_url', ''); if (!isset($af_cloud_url) || $af_cloud_url == "") { $af_cloud_url = 'www.affinitomics.com'; // $af_cloud_url = 'localhost:3000'; //TODO: this is just for testing update_option( 'af_cloud_url' , $af_cloud_url ); } return $af_cloud_url; } function af_update_url() { $affinitomics = array( 'url' => get_site_url(), 'title' => '', 'descriptors' => '', 'draws' => '', 'distances' => '', 'key' => af_verify_key(), 'uid' => '', 'category' => '', 'status' => '' ); if ($afid) $affinitomics['afid'] = $afid; $af_cloudify_url = get_option('af_cloud_url') . '/api/affinitomics/cloudify/' . af_verify_key() . '/'; $request = curl_request($af_cloudify_url, $affinitomics); } /* Save Custom DATA */ function afpost_save_postdata() { af_verify_key(); af_verify_provider(); $post_ID = get_the_id(); $post_status = get_post_status($post_ID); // Collect descriptor terms from the post $these_descriptors = wp_get_post_terms( $post_ID, "descriptor" ); $descriptor_terms = array(); foreach ($these_descriptors as $descriptor) { array_push($descriptor_terms, $descriptor->name); } // Collect draw terms from the post $these_draws = wp_get_post_terms( $post_ID, "draw" ); $draw_terms = array(); foreach ($these_draws as $draw) { array_push($draw_terms, $draw->name); } // Collect distance terms from the post $these_distances = wp_get_post_terms( $post_ID, "distance" ); $distance_terms = array(); foreach ($these_distances as $distance) { array_push($distance_terms, $distance->name); } // implode the data $afpost_descriptors = implode(",", $descriptor_terms); $afpost_draw = implode(",", $draw_terms); $afpost_distance = implode(",", $distance_terms); // Save Meta DATA add_post_meta($post_ID, '_afpost_descriptors', $afpost_descriptors, true) or update_post_meta($post_ID, '_afpost_descriptors', $afpost_descriptors); add_post_meta($post_ID, '_afpost_draw', $afpost_draw, true) or update_post_meta($post_ID, '_afpost_draw', $afpost_draw); add_post_meta($post_ID, '_afpost_distance', $afpost_distance, true) or update_post_meta($post_ID, '_afpost_distance', $afpost_distance); // Affinitomic ID $afid = get_post_meta($post_ID, 'afid', true); // Categories String $cat_string = ''; // Save Data To Prefrent Cloud global $af_flag; if ($af_flag == 0) { $cat_string = ''; $categories = get_the_category($id); if ($categories) { $cats = array(); foreach($categories as $cat) { $cats[] = $cat->term_id; } $cat_string = implode(",", $cats); } $affinitomics = array( 'url' => get_permalink($post_ID), 'title' => get_the_title($post_ID), 'descriptors' => $afpost_descriptors, 'draws' => $afpost_draw, 'distances' => $afpost_distance, 'key' => af_verify_key(), 'uid' => $post_ID, 'category' => $cat_string, 'status' => $post_status ); if ($afid) $affinitomics['afid'] = $afid; $af_cloudify_url = get_option('af_cloud_url') . '/api/affinitomics/cloudify/' . af_verify_key() . '/'; $request = curl_request($af_cloudify_url, $affinitomics); $af = json_decode($request, true); if (isset($af['data']['objectId'])) { update_post_meta($post_ID, 'afid', $af['data']['objectId']); } } $af_flag = 1; } /* ---------------------------------------------------------------------- CUSTOM TAXONOMY ---------------------------------------------------------------------- */ // Register Custom Taxonomy Descriptor function descriptor_taxonomy() { $labels = array( 'name' => _x( 'Descriptors', 'Taxonomy General Name', 'text_domain' ), 'singular_name' => _x( 'Descriptor', 'Taxonomy Singular Name', 'text_domain' ), 'menu_name' => __( 'Descriptor', 'text_domain' ), 'all_items' => __( 'All Descriptors', 'text_domain' ), 'parent_item' => __( 'Parent Descriptor', 'text_domain' ), 'parent_item_colon' => __( 'Parent Descriptor:', 'text_domain' ), 'new_item_name' => __( 'New Descriptor', 'text_domain' ), 'add_new_item' => __( 'Add New Descriptor', 'text_domain' ), 'edit_item' => __( 'Edit Descriptor', 'text_domain' ), 'update_item' => __( 'Update Descriptor', 'text_domain' ), 'separate_items_with_commas' => __( 'Descriptors are similar to Categories in Wordpress. Separate each Descriptor with commas. e.g. Summer Activities, Hobbies', 'text_domain' ), 'search_items' => __( 'Search descriptors', 'affinitomics' ), 'add_or_remove_items' => __( 'Add or remove descriptors', 'text_domain' ), 'choose_from_most_used' => __( 'Choose from the most used Descriptors', 'text_domain' ), ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => true, 'show_in_menu' => true, ); global $screens; register_taxonomy( 'descriptor', $screens, $args ); } // Hook into the 'init' action add_action( 'init', 'descriptor_taxonomy', 0 ); register_taxonomy_for_object_type( 'item', 'product' ); // Register Custom Taxonomy Draw function draw_taxonomy() { $labels = array( 'name' => _x( 'Positive Relationships (Draws)', 'Taxonomy General Name', 'text_domain' ), 'singular_name' => _x( 'Draw', 'Taxonomy Singular Name', 'text_domain' ), 'menu_name' => __( 'Draw', 'text_domain' ), 'all_items' => __( 'All Draws', 'text_domain' ), 'parent_item' => __( 'Parent Draw', 'text_domain' ), 'parent_item_colon' => __( 'Parent Draw:', 'text_domain' ), 'new_item_name' => __( 'New Draw', 'text_domain' ), 'add_new_item' => __( 'Add New Draw', 'text_domain' ), 'edit_item' => __( 'Edit Draw', 'text_domain' ), 'update_item' => __( 'Update Draw', 'text_domain' ), 'separate_items_with_commas' => __( 'Syntax: Draws can have a magnitude from 1 to 5 written as a suffix, with each draw separated by a comma. If a magnitude is not present, a magnitude of one will be assumed. e.g. Cats5, Laser Pointer2', 'text_domain' ), 'search_items' => __( 'Search draws', 'affinitomics' ), 'add_or_remove_items' => __( 'Add or remove draws', 'text_domain' ), 'choose_from_most_used' => __( 'Choose from the most used Draws', 'text_domain' ), ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => true, ); global $screens; register_taxonomy( 'draw', $screens, $args ); } // Hook into the 'init' action add_action( 'init', 'draw_taxonomy', 0 ); register_taxonomy_for_object_type( 'item', 'product' ); // Register Custom Taxonomy Distance function distance_taxonomy() { $labels = array( 'name' => _x( 'Negative Relationships (Distances)', 'Taxonomy General Name', 'text_domain' ), 'singular_name' => _x( 'Distance', 'Taxonomy Singular Name', 'text_domain' ), 'menu_name' => __( 'Distance', 'text_domain' ), 'all_items' => __( 'All Distances', 'text_domain' ), 'parent_item' => __( 'Parent Distance', 'text_domain' ), 'parent_item_colon' => __( 'Parent Distance:', 'text_domain' ), 'new_item_name' => __( 'New Distance', 'text_domain' ), 'add_new_item' => __( 'Add New Distance', 'text_domain' ), 'edit_item' => __( 'Edit Distance', 'text_domain' ), 'update_item' => __( 'Update Distance', 'text_domain' ), 'separate_items_with_commas' => __( 'Syntax: Distances can have a magnitude of 1 to 5, written as a suffix, with each distance separated by a comma. If a magnitude is not present, a magnitude of one will be assumed. e.g. Nickelback5, Canada2', 'text_domain' ), 'search_items' => __( 'Search distances', 'affinitomics' ), 'add_or_remove_items' => __( 'Add or remove Distance', 'text_domain' ), 'choose_from_most_used' => __( 'Choose from the most used Distances', 'text_domain' ), ); $args = array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => true, ); global $screens; register_taxonomy( 'distance', $screens, $args ); } // Hook into the 'init' action add_action( 'init', 'distance_taxonomy', 0 ); register_taxonomy_for_object_type( 'item', 'product' ); /* ---------------------------------------------------------------------- Register "Archetype" post type ---------------------------------------------------------------------- */ // Register Custom Post Type function arche_type() { $labels = array( 'name' => __( 'Archetypes', 'Post Type General Name', 'text_domain' ), 'singular_name' => __( 'Archetype', 'Post Type Singular Name', 'text_domain' ), 'menu_name' => __( 'Affinitomics™', 'text_domain' ), 'parent_item_colon' => __( 'Parent Archetype:', 'text_domain' ), 'all_items' => __( 'All Archetypes', 'text_domain' ), 'view_item' => __( 'View Archetype', 'text_domain' ), 'add_new_item' => __( 'Add New Archetype', 'text_domain' ), 'add_new' => __( 'New Archetype', 'text_domain' ), 'edit_item' => __( 'Edit Archetype', 'text_domain' ), 'update_item' => __( 'Update Archetype', 'text_domain' ), 'search_items' => __( 'Search Archetypes', 'text_domain' ), 'not_found' => __( 'No archetypes found', 'text_domain' ), 'not_found_in_trash' => __( 'No archetypes found in Trash', 'text_domain' ), ); $args = array( 'label' => __( 'archetype', 'text_domain' ), 'description' => __( 'Archetype information pages', 'text_domain' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'post-formats', ), 'taxonomies' => array( 'descriptor', 'draw', 'distance' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => false, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'menu_icon' => plugins_url( 'affinitomics-favicon.svg', __FILE__ ), 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); register_post_type( 'archetype', $args ); } // // Hook into the 'init' action add_action( 'init', 'arche_type', 0 ); /* ---------------------------------------------------------------------- RELATED POSTS SHORTCODE Examples: [afview], [afview limit="4"], [afview category_filter="50"] [afview limit=1 display_title="false"] ---------------------------------------------------------------------- */ //register shortcode add_shortcode("afview", "afview_handler"); //handle shortcode function afview_handler( $atts, $content = null ) { $afview_output = afview_function($atts); return $afview_output; } //process shortcode function afview_function($atts) { af_verify_key(); af_verify_provider(); global $screens; extract( shortcode_atts( array( 'affinitomics' => null, 'display_title' => 'true', 'limit' => 10, 'category_filter' => '', 'title' => '' ), $atts ) ); // Start output // $afview_output = '
'; $afview_output = ''; $post_id = get_the_ID(); $afid = get_post_meta($post_id, 'afid', true); $af_domain = get_option('af_domain'); $af_key = af_verify_key(); // Find Related Elements if ($afid) { if (!empty($category_filter)) { if (!is_numeric($category_filter)) { //we were given a slug instead of an id, so find the id of the slug $foundCategory = get_category_by_slug($category_filter); if ($foundCategory) { //get the id from the found category and make that the category filter $category_filter = $foundCategory->term_id; } } } $af_cloud = get_option('af_cloud_url') . '/api/affinitomics/related/' . $af_key . '?afid=' . $afid . '&ctype=' . AI_MOJO__TYPE . '&cversion=' . AI_MOJO__VERSION . '&limit=' . $limit . '&category_filter=' . $category_filter; if ($affinitomics) { $af_cloud = $af_cloud . '&af=' . rawurlencode($affinitomics); } global $afview_count; $afview_count ++; if ($display_title == 'true') { if (!empty($title)) { $afview_output .= '

' . $title . '

'; } else { $afview_output .= '

Affinitomic Relationships: '; // These are the custom affinitomics if ($affinitomics) { $afview_output .= $affinitomics; } $afview_output .= '

'; } } $run = 1; if (check_registration_remaining() == false) { $run = 0; } $afview_output .= ''; } // HTML Output /*

Related Items: +foo, -bar (sorted by Affinitomic concordance)

*/ return $afview_output; } /* End Affinitomics Commercial Code */ /* ---------------------------------------------------------------------- Administration and Settings Menu ---------------------------------------------------------------------- */ add_action( 'admin_menu', 'aimojo_admin_menu' ); /* //TODO: deprecated functionality add_action( 'admin_menu', 'af_plugin_menu' ); function af_plugin_menu() { // Add Custom Sub Menus add_submenu_page( 'edit.php?post_type=archetype', 'Settings', 'Settings', 'manage_options', 'affinitomics', 'af_plugin_options'); add_action( 'admin_init', 'af_register_settings' ); add_submenu_page( 'edit.php?post_type=archetype', 'Cloud Export', 'Cloud Export', 'manage_options', 'afcloudify', 'af_plugin_export'); } */ /* Affinitomics Commercial Code */ function af_plugin_export() { if ( !current_user_can( 'manage_options' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } if ( isset( $_GET['quietUpdate'] ) ) { //update the post's meta data if it has been updated by the server if (isset( $_GET['postID'] )) { $postID = $_GET['postID']; if (isset( $_GET['afid'] )) { update_post_meta($postID, 'afid', $_GET['afid']); } } return; } echo'
'; af_verify_key(); af_verify_provider(); // Export to Cloud echo '

Export and "Cloudify"

'; echo '

Your Affinitomics are saved in the cloud each time you publish a page or post so that our servers can do the heavy computation lift, leaving yours free to serve web pages as fast as possible. You only need to export your Affinitomics™ to the cloud if:

  1. You have edited multiple pages, posts or custom post types via the QuickEdit admin feature of Wordpress, or;
  2. You have recently imported pages, posts, or custom post types that contain Affinitomics™.

Again, pages, posts and custom post types ( those specified in the "settings" tab ) added or edited individually after ai•mojo™ was installed automatically save their Affinitomic elements to the cloud when published.

'; if (isset($_POST['af_cloudify']) && $_POST['af_cloudify'] == 'true') { echo ''; } global $screens; $args = array( 'post_type' => $screens, 'category' => $category_id, 'posts_per_page' => -1 ); $posts_array = get_posts($args); echo ''; echo '
    '; foreach($posts_array as $post) { place_jquery_tag($post); } echo '
'; // Default View echo '
'; echo ''; echo '
'; settings_fields( 'af-cloud-settings-group' ); do_settings_sections( 'af-cloud-settings-group' ); $af_cloudify = get_option( 'af_cloudify', '' ); if ($af_cloudify == 'true') $cloud_checked = 'checked="checked"'; echo '

Migrate Affinitomics™ to the Cloud?

'; echo ' Make it So!'; submit_button('Export'); echo '
'; echo '
'; if (is_plugin_active('affinitomics-taxonomy-converter/affinitomics-taxonomy-converter.php')) { echo 'Convert Taxonomy'; } else { echo 'Hey, did you know we have a handy importing tool? Check out the '; echo 'Affinitomics™ Taxonomy Converter'; } } function place_jquery_tag($post){ $id = $post->ID; $afid = get_post_meta($id, 'afid', true); $cat_string = ''; $categories = get_the_terms( $id, 'category' ); if ($categories) { $cats = array(); foreach($categories as $cat) { $cats[] = $cat->term_id; } $cat_string = implode(",", $cats); } // Collect draw terms from the post $these_draws = wp_get_post_terms( $id, "draw" ); $draw_terms = array(); foreach ($these_draws as $draw) { array_push($draw_terms, $draw->name); } // Collect distance terms from the post $these_distances = wp_get_post_terms( $id, "distance" ); $distance_terms = array(); foreach ($these_distances as $distance) { array_push($distance_terms, $distance->name); } // Collect descriptor terms from the post $these_descriptors = wp_get_post_terms( $id, "descriptor" ); $descriptor_terms = array(); foreach ($these_descriptors as $descriptor) { array_push($descriptor_terms, $descriptor->name); } $post_status = get_post_status($id); $affinitomics = array( 'url' => get_permalink($id), 'title' => get_the_title($id), 'descriptors' => implode(',', $descriptor_terms), 'draws' => implode(',', $draw_terms), 'distances' => implode(',', $distance_terms), 'uid' => $id, 'category' => $cat_string, 'status' => $post_status ); if ($affinitomics['descriptors'] || $affinitomics['draws'] || $affinitomics['distances']) { $af_cloud_url = get_option('af_cloud_url') . '/api/affinitomics/cloudify/' . af_verify_key() . '/?'; $af_cloud_url .= '&url=' . get_permalink($id); $af_cloud_url .= '&title=' . get_the_title($id); $af_cloud_url .= '&descriptors=' . implode(',', $descriptor_terms); $af_cloud_url .= '&draws=' . implode(',', $draw_terms); $af_cloud_url .= '&distances=' . implode(',', $distance_terms); $af_cloud_url .= '&uid=' . $id; $af_cloud_url .= '&category=' . $cat_string; $af_cloud_url .= '&status=' . $post_status; $af_cloud_url .= '&ctype=' . AI_MOJO__TYPE; $af_cloud_url .= '&cversion=' . AI_MOJO__VERSION; echo ''; } } function af_plugin_options() { if ( !current_user_can( 'manage_options' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } if ( isset( $_GET['dismissNotice'] ) ) { update_option( 'af_banner_notice_dismissed' , 'true' ); } $af_key = af_verify_key(); echo '
'; echo '
'; echo '

Affinitomics™ Plugin Settings

'; echo '

This is where you tell your Wordpress install how to talk to our system. Once set, we can do the heavy lifting when it comes to measuring relationships within your site – meaning that you can maintain a lightweight, fast site with the power of a much more robust intelligent system. Once these settings are made, archetypes will be created and saved in the Affinitomics™ I.Q. cloud whenever you save information containing Affinitomics™ on your site.

Legacy Data and the Export Function
Legacy data (stuff you already had saved before you installed ai•mojo) will not automatically become Affinitomic Archetypes. You will have to tell ai•mojo to do that for you. Once you’ve turned your legacy data into Affinitomic archetypes, you will need to export the data to the cloud (see export tab).

You should register the plugin as well (below). Even if you continue using the free version – It gives it 5x more power!

'; echo '
'; settings_fields( 'af-settings-group' ); do_settings_sections( 'af-settings-group' ); $af_cloud_url = af_verify_provider(); af_check_for_errors(); $af_errors = get_option('af_errors', ''); $af_error_code = get_option('af_error_code', ''); if(strlen($af_errors) > 0) { echo '

----- Warning -----

'; echo '

Error Message: ' . $af_errors . '

'; echo '

Error Code: ' . $af_error_code . '

'; echo '

----- Warning -----

'; } /* Affinitomics Commercial Code */ $status_request = curl_request($af_cloud_url . "/api/account_status?user_key=" . $af_key); $status_response = json_decode($status_request, true); $signin_url = $status_response['data']['signin_url']; $account_status_type = $status_response['data']['account_type']; echo '

Affinitomics™ API Key

'; echo ''; echo '

'; if($account_status_type == 'Anonymous') { echo 'Anonymous Account - Register for free and see in-depth reporting!
'; echo 'Register for Free'; $elapsed = days_since_activation(); $days_remaining = 30 - $elapsed; if ($days_remaining <= 0) { echo '
Registration is now required to continue using Affinitomics for free!
'; } else { echo '
' . $days_remaining . ' days remaining until registration is required.
'; } } elseif ($account_status_type == 'Legacy') { echo 'Legacy User Account - Create your user account for free and see in-depth reporting!
'; echo 'Register for Free'; } elseif ($account_status_type == 'Registered') { echo 'Registered User
'; echo 'View Usage Statistics'; } else { echo 'API Key Unrecognized...'; } echo '

'; $af_post_type_affinitomics = get_option('af_post_type_affinitomics'); $af_post_type_posts = get_option('af_post_type_posts'); $af_post_type_pages = get_option('af_post_type_pages'); $af_post_type_products = get_option('af_post_type_products'); $af_post_type_projects = get_option('af_post_type_projects'); $af_post_type_listings = get_option('af_post_type_listings'); $af_post_type_affinitomics_checked = ''; $af_post_type_posts_checked = ''; $af_post_type_pages_checked = ''; $af_post_type_products_checked = ''; $af_post_type_projects_checked = ''; $af_post_type_listings_checked = ''; if ($af_post_type_affinitomics == 'true') $af_post_type_affinitomics_checked = 'checked="checked"'; if ($af_post_type_pages == 'true') $af_post_type_pages_checked = 'checked="checked"'; if ($af_post_type_posts == 'true') $af_post_type_posts_checked = 'checked="checked"'; if ($af_post_type_products == 'true') $af_post_type_products_checked = 'checked="checked"'; if ($af_post_type_projects == 'true') $af_post_type_projects_checked = 'checked="checked"'; if ($af_post_type_listings == 'true') $af_post_type_listings_checked = 'checked="checked"'; echo '

To which Post-types would you like to apply your Affinitomics™?

'; echo ' Posts
'; echo ' Pages
'; echo ' Products
'; echo ' Projects
'; echo ' Listings
'; $af_tag_descriptors = get_option( 'af_tag_descriptors', 'true' ); $true_checked = ''; $false_checked = ''; if ($af_tag_descriptors == 'true') $true_checked = 'checked="checked"'; if ($af_tag_descriptors == 'false') $false_checked = 'checked="checked"'; /* $af_jumpsearch = get_option( 'af_jumpsearch', 'false' ); $true_checked = ''; $false_checked = ''; if ($af_jumpsearch == 'true') $true_checked = 'checked="checked"'; if ($af_jumpsearch == 'false') $false_checked = 'checked="checked"'; echo '

JumpSearch ( search using Affinitomics™ as context )

'; echo ' Yes
'; echo ' No
'; $af_google_cse_key = get_option('af_google_cse_key', ''); echo '

Google™ API Key

'; echo ' (not sure what this is?)'; $af_google_cse_id = get_option('af_google_cse_id', ''); echo '

Google™ Custom Search Engine ID

'; echo ' (not sure what this is?)'; $af_jumpsearch_post_type_affinitomics = get_option('af_jumpsearch_post_type_affinitomics'); $af_jumpsearch_post_type_posts = get_option('af_jumpsearch_post_type_posts'); $af_jumpsearch_post_type_pages = get_option('af_jumpsearch_post_type_pages'); $af_jumpsearch_post_type_products = get_option('af_jumpsearch_post_type_products'); $af_jumpsearch_post_type_projects = get_option('af_jumpsearch_post_type_projects'); $af_jumpsearch_post_type_listings = get_option('af_jumpsearch_post_type_listings'); $af_jumpsearch_post_type_affinitomics_checked = ''; $af_jumpsearch_post_type_posts_checked = ''; $af_jumpsearch_post_type_pages_checked = ''; $af_jumpsearch_post_type_products_checked = ''; $af_jumpsearch_post_type_projects_checked = ''; $af_jumpsearch_post_type_listings_checked = ''; if ($af_jumpsearch_post_type_affinitomics == 'true') $af_jumpsearch_post_type_affinitomics_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_posts == 'true') $af_jumpsearch_post_type_posts_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_pages == 'true') $af_jumpsearch_post_type_pages_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_products == 'true') $af_jumpsearch_post_type_products_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_projects == 'true') $af_jumpsearch_post_type_projects_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_listings == 'true') $af_jumpsearch_post_type_listings_checked = 'checked="checked"'; echo '

Which Pages or Post-types should have a JumpSearch field?

'; echo ' Posts
'; echo ' Pages
'; echo ' Products
'; echo ' Projects
'; echo ' Listings
'; $af_jumpsearch_location = get_option( 'af_jumpsearch_location', 'bottom' ); $top_checked = ''; $bottom_checked = ''; if ($af_jumpsearch_location == 'top') $top_checked = 'checked="checked"'; if ($af_jumpsearch_location == 'bottom') $bottom_checked = 'checked="checked"'; echo '

Where on Pages or Post-types should the JumpSearch field appear?

'; echo ' Top of the Page or Post
'; echo ' Bottom of the Page or Post
'; */ submit_button(); echo '
'; echo '
'; echo '
'; echo ''; } function af_jump_search() { $af_key = af_verify_key(); echo '
'; echo '
'; settings_fields( 'af-jumpsearch-settings-group' ); do_settings_sections( 'af-jumpsearch-settings-group' ); $af_cloud_url = af_verify_provider(); af_check_for_errors(); $af_errors = get_option('af_errors', ''); $af_error_code = get_option('af_error_code', ''); if(strlen($af_errors) > 0) { echo '

----- Warning -----

'; echo '

Error Message: ' . $af_errors . '

'; echo '

Error Code: ' . $af_error_code . '

'; echo '

----- Warning -----

'; } $af_jumpsearch = get_option( 'af_jumpsearch', 'false' ); $true_checked = ''; $false_checked = ''; if ($af_jumpsearch == 'true') $true_checked = 'checked="checked"'; if ($af_jumpsearch == 'false') $false_checked = 'checked="checked"'; echo '
'; echo '
'; echo ''; echo '

Jump Search allows you to combine the power of Google Custom Search Engine (CSE) and Affinitomics™. It allows CSE to use the Affinitomic elements (Descriptors, Draws, and Distances) of the Page or Post to modify the search results and make them more accurate, based on the context of the page.

'; echo ' Make Jump Search Active
'; /* echo ' No
'; */ $af_google_cse_key = get_option('af_google_cse_key', ''); echo '

Google™ API Key

'; echo ' (How to get this and set it up?)'; $af_google_cse_id = get_option('af_google_cse_id', ''); echo '

Google™ Custom Search Engine ID

'; echo ' (not sure what this is?)'; $af_jumpsearch_post_type_affinitomics = get_option('af_jumpsearch_post_type_affinitomics'); $af_jumpsearch_post_type_posts = get_option('af_jumpsearch_post_type_posts'); $af_jumpsearch_post_type_pages = get_option('af_jumpsearch_post_type_pages'); $af_jumpsearch_post_type_products = get_option('af_jumpsearch_post_type_products'); $af_jumpsearch_post_type_projects = get_option('af_jumpsearch_post_type_projects'); $af_jumpsearch_post_type_listings = get_option('af_jumpsearch_post_type_listings'); $af_jumpsearch_post_type_affinitomics_checked = ''; $af_jumpsearch_post_type_posts_checked = ''; $af_jumpsearch_post_type_pages_checked = ''; $af_jumpsearch_post_type_products_checked = ''; $af_jumpsearch_post_type_projects_checked = ''; $af_jumpsearch_post_type_listings_checked = ''; if ($af_jumpsearch_post_type_affinitomics == 'true') $af_jumpsearch_post_type_affinitomics_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_posts == 'true') $af_jumpsearch_post_type_posts_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_pages == 'true') $af_jumpsearch_post_type_pages_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_products == 'true') $af_jumpsearch_post_type_products_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_projects == 'true') $af_jumpsearch_post_type_projects_checked = 'checked="checked"'; if ($af_jumpsearch_post_type_listings == 'true') $af_jumpsearch_post_type_listings_checked = 'checked="checked"'; echo '

Which Pages or Post-types should have a JumpSearch field?

'; echo ' Posts
'; echo ' Pages
'; echo ' Products
'; echo ' Projects
'; echo ' Listings
'; $af_jumpsearch_location = get_option( 'af_jumpsearch_location', 'bottom' ); $top_checked = ''; $bottom_checked = ''; if ($af_jumpsearch_location == 'top') $top_checked = 'checked="checked"'; if ($af_jumpsearch_location == 'bottom') $bottom_checked = 'checked="checked"'; echo '

Where on Pages or Post-types should the JumpSearch field appear?

'; echo ' Top of the Page or Post
'; echo ' Bottom of the Page or Post
'; submit_button(); echo ''; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; } function af_register_settings() { register_setting('af-settings-group', 'af_cloud_url'); register_setting('af-settings-group', 'af_domain'); register_setting('af-settings-group', 'af_key'); register_setting('af-settings-group', 'af_post_type_affinitomics'); register_setting('af-settings-group', 'af_post_type_posts'); register_setting('af-settings-group', 'af_post_type_pages'); register_setting('af-settings-group', 'af_post_type_products'); register_setting('af-settings-group', 'af_post_type_projects'); register_setting('af-settings-group', 'af_post_type_listings'); register_setting('af-settings-group', 'af_tag_descriptors'); //keep the jumpsearch settings in their own group (partially because they will appear on a different tab) register_setting('af-jumpsearch-settings-group', 'af_jumpsearch'); register_setting('af-jumpsearch-settings-group', 'af_google_cse_key'); register_setting('af-jumpsearch-settings-group', 'af_google_cse_id'); register_setting('af-jumpsearch-settings-group', 'af_jumpsearch_post_type_affinitomics'); register_setting('af-jumpsearch-settings-group', 'af_jumpsearch_post_type_posts'); register_setting('af-jumpsearch-settings-group', 'af_jumpsearch_post_type_pages'); register_setting('af-jumpsearch-settings-group', 'af_jumpsearch_location'); register_setting('af-settings-group', 'af_errors'); register_setting('af-settings-group', 'af_error_code'); register_setting('af-cloud-settings-group', 'af_cloudify'); } function extraView( $name, array $args = array() ) { $args = apply_filters( 'aimojo_view_arguments', $args, $name ); foreach ( $args AS $key => $val ) { $$key = $val; } load_plugin_textdomain( 'aimojo' ); $file = AI_MOJO__PLUGIN_DIR . 'views/'. $name . '.php'; include( $file ); } function display_notice() { return; //ongoing development, this is disabled for now // only show notice if we're either a super admin on a network or an admin on a single site $show_notice = current_user_can( 'manage_network_plugins' ) || ( ! is_multisite() && current_user_can( 'install_plugins' ) ); if ( !$show_notice ) return; $af_key = af_verify_key(); $af_cloud_url = af_verify_provider(); $dismissed = get_option( 'af_banner_notice_dismissed', '' ); if ($dismissed != 'true') { $registerLink = 'http://' . $af_cloud_url . '/users/sign_up?key=' . $af_key; $postOptionsUrl = 'admin.php?page=aimojo-basic-settings&dismissNotice=1'; $bannerImage = AI_MOJO__PLUGIN_URL . 'images/'. 'register-aimojo-mod.jpg'; extraView( 'notice', array( 'bannerLink' => $registerLink, 'postOptionsUrl' => $postOptionsUrl, 'bannerImage' => $bannerImage ) ); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////// WORDPRESS TUTORIAL POINTERS ///////////////////////////////////////////////// function aimojo_admin_scripts() { // WordPress Pointer Handling // find out which pointer ids this user has already seen $seen_it = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); // at first assume we don't want to show pointers $show_pointers = false; // check for dismissal of aimojo settings menu pointer 'aimojoPointer1' if ( !in_array( 'aimojo_pointer1', $seen_it )) { // flip the flag enabling pointer scripts and styles to be added later $show_pointers = true; // hook to function that will output pointer script just for aimojoPointer1 add_action( 'admin_print_footer_scripts', 'aimojoPointer1_footer_script' ); } // check for dismissal of aimojo "setup a post..." pointer 'aimojoPointer2'... only want to show this one once pointer1 has been dismissed else if ( !in_array( 'aimojo_pointer2', $seen_it ) ) { // flip the flag enabling pointer scripts and styles to be added later $show_pointers = true; // hook to function that will output pointer script just for aimojoPointer2 add_action( 'admin_print_footer_scripts', 'aimojoPointer2_footer_script' ); } // check for dismissal of aimojo [afview] tag pointer 'aimojoPointer2' if ( ! in_array( 'aimojo_pointer3', $seen_it ) ) { // flip the flag enabling pointer scripts and styles to be added later $show_pointers = true; // hook to function that will output pointer script just for aimojoPointer3 add_action( 'admin_print_footer_scripts', 'aimojoPointer3_footer_script' ); } // check for dismissal of aimojo descriptor box pointer 'aimojoPointer4' if ( ! in_array( 'aimojo_pointer4', $seen_it ) ) { // flip the flag enabling pointer scripts and styles to be added later $show_pointers = true; // hook to function that will output pointer script just for aimojoPointer3 add_action( 'admin_print_footer_scripts', 'aimojoPointer4_footer_script' ); } // check for dismissal of aimojo draws box pointer 'aimojoPointer4' if ( ! in_array( 'aimojo_pointer5', $seen_it ) ) { // flip the flag enabling pointer scripts and styles to be added later $show_pointers = true; // hook to function that will output pointer script just for aimojoPointer3 add_action( 'admin_print_footer_scripts', 'aimojoPointer5_footer_script' ); } // check for dismissal of aimojo distances box pointer 'aimojoPointer4' if ( ! in_array( 'aimojo_pointer6', $seen_it ) ) { // flip the flag enabling pointer scripts and styles to be added later $show_pointers = true; // hook to function that will output pointer script just for aimojoPointer3 add_action( 'admin_print_footer_scripts', 'aimojoPointer6_footer_script' ); } // enqueue scripts and styles if show_pointers == TRUE if ( $show_pointers ) { // add JavaScript for WP Pointers wp_enqueue_script( 'wp-pointer' ); // add CSS for WP Pointers wp_enqueue_style( 'wp-pointer' ); } } //this pointer points to the aimojo settings menu function aimojoPointer1_footer_script() { $pointer_content = '

Get started using aimojo!

'; // Title should be

for proper formatting. $pointer_content .= '

Learn how you can find related posts, and display them to your users, by '; $pointer_content .= 'adding draws, distances, and descriptors.

'; ?> Set up a post with aimojo!

'; // Title should be

for proper formatting. $pointer_content .= '

Add descriptors, draws, and distances to setup relationships with other posts.

'; $pointer_content .= '

Then add the [afview] shortcode to find and display related post links to your users.

'; ?> Add aimojo relationships!

'; // Title should be

for proper formatting. $pointer_content .= '

Add the shortcode [afview] in your post to view other related posts.

'; $pointer_content .= '

Be sure to scroll down on the right side of the page'; $pointer_content .= ' to add draws, distances, and descriptors to your posts.

'; ?> aimojo tip: add descriptors

'; // Title should be

for proper formatting. $pointer_content .= '

Add terms that describe your post.

'; $pointer_content .= '

A post about cars might include the descriptors: cars, automobiles.

'; ?> aimojo tip: add draws

'; // Title should be

for proper formatting. $pointer_content .= '

Add draws that are related to your descriptors.

'; $pointer_content .= '

For example, a post about cars might include the draws: horsepower, nascar, racing, ferrari.

'; ?> aimojo tip: add distances

'; // Title should be

for proper formatting. $pointer_content .= "

Add distances that are things opposite to the draws and descriptors.

"; $pointer_content .= '

For example, a post about cars might include the distances: bicycle, boat, rain.

'; ?>

Search Using Affinitomic Profile:

---------------------------------------------------------------------- CSS Styling Examples: ---------------------------------------------------------------------- #af-search h2 {background-color:magenta;} #search-content {background-color:green;} */ if (get_option('af_jumpsearch') == 'true') { add_filter( 'the_content', 'af_search_content_filter', 20 ); } // Compare this post type with the user options function this_page_search_enabled(){ $this_page_type = get_post_type( get_the_ID() ); switch ($this_page_type) { case 'post': return get_option('af_jumpsearch_post_type_posts'); break; case 'page': return get_option('af_jumpsearch_post_type_pages'); break; case 'product': return get_option('af_jumpsearch_post_type_products'); break; case 'project': return get_option('af_jumpsearch_post_type_projects'); break; case 'listing': return get_option('af_jumpsearch_post_type_listings'); break; } } function af_search_content_filter( $content ) { if(this_page_search_enabled()){ if ( is_singular() ) { $cse = ''; $cse .= ''; $post_id = get_the_ID(); // Collect descriptor terms from the post $these_descriptors = wp_get_post_terms( $post_id, "descriptor" ); $descriptor_terms = array(); foreach ($these_descriptors as $descriptor) { array_push($descriptor_terms, $descriptor->name); } // Collect draws, find the highest draw $best_draw = ""; $best_draw_num = 0; $these_draws = wp_get_post_terms( $post_id, "draw" ); $draw_terms = array(); foreach ($these_draws as $draw) { $this_weight = substr($draw->name, -1); if (is_numeric($this_weight)){ if ($this_weight > 1) { if ( $this_weight > $best_draw_num ) { $best_draw = preg_replace("/[0-9]/", "", $draw->name); $best_draw_num = $this_weight; } } } else { $draw->name = preg_replace("/[0-9]/", "", $draw->name); array_push($draw_terms, $draw->name); } } // Find the best distance or use the first one $best_distance = ""; $best_distance_num = 0; $these_distances = wp_get_post_terms( $post_id, "distance" ); $distance_terms = array(); foreach ($these_distances as $distance) { $this_weight = substr($distance->name, -1); if (is_numeric($this_weight)){ if ( $this_weight > $best_distance_num ) { $best_distance = preg_replace("/[0-9]/", "", $distance->name); $best_distance_num = $this_weight; } } else { $distance->name = preg_replace("/[0-9]/", "", $distance->name); array_push($distance_terms, $distance->name); } } if (count($descriptor_terms) > 0){ $descriptors_meta = $descriptor_terms[0]; } else { $descriptors_meta = ""; } if($best_draw != ""){ $draw_meta = $best_draw; } else if (count($draw_terms) > 0){ $draw_meta = $draw_terms[0]; } else { $draw_meta = ""; } if($best_distance != ""){ $distance_meta = '-' . $best_distance; } else if (count($distance_terms) > 0){ $distance_meta = '-' . $distance_terms[0]; } else { $distance_meta = ""; } // Use Taxonomy Data to Build Affinitomic Search String $affinitomics = ''; if ($descriptors_meta != '') { $affinitomics = $descriptors_meta; } if ($draw_meta != '') { if ($affinitomics == '') { $affinitomics = $draw_meta; } else { $affinitomics .= ', ' . $draw_meta; } } if ($distance_meta != '') { if ($affinitomics == '') { $affinitomics = $distance_meta; } else { $affinitomics .= ', ' . $distance_meta; } } if ($affinitomics != '') { $cse .= '
 
'; $cse .= ''; $modified_content = ''; if (get_option('af_jumpsearch_location') == 'top') $modified_content .= $cse; $modified_content .= $content; if (get_option('af_jumpsearch_location') == 'bottom') $modified_content .= $cse; return $modified_content; } } return $content; } /* End Affinitomics Commercial Code */ // CURL Request Function function curl_request($url,$postdata=false) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLINFO_HEADER_OUT, false); curl_setopt($ch, CURLOPT_VERBOSE, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); if ($postdata) { //urlify the data for the POST $fields_string .= rawurlencode("ctype") .'='.rawurlencode(AI_MOJO__TYPE).'&' . rawurlencode("cversion") .'='.rawurlencode(AI_MOJO__VERSION).'&'; foreach($postdata as $key=>$value) { $fields_string .= rawurlencode($key).'='.rawurlencode($value).'&'; } rtrim($fields_string, '&'); curl_setopt($ch,CURLOPT_POST, count($postdata)); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); } $response = curl_exec($ch); curl_close($ch); return $response; } function aimojo_html_header() { ?>

Getting Started!

In a few short minutes, your site will be able to Match, Rank, and Relate information in posts, pages, and custom post-types better than ever before. You'll experience "stickier" sites that convert better and faster, while providing rich and relevant links for SEO.

aimojo-crash-course from Prefrent on Vimeo.

Using ai•mojo™ to create Affinitomics™ within your system will give your pages, posts and custom post-types a "self awareness," instructing them of their context within your system. ai•mojo™ needs to know where you want it to connect into your system – which things you want to make smart. In the ai•mojo™ "settings" tab, start by selecting "post." You can select any other's you want later, but this is the best way to get started. Now when posts are saved in your system, the Affinitomic elements will be saved to the cloud, making your site smarter.

Now you're ready to make your first "Archetype." An Archetype is any post-type that has Affinitomic elements so that it can interact, contextually, with other parts of your site. Go to your posts menu and choose a post to edit or create a new one. In the Descriptor Field put some terms describing your post. In the Draw field, put terms that somehow relate to your post. These are like tags (you can even use your tags if you want). Distances tell the system what the post or page should be disassociated with. At the bottom of your post content, put [afview] (you can use the shortcode in widgets now too). This shortcode creates an Affinitomic "Smart Menu." You'll need other pages and posts to have descriptors and draws for [afview] to work. Be sure to save your post.

Make another Archetype, as in Step Two. In the Descriptor or draw field, be sure to repeat at least one of the Descriptors you created previously. Insert an [afview] shortcode, save the post, and preview it. Notice that an Affinitomics™’ "Smart Menu" was created where you inserted the [afview] shortcode, and that the previous article shows with a score of the matching terms. This is the most basic Affinitomic relationship, and it can already be used to replace both categories and tags.

ai•mojo™ Settings

ai•mojo™ Extensions

A growing library of ai•mojo™ extensions!

The extensions panel lets you use and configure optional features and tools that make ai•mojo™ even more powerful and easy to use. It also serves as a roadmap for future development. To learn more about individual extensions, click the "Extension Settings" link in each one.
Jump Search

Jump Search combines Google CSE and Affinitomics™ for incredibly contextual searches. Requires a free Google API key, can be configured in less than five minutes.

ai•mojo™ Documentation

Quick Documentation

The documentation found here is a basic guide. For more in-depth documentation please go to Support at Prefrent.com. For a printable "Cheat Sheet" go here.
Archetype Any page or post-type (any piece of information really) that contains one or more descriptors, draws, or distances such that the information can be intelligently compared to other archetypes.
Descriptor A descriptor is similar to a tag, but is used to describe whatever it is attached to. It's not uncommon for a page to have a descriptor of "web page." A page about cars might include the descriptors "page, cars, automobiles."
Draw A draw is also similar to a tag, but is used to record what the descriptors are related to, or co-occur with. A page about cars might include the draws "horsepower, nascar, racing, gear-head."
Distance These are the opposites of draws and indicate things that oppose the descriptors or draws attached to an archetype. A page about cars might include the distances "bicycle, boat, rain."
Smart List A list created with [afview] shortcode, displaying Affinitomic relationships sorted by contextual match.
The first thing you'll want to do, is make sure your "permalinks" are set how you want them. aimojo exports to the cloud with a URI based on your permalinks. If they change, your Affinitomic™ links will be broken. Resetting them currently requires registering a new account.
  • [afview] This tells Affinitomics™ to build a dynamic menu list. Without other parameters, it uses the Affinitomics™ of the page it resides on to create a menu list of the top related items in the cloud.
  • [afview display_title="false"] This was a result of a request to be able to hide the hard coded title.
  • [afview title="title"] Replaces the default title with whatever you want.
  • [afview category_filter="50"] or [afview category_filter="name"] This short code tells Affinitomics™ to build a menu list based on the Affinitomics™ of the page, but to restrict the list to a particular category.
  • [afview limi="7"] This short code tells Affinitomics™ to build a menu with a limit of 7 links. Default is ten.
You may want to use the posts list to create numerous Archetypes at once, or you may have imported the sample post Archetypes. In either case, you'll want to upload All your Affinitomics™ to the cloud. Simply go to the "Export" tab above, check "make it so" and click the export button. Bam! After a couple of seconds, all your Archetypes will be registered and ready to use.
The smart lists available via Affinitomics™ shortcodes can be styled to suit your site. Each element of [afview] has an available selector:
  • afview: this element is attached to the div that the list appears in
  • aftitle: this class targets the title
  • afelement: this class allows you to style the list items
  • afelementurl: this selector targets the link
  • afelementscore: this selector targets the number that appears after any given element - the score
  • The shortcode is on the page, but it doesn't show a smart list. Make sure that you have exported all your pages and posts to the Affinitomics™ cloud.
  • A warning at the top of the page indicates that you're over your limit. Register (it's free) and your limit will increase, if that's not enough you can always upgrade your account.
  • This spot will be a repository for featuered sample code from our friends and customers. Keep your eyes peeled.
  • You can find other sample code here.

ai•mojo™ CSS

This page will have a form that allows the user to control certain CSS and layout elements

ai•mojo™ Export