WordPress.org

Ready to get started?Download WordPress

Forums

Tracking your block with Monpage (3 posts)

  1. ngungo
    Member
    Posted 6 years ago #

    In few minutes, now you can elegantly sport a graph of you blog's responsiveness as two sample sites here:
    voxclandestina and nam's website

    1. Register a free account with http://monpage.com
    2. In Header file include:

    <script src="http://static.simile.mit.edu/timeplot/api/1.0/timeplot-api.js" type="text/javascript"></script>
    <script>
     // REQUIRED variables
     var mp_account = "monpage"; // User name or monpage login
     var mp_service = "twitter"; // The short name you chose for a particular domain
     var mp_container = "monpage"; // id of DIV to hold the graph
     // OPTIONAL variables
     var mp_refresh = 5; // Minutes to wait
     var mp_hours = 4;  //Hours to show
     var mp_style = {
      // General Settings
      show_values : true,	// Show the onmouseover value scroller
      plot_style : "bar", // Choices: "bar", "filled-line", "line"
      grid_color : "#000", // Color for the grid and grid labels
    
      // For bar and filled-line graph gradients
      high_color : "red", //Gradient color for values greater than 50%
      mid_color : "red", //Gradient color for values approaching 50%
      low_color : "black" //Gradient color for values less than 50%
     };
    </script>
    <script src="http://monpage.com/tracker/graph.js" type="text/javascript"></script>

    3. In Sidebar file, include:

    <li>
     <div id="monpage"
      style="height:55px;
       background-color:white;
       color:black;
       cursor:e-resize;
       font-family:trebuchet MS;">
     </div>
     Responsiveness in seconds<br />
     courtesy of <a href="http://monpage.com">monpage.com</a>
     <!-- You don't have to do this, but I appreciate that you'd do (: -->
    </li>

    That is it!

  2. beansbbq
    Member
    Posted 6 years ago #

    If there is anyone out there like me, you try to spend as little time hacking php code as possible.

    One of the lead developers created a plugin which contains most of this code. It was much easier for me to get this working. Here it is in the wild.

    Get the plugin here here.

  3. beansbbq
    Member
    Posted 6 years ago #

    You can try the plugin as is to test it with your theme. Be sure to change the account and service variables if you're going to use the plugin to track your own url. See code below. 'monpage' becomes your account name that you created when you signed up. 'twitter' becomes the portfolio name of the url that you want to track. You created the portfolio name when you set up the url within monpage.

    // This function prints the script and style tags
    function widget_monpage_header() {
    	$options = get_option('widget_monpage');
    	$account = empty($options['account']) ? 'monpage' : $options['account'];
    	$service = empty($options['service']) ? 'twitter' : $options['service'];

Topic Closed

This topic has been closed to new replies.

About this Topic