Small Fixes: Revision

Last updated by SGr33n

Hi people,

Customizing Elgg I found a few things to fix.

I'd like to share them with you.
Here we go (updated):

  1. mod/profile/views/default/profile/userdetails.php
    show a message if no description
    search: <?php echo autop($vars['entity']->description); ?>
    replace with: <?php
            $userdescription = $vars['entity']->description;

            if (!empty($userdescription)) {
                echo autop($vars['entity']->description);

            } else {
               
                echo "<p class=\"description_none\">" . elgg_echo('profile:descriptionnone') . "</p>";
            }
        ?>

    add to the profile en.php language file: 'profile:descriptionnone' => "...",
  2. mod/bookmarks/views/default/widgets/bookmarks/view.php
    "bookmark inbox" hardcoded
    search: echo "<a href=\"{$user_inbox}\">Bookmark inbox</a>";
    replace with: echo "<a href=\"{$user_inbox}\">" . elgg_echo('bookmarks:inbox') . "</a>";
  3. mod/status/views/default/status/widget_view.php
    save & cancel buttons hardcoded
    search: <input type="button" id="status_save_button" value="Save" />
                <input type="button" id="status_cancel_button" value="Cancel" />

    replace with: <input type="button" id="status_save_button" value="<?php echo elgg_echo('save'); ?>" />
                         <input type="button" id="status_cancel_button" value="<?php echo elgg_echo('cancel'); ?>" />
  4. mod/groups/views/default/groups/forum_latest.php
    • "Replies" hardcoded (added to language files)
    • Error counting replies (one more):
      search: $count_annotations = $f->countAnnotations("group_topic_post");
      replace with: $count_annotations = $f->countAnnotations("group_topic_post");
                           $count_annotations = $count_annotations -1;
  5. mod/google-map/languages/en.php
    search: 'gmap:modify' => 'Enter your Google Maps API Key<br /><small>You can obtain an API Key <a target="_blank" href="http://code.google.com/apis/maps/signup.html">here</a&gt;.',
    replace with: 'gmap:modify' => 'Enter your Google Maps API Key<br /><small>You can obtain an API Key <a target="_blank" href="http://code.google.com/apis/maps/signup.html">here</a></small&gt;.',
  6. mod/messageboard/views/default/widgets/messageboard/view.php
    no message when empty
    search: echo "<div id=\"messageboard_wrapper\"></div>";
  7. replace with: echo "<div id=\"messageboard_wrapper\" class=\"messageboard_none\">" . elgg_echo('messageboard:none') . "</div>";
    * added a class name so you can style the message as you want (ex. a red box with exclamation)
    add to the messageboard en.php language file: 'messageboard:none' => "No comments yet",
  8. mod/messageboard/views/default/widgets/messageboard/group_messageboard.php
    no message when empty
    search:
    echo "<div id=\"messageboard_wrapper\" /></div>";
    replace with: echo "<div id=\"messageboard_wrapper\" class=\"messageboard_none\" />" . elgg_echo('messageboard:none') . "</div>";
    * added a class name so you can style the message as you want (ex. a red box with exclamation)

History