Example #1
0
File: Form.php Project: lmcro/fcms
 /**
  * display 
  * 
  * @return void
  */
 public function display()
 {
     $id = (int) $_GET['avatar'];
     // Get user info
     $sql = "SELECT `id`, `fname`, `lname`, `maiden`, `avatar`, `gravatar`\n                FROM `fcms_users`\n                WHERE `id` = ?";
     $row = $this->fcmsDatabase->getRow($sql, $id);
     if ($row === false) {
         $this->fcmsError->displayError();
         return;
     }
     $name = cleanOutput($row['fname']) . ' ' . cleanOutput($row['lname']);
     echo '
             <form id="frm" name="frm" enctype="multipart/form-data" action="?avatar=' . $id . '" method="post">
                 <fieldset>
                     <legend><span>' . sprintf(T_pgettext('%s is a persons full name', 'Picture for %s'), $name) . '</span></legend>
                     <div class="field-row">
                         <div class="field-label"><b>' . T_('Current Picture') . '</b></div>
                         <div class="field-widget">
                             <img src="' . getCurrentAvatar($id) . '"/>
                         </div>
                     </div>';
     $this->displayUploadArea();
     echo '
                     <p>
                         <input type="hidden" name="avatar_orig" value="' . cleanOutput($row['avatar']) . '"/>
                         <input class="sub1" type="submit" name="submitUpload" id="submitUpload" value="' . T_('Submit') . '"/>
                         &nbsp; <a href="familytree.php">' . T_('Cancel') . '</a>
                     </p>
                 </fieldset>
             </form>';
 }
Example #2
0
    /**
     * displayHeader 
     * 
     * @return void
     */
    function displayHeader()
    {
        print '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>' . sprintf(T_pgettext('%s is the name of the website', 'Register for %s.'), getSiteName()) . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Ryan Haudenschilt" />
<link rel="stylesheet" type="text/css" href="ui/css/fcms-core.css" />
<script type="text/javascript" src="ui/js/jquery.js"></script>
<script type="text/javascript" src="ui/js/livevalidation.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $("#username")
        .focus()
        .change(checkAvailability);
});
function checkAvailability() {
    $("#username").next("span").remove();
    $.ajax({
        type : "GET",
        url  : "register.php",
        data : {
            ajax     : 1,
            username : $("#username").val(),
        }
    })
    .success (function (data) {
        if (data === "available") {
            $("#username").after("<span class=\\"available\\">' . T_('Available') . '</span>");
        }
        else if (data === "unavailable") {
            $("#username").addClass("LV_invalid_field");
            $("#username").after("<span class=\\"LV_validation_message LV_invalid\\">' . T_('That username has already been taken.') . '</span>");
        }
        else {
            alert("' . T_('Could not check availability of username.') . '");
        }
    })
    .error (function() {
        alert("' . T_('There was an error with the connection.') . '");
    });
}
</script>
</head>
<body>';
    }
Example #3
0
    /**
     * displayHeader 
     * 
     * @return void
     */
    function displayHeader()
    {
        echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>' . getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion() . '</title>
<script type="text/javascript" src="ui/js/jquery.js"></script>
<script type="text/javascript" src="ui/js/fcms.js"></script>
<link rel="stylesheet" type="text/css" href="ui/css/fcms-core.css" />
<script type="text/javascript">
$(document).ready(function() {
    initAttendingEvent();
});
</script>
</head>
<body id="invitation" class="clearfix">
    <img id="logo" src="ui/img/logo.gif" alt="' . getSiteName() . '"/>';
    }
Example #4
0
/**
 * displayHeader 
 * 
 * @return void
 */
function displayHeader()
{
    echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>' . getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion() . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Ryan Haudenschilt" />
<link rel="stylesheet" type="text/css" href="' . URL_PREFIX . 'ui/themes/default/style.css"/>
<link rel="shortcut icon" href="' . URL_PREFIX . 'ui/themes/favicon.ico"/>';
    // TODO
    // Move css to fcms-core
    echo '
<style type="text/css">
html { background: #fff; }
body { width: 600px; margin: 0; padding: 20px; text-align: left; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; border: none; background: #fff; }
form div, form { display: inline; }
td.n { padding: 2px; text-align: right; width: 75px; }
td.v { text-align: center; width: 30px; }
td.file { padding: 0 5px;  text-align: left; width: 150px; }
tr.alt { background-color: #f4f4f4; }
.delbtn, .viewbtn { padding: 0 }
</style>
<script type="text/javascript">
//<![CDATA[
function insertUpImage(str) {
    var textarea = window.opener.document.getElementById(\'post\');
    if (textarea) {
        if (textarea.value == "message") { textarea.value = str + " "; } else { textarea.value += str + " "; }
        textarea.focus();
    }
    javascript:window.close();
    return true;
}
//]]>
</script>
</head>
<body>';
}
Example #5
0
/**
 * displayHeader 
 * 
 * @return void
 */
function displayHeader()
{
    echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>Family Connections ' . T_('Installation') . '</title>
<link rel="stylesheet" type="text/css" href="ui/css/fcms-core.css" />
<script type="text/javascript" src="ui/js/jquery.js"></script>
<script type="text/javascript" src="ui/js/livevalidation.js"></script>
<link rel="stylesheet" type="text/css" href="ui/css/datechooser.css"/>
<script type="text/javascript" src="ui/js/datechooser.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    var objDatePicker = new DateChooser();
    objDatePicker.setUpdateField({"day":"j", "month":"n", "year":"Y"});
    objDatePicker.setIcon("ui/themes/default/img/datepicker.jpg", "year");
    return true;
});
</script>
</head>
<body>';
}
Example #6
0
 /**
  * getWhatsNewDataAddressEditTextInfo 
  * 
  * @param array $data 
  * @todo  this should probably just say 'updated address'
  *        then the object info should show the details below
  * 
  * @return string
  */
 function getWhatsNewDataAddressEditTextInfo($data)
 {
     $titleType = T_('address');
     if ($data['title'] == 'email') {
         $titleType = T_('email address');
     } elseif ($data['title'] == 'home') {
         $titleType = T_('home phone number');
     } elseif ($data['title'] == 'work') {
         $titleType = T_('work phone number');
     } elseif ($data['title'] == 'cell') {
         $titleType = T_('cell phone number');
     }
     $address = '<a href="addressbook.php?address=' . (int) $data['id'] . '">' . $titleType . '</a>';
     if ($data['id2'] != $data['userid']) {
         $user = getUserDisplayName($data['userid']);
         $text = sprintf(T_pgettext('Example: "Updated the <address/phone/email> for <name>."', 'Updated the %s for %s.'), $address, $user);
     } else {
         if ($data['id3'] == 'F') {
             $text = sprintf(T_pgettext('Example: "Updated her <address/phone/email>."', 'Updated her %s.'), $address);
         } else {
             $text = sprintf(T_pgettext('Example: "Updated his <address/phone/email>."', 'Updated his %s.'), $address);
         }
     }
     return $text;
 }
Example #7
0
<?php

session_start();
define('URL_PREFIX', '../');
require URL_PREFIX . 'fcms.php';
setLanguage();
isLoggedIn('inc/');
$currentUserId = (int) $_SESSION['fcms_id'];
echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>' . getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion() . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Ryan Haudenschilt" />
<link rel="stylesheet" type="text/css" href="../ui/themes/default/style.css"/>
<link rel="shortcut icon" href="../ui/favicon.ico"/>';
// TODO
// Move css to fcms-core
echo '
<style type="text/css">
html { background: #fff; }
body { width: 350px; margin: 0; padding: 15px; text-align: left; font: 14px/20px Verdana, Tahoma, Arial, sans-serif; border: none; background: #fff; }
h1 { font: bold 20px/30px Verdana, Tahoma, Arial, sans-serif; }
h2 { font: bold 18px/30px Verdana, Tahoma, Arial, sans-serif; }
h3 { font: bold 16px/30px Verdana, Tahoma, Arial, sans-serif; }
</style>
</head>
<body>
<h1>' . T_('BBCode Help') . '</h1>
<p>' . T_('BBCode is a easy way to format text. Check out the examples below, the first line shows the bbcode and the second line show the output.') . '</p>
Example #8
0
 /**
  * displayProfile 
  * 
  * @return void
  */
 function displayProfile()
 {
     $memberId = (int) $_GET['member'];
     $this->displayHeader($memberId);
     // handle unknown user
     if ($memberId == 0) {
         echo '
         <p class="error-alert">
             <b>' . T_('Unknown member.') . '</b><br/>
         </p>';
         $this->displayFooter();
         return;
     }
     $sql = "SELECT u.fname, u.lname, u.email, u.`bio`, u.`dob_year`, u.`dob_month`, u.`dob_day`, \n                    u.`dod_year`, u.`dod_month`, u.`dod_day`, u.avatar, u.username, u.joindate, \n                    u.`activity`, u.`sex`, a.`id` AS aid, a.`address`, a.`city`, a.`state`, a.`zip`, \n                    a.`home`, a.`cell`, a.`work`  \n                FROM fcms_users AS u, fcms_address AS a \n                WHERE u.id = ?\n                AND u.id = a.user";
     $row = $this->fcmsDatabase->getRow($sql, $memberId);
     if ($row === false) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $tzOffset = getTimezone($memberId);
     $joinDate = fixDate(T_('F j, Y'), $tzOffset, $row['joindate']);
     $address = formatAddress($row);
     $contact = '';
     $activityDate = T_('Never visited');
     $points = getUserParticipationPoints($memberId);
     $level = getUserParticipationLevel($points);
     // Contacts - Email
     if (!empty($row['cell'])) {
         $contact .= '<p><span>' . T_('Email') . '</span> ' . $row['email'] . '</p>';
     }
     // Contacts - Phone
     if (!empty($row['cell'])) {
         $contact .= '<p><span>' . T_('Cell') . '</span> ' . formatPhone($row['cell']) . '</p>';
     }
     if (!empty($row['home'])) {
         $contact .= '<p><span>' . T_pgettext('The beginning or starting place.', 'Home') . '</span> ' . formatPhone($row['home']) . '</p>';
     }
     if (!empty($row['work'])) {
         $contact .= '<p><span>' . T_('Work') . '</span> ' . formatPhone($row['work']) . '</p>';
     }
     // Call
     $hasPhone = false;
     $call = '';
     $tel = '';
     if (!empty($row['cell'])) {
         $tel = $row['cell'];
         $hasPhone = true;
     } else {
         if (!empty($row['home'])) {
             $tel = $row['home'];
             $hasPhone = true;
         } else {
             if (!empty($row['work'])) {
                 $tel = $row['work'];
                 $hasPhone = true;
             }
         }
     }
     if ($hasPhone) {
         $call = '<li><a class="call" href="tel:' . $tel . '">' . sprintf(T_pgettext('%s is the name of a person. Call Bob. etc.', 'Call %s'), $row['fname']) . '</a></li>';
     }
     // Activity
     if ($row['activity'] != '0000-00-00 00:00:00') {
         $activityDate = fixDate(T_('F j, Y g:i a'), $tzOffset, $row['activity']);
     }
     $bday = formatDate('F j, Y', $row['dob_year'] . '-' . $row['dob_month'] . '-' . $row['dob_day']);
     $age = getAge($row['dob_year'], $row['dob_month'], $row['dob_day']);
     $gender = $row['sex'] == 'M' ? T_('Male') : T_('Female');
     echo '
             <div id="avatar">
                 <h1><img class="avatar" src="' . getCurrentAvatar($memberId) . '" alt="avatar"/></h1>
                 ' . $level . '
             </div>
             <div class="name-contacts">
                 <h1>' . cleanOutput($row['fname']) . ' ' . cleanOutput($row['lname']) . '</h1>
                 <h2>' . cleanOutput($row['username']) . '</h2>
                 <ul>
                     ' . $call . '
                     <li><a class="email" href="mailto:' . $row['email'] . '">' . T_('Send Email') . '</a></li>
                     <li><a class="pm" href="privatemsg.php?compose=new&amp;id=' . $memberId . '">' . T_('Send Private Message') . '</a></li>
                 </ul>
             </div>
             <ul>
                 <li>
                     <ul>
                         <li>
                             <b>' . T_('Birthday') . '</b>
                             <div>' . $bday . ' (' . sprintf(T_('%s years old'), $age) . ')</div>
                         </li>
                         <li>
                             <b>' . T_('Gender') . '</b>
                             <div>' . $gender . '</div>
                         </li>
                     </ul>
                 </li>
                 <li>
                     <ul>
                         <li>
                             <b>' . T_('Location') . '</b>
                             <div>' . $address . '</div>
                         </li>
                         <li>
                             <b>' . T_('Contact') . '</b>
                             <div>' . $contact . '</div>
                         </li>
                     </ul>
                 </li>
                 <li>
                     <b>' . T_('Bio') . '</b>
                     <div>' . cleanOutput($row['bio']) . '</div>
                 </li>
                 <li>
                     <ul>
                         <li>
                             <b>' . T_('Join Date') . '</b>
                             <div>' . $joinDate . '</div>
                         </li>
                         <li>
                             <b>' . T_('Last Visit') . '</b>
                             <div>' . $activityDate . '</div>
                         </li>
                     </ul>
                 </li>
             </ul>';
     $this->displayFooter($memberId);
 }
Example #9
0
    /**
     *  displayAddress
     *
     *  Displays the address details.
     *
     *  @param int    $aid Id of the address
     *  @param string $cat Category name
     *
     *  @return void
     */
    function displayAddress($aid, $cat)
    {
        $aid = (int) $aid;
        $cat = cleanOutput($cat);
        $sql = "SELECT a.`id`, a.`user`, `fname`, `lname`, `avatar`, `updated`, `country`, `address`, `city`, `state`, \n                    `zip`, `home`, `work`, `cell`, `email`, `phpass` \n                FROM `fcms_address` AS a, `fcms_users` AS u \n                WHERE a.`user` = u.`id` \n                AND a.`id` = ?";
        $r = $this->fcmsDatabase->getRow($sql, $aid);
        if ($r === false) {
            $this->fcmsError->displayError();
            return;
        }
        if (count($r) <= 0) {
            echo '
            <p class="error-alert">' . sprintf(T_('Could not find address (%s)'), $aid) . '</p>';
            return;
        }
        // Edit / Delete links
        $edit_del = '';
        if ($this->fcmsUser->id == $r['user'] || $this->fcmsUser->access < 2) {
            $edit_del = '<li id="edit"><a href="?cat=' . $cat . '&amp;edit=' . $r['id'] . '">' . T_('Edit') . '</a></li>';
            if ($r['phpass'] == 'NONMEMBER' || $r['phpass'] == 'PRIVATE') {
                $edit_del .= '
                        <li id="delete"><a id="del_address" href="?cat=' . $cat . '&amp;delete=' . $r['id'] . '">' . T_('Delete') . '</a></li>';
            }
        }
        // Address
        $address = formatAddress($r);
        $addressUrl = formatAddressUrl($address);
        if ($address == '') {
            $str = "<i>(" . T_('none') . ")</i>";
        }
        $map_link = !empty($addressUrl) ? '<br/><a href="http://maps.google.com/maps?q=' . $addressUrl . '"/>' . T_('Map') . '</a>' : '';
        // Email
        if (empty($r['email'])) {
            $email = "<i>(" . T_('none') . ")</i>";
        } else {
            $email = cleanOutput($r['email']) . ' <a class="email" href="mailto:' . cleanOutput($r['email']) . '" 
                title="' . T_('Email This Member') . '">&nbsp;</a>';
        }
        // Phone Number
        $home = empty($r['home']) ? '<i>(' . T_('none') . ')</i>' : formatPhone($r['home'], $r['country']);
        $work = empty($r['work']) ? '<i>(' . T_('none') . ')</i>' : formatPhone($r['work'], $r['country']);
        $cell = empty($r['cell']) ? '<i>(' . T_('none') . ')</i>' : formatPhone($r['cell'], $r['country']);
        // Display address
        echo '
            <div id="leftcolumn">';
        $this->displayCategories($cat);
        echo '
            </div>
            <div id="maincolumn">

                <div id="address-options">
                    <ul>
                        <li id="back"><a href="?cat=' . $cat . '">' . T_('Back to Addresses') . '</a></li>
                        <li id="email"><a href="mailto:' . cleanOutput($r['email']) . '">' . T_('Email') . '</a></li>
                        ' . $edit_del . '
                    </ul>
                </div>
                <div id="address-details">
                    <p>
                        <img alt="avatar" src="' . getCurrentAvatar($r['user']) . '"/>
                        <b class="name">' . cleanOutput($r['fname']) . ' ' . cleanOutput($r['lname']) . '</b>
                    </p>
                    <p>
                        <b class="label">' . T_('Address') . ':</b>
                        <span class="data">' . $address . ' ' . $map_link . '</span>
                    </p>
                    <p>
                        <b class="label">' . T_('Email') . ':</b>
                        <span class="data">' . $email . '</span>
                    </p>
                    <p>
                        <b class="label">' . T_pgettext('The dwelling where you live.', 'Home') . ':</b>
                        <span class="data">' . $home . '</span>
                    </p>
                    <p>
                        <b class="label">' . T_('Work') . ':</b>
                        <span class="data">' . $work . '</span>
                    </p>
                    <p>
                        <b class="label">' . T_('Mobile') . ':</b>
                        <span class="data">' . $cell . '</span>
                    </p>
                </div>

            </div>';
    }
Example #10
0
/**
 * displayHeader 
 * 
 * @param boolean $login Are we displaying the login screen?
 * 
 * @return  void
 */
function displayHeader($login = true)
{
    if ($login) {
        $sitename = getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion();
        $js = ' onload="document.getElementById(\'user\').focus()"';
    } else {
        // Don't translate
        $sitename = 'Family Connections';
        $js = '';
    }
    echo '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>' . $sitename . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="author" content="Ryan Haudenschilt"/>
<link rel="shortcut icon" href="ui/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="ui/css/fcms-core.css"/>
</head>
<body' . $js . '>';
}
Example #11
0
 /**
  * getAjaxAddRelativeMenu 
  * 
  * @return void
  */
 function getAjaxAddRelativeMenu()
 {
     $userId = (int) $_POST['id'];
     $sql = "SELECT `id`, `fname`, `mname`, `lname`\n                FROM `fcms_users`\n                WHERE `id` = ?";
     $user = $this->fcmsDatabase->getRow($sql, $userId);
     if ($user === false) {
         $this->error->add(array('type' => 'operation', 'message' => 'getAjaxAddRelativeMenu() - could not get user info.', 'error' => $_POST, 'file' => __FILE__, 'line' => __LINE__));
         header("HTTP/1.0 500 Internal Server Error");
         return;
     }
     $father = array();
     $mother = array();
     // Get parents
     $parents = $this->fcmsFamilyTree->getParentsOfUsers(array($userId));
     if ($parents === false) {
         $this->fcmsError->displayError();
         return;
     }
     foreach ($parents as $parent) {
         if ($parent['sex'] == 'M') {
             $father[] = $parent;
         } else {
             $mother[] = $parent;
         }
     }
     $addFather = '';
     $addMother = '';
     $addBrother = '';
     $addSister = '';
     if (empty($father)) {
         $addFather = '<li><a id="father" href="?view=' . $userId . '&add=' . $userId . '&type=father">' . T_('Father') . '</a></li>';
     } else {
         $addBrother = '<li><a id="brother" href="?view=' . $userId . '&add=' . $userId . '&type=brother">' . T_('Brother') . '</a></li>';
         $addSister = '<li><a id="sister" href="?view=' . $userId . '&add=' . $userId . '&type=sister">' . T_('Sister') . '</a></li>';
     }
     if (empty($mother)) {
         $addMother = '<li><a id="mother" href="?view=' . $userId . '&add=' . $userId . '&type=mother">' . T_('Mother') . '</a></li>';
     } elseif (strlen($addBrother) == 0) {
         $addBrother = '<li><a id="brother" href="?view=' . $userId . '&add=' . $userId . '&type=brother">' . T_('Brother') . '</a></li>';
         $addSister = '<li><a id="sister" href="?view=' . $userId . '&add=' . $userId . '&type=sister">' . T_('Sister') . '</a></li>';
     }
     $name = $user['fname'] . ' ' . $user['mname'] . ' ' . $user['lname'];
     $legend = sprintf(T_pgettext('%s is the name of a person', 'Add family member for %s'), $name);
     echo '<ul id="add_relative_menu">';
     echo '<li class="close">' . T_pgettext('x as in the symbol to close or exit out of something', 'X') . '</li>';
     echo '<li class="header">' . $legend . '</li>';
     echo $addFather;
     echo $addMother;
     echo $addBrother;
     echo $addSister;
     echo '<li><a id="spouse" href="?view=' . $userId . '&add=' . $userId . '&type=spouse">' . T_('Spouse') . '</a></li>';
     echo '<li><a id="child" href="?view=' . $userId . '&add=' . $userId . '&type=child">' . T_('Child') . '</a></li>';
     echo '</ul>';
     echo '<script type="text/javascript">';
     echo '$("#add_relative_menu .close").each(function() { $(this).click(function() { $("#add_relative_menu").remove(); }); });';
     echo '</script>';
 }
Example #12
0
 /**
  * displayAddBrotherSisterForm 
  * 
  * @param int    $userId 
  * @param string $type 
  * 
  * @return void
  */
 function displayAddBrotherSisterForm($userId, $type)
 {
     // Get user info
     $sql = "SELECT `id`, `fname`, `mname`, `lname`\n                FROM `fcms_users`\n                WHERE `id` = ?";
     $user = $this->fcmsDatabase->getRow($sql, $userId);
     if ($user === false) {
         $this->fcmsError->displayError();
         return;
     }
     $name = $user['fname'] . ' ' . $user['mname'] . ' ' . $user['lname'];
     // Get possible children
     if ($type == 'brother') {
         $members = $this->getPossibleBrotherList($userId);
         $legend = sprintf(T_pgettext('%s is a persons name', 'Add new brother for %s'), $name);
         $label = T_('Brother');
         $createText = T_('Create brother not listed above.');
         $createLink = '?create=brother&amp;user='******'%s is a persons name', 'Add new sister for %s'), $name);
         $label = T_('Sister');
         $createText = T_('Create sister not listed above.');
         $createLink = '?create=sister&amp;user='******'t send header because we already started printing to the page
         echo '<meta http-equiv="refresh" content="0; url=' . $createLink . '">';
         return;
     }
     echo '
     <form action="familytree.php?add=' . $userId . '" method="post">
         <fieldset>
             <legend><span>' . $legend . '</span></legend>
             <div class="field-row">
                 <div class="field-label">
                     <label for="rel_user"><b>' . $label . '</b></label>
                 </div>
                 <div class="field-widget">
                     <select name="rel_user">
                         ' . $members . '
                     </select><br/>
                     <a href="' . $createLink . '">' . $createText . '</a>
                 </div>
             </div>
             <p>
                 <input type="hidden" id="id" name="id" value="' . $userId . '"/>
                 <input type="hidden" id="type" name="type" value="' . $type . '"/>
                 <input class="sub1" type="submit" id="add-relative" name="additional-options" value="' . T_('Add') . '"/> &nbsp;
                 <a href="familytree.php?view=' . $this->currentTreeUserId . '">' . T_('Cancel') . '</a>
             </p>
         </fieldset>
     </form>';
 }
Example #13
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
echo T_pgettext('Language Code for this translation', 'lang');
?>
" lang="<?php 
echo T_pgettext('Language Code for this translation', 'lang');
?>
">
<head>
<title><?php 
echo $TMPL['sitename'] . " - " . T_('powered by') . " " . $TMPL['version'];
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="author" content="Ryan Haudenschilt" />
<meta name="viewport" content="width=device-width" />
<link rel="shortcut icon" href="<?php 
echo $TMPL['path'];
?>
ui/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="<?php 
echo $TMPL['path'];
?>
ui/themes/default/css/style.css?version=350"/>
<link rel="stylesheet" type="text/css" media="only screen and (max-width: 480px)" href="<?php 
echo $TMPL["path"];
?>
ui/themes/default/css/mobile.css"/>
<script type="text/javascript" src="<?php 
echo $TMPL['path'];
?>
Example #14
0
        </div><!--/.centercontent -->
    </div><!--/#content-->

    <div id="footer">
        <p>
            <a href="<?php 
echo $TMPL['path'];
?>
index.php" class="ft"><?php 
echo T_pgettext('The beginning or starting place.', 'Home');
?>
</a> | 
            <a href="http://support.familycms.com/" class="ft"><?php 
echo T_('Support');
?>
</a> | 
            <a href="<?php 
echo $TMPL['path'];
?>
help.php" class="ft"><?php 
echo T_('Help');
?>
</a><br />
            <a href="http://www.familycms.com"><?php 
echo $TMPL['version'];
?>
</a> - Copyright &copy; 2006-<?php 
echo $TMPL['year'];
?>
 Ryan Haudenschilt.
Example #15
0
    /**
     * displayInvitationSubmit 
     * 
     * @return void
     */
    function displayInvitationSubmit()
    {
        $this->displayHeader();
        $calendarId = (int) $_POST['calendar'];
        // make sure the user submitted atleast one email address
        if (!isset($_POST['all-members']) && !isset($_POST['email']) && !isset($_POST['non-member-emails'])) {
            $error = T_('You must invite at least one guest.');
            displayInvitationForm($calendarId, $error);
            return;
        }
        // Get any invitations already sent for this event
        $invitations = $this->getInvitations($calendarId, true);
        if ($invitations === false) {
            $this->fcmsError->displayError();
            $this->displayFooter();
            return;
        }
        if (!isset($invitations['_current_user'])) {
            // add the current user (host) to the invite as attending
            $sql = "INSERT INTO `fcms_invitation` \n                        (`event_id`, `user`, `created`, `updated`, `attending`)\n                    VALUES \n                        (?, ?, NOW(), NOW(), 1)";
            $params = array($calendarId, $this->fcmsUser->id);
            if (!$this->fcmsDatabase->insert($sql, $params)) {
                $this->fcmsError->displayError();
                $this->displayFooter();
                return;
            }
        }
        // Get the calendar event title
        $sql = "SELECT `title` \n                FROM `fcms_calendar` \n                WHERE `id` = ?";
        $r = $this->fcmsDatabase->getRow($sql, $calendarId);
        if ($r === false) {
            $this->fcmsError->displayError();
            $this->displayFooter();
            return;
        }
        $title = $r['title'];
        $invitees = array();
        $nonMembers = array();
        $members = array();
        // get emails from textarea
        if (isset($_POST['non-member-emails'])) {
            $nonMembers = explode("\n", $_POST['non-member-emails']);
        }
        // get any members that have been invited
        if (isset($_POST['all-members'])) {
            $sql = "SELECT `id`, `email` \n                    FROM `fcms_users` \n                    WHERE `activated` > 0\n                    AND `phpass` != 'NONMEMBER'\n                    AND `id` != ?";
            $rows = $this->fcmsDatabase->getRows($sql, $this->fcmsUser->id);
            if ($rows === false) {
                $this->fcmsError->displayError();
                $this->displayFooter();
                return;
            }
            foreach ($rows as $r) {
                array_push($members, array('id' => $r['id'], 'email' => $r['email']));
            }
        } elseif (isset($_POST['member'])) {
            foreach ($_POST['member'] as $id) {
                array_push($members, array('id' => $id, 'email' => $_POST["id{$id}"]));
            }
        }
        // merge all emails into one big list
        $invitees = array_merge($nonMembers, $members);
        // Create the invite and send the emails to each invitee
        foreach ($invitees as $invitee) {
            if (empty($invitee)) {
                continue;
            }
            // create a code for this user
            $code = uniqid('');
            $user = 0;
            $email = '';
            $toEmail = '';
            $toName = '';
            $fromName = getUserDisplayName($this->fcmsUser->id);
            $url = getDomainAndDir();
            // member
            if (is_array($invitee)) {
                $user = (int) $invitee['id'];
                $toEmail = rtrim($invitee['email']);
                $toName = getUserDisplayName($user);
                $email = null;
                $url .= 'calendar.php?event=' . $calendarId;
            } else {
                $user = 0;
                $toEmail = rtrim($invitee);
                $toName = $toEmail;
                $email = $toEmail;
                $url .= 'invitation.php?event=' . $calendarId . '&code=' . $code;
            }
            // Skip email address that have already been invited
            if (isset($invitations[$toEmail])) {
                continue;
            }
            // add an invitation to db
            $sql = "INSERT INTO `fcms_invitation` \n                        (`event_id`, `user`, `email`, `created`, `updated`, `code`)\n                    VALUES \n                        (?, ?, ?, NOW(), NOW(), ?)";
            $params = array($calendarId, $user, $email, $code);
            if (!$this->fcmsDatabase->insert($sql, $params)) {
                $this->fcmsError->displayError();
                $this->displayFooter();
                return;
            }
            // Send email invitation
            $subject = sprintf(T_pgettext('%s is the title of an event', 'Invitation: %s'), $title);
            $msg = sprintf(T_pgettext('%s is the name of a person, like Dear Bob,', 'Dear %s,'), $toName) . '

' . sprintf(T_pgettext('The first %s is the name of a person, the second is the title of an event', '%s has invited you to %s.'), $fromName, $title) . '

' . T_('Please visit the link below to view the rest of this invitation.') . '

' . $url . '

----
' . T_('This is an automated response, please do not reply.') . '

';
            $email_headers = getEmailHeaders();
            mail($toEmail, $subject, $msg, $email_headers);
        }
        displayOkMessage();
        $this->fcmsCalendar->displayEvent($calendarId);
        $this->displayFooter();
    }
Example #16
0
File: fcms.php Project: lmcro/fcms
/**
 * checkSiteStatus 
 * 
 * @return void
 */
function checkSiteStatus()
{
    // Site is on
    if (!file_exists(INC . 'siteoff')) {
        return;
    }
    global $upgrading;
    include INC . 'siteoff';
    // If the $upgrading timestamp is older than 10 minutes, don't die.
    if (time() - $upgrading >= 600) {
        return;
    }
    echo '
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '">
<head>
<title>' . T_('Site is currently turned off...') . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="author" content="Ryan Haudenschilt" />
</head>
<body>
<h1>' . T_('Hold On a Second!') . '</h1>
<p>' . T_('The site has been closed by an administrator.') . '</p>
<p>' . T_('Please come back later.') . '</p>
</body>
</html>';
    die;
}
Example #17
0
File: video.php Project: lmcro/fcms
    /**
     * displayUserVideosPage 
     * 
     * @return void
     */
    function displayUserVideosPage()
    {
        $this->displayHeader();
        $userId = (int) $_GET['u'];
        if (isset($_SESSION['message'])) {
            $this->displayMessage($_SESSION['message']);
        }
        // Get user info
        $sql = "SELECT 'id', `fname`, `lname`, `avatar`, `gravatar`\n                FROM `fcms_users`\n                WHERE `id` = ?";
        $row = $this->fcmsDatabase->getRow($sql, $userId);
        if ($row === false) {
            $this->fcmsError->displayError();
            $this->displayFooter();
            return;
        }
        if (empty($row)) {
            echo '<div class="error-alert">' . T_('Member not found.') . '</div>';
            $this->displayFooter();
            return;
        }
        $name = cleanOutput($row['fname']) . ' ' . cleanOutput($row['lname']);
        $avatarPath = getAvatarPath($row['avatar'], $row['gravatar']);
        echo '
        <div id="sections_menu">
            <ul>
                <li><a href="video.php">Latest Videos</a></li>
                <li><a href="video.php?members=all">Members</a></li>
            </ul>
        </div>

        <div id="video_content">
            <div id="member">
                <img src="' . $avatarPath . '" titl="' . $name . '"/>
                <span>' . T_('Videos For:') . '</span>
                <h2>' . $name . '</h2>
            </div>
            <ul class="categories">';
        // Get videos
        $sql = "SELECT `id`, `source_id`, `title`, `active`, `created`, `created_id`\n                FROM `fcms_video`\n                WHERE `created_id` = ?\n                ORDER BY `updated` DESC";
        $rows = $this->fcmsDatabase->getRows($sql, $userId);
        if ($rows === false) {
            $this->fcmsError->displayError();
            $this->displayFooter();
            return;
        }
        if (count($rows) <= 0) {
            echo '<div class="error-alert">' . T_('No videos found.') . '</div>';
            $this->displayFooter();
            return;
        }
        foreach ($rows as $row) {
            $class = '';
            if ($row['active'] == '0') {
                if ($row['created_id'] != $this->fcmsUser->id) {
                    continue;
                }
                $class = 'removed';
            }
            $date = fixDate('Y-m-d', '', $row['created'], $this->fcmsUser->id);
            echo '
                <li class="category ' . $class . '">
                    <a href="?u=' . $userId . '&amp;id=' . $row['id'] . '"><img src="http://i.ytimg.com/vi/' . $row['source_id'] . '/default.jpg"/></a>
                    <span>
                        <strong>' . cleanOutput($row['title']) . '</strong>
                        <i>' . sprintf(T_pgettext('%s is a date', 'on %s'), $date) . '</i>
                    </span>
                </li>';
        }
        $this->displayFooter();
    }
Example #18
0
 /**
  * displayMergeSubmit 
  * 
  * Merges two members together.
  * 
  * @return void
  */
 function displayMergeSubmit()
 {
     $this->displayHeader();
     $id = (int) $_POST['id'];
     $merge = (int) $_POST['merge'];
     $year = substr($_POST['birthday'], 0, 4);
     $month = substr($_POST['birthday'], 5, 2);
     $day = substr($_POST['birthday'], 8, 2);
     // Update member
     $sql = "UPDATE `fcms_users`\n                SET `fname`     = ?,\n                    `mname`     = ?,\n                    `lname`     = ?,\n                    `maiden`    = ?,\n                    `bio`       = ?,\n                    `email`     = ?,\n                    `dob_year`  = ?,\n                    `dob_month` = ?,\n                    `dob_day`   = ?\n                WHERE `id` = ?";
     $params = array($_POST['fname'], $_POST['mname'], $_POST['lname'], $_POST['maiden'], $_POST['bio'], $_POST['email'], $year, $month, $day, $id);
     if (!$this->fcmsDatabase->update($sql, $params)) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     echo sprintf(T_pgettext('%s is a name of a table that gets updated.', 'Update [%s] complete.'), 'fcms_users') . '<br/>';
     // Update member address
     $sql = "UPDATE `fcms_address`\n                SET `address` = ?,\n                    `city`    = ?,\n                    `state`   = ?,\n                    `zip`     = ?,\n                    `home`    = ?,\n                    `work`    = ?,\n                    `cell`    = ?\n                WHERE `user` = ?";
     $params = array($_POST['address'], $_POST['city'], $_POST['state'], $_POST['zip'], $_POST['home'], $_POST['work'], $_POST['cell'], $id);
     if (!$this->fcmsDatabase->update($sql, $params)) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     echo sprintf(T_pgettext('%s is a name of a table that gets updated.', 'Update [%s] complete.'), 'fcms_address') . '<br/>';
     // Update all occurences of merge id with id
     if (!$this->fcmsAdminMembers->mergeMember($id, $merge)) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     // Delete merge id
     $sql = "DELETE FROM `fcms_users`\n                WHERE `id` = ?";
     if (!$this->fcmsDatabase->delete($sql, $merge)) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     echo sprintf(T_pgettext('%s is a name of a table that is deleted.', 'Delete [%s] complete.'), 'fcms_users') . '<br/>';
     $this->displayFooter();
 }
Example #19
0
/**
 * getMeridiem 
 * 
 * Given a meridiem (am pm AM PM), returns the translated version.
 * 
 * @param string $a 
 * 
 * @return string
 */
function getMeridiem($a)
{
    $meridiem['am'] = T_pgettext('Lowercase Ante meridiem.', 'am');
    $meridiem['pm'] = T_pgettext('Lowercase Post meridiem.', 'pm');
    $meridiem['AM'] = T_pgettext('Uppercase Ante meridiem.', 'AM');
    $meridiem['PM'] = T_pgettext('Uppercase Post meridiem.', 'PM');
    return $meridiem[$a];
}
Example #20
0
    /**
     * displayAward 
     * 
     * Displays details about the given award type.
     * Along with who the award was awarded to and any other awards they own.
     * 
     * @param int $userid 
     * @param int $type
     * 
     * @return void
     */
    function displayAward($userid, $type)
    {
        $userid = (int) $userid;
        $sql = "SELECT a.`id`, a.`user`, a.`award`, a.`month`, a.`date`, a.`item_id`, a.`count`, u.`fname`\n                FROM `fcms_user_awards` AS a,\n                    `fcms_users` AS u\n                WHERE a.`user` = '{$userid}'\n                AND a.`award` = '{$type}'\n                AND a.`user` = u.`id`";
        $rows = $this->fcmsDatabase->getRows($sql, array($userid, $type));
        if ($rows === false) {
            $this->fcmsError->displayError();
            return;
        }
        if (count($rows) <= 0) {
            echo '
            <p class="error-alert">' . T_('Invalid Member/Award.') . '</p>';
            return;
        }
        $awardList = array();
        foreach ($rows as $r) {
            $awardList[] = $r;
            $fname = $r['fname'];
        }
        $currentAward = array('id' => $awardList[0]['id'], 'award' => $awardList[0]['award'], 'month' => $awardList[0]['month'], 'date' => $awardList[0]['date'], 'item_id' => $awardList[0]['item_id'], 'count' => $awardList[0]['count']);
        $awardsInfo = $this->getAwardsInfoList();
        $totalTimesAwarded = count($awardList);
        $string = T_ngettext('%s has been given this award %d time.', '%s has been given this award %d times.', $totalTimesAwarded);
        $awardedCount = sprintf($string, $fname, $totalTimesAwarded) . '</h5>';
        if ($userid == $this->fcmsUser->id) {
            $string = T_ngettext('You have been given this award %d time.', 'You have been given this award %d times.', $totalTimesAwarded);
            $awardedCount = sprintf($string, $totalTimesAwarded) . '</h5>';
        }
        echo '
            <div id="current-award">
                <div class="' . $currentAward['award'] . '"></div>
                <h1>' . $awardsInfo[$currentAward['award']]['name'] . '</h1>
                <h2>' . $awardsInfo[$currentAward['award']]['description'] . '</h2>
            </div>

            <h5 class="times-awarded">' . $awardedCount . '</h5>';
        foreach ($awardList as $r) {
            $details = '';
            $date = '';
            if (strlen($r['month']) == 6) {
                $year = substr($r['month'], 0, 4);
                $month = substr($r['month'], 4, 2);
                $date = date('F, Y', strtotime("{$year}-{$month}-01"));
            }
            switch ($r['award']) {
                case 'board':
                    $details = sprintf(T_pgettext('Ex: December, 2011 - 10 posts', '%s - %s posts'), $date, $r['count']);
                    break;
                case 'gallery':
                    $details = sprintf(T_pgettext('Ex: December, 2011 - 10 photos', '%s - %s photos'), $date, $r['count']);
                    break;
                case 'recipes':
                    $details = sprintf(T_pgettext('Ex: December, 2011 - 10 recipes', '%s - %s recipes'), $date, $r['count']);
                    break;
                case 'news':
                    $details = sprintf(T_pgettext('Ex: December, 2011 - 10 posts', '%s - %s posts'), $date, $r['count']);
                    break;
                case 'docs':
                    $details = sprintf(T_pgettext('Ex: December, 2011 - 10 documents', '%s - %s documents'), $date, $r['count']);
                    break;
                case 'icebreaker':
                    $thread = (int) $r['item_id'];
                    $replies = sprintf(T_pgettext('Ex: 21 replies', '%d replies'), $r['count']);
                    $details = $date . ' - <a href="messageboard.php?thread=' . $thread . '">' . $this->fcmsMessageBoard->getThreadSubject($thread) . '</a> - ' . $replies;
                    break;
                case 'shutterbug':
                    $id = (int) $r['item_id'];
                    $photo = $this->fcmsPhotoGallery->getPhotoInfo($id);
                    $views = sprintf(T_pgettext('Ex: 210 views', '%d views'), $r['count']);
                    $photoSrc = $this->fcmsPhotoGallery->getPhotoSource($photo);
                    $details = $date . ' - ' . $views . '<br/>';
                    $details .= '<a href="gallery/index.php?uid=' . $photo['user'] . '&amp;cid=' . $photo['category'] . '&amp;pid=' . $photo['id'] . '">';
                    $details .= '<img src="' . $photoSrc . '"/>';
                    $details .= '</a>';
                    break;
                case 'interesting':
                    $id = (int) $r['item_id'];
                    $views = sprintf(T_pgettext('Ex: 21 comments', '%d comments'), $r['count']);
                    $sql = "SELECT `title`\n                            FROM `fcms_news`\n                            WHERE `id` = '{$id}'";
                    $news = $this->fcmsDatabase->getRow($sql, $id);
                    if ($news === false) {
                        $this->fcmsError->displayError();
                        return;
                    }
                    $title = cleanOutput($news['title']);
                    $details = $date . ' - <a href="familynews.php?getnews=' . $r['user'] . '&amp;newsid=' . $id . '">' . $title . '</a> - ' . $views;
                    break;
                case 'secretive':
                    $views = sprintf(T_pgettext('Ex: 210 private messages', '%d private messages'), $r['count']);
                    $details = $date . ' - ' . $views . '<br/>';
                    break;
                case 'planner':
                    $views = sprintf(T_pgettext('Ex: 53 events', '%d events'), $r['count']);
                    $details = $date . ' - ' . $views . '<br/>';
                    break;
                case 'photogenic':
                    $views = sprintf(T_pgettext('Ex: 53 photos', '%d photos'), $r['count']);
                    $details = $date . ' - ' . $views . '<br/>';
                    break;
            }
            echo '
                <p>' . $details . '</p>';
        }
    }
Example #21
0
File: rss.php Project: lmcro/fcms
/**
 * displayFeedPhotoGallery 
 * 
 * @return void
 */
function displayFeedPhotoGallery()
{
    $fcmsError = FCMS_Error::getInstance();
    $fcmsDatabase = Database::getInstance($fcmsError);
    $url = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
    $urlroot = $url;
    $pos = strrpos($url, "/");
    if ($pos === false) {
        $pos = strrpos($url, "\\");
    }
    if (!($pos === false)) {
        $urlroot = substr($url, 0, $pos);
    }
    $lastday = time() - 84 * 60 * 60 * 24;
    // 12 weeks
    $sql = "SELECT `caption`, p.`user`, `filename`, p.`date`, `name` \n            FROM `fcms_gallery_photos` AS p, `fcms_category` As c\n            WHERE p.`category` = c.`id` \n            AND UNIX_TIMESTAMP(p.`date`) >= ?\n            ORDER BY p.`date`";
    $rows = $fcmsDatabase->getRows($sql, $lastday);
    if ($rows === false) {
        print "Error getting data.";
        return;
    }
    $output = "<?xml version=\"1.0\"?" . "> \n<rss version=\"2.0\"> \n<channel> \n<title>" . getSiteName() . " - " . T_('Photo Gallery') . "</title> \n<link>" . $url . "</link> \n<description>" . getSiteName() . " - " . T_('Photo Gallery') . " " . T_('RSS Feed') . "</description> \n<language>" . T_pgettext('Language Code for this translation', 'lang') . "</language> \n<managingEditor>" . getContactEmail() . "</managingEditor> \n";
    if (count($rows) > 0) {
        foreach ($rows as $line) {
            $title = htmlentities($line['caption']);
            if ($title == "") {
                $title = htmlentities($line['name']);
            }
            $output .= "<item><title><![CDATA[{$title}]]></title> \n<pubDate>" . gmdate('D, d M Y H:i:s', strtotime($line['date'])) . " GMT</pubDate> \n<link>" . htmlentities($urlroot . "/gallery/photos/member" . $line['user'] . "/" . $line['filename']) . "</link>              \n<description><![CDATA[<img src=\"{$urlroot}/gallery/photos/member" . $line['user'] . "/" . $line['filename'] . "\" border=\"0\" />]]></description> \n<enclosure url=\"" . $urlroot . "/gallery/photos/member" . $line['user'] . "/" . $line['filename'] . "\" type=\"" . returnMIMEType("./gallery/photos/member" . $line['user'] . "/" . $line['filename']) . "\" length=\"" . filesize("./gallery/photos/member" . $line['user'] . "/" . $line['filename']) . "\" /> \n<guid isPermaLink=\"true\"><![CDATA[" . $urlroot . "/gallery/photos/member" . $line['user'] . "/" . $line['filename'] . "]]></guid> \n</item> \n";
        }
    }
    $output .= "</channel></rss>";
    echo $output;
}