$smarty->assign("isProfil", 1); // Troféer $smarty->assign("avatarUrl", $medlem->getAvatar()->getUrl()); $guldmedaljer = Sammanstallning::listMedaljer($medlem, Sammanstallning::M_GULD); $silvermedaljer = Sammanstallning::listMedaljer($medlem, Sammanstallning::M_SILVER); $guldpokaler = Sammanstallning::listPokaler($medlem, Sammanstallning::P_GULD); $silverpokaler = Sammanstallning::listPokaler($medlem, Sammanstallning::P_SILVER); $smarty->assign("silvermedaljer", $silvermedaljer); $smarty->assign("guldmedaljer", $guldmedaljer); $smarty->assign("silverpokaler", $silverpokaler); $smarty->assign("guldpokaler", $guldpokaler); $smarty->assign("OM", $medlem->getBeskrivning()); // Medlems blockering if (!empty($USER)) { $smarty->assign("blockerad_av_medlem", (int) MedlemsBlockering::verifyBlocked($medlem->getId(), $USER->getId())); $smarty->assign("blockerat_medlem", (int) MedlemsBlockering::verifyBlocked($USER->getId(), $medlem->getId())); } // Grafer: include_once ROOT . '/php/libs/php-ofc-library/open-flash-chart-object.php'; ob_start(); open_flash_chart_object(300, 200, '/data/veckograf.php?id=' . $medlem->getId(), false, '/'); $graf = ob_get_contents(); ob_end_clean(); $smarty->assign("graf", $graf); if (isset($USER) && $USER->getId() == $medlem->getId()) { $selfProfile = true; } else { $selfProfile = false; } $smarty->assign('selfProfile', $selfProfile); $smarty->assign("pagetitle", ucfirst($medlem->getANamn()) . " — Profil");
$amne = isset($_POST['amne']) ? Security::escape(utf8_encode($_POST['amne'])) : ""; $msg = isset($_POST['msg']) ? utf8_encode($_POST['msg']) : ""; $allow_links = isset($_POST['allow_links']) && $_POST['allow_links'] == 'true' ? 1 : 0; // $msg = nl2br($msg); $sent_from = $USER->getId(); $date = date("Y-m-d H:i:s"); if ($USER->getId() == $mid) { echo 'mail_to_self'; die; } if (MedlemsBlockering::verifyBlocked($USER->getId(), $mid)) { echo 'blockerad_user'; die; //throw new MedlemsBlockeringException("Kan ej skicka mail till medlemmen, medlemmen har spärrat dig.", 6); } if (MedlemsBlockering::verifyBlocked($mid, $USER->getId())) { echo 'blockerad_target'; die; //throw new MedlemsBlockeringException("Kan ej skicka mail till medlemmen, du har spärrat medlemmen.", 5); } if ($send_to_Obj->getMotiomeraMailBlock() == 'true' && !$send_to_Obj->inAdressbok($USER)) { /** If user blocks mails from none friends */ echo 'targetBlockMail'; die; } if (!$send_to_Obj->synlig()) { echo 'blockedByProfile'; die; } //åtkomst - ingen, foretag, adressbok (kom ihåg adminanvändare) new MotiomeraMail($amne, $msg, $sent_from, $send_to, $date, 0, 0, $allow_links);
<?php /** * @author Mattias Borén, The Farm * * Blocks members on request */ include $_SERVER["DOCUMENT_ROOT"] . "/php/init.php"; Security::demand(USER); if (isset($_GET["bmid"])) { $banMember = Medlem::loadById($_GET['bmid']); if (!empty($banMember)) { MedlemsBlockering::blockeraMedlem($USER->getId(), $banMember->getId()); $urlHandler->redirect("Medlem", URL_VIEW, $banMember->getId()); } }
$smarty->assign("my_id", $USER->getId()); global $SETTINGS; $fromMedlem = Medlem::loadById($mail_to_read->getSentFrom()); $smarty->assign("medlem", $fromMedlem); $reserverade_anvandare = $SETTINGS["reserverade_anvandare"]; foreach ($reserverade_anvandare as $k => $anv) { $reserverade_anvandare[$k] = strtolower($anv); } if (isset($SETTINGS["reserverade_anvandare"])) { $replyable = in_array(strtolower($fromMedlem->getANamn()), $reserverade_anvandare) ? 0 : 1; } else { $replyable = 1; } $smarty->assign("replyable", $replyable); $from_id = $mail_to_read->getSentFrom(); $smarty->assign("blockerad", (int) MedlemsBlockering::verifyBlocked($USER->getId(), $from_id)); $myself = Medlem::loadById($USER->getId()); $my_contacts = $myself->getUsersThatHasMeAsContact($from_id); $smarty->assign("my_contacts", $my_contacts); $smarty->assign("from_id", $from_id); // $mail_msg = str_replace('<br />', '', $mail_to_read->getMsg()); // $smarty->assign("mail_msg", $mail_msg); $re_text = substr($mail_to_read->getSubject(), 0, 3) != 'RE:' ? 'RE: ' . $mail_to_read->getSubject() : $mail_to_read->getSubject(); $smarty->assign("re_text", $re_text); $vb_text = substr($mail_to_read->getSubject(), 0, 3) != 'VB:' ? 'VB: ' . $mail_to_read->getSubject() : $mail_to_read->getSubject(); $smarty->assign("vb_text", $vb_text); $nl = "\n\n-----------\n\n"; $smarty->assign("nl", $nl); if ($replyable) { $mail_message = $mail_to_read->getMsg(); }