Changeset 201255
- Timestamp:
- 02/03/2010 02:47:10 AM (16 years ago)
- Location:
- lifestream/trunk
- Files:
-
- 2 edited
-
inc/core.php (modified) (4 diffs)
-
templates/home.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lifestream/trunk/inc/core.php
r199288 r201255 528 528 'links_new_windows' => '0', 529 529 'truncate_interval' => '0', 530 'page_id' => '', 530 531 ); 531 532 … … 685 686 function is_lifestream_home() 686 687 { 687 global $wp_query ;688 689 return ( @$_GET['cp'] == 'lifestream');688 global $wp_query, $post; 689 690 return (is_page() && $post->ID == $this->get_option('page_id')); 690 691 } 691 692 … … 1669 1670 function install($allow_database_install=true) 1670 1671 { 1672 global $wpdb, $userdata; 1673 1671 1674 $version = (string)$this->get_option('_version', 0); 1672 1675 … … 1702 1705 $this->add_option('theme_dir', WP_CONTENT_DIR.'/wp-lifestream/themes/'); 1703 1706 $this->add_option('icon_dir', WP_CONTENT_DIR.'/wp-lifestream/icons/'); 1707 1708 if (!$this->get_option('page_id')) 1709 { 1710 get_currentuserinfo(); 1711 1712 // First let's see if they have a legacy page: 1713 1714 $results = $wpdb->get_results($wpdb->prepare("SELECT `ID` FROM `".$wpdb->prefix."posts` WHERE `post_type` = 'page' AND `post_content` LIKE '%%[lifestream]%%' AND `post_author` = %d AND `post_status` != 'trash' LIMIT 2", $userdata->ID)); 1715 if (count($results) == 2) 1716 { 1717 // Now we're in trouble 1718 } 1719 elseif (count($results) == 1) 1720 { 1721 $this->update_option('page_id', $results[0]->ID); 1722 } 1723 else 1724 { 1725 1726 $post = array( 1727 'post_title' => 'Lifestream', 1728 'post_content' => 'This is just a placeholder for your Lifestream. You may modify the title, categories, and anything else, but the page\'s content has no effect on your Lifestream.', 1729 'post_status' => 'publish', 1730 'post_author' => $userdata->ID, 1731 'post_type' => 'page', 1732 // should we insert the feed types into the tags? 1733 // 'tags_input' => '' 1734 ); 1735 $post_id = wp_insert_post($post); 1736 $this->update_option('page_id', $post_id); 1737 } 1738 } 1704 1739 1705 1740 if (version_compare($version, LIFESTREAM_VERSION, '=')) return; -
lifestream/trunk/templates/home.php
r200909 r201255 5 5 6 6 <h2><?php $lifestream->_e('Lifestream'); ?></h2> 7 7 <?php 8 /* TODO this should be the page text 9 <div class="entry"> 10 <p>This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.</p> 11 </div> 12 */ 13 ?> 14 15 8 16 <div class="navigation"> 9 17 <div class="alignleft"><?php ls_prev_page('« %link') ?></div>
Note: See TracChangeset
for help on using the changeset viewer.