mobabur94

About me: they speak english in what?!
Location:
Email: mobabur94@gmail.com

Send private message

You must be logged in to send a private message.

Activity

  • mobabur94 replied on the discussion topic Tidypics Conflict
    If I remove the code for the plugin settings, it works. Not sure why though. view reply
  • mobabur94 added a new discussion topic Tidypics Conflict in the group Beginning Developers
    http://www.mediafire.com/download.php?do7m9oop4o93286 ^ That is a plugin I'm working on. It works perfectly fine. Except it conflicts with teh tidypics mod.. Photo thumbnails don't load and I can't figure out why. When I disable the didyouknow...
  • mobabur94 has a new avatar
    mobabur94
  • mobabur94 replied on the discussion topic How do I override engine code?
    Yeah sure. In /engine/lib/entities.php, I added a small if statement to the elgg_list_entities() function: function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entities', $viewer = 'elgg_view_entity_list') { global... view reply
  • mobabur94 added a new discussion topic How do I override engine code? in the group Beginning Developers
    I added a small if statement to a function in /engine/lib/entities.php How can I add that change to a plugin? Is it possible to just copy that core file to myplugin/engine/lib/entities.php and make the change there?
    • Share your requirements. most things can be done with plugin / event hooks.

    • those 2 points above are valid..
      if need good assistance - answer both questions

      generally - functionalities should be achiveable with hooks etc
      and only in the very rare cases might a core code change be needed

      you should be available soon enough to supply a requirements statement 
      and that 1 line of 'if' code + 10 lines before + 10 lines after
      to enable quicker understanding of your purpose
      and then we can fiigure the better/best way through

       

    • Yeah sure. In /engine/lib/entities.php, I added a small if statement to the elgg_list_entities() function:

      function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entities',
      	$viewer = 'elgg_view_entity_list') {
      
      	global $autofeed;
      	$autofeed = true;
      
      	$defaults = array(
      		'offset' => (int) max(get_input('offset', 0), 0),
      		'limit' => (int) max(get_input('limit', 10), 0),
      		'full_view' => TRUE,
      		'list_type_toggle' => FALSE,
      		'pagination' => TRUE,
      	);
      
      	//the "small if statement"
      	if(isset($options['pagination']) && $options['pagination'] == FALSE){
      		$options['offset'] = 0;
      	}
      	//end the "small if statement"
      
      	$options = array_merge($defaults, $options);
      
      	//backwards compatibility
      	if (isset($options['view_type_toggle'])) {
      		$options['list_type_toggle'] = $options['view_type_toggle'];
      	}
      
      	$options['count'] = TRUE;
      	$count = $getter($options);
      
      	$options['count'] = FALSE;
      	$entities = $getter($options);
      
      	$options['count'] = $count;
      
      	return $viewer($entities, $options);
      }
      

      I am using the Custom Index Widgets mod to have the latest activity and the latest wire posts widgets show up on the index page. I want the activity widget to be paginated which is fine and works, but when you have ?offset=10 in the url, the latest wire posts get offset as well. However in the latest wire posts widget, pagination is set to false.

      This is not an issue only with latest wire posts, but latest files and a bunch of other widgets that set pagination to false but don't set offset to 0 when they call elgg_list_entities()... I am also using Widget Manager and it's also a problem with profile and group pages which have widgets that have pagination enabled and widgets that don't.

      I could simply edit each widget that has pagination set to false and just set offset to 0.. but it's much easier to just add this if statement to the engine..

      I don't like to edit core but otherwise I would be modifying like 15-20 files in the mod folder..

Group membership