diff --git a/customindex/videoThumbPromo.jpg b/customindex/videoThumbPromo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8b292ef035b95e59244e210f01a2047d8b7d49dd Binary files /dev/null and b/customindex/videoThumbPromo.jpg differ diff --git a/plugins/browse/index.php b/plugins/browse/index.php new file mode 100755 index 0000000000000000000000000000000000000000..2fb1e020311ad152c75076718c5da967923b2960 --- /dev/null +++ b/plugins/browse/index.php @@ -0,0 +1,307 @@ +<?php + + global $CONFIG; + // Get the Elgg framework + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + gatekeeper(); + + $context = get_context(); + + $title = elgg_view_title(elgg_echo('memberlist')); + + set_context('search'); + + $photofilter = get_input('photofilter'); + $sorted = get_input('sortresult'); + + + if (!$sorted) + $sorted = 1; + + + + + +if($sorted ==1){ //recently updated + + if($photofilter==1){ //if Applied both condition + + $allusers = get_data("select a.guid from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b where a.guid =b.guid and b.enabled = 'yes' order by b.time_updated DESC"); + + foreach($allusers as $userall) { + + $guid = $userall->guid; + $entity = get_entity($guid); + $one = get_entity_icon_url($entity,$size ='medium'); + + if (preg_match("/defaultmedium/",$one)) { + + } else { + $result .= elgg_view_entity($entity,$fullview); + $countentity[] = $entity; + + } + } + + $count = sizeof($countentity); + $offset =0; + $limit =10; + + $nav = elgg_view('navigation/pagination',array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); + + } + + + + + else{ + + function list_entities_sorted($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true,$order_by) { + + $offset = (int) get_input('offset'); + $count = get_entities($type, $subtype, $owner_guid,$order_by, $limit, $offset, true); + $entities = get_entities($type, $subtype, $owner_guid, $order_by, $limit, $offset); + + return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $navigation); + + } + //time_updated + $order_by ="time_updated DESC"; + $result = list_entities_sorted('user', $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true,$order_by); + + + + } + +} + + +if($sorted ==2){ //Last Login + + $totalCount= get_data("select a.guid from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b where a.guid =b.guid and b.enabled = 'yes' order by a.last_login DESC"); + //exit; + $offset=get_input('offset'); + if(empty($offset)) + $offset = 0; + $root = $CONFIG->wwwroot; + $limit =10; + $end = $limit; + + $allusers = get_data("select a.guid from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b where a.guid =b.guid and b.enabled = 'yes' order by a.last_login DESC limit $offset,$end"); + + $count = sizeof($totalCount); + + + + + if($photofilter==1){ //if Applied both condition + $allusers = get_data("select a.guid from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b where a.guid =b.guid and b.enabled = 'yes' order by a.last_login DESC"); + + foreach($allusers as $userall) { + + $guid = $userall->guid; + //$countentity[] = get_entity($guid); + $entity = get_entity($guid); + $one = get_entity_icon_url($entity,$size ='medium'); + // echo $one;echo "<br>"; + if (preg_match("/defaultmedium/",$one)) { + + } else { + $result .= elgg_view_entity($entity,$fullview); + $countentity[] = $entity; + + } + } + + $count = sizeof($countentity); + $offset =0; + $limit =10; + + $nav = elgg_view('navigation/pagination',array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); + + } + + + + else{ //only first condition */ + + $baseurl= $root.'pg/browse'.'?sortresult='.$sorted; + + $nav = elgg_view('navigation/pagination',array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); + + + foreach($allusers as $userall) { + + $guid = $userall->guid; + + $entity = get_entity($guid); + $result .= elgg_view_entity($entity,$fullview); + } + + } + +} + + +if($sorted ==3){ + + if($photofilter==1){ //if Applied both condition + + $offset=get_input('offset'); + if(empty($offset)) + $offset = 0; + $one = $CONFIG->wwwroot; + $limit =10; + $end = $limit; + + + $allusers = get_data("select a.guid from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b where a.guid =b.guid and b.enabled = 'yes' order by b.time_created DESC "); + + + + foreach($allusers as $userall) { + + $guid = $userall->guid; + + $entity = get_entity($guid); + $one = get_entity_icon_url($entity,$size ='medium'); + + if (preg_match("/defaultmedium/",$one)) { + + } else { + $result .= elgg_view_entity($entity,$fullview); + $countentity[] = $entity; + + } + } + + + $count = sizeof($countentity); + $root = $CONFIG->wwwroot; + + $baseurl= $root.'pg/browse'.'?sortresult='.$sorted.'&photofilter='.$photofilter; + + $nav = elgg_view('navigation/pagination',array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); + + + + } + else{ + + + $totalCount= get_data("select a.guid from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b + where a.guid =b.guid and b.enabled = 'yes' order by b.time_created DESC"); + + + + + $offset=get_input('offset'); + if(empty($offset)) + $offset = 0; + $one = $CONFIG->wwwroot; + $limit =10; + $end = $limit; + + $allusers = get_data("select a.guid from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b + where a.guid =b.guid and b.enabled = 'yes' order by b.time_created DESC limit $offset,$end"); + + $count = sizeof($totalCount); + + + + +foreach($allusers as $userall) { + + $guid = $userall->guid; + $entity = get_entity($guid); + $result .= elgg_view_entity($entity,$fullview); + } + + + + $baseurl= $one.'pg/browse'.'?sortresult='.$sorted; + + $nav = elgg_view('navigation/pagination',array( + 'baseurl' => $baseurl, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); + + + } +} + + + + $area1 .= "<FORM action=\" \" method=\"post\">"; + $area1 .= "<br><br><div style=\"color:;background-color:;\" ><h5>".elgg_echo("browse:bowseuser")."</h5>"; + $area1 .= " <table cellpadding=\"0\" cellspacing=\"0\"> + <tr> + <td>".elgg_echo("browse:sortresult")."</td> + <td class=\"browseCheckboxCopy\"> <select name=\"sortresult\" id=\"sortresult\">"; + + if($sorted == 1){ + $area1 .= "<option value=\"1\" SELECTED >".elgg_echo("browse:recently")."</option>"; + }else{ + $area1 .= "<option value=\"1\">".elgg_echo("browse:recently")."</option>"; + } + + if($sorted == 2){ + $area1 .="<option value=\"2\" SELECTED >".elgg_echo("browse:lastlogin")."</option>"; + }else{ + $area1 .= "<option value=\"2\">".elgg_echo("browse:lastlogin")."</option>"; + } + if($sorted == 3){ + $area1 .= "<option value=\"3\" SELECTED >".elgg_echo("browse:newtosite")."</option>"; + }else{ + $area1 .= "<option value=\"3\" > ".elgg_echo("browse:newtosite")."</option>"; + } + + + + $area1 .= "</select></td></tr>"; + + $area1 .="<tr><br><td><h6>".elgg_echo("browse:photos")."</h6></td></tr>"; + if($photofilter == 1){ + $area1 .= "<tr><td><input id=\"\" type=\"checkbox\" name=\"photofilter\" CHECKED value=\"1\"; /></td> + <td class=\"browseCheckboxCopy\">".elgg_echo("browse:showonlyusers")."</td></tr>"; + }else{ + $area1 .= "<tr><td><input id=\"\" type=\"checkbox\" name=\"photofilter\" value=\"1\"; /></td> + <td class=\"browseCheckboxCopy\">".elgg_echo("browse:showonlyusers")."</td></tr>"; + } + $area1 .= " </table>"; + + + $area1 .= "<input type=\"submit\" name=\"\" value=\"Update\" id=\"\" class=\"BrowseButton\" style=\"font-size:8pt;font-weight:bold;\" /> </div>"; + + $area1 .= "</form>"; + + // Display main admin menu +page_draw(elgg_echo("memberlist"), +elgg_view_layout("two_column_left_sidebar",$area1,$title.$nav.elgg_view("browse/user").$result)); + + + +?> diff --git a/plugins/browse/languages/en.php b/plugins/browse/languages/en.php new file mode 100755 index 0000000000000000000000000000000000000000..41644e20afcfd230914701d7922801689dae1da0 --- /dev/null +++ b/plugins/browse/languages/en.php @@ -0,0 +1,21 @@ +<?php + $english = array( + 'browse' => "Browse", + 'memberlist' => "Browse", + 'memberlistdescription' => "Display users", + 'browse:widget:description' => "Display All users.", + 'browse:num_display' => "Number of Users to display", + 'browse:Sort_Results_By' => "Sort Results By", + 'browse:recently' => "Recently Updated", + 'browse:lastlogin' => "Last Login", + 'browse:newtosite' => "New to Site", + 'browse:selected' =>"Selected", + + 'browse:bowseuser' =>"Browse Users:", + 'browse:sortresult' =>"Sort Results By:", + 'browse:photos' =>"Photos:", + 'browse:showonlyusers' =>"Show only users who has photos:", + ); + + add_translation("en",$english); +?> diff --git a/plugins/browse/manifest.xml b/plugins/browse/manifest.xml new file mode 100755 index 0000000000000000000000000000000000000000..2e9f8339bf6cbf21386af56a5ef348bb4f6688bf --- /dev/null +++ b/plugins/browse/manifest.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin_manifest> + <field key="author" value="Cubet Technologies, lovegin@cubettech.com" /> + <field key="version" value="1.5" /> + <field key="description" value="Browse plugin." /> + <field key="website" value="http://www.cubettech.com" /> + <field key="copyright" value="(C) Cubet Tech 2009" /> + <field key="licence" value="GNU Public License version 2" /> + <field key="elgg_version" value="2009030702" /> +</plugin_manifest> \ No newline at end of file diff --git a/plugins/browse/start.php b/plugins/browse/start.php new file mode 100755 index 0000000000000000000000000000000000000000..f0ba2e7b87837220b3c5aba122d1ecdd69bbe28a --- /dev/null +++ b/plugins/browse/start.php @@ -0,0 +1,20 @@ +<? +function browser_init() { + + global $CONFIG; + //add a widget + add_widget_type('browsewidget',elgg_echo("browse"),elgg_echo('browse:widget:description')); + // Set up menu for logged in users + register_translations($CONFIG->pluginspath . "browse/languages/"); + if (isloggedin()) { + add_menu(elgg_echo('browse'), $CONFIG->wwwroot ."pg/browse"); + } + register_page_handler('browse','browser_page_handler'); +} +function browser_page_handler($page) { + @include(dirname(__FILE__) . "/index.php"); + return true; + } + +register_elgg_event_handler('init','system','browser_init'); +?> diff --git a/plugins/browse/views/default/browse/user.php b/plugins/browse/views/default/browse/user.php new file mode 100755 index 0000000000000000000000000000000000000000..2fbc327cadf775b4a8f0a38cb416c26da75fdb74 --- /dev/null +++ b/plugins/browse/views/default/browse/user.php @@ -0,0 +1,4 @@ +<?php + + echo "<p>" . autop(elgg_echo("memberlistdescription")) . "</p>"; +?> diff --git a/plugins/browse/views/default/widgets/browsewidget/edit.php b/plugins/browse/views/default/widgets/browsewidget/edit.php new file mode 100755 index 0000000000000000000000000000000000000000..332b7ca9f2a4ff308b476eb4fd5f522372e881f1 --- /dev/null +++ b/plugins/browse/views/default/widgets/browsewidget/edit.php @@ -0,0 +1,53 @@ +<?php + + /** + * ElggBrowse + * browse widget options + * + * @package ElggBrowse + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Cubet Tech + * @copyright Cubet Tech + * @link http://elgg.org/ + */ + +?> + +<p> + + <?php echo elgg_echo("browse:num_display"); ?>: + <select name="params[num_display]"> + <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option> + <option value="20" <?php if($vars['entity']->num_display == 20)echo "SELECTED"; ?>>20</option> + <option value="40" <?php if($vars['entity']->num_display ==40) echo "SELECTED"; ?>>40</option> + <option value="50" <?php if($vars['entity']->num_display ==50 ) echo "SELECTED"; ?>>50</option> + <option value="80" <?php if($vars['entity']->num_display == 80) echo "SELECTED"; ?>>80</option> + <option value="100" <?php if($vars['entity']->num_display == 100) echo "SELECTED"; ?>>100</option> + <option value="150" <?php if($vars['entity']->num_display == 150) echo "SELECTED"; ?>>150</option> + <option value="200" <?php if($vars['entity']->num_display == 200)echo "SELECTED"; ?>>200</option> + <option value="300" <?php if($vars['entity']->num_display == 300) echo "SELECTED"; ?>>300</option> + + </select> +</p> + +<p> + <?php echo elgg_echo("browse:Sort_Results_By"); ?>: + <select name="params[sort_result]"> + <option value="1" <?php if($vars['entity']->sort_result == 1) echo elgg_echo("browse:selected"); ?>><?php echo elgg_echo("browse:recently"); ?></option> + <option value="2" <?php if($vars['entity']->sort_result == 2) echo elgg_echo("browse:selected"); ?>><?php echo elgg_echo("browse:lastlogin"); ?></option> + <option value="3" <?php if($vars['entity']->sort_result == 3) echo elgg_echo("browse:selected"); ?>><?php echo elgg_echo("browse:newtosite"); ?></option> + </select> +</p> + + +<p> + <?php echo elgg_echo("friends:icon_size"); ?>: + <select name="params[icon_size]"> + <option value="1" <?php if($vars['entity']->icon_size == 1) echo elgg_echo("browse:selected"); ?>><?php echo elgg_echo("friends:small"); ?></option> + <option value="2" <?php if($vars['entity']->icon_size == 2) echo elgg_echo("browse:selected"); ?>><?php echo elgg_echo("friends:tiny"); ?></option> + </select> +</p> + + + diff --git a/plugins/browse/views/default/widgets/browsewidget/view.php b/plugins/browse/views/default/widgets/browsewidget/view.php new file mode 100755 index 0000000000000000000000000000000000000000..4d8c027db41cc802d610b6d9e0da87f2e5b602c7 --- /dev/null +++ b/plugins/browse/views/default/widgets/browsewidget/view.php @@ -0,0 +1,63 @@ +<?php + /** + * ElggBrowse + * browse widget options + * + * @package ElggBrowse + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Cubet Tech + * @copyright Cubet Tech + * @link http://cubettech.com/ + */ + //the number of files to display + $limit = (int) $vars['entity']->num_display; + if (!$limit) + $limit = 50; + //get the correct size + $size = (int) $vars['entity']->icon_size; + if (!$size || $size == 1){ + $size_value = "small"; + }else{ + $size_value = "tiny"; + } + //sorting of result + $sort = (int) $vars['entity']->sort_result; + + if (!$sort) + $sort = 1; + + +if($sort ==1){ //recently updated + $allusers = get_entities($type = "user",$subtype = "",$owner_guid = 0,$order_by ="time_updated DESC",$limit,$offset = 0,$count = false,$site_guid = 0,$container_guid = null); +} + +if($sort ==2){ //Last Login + $allusers = get_data ("select * from {$CONFIG->dbprefix}users_entity as a,{$CONFIG->dbprefix}entities as b where a.guid =b.guid and b.enabled = 'yes' order by a.last_login DESC LIMIT $limit"); +} + + +if($sort ==3){ //New to site + $allusers =get_entities($type = "user",$subtype = "",$owner_guid = 0,$order_by ="",$limit,$offset = 0,$count = false,$site_guid = 0,$container_guid = null); +} + + + // Get the users //time_created ,time_updated + + + + // If there are any $friend to view, view them + if (is_array($allusers) && sizeof($allusers) > 0) { + + echo "<div id=\"widget_friends_list\">"; + + foreach($allusers as $userall) { + echo "<div class=\"widget_friends_singlefriend\" >"; + echo elgg_view("profile/icon",array('entity' => get_user($userall->guid), 'size' => $size_value)); + echo "</div>"; + } + + echo "</div>"; + } + +?> \ No newline at end of file diff --git a/plugins/messages/manifest.xml b/plugins/messages/manifest.xml index 37cc7307495b996e843d973c90c4c40893680450..350ae06431fd1ca4c7487632a159a93f30390eb9 100644 --- a/plugins/messages/manifest.xml +++ b/plugins/messages/manifest.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <plugin_manifest> - <field key="author" value="Curverider" /> + <field key="author" value="Curverider Guys"/> <field key="version" value="1.5" /> <field key="description" value="Elgg internal messages plugin. This plugin lets user send each other messages." /> <field key="website" value="http://www.elgg.org/" />