"logos_place_1", "pageid" => "frontpage")); /* / *translation:To subject page.* / $left_column .= ""; $left_column .= <<
EOT; */ $left_column .= elgg_view("koolielu/ke_menu_categories_view"); // logos_place_2 $left_column .= elgg_view("koolielu/frontpage_logos_view", array("placeid" => "logos_place_2", "pageid" => "frontpage")); // logos_place_3 //$left_column .= elgg_view("koolielu/frontpage_logos_view", array("placeid" => "logos_place_3", "pageid" => "frontpage")); $main_column = ""; // get front page news $frontpage_news = get_entities_from_metadata("frontpage", "1", "object", "news"); $main_news = ""; if (is_array($frontpage_news) && sizeof($frontpage_news) > 0) { foreach($frontpage_news as $news) { $news_comments_count = elgg_count_comments($news); $main_news .= "
getUrl()}\">" . $news->title; if ($news_comments_count != 0) { $main_news .= " ({$news_comments_count})"; } $main_news .= "

"; $news_text = elgg_view('output/longtext', array('value' => $news->shortdescription)); $main_news .= "
";//{$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 .= "getUrl() . "\">". elgg_echo("koolielu:text_read_more") .""; $main_news .= "
 
"; } } // get front page resource $resource_data = getFrontpageResource(); $rid = $resource_data->ID; $resource_info = ""; if ($rid) { try { $waramuResource = waramu_getResource('', $rid); $resource_info .= "wwwroot."pg/waramu/view/{$rid}\">" . $waramuResource->getTitle() . "

"; if (strcmp($waramuResource->getSchema(), "http://koolielu.ee/schemas/Media")) { $resource_img_url = getImageFileURL($rid . ".jpg", $resource_data->user_guid); $resource_info .= "
{$resource_data->description}
"; } else { $resource_info .= $waramuResource->renderEmbed(); } /*translation:View*/ $resource_info .= "wwwroot."pg/waramu/view/{$rid}\">". elgg_echo("koolielu:link_view") .""; } catch (Exception $exe) { // cannot load front page resource } } // get front page group $featured_groups = get_entities_from_metadata("featured", "1", "group", ""); if (is_array($featured_groups) && sizeof($featured_groups) > 0) { $group_info = "
"; $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_div .= sprintf(date("d.m.Y", $lnews->time_created)); $news_div .= " getUrl() . "\">" . $lnews->title; if ($lnews_comments_count != 0) { $news_div .= " ({$lnews_comments_count})"; } $news_div .= ""; $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 .= "
 
"; // scrollable frontpage objects $main_column .= ""; $main_column .= ""; $main_column .= ""; $main_column .= "
prev
    "; if ($resource_info) $main_column .= "
  • {$resource_info}
  • "; if ($group_info) $main_column .= "
  • {$group_info}
  • "; if ($topic_info) $main_column .= "
  • {$topic_info}
  • "; $main_column .= "
next
"; // logos_place_4 $main_column .= elgg_view("koolielu/frontpage_logos_view", array("placeid" => "logos_place_4", "pageid" => "frontpage", "layout" => "inline")); $right_column = ""; // logos_place_7 $right_column .= elgg_view("koolielu/frontpage_logos_view", array("placeid" => "logos_place_7", "pageid" => "frontpage")); $poll_question = ""; $poll = get_data_row("SELECT * FROM {$CONFIG->dbprefix}koolielu_polls WHERE isActive=1;"); if ($poll->ID) { $poll_id = $poll->ID; /*translation:Poll*/ //$poll_question .= "". elgg_echo("koolielu:poll") ."

"; $poll_question .= "
" . $poll->questiontext . "

"; $has_answered = false; if (isset($_COOKIE["koolielu_poll"])) { $answered_poll_id = $_COOKIE["koolielu_poll"]; if ($poll_id == $answered_poll_id) { $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 . "%
"; } /*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 . "
"; /*translation:Vote*/ $poll_question .= elgg_view('input/namedsubmit', array('internalname' => 'vote_button', 'value' => elgg_echo('koolielu:button_vote'))); /*translation:View answers*/ $poll_question .= elgg_view('input/namedsubmit', array('internalname' => 'view_button', 'value' => elgg_echo('koolielu:button_view_answers'))); $poll_question .= elgg_view('input/hidden', array('internalname' => 'poll_id', 'value' => $poll->ID)); $right_column .= elgg_view('input/form', array('action' => "{$CONFIG->wwwroot}action/koolielu/vote_poll", "body" => $poll_question)); //$right_column .= $poll_question; } } // Waramu subjects //$right_column .= elgg_view("koolielu/ke_subjects_main_view"); // logos_place_6 $right_column .= elgg_view("koolielu/frontpage_logos_view", array("placeid" => "logos_place_6", "pageid" => "frontpage")); // logos_place_5 $right_column .= elgg_view("koolielu/frontpage_logos_view", array("placeid" => "logos_place_5", "pageid" => "frontpage")); global $autofeed; $autofeed = false; $content = elgg_view_layout('three_columns_ke_index', $left_column, $main_column, $right_column); echo page_draw(null, $content); ?>