Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • tobi added a new discussion topic numbered elgg_list_entities in the group Elgg Technical Support
    Hello, I am using the function elgg_list_enties. I have a subtype called "agvideo". For the list-item content I have a file (views/default/object/agvideo.php). Everything works fine, but now I want it to look like a chart, so I need numbers in...
  • tobi added a new discussion topic Javascript & Simple Cache in the group Elgg Technical Support
    Hello, before my javascript is delivered to the server, there are some php code in the file <?php $ts = time();$token = generate_action_token($ts);$url = elgg_get_site_url() ....
  • tobi added a new discussion topic Fatal Error - Exception #1368308531 in the group Elgg Technical Support
    On every page this text comses up Fatal Error. An unrecoverable error has occurred and has been logged. Contact the site administrator with the following information: Exception #1368308580.   What can I do?
    • The #1368308580 is a unix timestamp informing you when this fatal error has occured. At this time an entry is added to your server's log (Apache log file or php log file if this is a separate file). This entry will contain more information about the fatal error. You can search in your server log for this number (1368308580) to find the entry or you can convert the unix timestamp into a normal time+date format (e.g. here: http://www.gaijin.at/olsutc.php) to know when this error occured and jump to the entries in the server log added around this time.

      If you have found  the entries in your server log, you might already got an idea how to solve your problem. Otherwise, you can post here the additional info made in the entries here to ask for help as the fatal error message alone won't give any indication alone what might go wrong. The only general advice that comes to my mind: in case you made any changes on your site recently (e.g. added a plugin, made any upgrade) this might be causing the problem and you might need to revert back / disable the plugin etc.

  • tobi added a new discussion topic change language in the group Elgg Technical Support
    I know that I can change the language for the whole site and also that an user can choose his language. But I want a language button on the page to change the language even you are not logged in. Someone has a hint for me how to do this? Thanks...
  • I solved it now with jQuery: $(document).ready(function() {    path= window.location.pathname;    if(path.indexOf( 'activity' )>-1){      ... view reply
  • I have version 1.8.13 and the elgg-state-selected class won't come up for the custom menu items (elgg-admin ->Appearance->Menu Items). Any ideas?I guess it was lost by upgrading from 1.8.1 to 1.8.9. Thanks in Advance Tobi view reply
  • tobi replied on the discussion topic How to configure multiple database in elgg
    //Connect to another database$r2 =mysql_connect( $host,$user, $pass) OR die(mysql_error());mysql_select_db($db,$r2) OR die(mysql_error());  //Do some sql$sql = 'INSERT INTO ...';$res=mysql_query($sql,$r2); //get back to elgg... view reply
  • tobi replied on the discussion topic turn off System log
    OK, here is the code. It is a API function /** *  Ratings and Votings into elgg * ids is a string like that:*  VideoID:Rating:Count_of_Votes;VideoID2 ... *  * @param string $ids * @return string */function... view reply
  • tobi added a new discussion topic turn off System log in the group Elgg Technical Support
    Hello, I use a cronjob to put some metadata of the users from another system into elgg. The cronjob runs every 10 minutes and it creates, updates and delete metadata. And everything is logged in the elgg systemLog. Now I have got 752,237 entries in...
    • post that code here and we can then spend some time to study it to see what more code is needed to do what you're seeking.

    • OK, here is the code. It is a API function

      /**
       *  Ratings and Votings into elgg
       * ids is a string like that:
      *  VideoID:Rating:Count_of_Votes;VideoID2 ...
       *
       * @param string $ids
       * @return string
       */
      function apiSetRating($ids){
          if(!empty($ids)){
              $ignore = elgg_set_ignore_access(true);
              $ids=explode(';',$ids);
              $meldung='';
              $error='';
              while (list($er)=each($ids)) {
                  $idRat=explode(':',$ids[$er]);
                  //get video
                  $video=get_entity(intval($idRat[0]));
                  if(!is_object($video)){
                      $error .='Video '.$idRat[0].' not found
                      ';
                  }else{
                      $meldung.='
                      Video: '.intval($idRat[0]).'
                      Rating: '.intval($idRat[1]).'
                      Voting: '.intval($idRat[2]);
                      //set Rating
                      $video->agvideoRating=intval($idRat[1]);
                      //count votings
                      $video->agvideoVotings=intval($idRat[2]);
                  }
              }
              elgg_set_ignore_access($ignore);
              return array('succsess'=>'Ratings and Votigs ok','error'=>$error,'Meldung'=>$meldung);
          }
          return array('error'=>'no IDs');
      }

    • i don't see any explicit ->save() !?;-)
      try :-
      elgg_unregister_event_handler('all', 'all', 'system_log_listener');
      elgg_unregister_event_handler('log', 'systemlog', 'system_log_default_logger');
      call..     apiSetRating($ids);
      elgg_register_event_handler('all', 'all', 'system_log_listener');
      elgg_register_event_handler('log', 'systemlog', 'system_log_default_logger');
      -- but need to set it back after your call. - function code is core - not avail to you! how ?

  • tobi added a new discussion topic How to sort owner menu? in the group Elgg Technical Support
    Hello, I want to sort the owner menu. The default is alphabetically. But I want to use the priority value. That my try, which is not working (priority is ignored - always sorted alphabetically by text...
    • Seems this does not work with setPriority().  However, the following 2 documented methods of ElggMenuItem are doing the same:

           setWeight ($priority)
           Set the priority of the menu item.

           setPriority ($priority)
           Set the priority of the menu item

      So what on earth is the difference? :-)

      Have you tried with setWeight()? this might work.

    • The priority is part of the EllgMenuItem, but it is not sorted by it.

      Now I have done it this way.

      I have copied the view "views/default/navigation/menu/default.php" to my plugin under

      "myplugin/views/default/navigation/menu/owner_block.php"

      Then I added this function to the code to sort the menuitems by priority

      function sortOwnerMenu($a, $b)
      {
          if(is_object($a) AND is_object($b)){
            if ($a->getPriority() == $b->getPriority()) {
              return 0;
            }
            return ($a->getPriority() < $b->getPriority()) ? -1 : 1;
          }
      }

      usort($vars['menu']['default'], 'sortOwnerMenu');

      This works - but perhaps there is a more "elgg-like" way to do this?

    • The sort is done during the ElggMenuBuilder::getMenu call: http://reference.elgg.org/1.8/classElggMenuBuilder.html#abfa107901d7c497c1da216e7d14cd4fd

      I don't know offhand if there's a way to set this dynamically, but if so, that would be the most elgg-like way I guess.

  • tobi replied on the discussion topic Ordering relationships
    Ok  -so I have done it this way, to get a orderd video-playlist of entities for every user: //generate a name for metadata unique for every user$ordernumbername='playlist'.$playlistowner->getGUID(); //use this metadata to order the... view reply
  • tobi added a new discussion topic Ordering relationships in the group Elgg Technical Support
    Is it possible to order relationships, something link store a ordernumber with the relatingship?
    • Ok  -so I have done it this way, to get a orderd video-playlist of entities for every user:

      //generate a name for metadata unique for every user
      $ordernumbername='playlist'.$playlistowner->getGUID();

      //use this metadata to order the entities
      $videoentity->$ordernumbername; //put the ordernumber to one entity

      //Get the entities ordered by the generated name
      $params = array(
      'type' => 'object',
      'subtypes'=>'video',
      'full_view' => false,
      'order_by_metadata'=>array(
      'name' => $ordernumbername,
      'direction' => 'ASC',
      'as'=>'integer')
      );
      $videos= elgg_get_entities_from_metadata($params);

       

      No relationships needed!

  • tobi added a new discussion topic Profile Type on registration page - Profile Manager in the group Elgg Technical Support
    Hello, I am using the Profile Manager (great PlugIn). But I want the users to decide on the regestrations page for one profile type. There is no possibility in the Profile Manager to have the profile-type on the registration page. So I have in my...
  • tobi added a new discussion topic indirectly Metadata Searching in the group Elgg Technical Support
    I have a subtype for videos.The Videos have as owner_guid the guid of a user.The Users have a Metadata for the country ($user->country='de')Now I am looking for videos from a special country. How can I do that? Is it possible to use...
  • tobi added a new discussion topic Remove "All - Mine - Friends" Menü in the group Elgg Technical Support
    I have done a object list , doing  this way $options array('type'=>'object','subtypes'=>'video',owner_guids'=>array($owner->guid));$content .= elgg_list_entities($options);$params = array(    'content' =>...
  • tobi replied on the discussion topic elgg_unregister_menu_item - finding the right name
    I have place this in the init function of my plugin. Now I have run the upgrade.php and the dashboard icon has gone away. view reply
  • tobi added a new discussion topic elgg_unregister_menu_item - finding the right name in the group Elgg Technical Support
    I want to unregister a menupoint (the dashboard) in the top bar I have tried this: elgg_unregister_menu_item('topbar', 'dashboard'); But it seems not to be the right name for this item.How can I find out the right name?
    • elgg_unregister_menu_item('topbar', 'dashboard'); is the same function you need to unregister the dashboard link. Where are you adding this? Also try to place the plugin under the bottom of the list.

    • I have place this in the init function of my plugin.

      Now I have run the upgrade.php and the dashboard icon has gone away.

  • tobi replied on the discussion topic Most viewed
    Ok, no standards there. What about somthing like that: $count=intval($entity->viewcount);$entity->viewcount = (1 + $count); or would an annotation be better? Never have done something with annotation till now. view reply
  • tobi added a new discussion topic Most viewed in the group Elgg Technical Support
    Is there a function to create a list of most viewed entities of a special subtype?
    • Create an incrementing annotation on the entity for each view and then fetch entities based on these annotations.

    • Ok, no standards there.

      What about somthing like that:

      $count=intval($entity->viewcount);
      $entity->viewcount = (1 + $count);

      or would an annotation be better?
      Never have done something with annotation till now.

  • tobi replied on the discussion topic Elgg API
    Here is the solution: I have added the following to the api function function doSomeApiStuff($id){   $ignore = elgg_set_ignore_access(true);   //here my code   elgg_set_ignore_access($ignore); }      ... view reply