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' => "... o__O",
  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)
  9. mod/thewire/views/default/object/thewire.php
    reply hardcoded
    search: <a href="<?php echo $vars['url']; ?>mod/thewire/reply.php?note_id=<?php echo $vars['entity']->guid; ?>" class="reply">reply</a>
    replace with: <a href="<?php echo $vars['url']; ?>mod/thewire/reply.php?note_id=<?php echo $vars['entity']->guid; ?>" class="reply"><?php echo elgg_echo('thewire:reply'); ?></a>

History