From 0911bafdcddddd2104e696e6fb44cd77247ade7b Mon Sep 17 00:00:00 2001 From: Greg Froese Date: Sun, 10 May 2009 23:36:42 +0000 Subject: adding in most viewed and recent images pages --- start.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'start.php') diff --git a/start.php b/start.php index 0d1b167d4..bbe665229 100644 --- a/start.php +++ b/start.php @@ -91,12 +91,14 @@ add_submenu_item( elgg_echo("album:yours"), $CONFIG->wwwroot . "pg/photos/owned/" . $_SESSION['user']->username, 'tidypics' ); - add_submenu_item( sprintf(elgg_echo("album:user"), $page_owner->name), - $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username, - 'tidypics' ); - add_submenu_item( sprintf(elgg_echo('album:friends'),$page_owner->name), - $CONFIG->wwwroot . "pg/photos/friends/". $page_owner->username, - 'tidypics'); + if($page_owner->name) { + add_submenu_item( sprintf(elgg_echo("album:user"), $page_owner->name), + $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username, + 'tidypics' ); + add_submenu_item( sprintf(elgg_echo('album:friends'),$page_owner->name), + $CONFIG->wwwroot . "pg/photos/friends/". $page_owner->username, + 'tidypics'); + } } else if ($page_owner->guid) { // non logged in user gets "page owners albums", "page owner's friends albums" add_submenu_item( sprintf(elgg_echo("album:user"), $page_owner->name), @@ -110,6 +112,11 @@ add_submenu_item( sprintf(elgg_echo('album:all'),$page_owner->name), $CONFIG->wwwroot . "pg/photos/world/", 'tidypics'); + add_submenu_item( "Most Viewed Images", + $CONFIG->wwwroot . 'pg/photos/mostviewed'); + + add_submenu_item( "Most Recent Images", + $CONFIG->wwwroot . 'pg/photos/mostrecent'); } } @@ -170,7 +177,21 @@ case "world": include($CONFIG->pluginspath . "tidypics/world.php"); break; + + case "rate": //rate image + if (isset($page[1])) set_input('guid',$page[1]); + include($CONFIG->pluginspath . "tidypics/actions/rate.php"); + break; + case "mostviewed": //view an image individually + if (isset($page[1])) set_input('guid',$page[1]); + include($CONFIG->pluginspath . "tidypics/mostviewedimages.php"); + break; + + case "mostrecent": //view an image individually + if (isset($page[1])) set_input('guid',$page[1]); + include($CONFIG->pluginspath . "tidypics/mostrecentimages.php"); + break; } } else @@ -255,5 +276,6 @@ register_action("tidypics/edit_multi", false, $CONFIG->pluginspath. "tidypics/actions/edit_multi.php"); register_action("tidypics/download", true, $CONFIG->pluginspath . "tidypics/actions/download.php"); register_action("tidypics/addtag", true, $CONFIG->pluginspath . "tidypics/actions/addtag.php"); + register_action("tidypics/rate", true, $CONFIG->pluginspath . "tidypics/actions/rate.php"); ?> \ No newline at end of file -- cgit v1.2.3