]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Merged [5623]:head from 1.7 to trunk.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 16 Apr 2010 01:56:18 +0000 (01:56 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 16 Apr 2010 01:56:18 +0000 (01:56 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5760 36083f99-b078-4883-b0ff-0f9b5a30f544

18 files changed:
_graphics/indicator.gif [new file with mode: 0644]
engine/lib/elgglib.php
mod/categories/actions/save.php
mod/categories/languages/en.php
mod/categories/listing.php [new file with mode: 0644]
mod/categories/settings.php
mod/categories/start.php
mod/categories/views/default/categories.php
mod/categories/views/default/categories/list.php
mod/categories/views/default/categories/settings.php
mod/categories/views/default/categories/view.php
mod/profile/actions/cropicon.php
mod/profile/icondirect.php
mod/profile/start.php
mod/search/search_hooks.php
mod/search/views/default/search/css.php
mod/search/views/default/search/entity.php
mod/thewire/views/rss/object/thewire.php [new file with mode: 0644]

diff --git a/_graphics/indicator.gif b/_graphics/indicator.gif
new file mode 100644 (file)
index 0000000..085ccae
Binary files /dev/null and b/_graphics/indicator.gif differ
index 0cb696e1dff64447d8239e74bec98ab622f20531..77cc0d3a1657c657005776e630093fd3aeb50f80 100644 (file)
@@ -752,6 +752,11 @@ function elgg_view_annotation(ElggAnnotation $annotation, $bypass = true, $debug
 function elgg_view_entity_list($entities, $count, $offset, $limit, $fullview = true, $viewtypetoggle = true, $pagination = true) {
        $count = (int) $count;
        $limit = (int) $limit;
+       
+       // do not require views to explicitly pass in the offset
+       if (!$offset = (int) $offset) {
+               $offset = sanitise_int(get_input('offset', 0));
+       }
 
        // do not require views to explicitly pass in the offset
        if (!$offset = (int) $offset) {
index c8d8bd0510be58ab1609c054e8126b41aa9d9914..21602f6596e58954144a9b75d8ff27945b6d9f67 100644 (file)
@@ -1,23 +1,22 @@
 <?php
 
-       /**
       * Elgg categories plugin category saver
-        * 
       * @package ElggCategories
       * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
       * @author Curverider Ltd <info@elgg.com>
       * @copyright Curverider Ltd 2008-2010
       * @link http://elgg.com/
       */
+/**
+ * Elgg categories plugin category saver
+ *
+ * @package ElggCategories
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
 
-               $categories = get_input('categories');
-               $categories = string_to_tag_array($categories);
-               
-               global $CONFIG;
-               $site = $CONFIG->site;
-               $site->categories = $categories;
-               system_message(elgg_echo("categories:save:success"));
-               
-               forward($_SERVER['HTTP_REFERER']);
+$categories = get_input('categories');
+$categories = string_to_tag_array($categories);
+
+global $CONFIG;
+$site = $CONFIG->site;
+$site->categories = $categories;
+system_message(elgg_echo("categories:save:success"));
+
+forward($_SERVER['HTTP_REFERER']);
 
-?>
index ecd01a9df7bca27a0653ac32dba7fcfc9ea03f72..588c194e4f15233beadba9a5f9a2557ffc9785c8 100644 (file)
@@ -6,6 +6,7 @@
                'categories:settings' => 'Set site categories', 
                'categories:explanation' => 'To set some predefined site-wide categories that will be used throughout your system, enter them below, separated with commas. Compatible tools will then display them when the user creates or edits content.',   
                'categories:save:success' => 'Site categories were successfully saved.',
+               'categories:results' => "Results for the site category: %s",
        
        );
                                        
diff --git a/mod/categories/listing.php b/mod/categories/listing.php
new file mode 100644 (file)
index 0000000..ecc1bed
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Elgg categories listing page
+ *
+ * @package ElggCategories
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+$limit = get_input("limit", 10);
+$offset = get_input("offset", 0);
+$category = get_input("category");
+$owner_guid = get_input("owner_guid", 0);
+$subtype = get_input("subtype", ELGG_ENTITIES_ANY_VALUE);
+$type = get_input("type", 'object');
+
+$objects = list_entities_from_metadata('universal_categories',
+                                                                               $category,
+                                                                               $type,
+                                                                               $subtype,
+                                                                               $owner_guid,
+                                                                               $limit,
+                                                                               false,
+                                                                               false,
+                                                                               true,
+                                                                               false);
+
+
+$title = sprintf(elgg_echo('categories:results'), $category);
+
+$content = elgg_view_title($title);
+$content .= $objects;
+
+$body = elgg_view_layout('two_column_left_sidebar', '', $content);
+
+page_draw($title, $body);
index 85696730ae7c4cf87f52074b120f73dc719387c5..260b057c3fa57cf8fb92a16ef8601b21d50dcdff 100644 (file)
@@ -1,43 +1,35 @@
 <?php
 
-       /**
-        * Elgg categories plugin settings page
-        * 
-        * @package ElggCategories
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.com/
-        */
-
-       // Load engine and restrict to admins 
-
-               require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
-               admin_gatekeeper();
-               
-       // Set context
-       
-               set_context('admin');
-               
-       // Get site and categories
-               
-               global $CONFIG;
-               $site = $CONFIG->site;
-               $categories = $site->categories;
-               
-               if (empty($categories)) $categories = array();
-               
-       // Load category save view
-       
-               $body = elgg_view('categories/settings',array(
-                                                       'categories' => $categories,
-                                               ));
-
-       // Layout
-
-               $body = elgg_view_layout('two_column_left_sidebar','', $body);
-                                               
-       // View page
-               page_draw(elgg_echo('categories:settings'),$body);
-               
-?>
\ No newline at end of file
+/**
+ * Elgg categories plugin settings page
+ *
+ * @package ElggCategories
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+// Load engine and restrict to admins 
+require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
+admin_gatekeeper();
+
+// Set context
+set_context('admin');
+
+// Get site and categories
+global $CONFIG;
+$site = $CONFIG->site;
+$categories = $site->categories;
+
+if (empty($categories)) {
+       $categories = array();
+}
+
+// Load category save view
+$body = elgg_view('categories/settings',array('categories' => $categories));
+
+
+$body = elgg_view_layout('two_column_left_sidebar', '', $body);
+
+page_draw(elgg_echo('categories:settings'), $body);
index 1a8e686fe18d06173b10d8f411c45df8a0b5fab9..dd6da16d51a6872f18649be46eb818b0e6d3f8b3 100644 (file)
@@ -1,70 +1,79 @@
 <?php
 
-       /**
-        * Elgg categories plugin
-        * 
-        * @package ElggCategories
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.com/
-        */
-
-       /**
-        * Initialise categories actions etc
-        *
-        */
-               function categories_init() {
-                       
-                       // Get config
-                               global $CONFIG;
-                               
-                       elgg_extend_view('css', 'categories/css');
-                       
-                       // Register action
-                               register_action('categories/save',false,$CONFIG->pluginspath . 'categories/actions/save.php',true);
-                       
-               }
-       
-       /**
-        * Set up menu items
-        *
-        */
-               function categories_pagesetup()
-               {
-                       if (get_context() == 'admin' && isadminloggedin()) {
-                               global $CONFIG;
-                               add_submenu_item(elgg_echo('categories:settings'), $CONFIG->wwwroot . 'mod/categories/settings.php');
-                       }
-               }
-               
-       /**
-        * Save categories
-        *
-        */
-               function categories_save($event, $object_type, $object) {
+/**
+ * Elgg categories plugin
+ *
+ * @package ElggCategories
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+/**
+ * Initialise categories plugin
+ *
+ */
+function categories_init() {
+
+       global $CONFIG;
+
+       elgg_extend_view('css', 'categories/css');
+
+       register_action('categories/save',false,$CONFIG->pluginspath . 'categories/actions/save.php',true);
+
+       register_page_handler('categories', 'categories_page_handler');
+
+}
+
+/**
+ * Set up admin menu item
+ *
+ */
+function categories_pagesetup() {
+       if (get_context() == 'admin' && isadminloggedin()) {
+               global $CONFIG;
+               add_submenu_item(elgg_echo('categories:settings'), $CONFIG->wwwroot . 'mod/categories/settings.php');
+       }
+}
+
+/**
+ * Page handler
+ *
+ */
+function categories_page_handler() {
+
+       include(dirname(__FILE__) . "/listing.php");
+       return true;
+}
+
+/**
+ * Save site categories
+ *
+ */
+function categories_save($event, $object_type, $object) {
+
+       if ($object instanceof ElggEntity) {
+
+               $marker = get_input('universal_category_marker');
+
+               if ($marker == 'on') {
+
+                       $categories = get_input('universal_categories_list');
                        
-                       if ($object instanceof ElggEntity) {
-                               
-                               $marker = get_input('universal_category_marker');
-                               if ($marker == 'on') {
-                                       
-                                       $categories = get_input('universal_categories_list');
-                                       if (empty($categories)) $categories = array();
-                                       
-                                       $object->universal_categories = $categories;
-                                       
-                               }
-                               
+                       if (empty($categories)) {
+                               $categories = array();
                        }
-                       return true;
-                       
+
+                       $object->universal_categories = $categories;
                }
-       
+       }
+
+       return true;
+}
 
-       register_elgg_event_handler('init','system','categories_init');
-       register_elgg_event_handler('pagesetup','system','categories_pagesetup');
-       register_elgg_event_handler('update','all','categories_save');
-       register_elgg_event_handler('create','all','categories_save');
 
-?>
\ No newline at end of file
+register_elgg_event_handler('init','system','categories_init');
+register_elgg_event_handler('pagesetup','system','categories_pagesetup');
+register_elgg_event_handler('update','all','categories_save');
+register_elgg_event_handler('create','all','categories_save');
index f5a41cfa1c409163d980d7b0ebfb3c88c35cb879..98e87a05fc3e573c61c8935fe535b507a5201a8d 100644 (file)
@@ -1,48 +1,52 @@
 <?php
 
-       /**
-        * Elgg categories plugin
-        * 
-        * @package ElggCategories
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.com/
-        */
-
-               if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
-                       $selected_categories = $vars['entity']->universal_categories;
-               }
-               $categories = $vars['config']->site->categories;
-               if (empty($categories)) $categories = array();
-               if (empty($selected_categories)) $selected_categories = array(); 
-
-               if (!empty($categories)) {
-                       if (!is_array($categories)) $categories = array($categories);
-               
-?>
-
-               <div id="content_area_user_title"><h2 class="categoriestitle"><?php echo elgg_echo('categories'); ?></h2></div>
-               <div class="categories">
-                       <p>
-                       
-<?php
+/**
+ * Elgg categories plugin
+ *
+ * @package ElggCategories
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
+       $selected_categories = $vars['entity']->universal_categories;
+}
+$categories = $vars['config']->site->categories;
+if (empty($categories)) {
+       $categories = array();
+}
+if (empty($selected_categories)) {
+       $selected_categories = array();
+}
+
+if (!empty($categories)) {
+       if (!is_array($categories)) {
+               $categories = array($categories);
+       }
 
-               echo elgg_view('input/checkboxes',array(
-                       'options' => $categories,
-                       'value' => $selected_categories,
-                       'internalname' => 'universal_categories_list'
-                                                                                               ));
-
-?>
-                       <input type="hidden" name="universal_category_marker" value="on" />
-                       </p>
-               </div>
-               
-<?php
+       ?>
 
-       } else {
-               echo '<input type="hidden" name="universal_category_marker" value="on" />';
-       }
+<div id="content_area_user_title"><h2 class="categoriestitle"><?php echo elgg_echo('categories'); ?></h2></div>
+<div class="categories">
+       <p>
+
+                       <?php
+
+                       echo elgg_view('input/checkboxes',array(
+                               'options' => $categories,
+                               'value' => $selected_categories,
+                               'internalname' => 'universal_categories_list'
+                               ));
+
+                       ?>
+               <input type="hidden" name="universal_category_marker" value="on" />
+       </p>
+</div>
+
+       <?php
 
-?>
\ No newline at end of file
+} else {
+       echo '<input type="hidden" name="universal_category_marker" value="on" />';
+}
index b6f9f430289ceb80d119585e4f2ab0f010b88c6f..161a2165522ab7c1c14797efd336fe91cae0a3e0 100644 (file)
@@ -1,41 +1,51 @@
 <?php
 
-       $categories = $vars['config']->site->categories;
-       
-       if ($categories) {
-               if (!is_array($categories)) $categories = array($categories);
-               
+$categories = $vars['config']->site->categories;
+
+if ($categories) {
+       if (!is_array($categories)) {
+               $categories = array($categories);
+       }
+
        if (!empty($vars['subtype'])) {
                $flag = array();
                $owner_guid = '';
-               if (isset($vars['owner_guid'])) $owner_guid = (int) $vars['owner_guid'];
-               if ($cats = get_tags(0,999,'universal_categories','object',$vars['subtype'],$owner_guid))
-                       foreach($cats as $cat)
+               if (isset($vars['owner_guid'])) {
+                       $owner_guid = (int) $vars['owner_guid'];
+               }
+               if ($cats = get_tags(0,999,'universal_categories','object',$vars['subtype'],$owner_guid)) {
+                       foreach($cats as $cat) {
                                $flag[] = $cat->tag;
-                               
+                       }
+               }
+
        } else {
                $flag = null;
        }
-       
+
        if (is_null($flag) || !empty($flag)) {
-               
-?>
 
-       <h2><?php echo elgg_echo('categories'); ?></h2>
-       <div class="categories">
-               <?php
+               ?>
+
+<h2><?php echo elgg_echo('categories'); ?></h2>
+<div class="categories">
+                       <?php
 
                        $catstring = '';
                        if (!empty($categories)) {
                                foreach($categories as $category) {
-                                       if (is_null($flag) || (is_array($flag) && in_array($category,$flag)))
+                                       if (is_null($flag) || (is_array($flag) && in_array($category,$flag))) {
                                                $catstring .= '<li><a href="'.$vars['baseurl'].urlencode($category).'">'. $category .'</a></li>';
+                                       }
                                }
                        }
-                       if (!empty($catstring)) echo "<ul>{$catstring}</ul>";
-               
-               ?>
-       </div>
-<?php } 
+                       if (!empty($catstring)) {
+                               echo "<ul>{$catstring}</ul>";
+                       }
+
+                       ?>
+</div>
+               <?php
+       }
 
-}?>
\ No newline at end of file
+}
index 6c55d88f901e051e8421472ddcdf64f3bb735c7a..7f38b6579dbf0e07db687067cc844a1854274e40 100644 (file)
@@ -1,26 +1,24 @@
 <?php
 
-       echo elgg_view_title(elgg_echo('categories:settings'));
+echo elgg_view_title(elgg_echo('categories:settings'));
 
 ?>
 
-       <div class="contentWrapper">
-               <p>
-                       <?php echo elgg_echo('categories:explanation'); ?>
-               </p>
-       
+<div class="contentWrapper">
+       <p>
+               <?php echo elgg_echo('categories:explanation'); ?>
+       </p>
 
-<?php
 
-       echo elgg_view(
-                                               'input/form',
-                                               array(
+       <?php
+
+       echo elgg_view('input/form', array(
                                                        'action' => $vars['url'] . 'action/categories/save',
                                                        'method' => 'post',
                                                        'body' => elgg_view('categories/settingsform',$vars)
-                                               )
+                                                       )
                                        );
 
-?>
+       ?>
 
 </div>
\ No newline at end of file
index ef092ce846850b737c3fbc279b23cbcb3a46d92d..7ee0170d93d797028001c8bc6cc2f3f50b675199 100644 (file)
@@ -1,19 +1,22 @@
 <?php
 
-       $linkstr = '';
-       if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
-               
-               $categories = $vars['entity']->universal_categories;
-               if (!empty($categories)) {
-                       if (!is_array($categories)) $categories = array($categories);
-                       foreach($categories as $category) {
-                               $link = $vars['url'] . 'search?tagtype=universal_categories&tag=' . urlencode($category);
-                               if (!empty($linkstr)) $linkstr .= ', ';
-                               $linkstr .= '<a href="'.$link.'">' . $category . '</a>';
+$linkstr = '';
+if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
+
+       $categories = $vars['entity']->universal_categories;
+       if (!empty($categories)) {
+               if (!is_array($categories)) {
+                       $categories = array($categories);
+               }
+               foreach($categories as $category) {
+                       $link = $vars['url'] . 'pg/categories/list/?category=' . urlencode($category);
+                       if (!empty($linkstr)) {
+                               $linkstr .= ', ';
                        }
+                       $linkstr .= '<a href="'.$link.'">' . $category . '</a>';
                }
-               
        }
-       echo $linkstr;
 
-?>
\ No newline at end of file
+}
+
+echo $linkstr;
index 70b8e9288ad6ea9aacb55727ef854c406cf7114e..5bba84a8c6ef376580234c4bf22454f2ffcb1977 100644 (file)
@@ -29,10 +29,10 @@ $filehandler->owner_guid = $profile_owner->getGUID();
 $filehandler->setFilename("profile/" . $profile_owner->username . "master" . ".jpg");
 $filename = $filehandler->getFilenameOnFilestore();
        
-$topbar = get_resized_image_from_existing_file($filename, 16, 16, true, $x1, $y1, $x2, $y2);
-$tiny = get_resized_image_from_existing_file($filename, 25, 25, true, $x1, $y1, $x2, $y2);
-$small = get_resized_image_from_existing_file($filename, 40, 40, true, $x1, $y1, $x2, $y2);
-$medium = get_resized_image_from_existing_file($filename, 100, 100, true, $x1, $y1, $x2, $y2);
+$topbar = get_resized_image_from_existing_file($filename, 16, 16, true, $x1, $y1, $x2, $y2, TRUE);
+$tiny = get_resized_image_from_existing_file($filename, 25, 25, true, $x1, $y1, $x2, $y2, TRUE);
+$small = get_resized_image_from_existing_file($filename, 40, 40, true, $x1, $y1, $x2, $y2, TRUE);
+$medium = get_resized_image_from_existing_file($filename, 100, 100, true, $x1, $y1, $x2, $y2, TRUE);
        
 if ($small !== FALSE && $medium !== FALSE && $tiny !== FALSE) {
        $filehandler = new ElggFile();
index 353ce389c8c28397f00da629212d1b3212ba74a1..8a46786ab051cd5da7e3b1dc5546525c217d02a7 100644 (file)
@@ -1,28 +1,89 @@
 <?php
 
-       /**
-        * Elgg profile icon cache/bypass
-        * 
-        * @package ElggProfile
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.com/
-        */
-
-       // This should provide faster access to profile icons by not loading the
-       // engine but directly grabbing the file from the user's profile directory.
-       // The speedup was broken in Elgg 1.7 because of a change in directory structure.
-       // The link to this script is provided in profile_usericon_hook(). To work
-       // in 1.7 forward, the link has to be updated to provide more information.
-       // The profile icon filename should also be changed to not use username.
-
-       // To see previous code, see svn history.
-
-       // At the moment, this does not serve much of a purpose other than provide
-       // continuity. It currently just includes icon.php which uses the engine.
-
-       // see #1989 and #2035
-
-       require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-       require_once(dirname(__FILE__).'/icon.php');
+/**
+ * Elgg profile icon cache/bypass
+ * 
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+
+// Get DB settings
+require_once(dirname(dirname(dirname(__FILE__))). '/engine/settings.php');
+
+global $CONFIG;
+
+
+$username = $_GET['username'];
+$joindate = (int)$_GET['joindate'];
+$guid = (int)$_GET['guid'];
+
+$size = strtolower($_GET['size']);
+if (!in_array($size,array('large','medium','small','tiny','master','topbar'))) {
+       $size = "medium";
+}
+
+// security check on username string
+if (   (strpos($username, '/')!==false) ||
+               (strpos($username, '\\')!==false) ||
+               (strpos($username, '"')!==false) ||
+               (strpos($username, '\'')!==false) ||
+               (strpos($username, '*')!==false) ||
+               (strpos($username, '&')!==false) ||
+               (strpos($username, ' ')!==false) ) {
+       // these characters are not allowed in usernames
+       exit;
+}
+
+
+
+$mysql_dblink = @mysql_connect($CONFIG->dbhost,$CONFIG->dbuser,$CONFIG->dbpass, true);
+if ($mysql_dblink) {
+       if (@mysql_select_db($CONFIG->dbname,$mysql_dblink)) {
+
+               // get dataroot and simplecache_enabled in one select for efficiency
+               if ($result = mysql_query("select name, value from {$CONFIG->dbprefix}datalists where name in ('dataroot','simplecache_enabled')",$mysql_dblink)) {
+                       $simplecache_enabled = true;
+                       $row = mysql_fetch_object($result);
+                       while ($row) {
+                               if ($row->name == 'dataroot') {
+                                       $dataroot = $row->value;
+                               } else if ($row->name == 'simplecache_enabled') {
+                                       $simplecache_enabled = $row->value;
+                               }
+                               $row = mysql_fetch_object($result);
+                       }
+               }
+
+               @mysql_close($mysql_dblink);
+
+               // if the simplecache is enabled, we get icon directly
+               if ($simplecache_enabled) {
+
+                       // first try to read icon directly
+                       $user_path = date('Y/m/d/', $joindate) . $guid;
+                       $filename = $dataroot . $user_path . "/profile/" . $username . $size . ".jpg";
+                       $contents = @file_get_contents($filename);
+                       if (!empty($contents)) {
+                               header("Content-type: image/jpeg");
+                               header('Expires: ' . date('r',time() + 864000));
+                               header("Pragma: public");
+                               header("Cache-Control: public");
+                               header("Content-Length: " . strlen($contents));
+                               $splitString = str_split($contents, 1024);
+                               foreach($splitString as $chunk) {
+                                       echo $chunk;
+                               }
+                               exit;
+                       }
+               }
+       }
+
+}
+
+// simplecache is not turned on or something went wrong so load engine and try that way
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+require_once(dirname(__FILE__).'/icon.php');
index 9d5bb2e49ae9621c4a305eaf5b326b55270c4bdb..1b47445d7a6027d176a84711a61c3c829a7eeef8 100644 (file)
@@ -273,7 +273,7 @@ function profile_usericon_hook($hook, $entity_type, $returnvalue, $params){
 
                if ($filehandler->exists()) {
                        //$url = $CONFIG->url . "pg/icon/$username/$size/$icontime.jpg";
-                       return $CONFIG->wwwroot . 'mod/profile/icondirect.php?lastcache='.$icontime.'&amp;username='.$entity->username.'&amp;size='.$size;
+                       return $CONFIG->wwwroot . 'mod/profile/icondirect.php?lastcache='.$icontime.'&username='.$entity->username.'&joindate=' . $entity->time_created . '&guid=' . $entity->guid . '&size='.$size;
                }
        }
 }
@@ -297,4 +297,4 @@ register_action("profile/editdefault/reset",false,$CONFIG->pluginspath . "profil
 register_action("profile/editdefault/reorder",false,$CONFIG->pluginspath . "profile/actions/reorder.php", true);
 register_action("profile/editdefault/editfield",false,$CONFIG->pluginspath . "profile/actions/editfield.php", true);
 register_action("profile/addcomment",false,$CONFIG->pluginspath . "profile/actions/addcomment.php");
-register_action("profile/deletecomment",false,$CONFIG->pluginspath . "profile/actions/deletecomment.php");
\ No newline at end of file
+register_action("profile/deletecomment",false,$CONFIG->pluginspath . "profile/actions/deletecomment.php");
index 1af208d6e68d7cc673f13c3d2d38798e6321e905..a2063dbc1e9f4d127fd799a3f9db978a69647405 100644 (file)
@@ -240,8 +240,21 @@ function search_tags_hook($hook, $type, $value, $params) {
                        }
                }
 
+               // different entities have different titles
+               switch($entity->type) {
+                       case 'site':
+                       case 'user':
+                       case 'group':
+                               $title_tmp = $entity->name;
+                               break;
+
+                       case 'object':
+                               $title_tmp = $entity->title;
+                               break;
+               }
+
                // Nick told me my idea was dirty, so I'm hard coding the numbers.
-               $title_tmp = strip_tags($entity->title);
+               $title_tmp = strip_tags($title_tmp);
                if (elgg_strlen($title_tmp) > 297) {
                        $title_str = elgg_substr($title_tmp, 0, 297) . '...';
                } else {
@@ -257,7 +270,6 @@ function search_tags_hook($hook, $type, $value, $params) {
 
                $tags_str = implode('. ', $matched_tags_strs);
                $tags_str = search_get_highlighted_relevant_substrings($tags_str, $params['query']);
-               //$tags_str = "($tags_str)";
 
                $entity->setVolatileData('search_matched_title', $title_str);
                $entity->setVolatileData('search_matched_description', $desc_str);
@@ -392,4 +404,4 @@ function search_comments_hook($hook, $type, $value, $params) {
 function search_custom_types_comments_hook($hook, $type, $value, $params) {
        $value[] = 'comments';
        return $value;
-}
\ No newline at end of file
+}
index 72b6960591513b7bee68b03708b5a7030e4eb54f..d008dd3c0d959162d0bbc8a6caf5578dc8115391 100644 (file)
 }
 
 /* formatting for the search results */
-.search_listing .item_extra {
-       border: 1px solid #cccccc;
-       margin: 2px;
-       padding: 3px;
-}
 
 .search_listing .item_timestamp {
        font-style: italic;
-}
\ No newline at end of file
+}
index 538cc8a6488391a007e5615e47d16ff2ac005c32..e5659d6ab9e84998a5a8cba75f5001f389d9d2ed 100644 (file)
@@ -42,9 +42,11 @@ $title = $entity->getVolatileData('search_matched_title');
 $description = $entity->getVolatileData('search_matched_description');
 $extra_info = $entity->getVolatileData('search_matched_extra');
 $url = $entity->getVolatileData('search_url');
+
 if (!$url) {
        $url = $entity->getURL();
 }
+
 $title = "<a href=\"$url\">$title</a>";
 $time = $entity->getVolatileData('search_time');
 if (!$time) {
@@ -53,7 +55,7 @@ if (!$time) {
        $time = friendly_time(($tu > $tc) ? $tu : $tc);
 }
 ?>
-       <div class="search_listing clearfloat">
+       <div class="search_listing">
        <div class="search_listing_icon"><?php echo $icon; ?></div>
                <div class="search_listing_info">
                        <p class="entity_title"><?php echo $title; ?></p>
diff --git a/mod/thewire/views/rss/object/thewire.php b/mod/thewire/views/rss/object/thewire.php
new file mode 100644 (file)
index 0000000..ce63c55
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Elgg thewire rss view
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$owner = $vars['entity']->getOwnerEntity();
+if ($owner) {
+       $title = sprintf(elgg_echo('thewire:by'), $owner->name);
+} else {
+       $subtitle = strip_tags($vars['entity']->description);
+       $title = substr($subtitle,0,32);
+       if (strlen($subtitle) > 32) {
+               $title .= " ...";
+       }
+}
+
+?>
+
+<item>
+<guid isPermaLink='false'><?php echo $vars['entity']->getGUID(); ?></guid>
+<pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
+<link><?php echo htmlspecialchars($vars['entity']->getURL()); ?></link>
+<title><![CDATA[<?php echo $title; ?>]]></title>
+<description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
+<?php
+               $owner = $vars['entity']->getOwnerEntity();
+               if ($owner) {
+?>
+<dc:creator><?php echo $owner->name; ?></dc:creator>
+<?php
+               }
+?>
+<?php
+               if (
+                       ($vars['entity'] instanceof Locatable) &&
+                       ($vars['entity']->getLongitude()) &&
+                       ($vars['entity']->getLatitude())
+               ) {
+                       ?>
+                       <georss:point><?php echo $vars['entity']->getLatitude(); ?> <?php echo $vars['entity']->getLongitude(); ?></georss:point>
+                       <?php
+               }
+?>
+<?php echo elgg_view('extensions/item'); ?>
+</item>