Phill collins

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • @rjcalifornia No, no spammers here! view reply
  • iionly, so I think it is time to change to a dedicated server, right? I am worried about it, because I use this shared server more than one year, and only now it comes to happen. Anyway, if I move to a dedicated one, will I have problems with... view reply
  • Phill collins has a new avatar
    Phill collins
  • Well, my problem is that my file page_handler.php is using almost 60%(!!!) of the cpu. I don't know what is causing this (my site has 20 visits/day) and I didn't change anything on it.No new plugins and no new codes written. How can I...
    • @Phil Collins

      I sent you a private message yesterday. Could you please respond to that?

      Thanks

    • @Phil: are you really sure that it has changed?

      As I've tried to explain the 60% are very likely NOT "60% total available CPU resources used" but rather "60% of the CPU resources used are by pagehandler.php". And this would be a perfectly normal situation. If the site is not having any visits for example in 23h59min in a day you still would have "~60-80% CPU resources used by pagehandler.php" in the remaining 1min even if the CPU is idle for almost all day.

       

    • Almost all requests end up going through the pagehandler, so either explanation is valid.  If the site is doing something to eat up resources it would still likely be reported as pagehandler.php

      Unfortunately without additional details there's no good way of identifying the real issue or a solution.

  • Phill collins added a new discussion topic It's about Elggx Userpoints plugin in the group General Discussion
    Is there a way to return to any user of my site how many points they gained in a day?   For example: I have 100 points.But today I only won 15 points, then, it should return me "15 points". Well, thanks since now.
    • Not tested the following code but it should do what you have in mind:

      // Which user do you want to get the points gained today for?
      $user_guid = elgg_get_logged_in_user_guid(); the user logged in
      // or
      $user_guid = elgg_get_page_owner_guid(); // for example the user whose profile page someone is looking at

      // the following line is likely to be necessary if the intention is to let another user see
      // how many points the user has gained today. It disables Elgg's access management temporarily
      $access = elgg_set_ignore_access(true);

      $points_entities = new ElggBatch('elgg_get_entities', array(
          'type' => 'object',
          'subtype' => 'userpoint',
          'owner_guid' => $user_guid,
          'created_time_upper' => time(),
          'created_time_lower' => time() - 86400,
      ));

      $points_today = 0;
      foreach($points_entities as $entity) {
          // only considering points that have already been approved here
          // if pending userpoints are to be counted up, too, the if-clause is not necessary
          if ($entity->meta_moderate == 'approved') {
              $points_today = (int)$points_today + (int)$entity->meta_points;
          }
      }

      // restore Elgg's access management
      elgg_set_ignore_access($access);

      echo "Userpoints gained today: " . $points_today;

      If you would include it for example in mod/elggx_userpoints/views/default/elggx_userpoints/icon.php in an appropriate way it should display the points the user gained today on the profile page.

  • Phill collins added a new discussion topic It's about Profile manager plugin in the group General Discussion
    Well,  am using 'profile manager' plugin and I just created some custom profile fields. But I need to know how can I get one of these fields (birthday, for example) and show it in another page (not in profile edit).It seems weird,...
  • Phill collins added a new discussion topic Is it possible to create an app to an elgg site? in the group Professional Services
      Wel, I used the plugin "mobilize" to get a mobile version of my site and it is working well...but i miss something more, something like an app for my site.Is it possible?   If yes, how expensive could be to pay someone to do...