[Register]
Powered by Elgg

Developer discussion :: Blog :: Archives

September 2007

September 01, 2007

I am currently trying to create a plugin that integrates Elgg with Gallery2.

How do plugin's access the main users template when they need to generate a new page.

For example the vanilla forum is not hosted inside the elgg template, you are just redirected to a vanilla page, however with the feeds plugin the html is inside the standard template.

Is it simply done by defining global $Page at top of page?

Sorry if this is obvious, my PHP is a bit shakey

Also which files define $PAGE and $CFG

Thanks

Mark 

Posted by Mark Easton @ Developer discussion | 0 comment(s)

September 02, 2007

I've got an overview of elgg and I was wondering on how to create (or derived) a new "entity" like it is for "People" and "Communities". Do I need to tweak elgg or is there any way to merely derived a new model from "people/communities" entities ?

The new entity is intended to describe organization (like a football club, dance club, school, etc...), and "communities" will map those organizations. Anyway, "communities" might be used for this purpose, but at the end I would like to "control" the creation of "organization" to avoid redundancies.

Thanks in advance for your piece of advice. 

Posted by Bertrand @ Developer discussion | 3 comment(s)

September 03, 2007

Looks like there's a bug in lib/elgglib.php, validate_email() or the doc in config.php is wrong. I'd say validate_email is wrong.

$domain = substr($address,strpos($address,"@")+1);

for an email test@smo.uhi.ac.uk, this gives smo.uhi.ac.uk

if (substr_count($CFG->emailfilter, $domain) == 0) return false

it tries to find smo.uhi.ac.uk in emailFilter, which is uhi.ac.uk so fails

The documentation in config.php states:

// If the following string is non-blank, it must be present within
// the domains of email addresses of people signing up.

which is clearly not the case. smo.uhi.ac.uk will never appear in uhi.ac.uk

Adding valid domains to emailFilter solves the problem: 

$CFG->emailfilter = "uhi.ac.uk smo.uhi.ac.uk";

should it be the other way around though? validate_email should work with one root domain in emailFilter? 

Keywords: email, error, friend, invite, validation

Posted by Alistair Young @ Developer discussion | 0 comment(s)

Hello everyone, I'm a total newbie to elgg, trying to create my very first plugin.

at the moment I'm only trying to diaplay the time on a page.

here is how the index.php looks like:

===== start index.php ==== 

<?php

    //    ELGG Time Test

    // Run includes
        require_once(dirname(dirname(__FILE__))."/../includes.php");
       
    // Initialise functions for user details, icon management and profile management
        run("userdetails:init");
        run("profile:init");       
        run("time:init");      
        templates_page_setup();
            define ("context","time");
    // Whose files are we looking at?

        global $CFG, $page_owner, $owner, $folder;
        $title = run("profile:display:name") . " :: ". __gettext("Time") ."";

        $body = run("time:display:view");

       
        echo templates_page_draw( array(
                    $title,
                    templates_draw(array(
                            'context' => 'contentholder',
                            'title' => $title,
                            'body' => $body
                        )
                        )
                )
                );
               
?>

====end index.php ====

 

and this is lib.php

===start lib.php ===

<?php

function time_pagesetup() {
   global $PAGE, $CFG;
  $time_url = $CFG->wwwroot."mod/time/";
        $PAGE->menu[] = array (
          'name' => 'time',
          'html' => "<li><a href=\"" . $time_url . "\" >" . __gettext("Time"
        ) . '</a></li>'); 
 }
 
  function time_init()
 {
     $function['display:view'][] = $CFG->dirroot . "mod/time/time_view.php";
 }
 ?>

===end lib.php === 

 

last file is time_view.php

===start time_view.php ===

<?php
    return  "The Time Now is " . (string) date("F j, Y, g:i a");
 ?>

==end time_view.php === 

 

nothing is happening when I'm trying to run this code.

what am i doing wrong?

 Thank you for any suggestion..

 

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

September 04, 2007

Well, as part of my personal coding Stalingrad, I was simply trying to insert a new record on behalf of a new user into my plugin's table.  Simple 'nuff, I just needed the user's id, and I'd be on my way and the sun would shine, birds would sing and the world would smile on me.

 I plugged in the code, registered a new user, my code snagged the object->ident from the listen_for_id call, checked the table, and found... user_id=0.

 Uh-oh.  Can you take a raincheck on sunshine?

 I thought about it, and it came to me.  There was nothing wrong with my code, or the database table, or the code to update it.  Nor even of the event structure.  The problem was...

When you register, receive your email, go back to the site to supply your password and announce you're older than 13, then the 'new' event happens.  Then, the 'publish' event happens, if the db insert was successful.

Then the register.php code redirects you to a login page.

My problem, and the likely reason the oversight hadn't raised a ruckus is...  my plugin happens whether you're logged in or not.  So, it happens when the login page loads.  And it catches the user's publish event.  But there's no id.  Seems the redirect wiped it.

And since nobody is logged in, there is no userid available from session either.

Now, being new with ELGG, I could be completely wrong about this.  But I checked out the object, and it didn't have any data, even though plugin caught the event just fine.  Can you confirm the issue?  And if so, can you consider automatically logging in the new user after confirmation?

I didn't post this as a bug report cause I'm still fairly new at this, though I've been spending lots of time with your code.  My less-than-perfect workaround was to query the User table for the max ident.

Summary:  Post-registration redirect whacks the user publish event object's data.  Workaround would be good, but it may be time to consider automatically logging newly-confirmed registered users to insure user_id is available from the environment.

 Paul Wolborsky

 '~~~~~~~~~~~~~~~ code snippet   /mod/map/lib.php

    function map_add_newUser($event_type,$event,$object)
    {
        $mapUser = new stdClass;
        $mapUser->user_id = $object->ident;
        $mapUser->owner = $object->ident;
        $result = insert_record('_mapusers',$mapUser);
        return $object;
    }

... from map_init

listen_for_events('user','publish','map_add_newUser'); 

-- table after code

table 'elgg_mapusers'

ident=4
user_id=0
owner=0

Keywords: event_hooks, ident=0, listen_for_events, mishap, missing user_id, problem, publish, user, user_id=0

Posted by Paul Wolborsky @ Developer discussion | 0 comment(s)

September 06, 2007

I’m looking to hire someone to handle a couple of small things I haven’t been able to sort out. Please email me a quote if your interested. You may bid on them seperately if you like.

1. I want the bug fixed where for a walled community when logged off the templates don’t work and the page looks crappy. See http://elgg.org/mod/forum/forum_view_thread.php?post=1204 for more details.

2. I don’t want Tasks, Search, or user stats showing up in the sidebar if not logged in.

3. I want users to be able to choose from a list of mp3 songs one for their profile just like myspace, not like the files section or any other widget in elgg. Users may also upload a song to the library.

Keywords: request for quote

Posted by Edward Leonforte @ Developer discussion | 0 comment(s)

I want some a real full featured forum either by writing a new deluxe forum mod or perhaps wrapping in a great forum like phpbb http://www.phpbb.com. My wish list is as follows: 

  1. Link to Forums in top menu leads to master page where members see all forums by all communities and persons that fit the user’s access level.
  2. Site admins create and maintain top level categories and subcategories for forums.
  3. All community owners choose where to categorize their communities by top level category and subcategory if applicable.
  4. Each community owner also has the ability to create community forum categories and to organize topics into those categories.
  5. And when any topic is created in that community the creator chooses from to categories given by the community owner or moderator.
  6. Persons also choose a category and subcategory for any topic/blog they create and they may change the category as may the admins.
  7. Whenever a category is changed a shadow of the topic or community remains in the old location with a hyperlink to the new location until removed by the topic owner or admin.
  8. Community owner is moderator and can do anything to any category, topic, or post including edit, delete, or change access restrictions.
  9. Topic/blog owner is moderator for topic and can do anything to any post including edit, delete, or change access restrictions. Anyone can edit their own posts up until the time another post has followed it.
  10. Post edits include note of who edited and when or who deleted and when.
  11. Categories and Topics have descriptions and keywords.
  12. Posts have keywords too.
  13. Admin/Community owner can assign other members as moderators.
  14. Categories have columns for Category Name (shows category name and description), No. of subcategories, No of topics, No. of posts, Last post (name, date, time)
  15. Subcategories have columns for Category Name (shows category name and description), No. of topics, no. of posts, started by (name, date, time), Last post (name, date, time)
  16. Topics have columns for Topic Name (shows topic name and description), No. of posts/replies, started by (name, date, time), Last post (name, date, time)
  17. Topics are marked read when read so users can see where they left off.
  18. Users may sort categories or topics by any column by clicking on column header name.
  19. Switch to mark all as read in any topic or category.
  20. Filter forums by a) member of community or by friends, b) marked interesting.
  21. Mark interesting function as in elgg blog (automatic with reply unless turned off).
  22. Admin or Moderator can peg any category or topic to stick to the top.
  23. Search function that searches the actual text of posts not just keywords. (this may be a mod of the main site search function).
  24. The forum would be the default for any community unless changed by the owner.
  25. Forum in community one only sees the community forums.
  26. Member info next to each post includes: members name, pic, blurb, posts, joined community, last active, city, state, country.

Posted by Edward Leonforte @ Developer discussion | 4 comment(s)

Hi everyone,

Am I correct that when a user logs in, the password is sent in cleartext from the brower to the server?  Wouldn't it be better to do some quick hashing to prevent that?  I'm new to PHP so please let me know if I've read the code incorrectly.

-Shultz

Keywords: password cleartext

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

I am a pretty bad hack as is, but I am stumped by this step. I am writing a new module for a widget.

I would like users using this widget's edit form in their manage widgets sections to be able to fill out a text box, just like the Text Widget, and to store it in the profile table as one of the existing profile fields [e.g., interests] rather than the widget_data table which is the existing default [and how the contents of the text widget are stored]. 

I would like to accomplish this task without modifying core files if possible, I see some awful messy ways to accomplish this in mod/widgets/edit.php and lib.php but nothing comes to mind for making a free-standing module.

I am also aware that for this to be fully functional keywords for the tags table would also be needed but that seems manageable. 

I have been circling this problem so long I can't really keep it straight anymore. Any help at all would be greatly appreciated!

Thanks!! 

Keywords: actions, edit widgets, manage widgets, profile, profile table, widgets

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

September 07, 2007

I would like to get rid of the pull-down menu on blog entries and profile data where the user has to select Private/Public/Logged in and make it such that all data is public...

 is there a single setting (like in config.php) that does this? if not, any ideas how to do this easily?

thanks in advance, raza 

Keywords: private, public

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

Which files determine how the profiles are presented. F.i. I've seen that some parts get an <h3> tag etc.

 I would like to change this and put some fields together etc. (for instance i want to put 3 fields together etc. 

Posted by Robbie van der Blom @ Developer discussion | 5 comment(s)

September 08, 2007

It seems that elgg RSS reader does not accept some feeds.

I think the problem is the snoopy class. it can not always fetch the xml content of the url via redirections.

An example: http://jaiku.com/channel/elearn/feed/rss

Trying to subscribe the feed above in our system (tugll) or in eduspaces.net, you receive the following message:

Feed subscription failed: feed appears to be invalid. Please check your link or try later.

If I turn on the debug message in file units/magpie/function_actions.php where $client->results is put in to an iframe, I get the following response which has, as you can see, no xml format.

Found

The document has moved here.


Apache/2.2.2 (Fedora) Server at jaiku.com Port 80

 

Any ideas?

Keywords: elgg, rss, rss reader, snoppy

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

September 11, 2007

Hi all,

I've seen some mention of development being done regarding using Elgg as an OpenID server and I'm just wondering what the status is on this?

Thanks,

Gearoid 

Keywords: elgg openid development

Posted by Gearoid Hynes @ Developer discussion | 2 comment(s)

Does or Can ELGG deploy IP logging for activities such as blog post and login?  I wouldn't mind seeing each blog post with an IP address below it.

Can you hack the "add blog post page" to do this? 

 

One of the things about Moodle that is awesome is that student activities are traceable by IP for everything the student does.  This has helped solve a few significant issues we had. 

Keywords: blog, IP, IP logging

Posted by Chris Kenniburg @ Developer discussion | 0 comment(s)

September 13, 2007

Hi,

I'm trying to answer this post:

http://elgg.org/developers/weblog/1328.html

But it returns a blank page. Elgg.org must be with some problem, I tried post the comment several times...

Here is my answer:

----- 

Beni, look at the error with this feed on feed validator page: www dot feedvalidator dot org

It seems a simple error, I didn't understand it very much, but maybe this can help you understand why Elgg doesn't accept this feed...

Message

Image link doesn't match channel link

Explanation

This should be the same URL as the channel's link element.

Solution

Repeat the channel's link element in the image.

 

Keywords: bug, comment, elgg.org, post comment

Posted by Everton Zanella Alvarenga @ Developer discussion | 13 comment(s)

September 15, 2007

Hi,

I recently downloaded and installed Elgg on a shared host in order to test it.

However it seems that in order to install translations i need to have shell access to my sever (which i don't).

Any way around this ?

 

Keywords: hebrew, translation

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

September 19, 2007

I am running elgg 0.8. It is not the latest svn. ( i dont think ) I have found that whenever a user makes a post in a community blog... It shows the usericon for the community, not for the indvidual user.

However, here on elgg.org. I see that the usericons that are displayed withen even this developer discussion community are mixed. Mixed between the community user icon and then peoples own user icon.

The forum mod, cleans this up and posts peoples usercions as normal. However, in the blog view. I am just getting an endless repeat of the communities usericon! Please advise a fellow elgger!

Keywords: communities, community, icon, usericon

Posted by Adam Poots @ Developer discussion | 1 comment(s)

Is there a trick to the new comment wall svn.. i cant seem to get it working. Ive deleted my old comment wall, and replaced it... But it just dosnt appear at all, nothing, no errors and it i cant add it to profile pages.

 Thanks!

Keywords: comment wall, comment wall error, comment wall svn

Posted by Adam Poots @ Developer discussion | 5 comment(s)

Hi,

I have heard that the next version of Elgg will not only address a few issues, but also introduce a more 'core' version with 'extraneous' stuff supported via plugins. This sounds like not only a good thing (tm), but also something that wouldn't be backwards compatible.

As I have a fairly hefty project for which I have (pretty much) decided to use Elgg, I am wondering if there's any word on said new release - in other words I'm wondering whether I'm better off waiting.

TIA :) 

Keywords: Compatibility, Stable, Version

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

September 22, 2007

I had this issue before on a site, i thought was something around the server versions. I fixed with a workaround, but recently i had the same problem again. One has php 5 and other php 4.

Perhaps some problem around cookie ElggSessionTest which gets the value "deleted" (¿?), and loop into report_session_error() function in setup.php. Causing a infinite redirect loop.

I was fixed with a workaround with session_destroy, here is the patch:

[patch] 

diff -r 665d58701993 -r 49e6a102a4fd lib/elgglib.php
--- a/lib/elgglib.php   Thu Sep 06 02:42:38 2007 -0400
+++ b/lib/elgglib.php   Thu Sep 06 12:21:45 2007 -0400
@@ -372,6 +372,8 @@ function report_session_error() {
     //    set_config('session_error_counter', 1);
     //}
     //called from setup.php, so gettext module hasn't been loaded yet
+    //workaround;
+    session_destroy();
     redirect($FULLME, '', 1);
 }
 
diff -r 665d58701993 -r 49e6a102a4fd login/logout.php
--- a/login/logout.php  Thu Sep 06 02:42:38 2007 -0400
+++ b/login/logout.php  Thu Sep 06 12:21:45 2007 -0400
@@ -26,6 +26,7 @@ if (isset($_COOKIE[session_name()])) {
 // Remove the any AUTH_COOKIE persistent logins
 setcookie(AUTH_COOKIE, '', time()-84600, $CFG->cookiepath);
 
+session_unset();
 session_destroy();
 
 // Set headers to forward to main URL
 

[/patch] 

Anyone had this issue? 

Keywords: bug, elgg, patch, redirect, session

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

September 27, 2007

Sorry about the cross post - see http://elgg.org/mod/forum/forum_view_thread.php?post=13

I am still having problems with this. I am at v1229 (the most recent version on SVN). I have the same issue of two different installs (a test one and a live one) with editing a posted file. When I try to save the changes I get directed back to the home page and the changes are not made.

I've tested this on eduspaces and it works as I'd expect - after saving I go back to the list of files and the chage is made.  The form's "action" the same in mine as eduspaces. Does anyone (Ben, Dave?) have any idea why this could be happening?

 There are a couple of demo accounts on my lilve install that you can use to see the problem: go to http://elgg.ll4schools.co.uk

What is eduspaces running? The devel version or a "stable"? Has anyone else seen this problem? 

Any help appreciated. 

Keywords: edit files, files, redirection, your files

Posted by John Hackett @ Developer discussion | 6 comment(s)

September 28, 2007

I discovered this system earlier this week and am very impressed by what it can do. I managed to get it installed on my webhost without too much trouble (I had to edit alot of PDF files because im on dreamhost or something), but it seems to work well. I have a few issues though. Is there a way to implement friends verification? like if I attempt to add a person as a friend, the system could require the other party to accept or deny this option?

I've also noticed that the search system doesn't really work, atleast not for me. It never returns results, no matter what I search for (friend names, leaving it blank, whatever). Is this function supposed to work yet?

Otherwise, the software seems really well put together and quite functional. 

Keywords: friends, search, verification

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

Site supported by Curverider Ltd - powered by the awesome Elgg