Bold is the file code.
I wanted to call the execution of a file or code where it is marked "HERE".
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly
iionly - 0 likes
- ChocolateSwing@vagsiarom
ChocolateSwing - 0 likes
//filtered users $filterid = (int) $vars['entity']->todayfilterid; if (!$filterid){ $filterid = 0; } print '<div class="user_settings"><p style="text-align:right">'.elgg_echo('today_celebrations:today').' <strong>'.printcelebrationsdate(1, time()).'</strong></p>'; $row_celebrations = user_celebrations(0,'next', $filterid); // list of celebrations if (!empty($row_celebrations)) { print '<table width="100%">'; foreach($row_celebrations as $key => $val) { $sendcelebrationsmessage = ''; if (($val['type'] != 'dieday') && ($val['id'] != elgg_get_logged_in_user_guid())) { $sendcelebrationsmessage = '<a class="privatemessages" href="'.elgg_get_site_url().'messages/compose?send_to='.$val['id'].'" > </a>'; } if ((elgg_get_plugin_setting("replaceage","celebrations") == 'yes') && ($val['type'] == 'birthdate')){ $age = showage($val['date']).' '.elgg_echo('celebrations:age'); } else { $age = ''; } $even_odd = ( 'F3F3F3' != $even_odd ) ? 'F3F3F3' : 'FFFFFF'; echo "<tr bgcolor=\"#{$even_odd}\">"; print '<td><img class="user_mini_avatar" src="'.$val['icon'].'"> <a href="'.$val['url'].'" title="'.$val['fullname'].'">'.$val['name'].'</a></td><td align="right">'.elgg_echo('today_celebrations:'.$val['type']).'</td><td align="right">'.$age.'</td><td align="right">'.$sendcelebrationsmessage.'</td></tr>'; } print '</table>'; print '</div>';
- iionly@iionly
iionly - 0 likes
- ChocolateSwing@vagsiarom
ChocolateSwing - 0 likes
- iionly@iionly
iionly - 0 likes
- ChocolateSwing@vagsiarom
ChocolateSwing - 0 likes
You must log in to post replies.The third parameter of elgg_view_module() must contain already the content you want to output. The third parameter is not meant to refer to a view / file that deals with the output.
Just assign the output of the print commands to a variable and then use this variable as 3rd parameter, i.e.
You just need to make sure to assign all print output to the variable.
Thank you Master iionly for the tip. But then I need to put the whole line of code below for the third parameter. How to associate this whole line in a variable? In case it would be $ body
It's not the whole code but only the output produced by this code that you need to assign to a variable that you then use as 3rd parameter. The whole code needs to be added in the file you also have the elgg_view_module() line with changing the direct output of the code (here the print command is used for output), e.g.
becomes
For the second and consecutive outputs you would have to use .= instead of = to append the output to the value already assigned to $body.
You also need to define the values taken from the $vars variable directly here. In the celebrations plugin the $vars array values are set elsewhere already when the code is called. You can't rely on that anymore.
If you wouldn't want to add the whole code here, you could add a new view file (widget view files won't work though) and then call this view with elgg_view(), e.g.
In this case you would still have to set the values used in the $vars array in the view but the code would not have to get changed (because elgg_view() return the output and saves in in $body that you can then use for elgg_view_module()).
Trying to master but nothing yet. I want to call plugin celebration on my main page, just like I called blogs, events ... except that in these plugins I was able to identify type and subtype. Today's birthday I can not call. Below is the format I call blogs, events ... $ Options = array ( 'Type' => 'birthdate', // 'subtype' => 'birthdate', 'Full_view' => false, 'Pagination' => false, 'Subtitle' => $ date, 'Limit' => $ num, 'List_type' => 'gallery', ); $ Row_celebrations = elgg_get_entities ($ options); Up $ row_celebrations would be the third parameter. But in celebrations this method does not work.
this method does not work.
The Celebrations plugin needs some custom code to retrieve the celebration entities, so the way it works for other entities won't work. Also, listing is done in a custom way.
Assuming you use Elgg 1.8 (as newer releases of the Celebrations plugin no longer use the "print" command) the code would be
That's the code also used in mod/celebrations/views/default/widgets/index_today_celebrations/content.php (which offers an index page widget if the Widget Manager plugin is installed). The only changes necessary are the points I already outlined in my previous postings.
Thank you Master Iionly for the help. I broke my head but I did it. $ Result. = '<Table width = "100%">'; $ Result. = Print '</ table>'; Thank you very much! Learning more and more!