Changeset 1249 for branches/1.2/content/plugins
- Timestamp:
- 02/26/10 16:56:49 (3 years ago)
- Location:
- branches/1.2/content/plugins/hello_universe
- Files:
-
- 3 edited
-
hello_universe.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
templates/profile_example.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/content/plugins/hello_universe/hello_universe.php
r1247 r1249 3 3 * name: Hello Universe 4 4 * description: Demonstrates how to make plugins 5 * version: 0. 75 * version: 0.8 6 6 * folder: hello_universe 7 7 * class: HelloUniverse 8 * hooks: theme_index_top, theme_index_main, theme_index_sidebar, profile_navigation 8 * hooks: theme_index_top, theme_index_main, theme_index_sidebar, profile_navigation, breadcrumbs 9 9 * author: Nick Ramsay 10 10 * authorurl: http://hotarucms.org/member.php?1-Nick … … 46 46 $h->pageTitle = $h->lang["hello_universe"]; 47 47 } 48 49 if ($h->pageName == 'profile_example') 50 { 51 $user = $h->cage->get->testUsername('user'); 52 $h->pageTitle = "Profile Example" . "[delimiter]" . $user; 53 $h->pageType = 'user'; // this setting hides the posts filter bar 54 55 // create a user object and fill it with user info 56 $h->vars['user'] = new UserAuth(); 57 $h->vars['user']->getUserBasic($h, 0, $user); 58 } 48 59 } 49 60 … … 71 82 $user = $h->cage->get->testUsername('user'); 72 83 if ($user) { 73 // create a user object and fill it with user info 74 $h->vars['user'] = new UserAuth(); 75 $user_info = $h->vars['user']->getUserBasic($h, 0, $user); 76 if ($user_info) { 84 if ($h->vars['user']->id) { 77 85 // only show the page if the user exists: 78 $h->pageType = 'user';79 86 $h->displayTemplate('users_navigation', 'users'); // Displays user navigation from Users plugin 80 87 $h->displayTemplate('profile_example'); // Displays the page from this plugin folder … … 171 178 echo "<li><a href='" . $h->url(array('page'=>'profile_example', 'user'=>$h->vars['user']->name)) . "'>" . $h->lang['hello_universe_profile_example'] . "</a></li>\n"; 172 179 } 180 181 182 /** 183 * FUNCTION #7 184 * 185 * Breadcrumbs for the profile page 186 */ 187 public function breadcrumbs($h) 188 { 189 if ($h->pageName == 'profile_example') { 190 $user = $h->cage->get->testUsername('user'); 191 return "<a href='" . $h->url(array('user'=>$user)) . "'>" . $user . "</a> » Profile Example"; 192 } 193 } 173 194 174 195 } -
branches/1.2/content/plugins/hello_universe/readme.txt
r1247 r1249 13 13 Changelog 14 14 --------- 15 v.0.8 2010/02/26 - Nick - Fixes for profile page, title and breadcrumbs 15 16 v.0.7 2010/02/26 - Nick - Demonstration of adding a page to a user profile 16 17 v.0.6 2009/12/28 - Nick - Updates for compatibility with Hotaru 1.0 -
branches/1.2/content/plugins/hello_universe/templates/profile_example.php
r1247 r1249 33 33 <p>This is the profile_example.php file in the Hello Universe plugin folder.</p> 34 34 35 <p>The link to this page in the menu was done in Function #6 in hello_universe.php. This page is displayed from the <i>theme_index_main</i> function (Function #2).</p> 35 <p>The title was set and user info retrieved in the <i>theme_index_top</i> function (Function #1).</p> 36 <p>The page was displayed from the <i>theme_index_main</i> function (Function #2).</p> 37 <p>The link to this page in the menu was done in the <i>profile_navigation</i> function (Function #6).</p> 38 <p>The link to this page in the menu was done in the <i>breadcrumbs</i> function (Function #7).</p> 39 36 40 37 41 <p><a href="<?php echo BASEURL; ?>"><?php echo $h->lang["hello_universe_back_home"]; ?></a></p>
Note: See TracChangeset
for help on using the changeset viewer.