Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Activity

  • Jon replied on the discussion topic Questions about Elgg's future
    Cash, I took a look at the code from the link Brett supplied. The new search mod looks nice. I'll give it a test when I can find the time. view reply
  • Jon added a new discussion topic Inclusion of start.php in the group Elgg Technical Support
    Hi Everyone. Could someone please explain to me why a page that is included by the page handler includes the engine/start.php? The page handler file already includes this file. Are there times one will call the file directly rather than use the...
    • The development of Elgg was incremental. I think (I wasn't around then) originally the pages were called directly and then over time they were moved to used page handlers. I also have a sneaking susicipion that the include of Elgg's boot script was left in just to be safe.

      The plan is to clean this kind of thing up in the plugins for the 1.8 release of Elgg.

      In general, plugins should avoid calling a page directly but use the page handling system. This allows other plugins to override the page handler of a plugin (or some section of the core) and create their own pages.

      We've also thrown around adding a better routing system but I think you brought that up before...

    • Hi I've realised one of my plugins has a mix (for a me, a confusing mix) of page calls - some using the page handler - some going straight to the /mod/ ...which doesn't look good in the browser.

      for example;

      add_submenu_item(elgg_echo('myplugin:everyone'),$CONFIG->wwwroot."mod/myplugin/everyone.php");
                      add_submenu_item(elgg_echo('myplugin:search'),$CONFIG->wwwroot."mod/myplugin/mypluginbycountry.php");
                      add_submenu_item(elgg_echo('myplugin:featured'),$CONFIG->wwwroot."mod/myplugin/featured.php");
                      add_submenu_item(elgg_echo('myplugin:your'),$CONFIG->wwwroot."pg/myplugin/" . $_SESSION['user']->username);
                      add_submenu_item(elgg_echo('myplugin:friends'),$CONFIG->wwwroot."pg/myplugin/" . $_SESSION['user']->username . "/friends/");

      I also have:

          register_page_handler('myplugin','myplugin_page_handler');
          function myplugin_page_handler($page) {
              // The first component of a myplugin URL is the username
              if (isset($page[0])) {
                  set_input('username',$page[0]);
              }
              // The second part dictates what we're doing
              if (isset($page[1])) {
                  switch($page[1]) {
                      case "read":        set_input('mypluginpost',$page[2]);
                                  @include(dirname(__FILE__) . "/read.php");
                                  break;
                      case "friends":        @include(dirname(__FILE__) . "/friends.php");
                                  break;
                  }
              // If the URL is just 'myplugin/username', or just 'myplugin/', load the standard myplugin index
              } else {
                  @include(dirname(__FILE__) . "/index.php");
                  return true;
              }
              return false;
          }

       

      So - If i call any of those pages which have /mod/ as they are added to the submenu BUT with pg they get messed with and presented incorrectly - as per the function above. Is there an easy way to incorporate into the page handler function an exception for everyone.php , featured.php and mypluginbycountry.php - i think that'd solve the problem?

       

  • Jon joined the group Elgg Technical Support
  • Jon replied on the discussion topic Questions about Elgg's future
    Brett, There is no search module included in the core or full version of 1.6.1 when downloaded from elgg.org. The search is located in the root of the project. This is what prompted my question. I then retracted it when I found a solution that... view reply
  • Jon replied on the discussion topic Questions about Elgg's future
    Cash, Thanks for the link view reply
  • Jon joined the group General Discussion
  • Jon replied on the discussion topic Questions about Elgg's future
    Cash, I'll give it a try. See if it meets my needs. Thanks. view reply
  • Jon replied on the discussion topic Questions about Elgg's future
    Cash, On debugging tools, I've thought about adding a visual toolbar to the Elgg developer tools, but have been happy with FirePHP/Firebug. If you haven't tried it:... view reply