Tag: Code

Creating A Header Centred Between A Menu And A Widget

Shown above is the header I created within the Beans theme for the website of Tees Valley Arts.

The goal here was to mimic the old layout created for the Tees Valley Arts website using the Genesis theme using the Beans theme instead.

This required a widget area to the right of the site title for the use of the plugin “Simple social icons” (although I may later make an improved version that doesn’t require the plugin at all).

Functions

The code for setting everything to it’s proper place:


add_action( 'widgets_init', 'widget_areas' );
/**
 * Add widget area.
 */
function widget_areas() {

    beans_register_widget_area( array(
        'name' => 'Right',
        'id' => 'right',
		'description' => 'Widgets in this area will be shown on the right side
 of the site title (put simple social icons here).',
        'beans_type' => 'grid'
    ) );
}




/**
 * Display the header widget area at the end of the header.
 */
add_action( 'beans_site_branding_after_markup', 'header_widget_area' );
/**
 * Header widget area layout/style.
 */
function header_widget_area() {

 ?>
<?php echo beans_widget_area( 'right' ); ?>
<?php

}


/**
 * Moves Beans "Primary Menu" to the left side of the site title.
 */
beans_modify_action_hook( 'beans_primary_menu', 'beans_header_prepend_markup' );


Style

The code for centring the site title between a stylised menu and a set of spaced out social icons:

/**
 * Sets up the layout of the header
 */

//social media icons
body > div.tm-site > header > div > div.uk-grid > div > div > div > ul.alignright {
	margin-left:0px;
	margin-right:0px;
	padding-left:0px;
}

body > div.tm-site > header > div > div.uk-grid > div > div > div > ul.alignright li { 
	display: inline;
	float:right;
	width:25px;
	height:25px;
	
	padding-left:30px!important;
} 


body > div.tm-site > header > div > div.uk-grid > div > div > div > ul.alignright li a svg { 
	width:25px;
	height:25px;
} 

//site title
body > div.tm-site > header > div > div.tm-site-branding {
	display: inline;
}

body > div.tm-site > header.tm-header .uk-grid {
	margin-left:0px;
	margin-right:0px;
	padding-left:0px;
	padding-right:0px;
	
	float:right;
}

body > div.tm-site > header.tm-header .uk-grid .uk-width-medium-1-1 {
	width:232.188px;
	margin-left:0px;
	margin-right:0px;
	padding-left:0px;
	padding-right:0px;
}

//primary menu
body > div.tm-site > header.tm-header .tm-primary-menu {
	margin-right:0px;
	margin-left:0px;
	
	float:left;
}


body > div.tm-site > header.tm-header .uk-container-center {
	padding-left:0px;
	padding-right:0px;
	
	margin-left:0px;
	margin-right:0px;
	
	max-width:100%;
}

body > div.tm-site > header.tm-header {
	margin-left:0px;
	margin-right:0px;
	
	text-align:center;
	
	padding-left:8%;
	padding-right:8%;
}

Widget

Then simply place the simple social icons plugin within the widget area.

Bear in mind that the plugins style settings will not function outside of a post/page but the style handles that.

Of course this solution doesn’t look good on mobile yet, so I’ll probably do another post on that when I’ve fixed it.

Filed under: WordPressTagged with: , ,

Finding And Focusing On Player

When displaying a portion of the map upon the combat screen I had to ensure that the player was displayed on screen at all times.

Finding The Player

In order to find the player within the map I created the “checkTileForPlayer” method which checks if a single integer is one of the various numbers that represent the player.

/**
     * A method that checks for any numbers that represent player-occupied versions of tiles
     * (such as "blank_with_player" and "door_with_player").
     * @param tile The number to be checked.
     * @return A boolean indicating if the tile contains the player character.
     */
    public Boolean checkTileForPlayer(int tile) {
        boolean playerFound = false;
        if(tile == 7 || tile == 104 || tile == 108 || tile == 112 || tile == 116 || tile == 126) {
            playerFound = true;
        }


        return playerFound;
    }

However this still left the issue of going through the unusual layout of my integer array maps.

I solved this issue with the creation of my most ramshackle and unwieldy method “findPlayer”.

This determines the “Column Number”, “Column Depth”, “Row”, “Item Number” and overall “Position” of the players current location.

/**
     * Locates the player within the map and provides their precise coordinates.
     * @return columnAndDepthAndRowAndItemAndPosition An array containing the Column Number,
     * Column Depth, Row, Item Number and overall Position of the players current location.
     */
    public int[] findPlayer() {
        /**
         * An array containing the column number and column depth to be returned.
         *
         * Now also includes which row contains the player along with the exact Item number
         * of the player to pinpoint their exact position with precision.
         */
        int[] columnAndDepthAndRowAndItemAndPosition = {0, 0, 0, 0, 0};

        //int a = 0;
        //^ REPLACED WITH columnAndDepthAndRowAndItemAndPosition[4] !!!!
        int currentRow = 0;

        int columnDepth = 0;
        while (columnAndDepthAndRowAndItemAndPosition[4] < map.length) {
            int currentColumn = 0;
            /**
             * Number Of Columns Loop
             * loops whatever the single column loop would have done several times depending on how many columns there are
             */
            for (int column = 0; column < numberOfColumns; column++) {
                /**
                 * Single Column Loop
                 * loop: goes through all 11 lines/rows of a single column in the map
                 *
                 * Line: the line being looked at in the column (11 each column)
                 */
                for (int line = 0; line < mapHeight; line++) {
                    currentColumn++;
                    /**
                     * Single Line Loop
                     * loop: goes through a line in the map
                     *
                     * itemNum: the item being looked at in the line (17 each line).
                     */
                    for (int itemNum = 0; itemNum < mapWidth; itemNum++) {
                        /**
                         * If reached the end of the current row (across all columns) increase currentRow by 1.
                         *
                         * if(a % 51 == 0)
                         * maybe replace 51 with ((mapWidth * numberOfColumns) - 1)?
                         * maybe replace 51 with (mapWidth * numberOfColumns)?
                         */
                        if (columnAndDepthAndRowAndItemAndPosition[4] % (mapWidth * numberOfColumns) == 0) {
                            /**
                             * if this is the last row in a column then depth increases by 1.
                             */
                            if (currentRow % mapHeight == 0) {
                                columnDepth++;
                            }
                            currentRow++;
                        }
                        /**
                         * PLAYER FOUND!
                         *
                         * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                         * current version checks for player by seeing if a is "7" as that is the number that represents "blank_with_player"
                         * Future versions should have a "checkTileForPlayer(int tile)" method that checks for any numbers that represent player-occupied versions of tiles (such as "blank_with_player" and "door_with_player")
                         * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                         */
                        if (checkTileForPlayer(map[columnAndDepthAndRowAndItemAndPosition[4]])) {
                            columnAndDepthAndRowAndItemAndPosition[0] = currentColumn;
                            columnAndDepthAndRowAndItemAndPosition[1] = columnDepth;
                            /**
                             * USE "CURRENTROW" AND "ITEMNUM" TO FIND PLAYER BEFORE AND AFTER MOVING THEN
                             *
                             * MAKE FINDPLAYER() RETURN "CURRENTROW" AND "ITEMNUM" ASWELL!
                             *
                             *
                             */
                            columnAndDepthAndRowAndItemAndPosition[2] = currentRow;
                            columnAndDepthAndRowAndItemAndPosition[3] = itemNum;
                            //System.out.println("Row: " + (currentRow));
                            //System.out.println("Item: " + (itemNum));
                            System.out.println("LOCATION: " + (columnAndDepthAndRowAndItemAndPosition[4]));
                            /**
                             * If I put return here does it skip the rest of the loop?
                             */
                            return columnAndDepthAndRowAndItemAndPosition;
                        }
                        columnAndDepthAndRowAndItemAndPosition[4]++;
                    }
                    if (currentColumn == numberOfColumns) {
                        currentColumn = 0;
                    }
                }
            }
        }
        return columnAndDepthAndRowAndItemAndPosition;
    }

Although this method likely returns more information than is needed it performs it’s intended purpose.

A section of the map integer array highlighting the number representing the player standing on stone.

Focusing On The Player

The “setupMap” method does the lions share of the work in actually going through the map and finding numbers representing images to assign to tiles on the combat screen.

As the map is split into nine sections, each big enough to fill the combat screen, the method only displays whichever section currently contains the player.

/**
     * Peruses a section of the map for numbers representing images to assign to tiles.
     * @param targetColumn The column number of the target section of the map.
     * @param targetColumnDepth The column depth (as im using the word "row" for something else) of
     *                          the target section of the map.
     */
    public void setupMap(int targetColumn, int targetColumnDepth) {

        /**
         * The map item currently being looked at.
         */
        int a = 0;
        /**
         * The row currently being looked at.
         */
        int currentRow = 0;
        /**
         * The column depth currently being looked at.
         */
        int columnDepth = 0;
        /**
         * Tile currently being set/worked-on.
         */
        int currentTile = 0;
        System.out.println("LENGTH: " + map.length);
        while (a < map.length) {
            int currentColumn = 0;
            /**
             * Number Of Columns Loop
             * loops whatever the single column loop would have done several times depending on how many columns there are
             */
            for (int column = 0; column < numberOfColumns; column++) {
                /**
                 * Single Column Loop
                 * loop: goes through all 11 lines/rows of a single column in the map
                 *
                 * Line: the line being looked at in the column (11 each column)
                 */
                for (int line = 0; line < mapHeight; line++) {
                    currentColumn++;
                    /**
                     * The entire row in the form of a string (USED FOR TESTING).
                     */
                    //String row = "";
                    /**
                     * Single Line Loop
                     * loop: goes through a line in the map
                     *
                     * itemNum: the item being looked at in the line (17 each line).
                     */
                    for (int itemNum = 0; itemNum < mapWidth; itemNum++) {

                        // if (row == "") {
                        //      row = row + map[a];
                        //  } else {
                        //       row = row + ", " + map[a];
                        //    }
                        /**
                         * If reached the end of the current row (across all columns) increase currentRow by 1.
                         *
                         * if(a % 51 == 0)
                         * maybe replace 51 with ((mapWidth * numberOfColumns) - 1)?
                         * maybe replace 51 with (mapWidth * numberOfColumns)?
                         */
                        if (a % (mapWidth * numberOfColumns) == 0) {
                            /**
                             * if this is the last row in a column then depth increases by 1.
                             */
                            if (currentRow % mapHeight == 0) {
                                columnDepth++;
                            }
                            currentRow++;
                        }
                        /**
                         * what is needed to set parameters of where on the map to load?
                         * targetColumn:
                         * targetColumnDepth:
                         */
                        if (currentColumn == targetColumn && columnDepth == targetColumnDepth) {
                            String i = ("i" + currentTile);
                            //System.out.println(i + " ----------------- Tile: " + currentTile + "      map: " + a);
                            /**
                             * set tile
                             */
                            setTile(a, tiles[currentTile]);
                            //tiles[currentTile].setImageResource(R.drawable.blank);
                            currentTile++;
                        }
                        //System.out.println("Column: " + (currentColumn));
                        //System.out.println("Column Depth: " + (columnDepth));

                        /**
                         * USE "CURRENTROW" AND "ITEMNUM" TO FIND PLAYER BEFORE AND AFTER MOVING THEN
                         *
                         * MAKE FINDPLAYER() RETURN "CURRENTROW" AND "ITEMNUM" ASWELL!
                         *
                         *
                         */
                        //System.out.println("Row: " + (currentRow));
                        //System.out.println("Item: " + (itemNum));
                        a++;
                    }
                    //System.out.println("Line: " + (line + 1));
                    //System.out.println(row);
                    if (currentColumn == numberOfColumns) {
                        currentColumn = 0;
                    }
                }
            }
        }
    }

Assigning of appropriate images to tiles on the combat screen is done using the “setTile” method.

/**
     * Sets the image displayed by the ImageView to the appropriate tile for the number provided.
     * @param tileNum The number taken from the map which represents a specific type of tile.
     * @param tile The ImageView used to display a tile upon the combat screen.
     */
    public void setTile(int tileNum, ImageView tile) {
        switch (map[tileNum]) {
            case 101: //Stone Wall Up
                tile.setImageResource(R.drawable.stone_wall_up);
                break;
            case 102: //Stone Wall Up Door
                tile.setImageResource(R.drawable.stone_wall_up_door);
                break;
            case 103: //Stone Wall Up Door Open
                tile.setImageResource(R.drawable.stone_wall_up_door_open);
                break;
            case 104: //Stone Wall Up Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_up_door_open_with_player);
                break;

            case 105: //Stone Wall Left
                tile.setImageResource(R.drawable.stone_wall_left);
                break;
            case 106: //Stone Wall Left Door
                tile.setImageResource(R.drawable.stone_wall_left_door);
                break;
            case 107: //Stone Wall Left Door Open
                tile.setImageResource(R.drawable.stone_wall_left_door_open);
                break;
            case 108: //Stone Wall Left Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_left_door_open_with_player);
                break;

            case 109: //Stone Wall Right
                tile.setImageResource(R.drawable.stone_wall_right);
                break;
            case 110: //Stone Wall Right Door
                tile.setImageResource(R.drawable.stone_wall_right_door);
                break;
            case 111: //Stone Wall Right Door Open
                tile.setImageResource(R.drawable.stone_wall_right_door_open);
                break;
            case 112: //Stone Wall Right Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_right_door_open_with_player);
                break;

            case 113: //Stone Wall Down
                tile.setImageResource(R.drawable.stone_wall_down);
                break;
            case 114: //Stone Wall Down Door
                tile.setImageResource(R.drawable.stone_wall_down_door);
                break;
            case 115: //Stone Wall Down Door Open
                tile.setImageResource(R.drawable.stone_wall_down_door_open);
                break;
            case 116: //Stone Wall Down Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_down_door_open_with_player);
                break;

            case 117: //Stone Wall Up Left Corner
                tile.setImageResource(R.drawable.stone_wall_up_left_corner);
                break;
            case 118: //Stone Wall Up Right Corner
                tile.setImageResource(R.drawable.stone_wall_up_right_corner);
                break;
            case 119: //Stone Wall Down Left Corner
                tile.setImageResource(R.drawable.stone_wall_down_left_corner);
                break;
            case 120: //Stone Wall Down Right Corner
                tile.setImageResource(R.drawable.stone_wall_down_right_corner);
                break;


            case 121: //Stone Wall Up Left Square
                tile.setImageResource(R.drawable.stone_wall_up_left_square);
                break;
            case 122: //Stone Wall Up Right Square
                tile.setImageResource(R.drawable.stone_wall_up_right_square);
                break;
            case 123: //Stone Wall Down Left Square
                tile.setImageResource(R.drawable.stone_wall_down_left_square);
                break;
            case 124: //Stone Wall Down Right Square
                tile.setImageResource(R.drawable.stone_wall_down_right_square);
                break;

            case 125: //Stone
                tile.setImageResource(R.drawable.stone);
                break;

            case 126: //Stone With Player
                tile.setImageResource(R.drawable.stone_with_player);
                break;

            case 127: //Stone With Poison Gas
                tile.setImageResource(R.drawable.stone_with_poison_gas);
                break;


            case 128: //Stone Wall Up Left Corner
                tile.setImageResource(R.drawable.stone_wall_up_left_corner_with_poison_gas);
                break;
            case 129: //Stone Wall Up Right Corner
                tile.setImageResource(R.drawable.stone_wall_up_right_corner_with_poison_gas);
                break;
            case 130: //Stone Wall Down Left Corner
                tile.setImageResource(R.drawable.stone_wall_down_left_corner_with_poison_gas);
                break;
            case 131: //Stone Wall Down Right Corner
                tile.setImageResource(R.drawable.stone_wall_down_right_corner_with_poison_gas);
                break;


            case 132: //Stone Wall Up Left Square
                tile.setImageResource(R.drawable.stone_wall_up_left_square_with_poison_gas);
                break;
            case 133: //Stone Wall Up Right Square
                tile.setImageResource(R.drawable.stone_wall_up_right_square_with_poison_gas);
                break;
            case 134: //Stone Wall Down Left Square
                tile.setImageResource(R.drawable.stone_wall_down_left_square_with_poison_gas);
                break;
            case 135: //Stone Wall Down Right Square
                tile.setImageResource(R.drawable.stone_wall_down_right_square_with_poison_gas);
                break;

            case 136: //Stone Wall Down
                tile.setImageResource(R.drawable.stone_wall_up_with_poison_gas);
                break;

            case 137: //Stone Wall Down
                tile.setImageResource(R.drawable.stone_wall_left_with_poison_gas);
                break;

            case 138: //Stone Wall Down
                tile.setImageResource(R.drawable.stone_wall_right_with_poison_gas);
                break;

            case 139: //Stone Wall Down
                tile.setImageResource(R.drawable.stone_wall_down_with_poison_gas);
                break;


            case 140: //Stone Wall Up Door
                tile.setImageResource(R.drawable.stone_wall_up_door_with_poison_gas);
                break;
            case 141: //Stone Wall Up Door Open
                tile.setImageResource(R.drawable.stone_wall_up_door_open_with_poison_gas);
                break;
            case 142: //Stone Wall Left Door
                tile.setImageResource(R.drawable.stone_wall_left_door_with_poison_gas);
                break;
            case 143: //Stone Wall Left Door Open
                tile.setImageResource(R.drawable.stone_wall_left_door_open_with_poison_gas);
                break;
            case 144: //Stone Wall Right Door
                tile.setImageResource(R.drawable.stone_wall_right_door_with_poison_gas);
                break;
            case 145: //Stone Wall Right Door Open
                tile.setImageResource(R.drawable.stone_wall_right_door_open_with_poison_gas);
                break;
            case 146: //Stone Wall Down Door
                tile.setImageResource(R.drawable.stone_wall_down_door_with_poison_gas);
                break;
            case 147: //Stone Wall Down Door Open
                tile.setImageResource(R.drawable.stone_wall_down_door_open_with_poison_gas);
                break;

            case 148: //Stone With Player
                tile.setImageResource(R.drawable.stone_with_player_with_poison_gas);
                break;
            case 149: //Stone Wall Up Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_up_door_open_with_player_with_poison_gas);
                break;
            case 150: //Stone Wall Left Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_left_door_open_with_player_with_poison_gas);
                break;
            case 151: //Stone Wall Right Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_right_door_open_with_player_with_poison_gas);
                break;
            case 152: //Stone Wall Down Door Open With Player
                tile.setImageResource(R.drawable.stone_wall_down_door_open_with_player_with_poison_gas);
                break;


            case 153: //Stone With Acid
                tile.setImageResource(R.drawable.stone_with_acid);
                break;
        }
    }

Filed under: AndroidTagged with: , ,

Map Storage

The first challenge I encountered when creating a tile-based mobile game was deciding how I would store the various maps upon which various combat scenarios would take place.

What I eventually settled on was an array of integers with each number representing a different type of tile, these arrays were arranged in such a way that the integers were displayed within the xml file in the same layout as the actual map.

This may not have been the best choice for storing the map info but I implemented it anyway as I enjoyed the ease with which I could edit the maps.

A (very small) look at how the map integer arrays are laid out within my code.

3 x 3

As you may have noticed above the integer array has been laid out into three columns of three rows, each of these sections represent enough tiles to fill the combat screen of my app.

When I first tested the combat screen of my app I only created a map big enough to fill the screen before deciding that each map should contain nine such areas in order to give the player the illusion of a bigger world.

The middle section of the map integer array shown above.

I accomplished this by simply making the integer array nine times longer, although looking back I realise it may or may not have been simpler to just have nine separate arrays.

These new larger maps however brought with them a new problem: if the player can move around in an area larger than the screen, how should I go about ensuring that the player is always on the screen?

The middle section of the map integer array shown above when displayed.
Filed under: AndroidTagged with: , ,

If It Breathes It Dies

A compilation of embedded posts containing information on my app “If It Breathes It Dies” (documenting various points in the creation process). I’m mostly posting this so I’ll have access to all this work anywhere I go. But maybe this will be of use to someone in the future.

Filed under: AndroidTagged with: , , ,

Getting Data From Google Sheet

Shown here is my Shortcode which aquires the value of a single cell of Google Sheet Data: 

/**
 * Aquiring google sheet data (David Stockdale)
 * Shortcode should be something like this: [get_sheet_value location="'Summary Page'!C3"]
 */
function sheet_value_shortcode($atts) {
    $API = 'XXX_XXX';
    $google_spreadsheet_ID = 'XXX-XXX-XXX';
    $api_key = esc_attr( $API);

    $location = $atts['location'];
    $get_cell = new WP_Http();
    $cell_url = "https://sheets.googleapis.com/v4/spreadsheets/$google_spreadsheet_ID/values/$location?&key=$api_key";	
    $cell_response = $get_cell -> get( $cell_url);
    $json_body = json_decode($cell_response['body'],true);	
    $cell_value = $json_body['values'][0][0];
    return $cell_value;
}
add_shortcode('get_sheet_value', 'sheet_value_shortcode');

To get the API Key goto the “Google Developers Console” and create a key in the “Credentials” section.

To get the SpreadSheet ID simply look in the “Sharable Link” (broken down here):

https://docs.google.com/spreadsheets/d/spreadsheetId/edit#gid=sheetId

Shortcode:

[get_sheet_value location="'Summary Page'!C3"]

Filed under: WordPressTagged with: , ,

Embed Customisation Supporting “Co-Authors Plus”: Final Solution

So a while ago while doing some volunteer work I fiddled around with making the website adding support for “Co-Authors Plus” in embedded posts as outlined in Embed Customisation Supporting “Co-Authors Plus”.

 I found that my solutions all looked rather messy.

I presented those initial attempts to my boss and after making a few changes based on his feedback this is what we eventually settled on.

/**
 * Removes the title (David Stockdale).
 */
add_filter('embed_site_title_html','__return_false');
/**
 * Adds the author's names (David Stockdale).
 */
add_action( 'embed_content', 'embed_author' );
/**
 * Adds the author div to the embed iframe (David Stockdale).
 */
function embed_author() {
	$output .= '<div class="wp-embed-author">By:';
	$coauthors = get_coauthors();
	$loopcheck = 0;
	foreach( $coauthors as $coauthor ): 
		/**
		 * Checking if it's the first line to decide if it should be seperated with a comma.
		 */
		if($loopcheck == 0) {
			$loopcheck++;
		} else {
			$output .= ',';
		}
		$output .= ' ';
		$authorArchiveLink = get_author_posts_url($coauthor->ID);
		$output .=  "<a href=$authorArchiveLink> $coauthor->user_firstname $coauthor->user_lastname</a>";
	endforeach;
	$output .= '.';
	$output .= '</div>';
    echo $output;
}

By removing the author portraits I was able to create a cleaner looking list.

I then styled it to fit the websites theme of links in a specific colour.

/**
 * Customises the style/colours of embedded posts.
 */
add_action( 'embed_head', 'embed_styles' );
/**
 * Embed the plugin's custom styles.
 */
function embed_styles() {
    echo <<<CSS
<style>
	.wp-embed-author {
		margin-top: 0.5em;
	}
	.wp-embed-author a {
		color: #a6191a;
	}
	.wp-embed-author a:hover {
		color: #454545;
	}
</style>
CSS;
}

All in all a much neater look that is far more consistant with the website as a whole.

Filed under: WordPressTagged with: , ,

Adding “Excerpt” To Pages

Another day of volunteer work, another nugget of knowledge learned.

To enable post-like excerpts on your website go into the functions.php file of your theme (in theme editor) or a site-specific plugin (in plugin editor).

Add the following code at the end:

add_post_type_support( 'page', 'excerpt' );

This code modifies the default WordPress content type ‘page’ to add support for excerpts.

Filed under: WordPressTagged with: , ,

David Scroller Plugin

The final stage in making it as easy as possible to display a number contained by a cell within a Google Spreadsheet as a scrolling number: making a plugin.

This is only Version 1.0.0 of the plugin and it is definitely not documented properly (I used both WordPress-Plugin-Boilerplate as a starting point and it includes NumScroller as part of the plugin so I need to find the correct way to comment/document/credit these to meet industry standards) but it works!

All you need to do is update your API Keys and Spreadsheet IDs:

/**
 * Stores/updates the array of Api Keys within the options database table.
 */
update_option( 'api_key_array', array(1 => "XXX_XXX"), true );
/**
 * Stores/updates the array of SpreadSheet IDs within the options database table.
 */
update_option( 'spreadsheet_id_array', array(1 => "XXX-XXX-XXX",
											 2 =>"XXX-XXX"), true );

Plop down some shortcode:

[david_scroller location="'Summary Page'!L6" api_key=1 spreadsheet_id=2 delay=1 increment=100]

And Voila:

0
Filed under: WordPressTagged with: , , , , ,