Stephen

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • Stephen added a new discussion topic Register form is not sticky when used in dropdown menu in the group Elgg Technical Support
    I added the registration form as a dropdown form next to the Log In button at the top. Everything works fine unless registration fails and then the form does not retain its values. The sticky form functions are still be called as the views and...
  • Stephen replied on the discussion topic elgg_get_entities with custom SQL
    I see. Thanks. Although I still can't see how you could order the results based on the number of topics, as they are not stored as metadata? I think you may still need a JOIN (or something!) to do that?  I've actually done it my way now, it... view reply
  • Stephen replied on the discussion topic elgg_get_entities with custom SQL
    I'm struggling to see the metadata relationship between groups and discussion topics? I can see that when a new topic is saved the group is set as its container_guid, but I don't think this helps at all. I'm leaning towards overriding or extending... view reply
  • Stephen added a new discussion topic elgg_get_entities with custom SQL in the group Elgg Technical Support
    Anyone that is much more profficient at SQL than me feel like helping me with selecting entities? I want to select all groups where discussion is enabled, preferably ordered by the groups which have the most discussion topics. Any help or guidence...
    • I'm struggling to see the metadata relationship between groups and discussion topics? I can see that when a new topic is saved the group is set as its container_guid, but I don't think this helps at all.

      I'm leaning towards overriding or extending the discussion/save action, creating a relationship between the topic and the group and then searching with elgg_get_entities_from_relationship_count().

      Does this sound reasonable? Or am I missing something obvious with the metadata?

      Thanks

    • No, I think Pawel meant that you can search groups based on the "forum_enable" metadata.

      $groups = elgg_get_entities_from_metadata(array(
          'type' => 'group',
          'metadata_name_value_pairs' => array(
              'name' => "forum_enable"
              'value' => "no",
              'operand' => '!='
          ),
          'limit' => false
      ));

      This will return all groups that have group discussions enabled.

    • I see. Thanks.

      Although I still can't see how you could order the results based on the number of topics, as they are not stored as metadata? I think you may still need a JOIN (or something!) to do that? 

      I've actually done it my way now, it was quite simple and I think it makes the ordering easier. It also means that results will only show up if at least one discussion topic has been created.

       

  • Stephen added a new discussion topic User settings for individual groups? in the group Plugin Development
    Any ideas on the best way to store and retrieve user settings for each individual group? The only way I can see so far is to create a user setting using metadata and prefix the setting name with the group guid. Any more elegant solutions?  
  • Stephen joined the group Plugin Development
  • Stephen replied on the discussion topic Choose which top menu item is highlighted
    Thanks for the answers everyone. For clarity, if anyone else has the same question in the future: My menu item was setup using $item = new ElggMenuItem('item_name', elgg_echo('Menu Label'), 'plugin/link'); elgg_register_menu_item('site',... view reply
  • Stephen added a new discussion topic Choose which top menu item is highlighted in the group Elgg Technical Support
    I've created my own plugin and created a top menu item using elgg_register_menu_item which all works fine, when I click on the menu it highlights the menu item to show it's selected, but when I browse to any further pages I lose the...
    • @Juho Jaakkola :) There is another CSS trick.

      I meant create CSS style and add link class into  menu:item.

       

      In css.php

       

      .elgg-menu-page li.elgg-state-selected > a {
          color: white;
      }

      .elgg-menu-page li > a.elgg-state-selected {
          color: black;
      }

       

      Sure, it's works for menu:page only.

      For other items need to create similar styles too, e.g.:

       

      .elgg-menu-extras li > a.elgg-state-selected {
          color: white;
      }
      .elgg-menu-extras li.elgg-state-selected > a {
          color: black;
      }

    • Make all your plugin pages push a context like "vendor_myplugin". Give your site menu item the same name.

      Elgg has a built-in menu handler that will auto-select the item based on current (topmost) context.

    • Thanks for the answers everyone.

      For clarity, if anyone else has the same question in the future:

      My menu item was setup using

      $item = new ElggMenuItem('item_name', elgg_echo('Menu Label'), 'plugin/link');
      elgg_register_menu_item('site', $item);

      Then on each plugin page where I want to highlight that menu item I used

      elgg_push_context('item_name');

      Seems to work anyway!