";//{$news_image_url}";
if (getImageFileExists("small_" . $news->guid . ".jpg", $news->getOwner())) {
$news_image_url = getImageFileURL("small_" . $news->guid . ".jpg", $news->getOwner());
$main_news .= "
";
}
$main_news .= $news_text . "
";
/*translation:Read more...*/
$main_news .= "";
$featured_group = $featured_groups[0];
/*translation:Featured group*/
$group_info .= "
getURL() ."\">" . elgg_echo("koolielu:heading_featured_group") . "";
$group_info .= "
";
$group_info .= elgg_view("groups/icon", array('entity' => $featured_group, 'size' => 'medium'));
$group_info .= "
" . $featured_group->briefdescription . "
";
$group_info .= "
";
/*translation:View*/
$group_info .= "
getURL() . "\">" . elgg_echo("koolielu:link_view") . "";
$group_info .= "
";
}
// get front page discussion
$frontpage_disctopic = get_entities_from_metadata("frontpage", "1", "object", "disctopic");
if (is_array($frontpage_disctopic) && sizeof($frontpage_disctopic) > 0) {
$topic_info = "";
$topic = $frontpage_disctopic[0];
/*translation:Featured topic*/
$topic_info .= "
getURL() ."\">". elgg_echo("koolielu:featured_topic") ."";
$owner_entity = $topic->getOwnerEntity();
$topic_info .= "
";
if ($owner_entity) {
$topic_info .= elgg_view("profile/icon", array('entity' => $owner_entity, 'size' => 'medium', 'override' => 'true'));
} else {
$topic_info .= "
wwwroot}mod/profile/graphics/defaultmedium.gif\" />";
}
$topic_info .= "
" . autop($topic->description) . "
";
$topic_info .= "
";
/*translation:View*/
$topic_info .= "
getURL() . "\">" . elgg_echo("koolielu:link_view") . "";
$topic_info .= "
";
}
$latest_news = get_entities_from_metadata_multi(array("frontpage" => "0", "approved" => "1", "archived" => 0), "object", "news", "", 999);
$news_div = "";
/*translation:News*/
$news_div .= "
wwwroot."pg/info/news" . "\">". elgg_echo("koolielu:news") ."";
$news_count = 0;
if (is_array($latest_news) && sizeof($latest_news) > 0) {
foreach($latest_news as $lnews) {
$publishing_date = $lnews->deadline;
if (!$publishing_date || ($publishing_date < time())) {
$lnews_comments_count = elgg_count_comments($lnews);
$news_div .= "
";
$news_count += 1;
// show only five latest news
if ($news_count == 10) {
break;
}
}
}
}
$news_div .= "
";
$main_column .= $main_news;
$main_column .= $news_div;
$main_column .= "" . $poll->questiontext . "
" . $var ."
";
$var_divs .= "" . $percent . "%
";
}
/*translation:View previous polls*/
$var_divs .= elgg_view('input/namedsubmit', array('internalname' => 'view_polls', 'value' => elgg_echo('koolielu:button_view_previous_polls')));
$right_column .= elgg_view('input/form', array('action' => "{$CONFIG->wwwroot}action/koolielu/view_polls", "body" => $var_divs));
//$right_column .= $var_divs;
$has_answered = true;
}
} else {
if (isloggedin()) {
// if has answered, then show answers
$user = $_SESSION['user']->getGUID();
$useranswer = get_data("SELECT * FROM {$CONFIG->dbprefix}koolielu_polls_answers WHERE user_guid = $user");
if (is_array($useranswer) && count($useranswer) > 0) {
$right_column .= $poll_question;
$var_percents = get_poll_var_percents();
$var_divs = "";
foreach ($var_percents as $var => $var_results) {
$percent = $var_results["percent"];
$var_divs .= "" . $var . "
";
$var_divs .= "" . $percent . "%
";
}
$right_column .= $var_divs;
$has_answered = true;
}
}
}
if ($has_answered == false) {
// get poll variants
$poll_variants = get_data("SELECT * FROM {$CONFIG->dbprefix}koolielu_polls_variants WHERE poll_id = {$poll->ID} ORDER BY pos");
$variants = array();
foreach ($poll_variants as $var) {
$variants[$var->variant] = $var->ID;
}
$poll_question .= "" . elgg_view('input/radio', array('internalname' => 'quesvar', 'options' => $variants)) . "
";
//$poll_question .= $var->variant . "