[Register]
Powered by Elgg

Developer discussion :: Blog :: Archives

February 2007

February 08, 2007

Welcome to our brand new developer community!

This community is for us to discuss development and technical issues surrounding the Elgg open source social networking platform. If you're wondering how to develop a plugin, or would like to discuss the internals of the core system itself, this is the place to do it.

Posted by Ben Werdmuller @ Developer discussion | 0 comment(s)

February 13, 2007

At the beginning of February, we had a development meeting here in Oxford. The following is what we decided.

We discussed pre-1.0 (urgent) and post-1.0 (desirable/quick) additions.

Technical documentation: we discussed providing in-code documentation suitable for processing by phpDoc. All agreed that any new code written should have this embedded; if we can, it would be very good if edits to existing files could include additions of those comments as well. (This should perhaps go for plugin developers too.)

Kevin Jardine very kindly agreed to provide some additional documentation, including a "cheat sheet" for the new API calls we discussed.

Misc metadata: we agreed to create a new 'created' field for new users, probably in the users table itself, and discussed a new, decentralised 'metadata' field to be eventually introduced. The fields we discussed including are:

Title
Description
Creator
Object type
Update time
Created time
Language

Language was a tricky one, because it seems silly to have a pull-down to select this every time you make a blog post etc. Instead, it was suggested that we eventually have a hidden 'advanced options' toggle, allowing people to set things like language if they needed to on a per-item basis. This is post-1.0.

A set_updated() function would allow the object's update time to be updated without changing any other item of metadata.

All this is a post-1.0 feature internally, although its related table and API (get_metadata, set_metadata, get_metadata_title etc) should be available for plugins to be used pre-1.0, perhaps for version 0.9.

Widgets: we discussed Kevin's proposed widget API. Profile widgets will be displayed in two columns, with even number widgets in one and odd number widgets in the other. Some widgets will be undeletable. Control of widgets will be via little icons, perhaps hidden with CSS until you roll over them, so that nothing is obscured and you're not presented with a screen full of widget editing controls. Widget functions that return false won't display anything; widgets that return a string will. Widgets don't know how they're going to be displayed. Ben's note: This will be rolled out in svn over the next few weeks.

Access controls: we discussed centralising access controls and ownership into a new table. The benefits of this would be many owners per item, allowing for shared ownership of communities etc; it would also allow for a generalised access control API for everything. The access controls themselves would be more granular (post 1.0), allowing for read, write, etc - and roles relating to an object. For now, although all the access control API functions should work, the more granular aspects should return false (or some other error code that suggests that facility isn't available yet).

Plugins: rather than being loaded alphabetically, Elgg would have an ordered list of available activated plugins. This means we can change the order in which plugins are run from the admin panel, and although new plugins are autodiscovered, they aren't actually activated until the admin says so. A new function, module_purge();, was discussed for uninstalling plugins.

In general, it was decided that there should be plugin standards that should be adhered to; only those that meet the standards should be approved by us. We're also going to stop making module_pagesetup mandatory.

Session data: we decided that using $_SESSION for determining the current user is not the way to go (it's too dependent on the internal PHP session functions). A set of functions should be established for determining the current user, page owner and template in particular. (There is ongoing discussion about whether these should be global variables instead - all thoughts appreciated!)

Keywords: elgg development

Posted by Ben Werdmuller @ Developer discussion | 6 comment(s)

February 15, 2007

Hi elgg development team,

Currently, place holder in translatable text is replaced by combining __gettext() and sprintf().

e.g. line 69 in _activity/index.php;

    $commentposter = sprintf(__gettext("<b>%s</b> commented on weblog post '%s' in %s:"), $activity->postedname, stripslashes($activity->weblogtitle), $activity->weblogname);

However, because word order in text is different in each language, it's difficult to translate appropriately by this method. Place holder should have a unique name and placement flexibility.
Therefore, I suggest fixing __gettext() as follows.


    // Echo a translated string.
  function __gettext($text, $array = null, $domain = 'none')
  {
    global $CFG;
    if ($domain == 'none') {
      $domain = $CFG->translation_domain;
    }
    // Domain loader
    $i18n = get_domain($domain);
    if ($i18n != null) {
      $text = $i18n->translate($text);
    }
    if ($array != null) {
      return strtr($text, $array);
    }
    else {
      return $text;
    }
  }

usage;


  $commentposter = __gettext("<b>%postedname</b> commented on weblog post '%weblogtitle' in %weblogname:", array('%postedname' => %$activity->postedname, '%weblogtitle' => stripslashes($activity->weblogtitle), '%weblogname' => $activity->weblogname));

e.g. line 29 in _activity/index.php;

  $body = __gettext("<p>Currently viewing recent activity since %starttime.</p>", array('%starttime' => gmstrftime("%B %d, %Y", $starttime)));

Keywords: i18n

Posted by Takafumi @ Developer discussion | 2 comment(s)

February 19, 2007

I posted this on the plugin forum but am not sure that is the right place since the thread was originally on the developer mailing list so I am posting it here as well.

"Well, I finally bit the bullet and upgraded to the latest version of elgg.

I was on the mail list before and there was talk about a plugin which made friendly urls. For instance, instead of  weblog/5.html  it would be weblog/whatever-the-title-was.html

Did that get rolled into this newest release? If so, how do I activate it? If not, where do I get it if it is available.

Thanks for all your work on this."

Micki

Keywords: blog urls, plugin

Posted by Micki @ Developer discussion | 0 comment(s)

I just changed in includes.php the position of run('init'): now it is

[code=PHP]

if ($allmods = get_list_of_plugins('mod') ) {
           foreach ($allmods as $mod) {
                $mod_init = $mod . '_init';
                if (function_exists($mod_init)) {
                    $mod_init();
                   }
           }
        }

        run("init");

[/code]

This is necessary for at least the fshl (source code formatting) plugin to work. Is  this ok, or should plugin writers not rely on $function['init']  anymore?

 Ewout

(this fshl plugin would make a nice addition to elgg.org...) 

Posted by Ewout ter Haar @ Developer discussion | 0 comment(s)

February 20, 2007

Here's a story by the Irish media agency RTE on the new Elgg-based site Just World:

http://www.rte.ie/news/2007/0220/trocaire.html?rss

The site is here:

http://trocaire.org/justworld/

The site has some interesting technical innovations, including OpenID and access control integration with Drupal,  profile fillout at registration, widgets on profile pages, a very simple skin switcher, dynamic content on the front page and a rudimentary member directory (pagination to be added soon!).

This is based on the demo site technology I mentioned in an earlier message. Currently the code is a fairly major hack on vanilla Elgg. However, Ben, Dave and I are working to make sure that many of these innovations will be available in a future Elgg release.

Cheers,

Kevin 

Keywords: innovation, media, NGOs, OpenID, social justice

Posted by Kevin Jardine @ Developer discussion | 4 comment(s)

February 21, 2007

Is there a mechanism for reporting bugs for Elgg? I think I've found an issue with JavaScript, IE7 and adding a file to a blog post, but am not sure where to post it ...

Posted by Richard Osborne @ Developer discussion | 2 comment(s)

Hello,

 Is anyone planning to modify or enhance the file module before 1.0?  There are some features I want to add to it:

  • Allow a "file", as seen in the user's profile, to be any kind of item - a real file on the disk, or a link to a webpage, or some form of metadata;
  • Allow external processes to add file items to a user's profile.  (Will the db schema change for the file module anytime soon?)

Cheers,

-J 

Keywords: changes, file, module

Posted by Josh @ Developer discussion | 0 comment(s)

February 22, 2007

I've install elgg but not running user page "site/asdd" or "site/ada" or "site/tom". message is "

The page cannot be found

"

Can fix this problem ? 

Posted by Bogdan @ Developer discussion | 1 comment(s)

February 23, 2007

I'm wanting to change the wording of the top nav, but can't for the life of me figure out how.  Any ideas?

Posted by tgpo @ Developer discussion | 8 comment(s)

February 25, 2007

I made an Atom feed version of allpostsfeed.php. You can find it here:  http://pccepa3.if.usp.br/trac/demi/browser/trunk/elgg/allpostsat .

Ewout 

Posted by Ewout ter Haar @ Developer discussion | 1 comment(s)

February 26, 2007

Hello.

I have a question. 

Is it possible to make language Japanese?

I am not good at programing, but I want to try to make even only language of pages' surface Japanese.

 

Regards,

Masa

Posted by Masa @ Developer discussion | 2 comment(s)

February 28, 2007

is there any way to set delete/add permission in the file storage? i found member of the community can delete other files / folders

 

Thanks and Regards. 

Keywords: delete, file, folder, storage

Posted by lftr @ Developer discussion | 0 comment(s)

Hi, i made small changes to allpostsfeed.php to show latest comments on blogs:

http://devel.memi.umss.edu.bo/rolando/hg/elgg_ajayu/file/tip/allcomme 

Keywords: feed, latest comments, rss

Posted by Rolando Espinoza La Fuente @ Developer discussion | 6 comment(s)

Site supported by Curverider Ltd - powered by the awesome Elgg