Beispiel #1
0
function LanguageChangeTest()
{
    $newlang = "";
    if (GetStrParam("lang") != "") {
        SwitchToNewLang(GetStrParam("lang"));
    }
    if (!isset($_SESSION['lang'])) {
        if (!empty($_COOKIE['LastLang'])) {
            // If there is already a cookie ide set, we are going try it as language
            SwitchToNewLang($_COOKIE['LastLang']);
        } else {
            SwitchToNewLang();
            // Switch lang will choose the default language
        }
    }
    // -----------------------------------------------------------------------------
    // test if member use the switchtrans switch to record use of words on its page
    if (isset($_GET['switchtrans']) and $_GET['switchtrans'] != "") {
        if (!isset($_SESSION['switchtrans'])) {
            $_SESSION['switchtrans'] = "on";
        } else {
            if ($_SESSION['switchtrans'] == "on") {
                $_SESSION['switchtrans'] = "off";
            } else {
                $_SESSION['switchtrans'] = "on";
            }
        }
    }
    // end of switchtrans
    if (isset($_GET['forcewordcodelink'])) {
        // use to force a linj to each word
        //code on display
        $_SESSION['forcewordcodelink'] = $_GET['forcewordcodelink'];
    }
}
Beispiel #2
0
function OnActionLogin()
{
    global $user, $data, $db;
    if ($_SERVER['REQUEST_METHOD'] == 'GET') {
        ShowTemplatePage("login");
    } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $email = GetStrParam('email', $_POST, MIN_EMAIL_LENGTH, MAX_EMAIL_LENGTH);
        $password = GetStrParam('password', $_POST, MIN_PASSWORD_LENGTH, MAX_PASSWORD_LENGTH);
        if (strlen($email) > 0 && strlen($password) > 0) {
            $ret['ret'] = $user->Login($email, $password);
        } else {
            $ret['ret'] = false;
        }
        _json_encode($ret);
    }
}
Beispiel #3
0
function viewSpamSayMember($sResult = "")
{
    $TMess = array();
    $str = "select messages.*,messages.Status as MessageStatus,mSender.Username as Username_sender,mReceiver.Username as Username_receiver from messages,members as mSender,members as mReceiver where mSender.id=IdSender and messages.SpamInfo='SpamSayMember' and mReceiver.id=IdReceiver and (mSender.Status='Active' or mSender.Status='Pending') order by messages.id desc limit 50";
    if (GetStrParam("IdSender", "") != "") {
        $str = "select messages.*,messages.Status as MessageStatus,mSender.Username as Username_sender,mReceiver.Username as Username_receiver from messages,members as mSender,members as mReceiver where mSender.id=IdSender and mReceiver.id=IdReceiver and (mSender.Status='Active' or mSender.Status='Pending') and messages.SpamInfo='SpamSayMember' and messages.IdSender=" . IdMember(GetStrParam("IdSender", 0)) . " order by messages.id desc limit 20";
    }
    if (GetStrParam("IdReceiver", "") != "") {
        $str = "select messages.*,messages.Status as MessageStatus,mSender.Username as Username_sender,mReceiver.Username as Username_receiver from messages,members as mSender,members as mReceiver where mSender.id=IdSender and mReceiver.id=IdReceiver and (mSender.Status='Active' or mSender.Status='Pending') and messages.SpamInfo='SpamSayMember' and messages.IdReceiver" . IdMember(GetStrParam("IdReceiver", 0)) . " order by messages.id desc limit 20";
    }
    //		echo "str=$str<br>" ;
    $qry = sql_query($str);
    while ($rr = mysql_fetch_object($qry)) {
        array_push($TMess, $rr);
    }
    DisplayMessages($TMess, $sResult, GetStrParam("IdSender", ""));
    // call the layout
    exit(0);
    // exit after the layout has been called
}
Beispiel #4
0
function _Pagination($maxpos)
{
    $curpos = GetParam("start_rec", 0);
    // find current pos (0 if not)
    $width = GetParam("limitcount", 100);
    // Number of records per page
    $PageName = $_SERVER["PHP_SELF"];
    // Find the url parameters
    $strurl = "action=Find" . ParamUrl();
    $strurl .= "&OrderBy=" . GetStrParam("OrderBy");
    //    echo "width=",$width,"<br>" ;
    //    echo "curpos=",$curpos,"<br>" ;
    //    echo "maxpos=",$maxpos,"<br>" ;
    echo "\n<center>";
    $countlink = 0;
    for ($ii = 0; $ii < $maxpos; $ii = $ii + $width) {
        $i1 = $ii;
        $i2 = min($ii + $width, $maxpos);
        $countlink++;
        if ($countlink > 20) {
            echo "<a href=\"", $PageName, "?" . $strurl . "&start_rec=", $i1, "\"> ....</a> ";
            break;
            // do not put too much links
        }
        if ($curpos >= $i1 and $curpos < $i2) {
            // mark in bold if it is the current position
            echo "<b>";
        }
        echo "<a href=\"", $PageName, "?" . $strurl . "&start_rec=", $i1, "\">", $i1 + 1, "..", $i2, "</a> ";
        if ($curpos >= $i1 and $curpos < $i2) {
            // end of mark in bold if it is the current position
            echo "</b>";
        }
    }
    echo "</center>\n";
}
Beispiel #5
0
            $str = "INSERT INTO words\n                                    (code,\n                                     Description,\n                                     IdLanguage,\n                                     ShortCode,\n                                     created)\n                                VALUES\n                                    ('FaqA_" . GetStrParam("QandA") . "',\n                                     'This is the answertext for a Frequently Asked Question.',\n                                     0,\n                                     '" . $_SESSION['lang'] . "',\n                                     NOW())";
            sql_query($str);
        }
        // reload for case it was just inserted before
        $rwq = LoadRow("SELECT * FROM words WHERE code='" . "FaqQ_" . GetStrParam("QandA") . "' and IdLanguage=0");
        $rwa = LoadRow("SELECT * FROM words WHERE code='" . "FaqA_" . GetStrParam("QandA") . "' and IdLanguage=0");
        if (GetStrParam('changetype') == 'major') {
            $majorupdate = ',majorupdate = NOW() ';
        } else {
            $majorupdate = '';
        }
        $str = "UPDATE words SET Description='" . addslashes($rwq->Description) . "',Sentence='" . GetStrParam("Question") . "' {$majorupdate} WHERE id=" . $rwq->id;
        sql_query($str);
        $str = "UPDATE words SET Description='" . addslashes($rwa->Description) . "',Sentence='" . GetStrParam("Answer") . "' {$majorupdate} WHERE id=" . $rwa->id;
        sql_query($str);
        $str = "UPDATE faq SET IdCategory=" . GetParam("IdCategory") . ",QandA='" . GetParam("QandA") . "',Active='" . GetStrParam("Status") . "',SortOrder=" . GetParam("SortOrder") . " WHERE id=" . $Faq->id;
        sql_query($str);
        LogStr("updating Faq #" . $Faq->id, "Update Faq");
        break;
}
// prepare the list
if (GetParam("IdCategory")) {
    $FilterCategory = " AND IdCategory=" . GetParam("IdCategory");
} else {
    $FilterCategory = "";
}
if ($IdFaq != 0) {
    // if one specific Faq is chosen
    $str = "SELECT faq.*,faqcategories.Description AS CategoryName,PageTitle FROM faq,faqcategories  WHERE faq.id=" . $IdFaq . " and faqcategories.id=faq.IdCategory " . $FilterCategory . $FilterActive . " ORDER BY faqcategories.SortOrder,faq.SortOrder";
} else {
    $str = "SELECT faq.*,faqcategories.Description AS CategoryName,PageTitle FROM faq,faqcategories  WHERE faqcategories.id=faq.IdCategory " . $FilterCategory . $FilterActive . " ORDER BY faqcategories.SortOrder,faq.SortOrder";
Beispiel #6
0
function DisplayAdminMassprepareenque($rBroadCast, $TGroupList, $TCountries, $TData, $count = 0, $countnonews = 0, $query = "")
{
    global $title;
    $title = "Admin Mass Mails";
    require_once "header.php";
    Menu1("", ww('MainPage'));
    // Displays the top menu
    Menu2("admin/adminmassmails.php", ww('MainPage'));
    // Displays the second menu
    $MenuAction = "            <li><a href=\"adminmassmails.php\">Admin Massmails</a></li>\n";
    $MenuAction .= "            <li><a href=\"adminmassmails.php?action=createbroadcast\">Create new broadcast</a></li>\n";
    if (HasRight("MassMail", "Send")) {
        // if has right to trig
        $MenuAction .= "            <li><a href=\"adminmassmails.php?action=ShowPendingTrigs\">Trigger mass mails</a></li>\n";
    }
    DisplayHeaderShortUserContent("Admin Mails - Broadcast Messages", "");
    ShowLeftColumn($MenuAction, VolMenu());
    $Name = $rBroadCast->Name;
    $IdGroup = GetParam("IdGroup", 0);
    $CountryIsoCode = GetParam("CountryIsoCode", 0);
    echo "    <div id=\"col3\"> \n";
    echo "      <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "        <div class=\"info clearfix\">\n";
    echo "<h2>For broadcast <b>", $Name, "</b></h2>";
    if ($count > 0) {
        echo "<p class=\"note\"> {$count} enqueued messages !<br /><i>{$countnonews} will not receive the mail because of their preference</i></p>";
    }
    $BroadCast_Title_ = getBroadCastElement("BroadCast_Title_" . $Name, 0);
    $BroadCast_Body_ = getBroadCastElement("BroadCast_Body_" . $Name, 0);
    $rr = LoadRow("select * from words where code='BroadCast_Title_" . $Name . "' and IdLanguage=0");
    if (isset($rr->Description)) {
        $Description = $rr->Description;
    } else {
        $Description = "";
    }
    echo "<h3>", nl2br($BroadCast_Title_), "</h3>";
    echo "<p>", nl2br($BroadCast_Body_), "</p>";
    echo "<br /><form method=\"post\" action=\"adminmassmails.php\" name=\"adminmassmails\" class=\"yform full\">\n";
    echo "<input type=\"hidden\" Name=\"IdBroadCast\" value=" . GetParam("IdBroadCast", 0) . ">\n";
    echo "<h3> Filtering the scope of the mass mail</h3>";
    echo "<div class=\"type-text\">";
    echo "<label for=\"Usernames\">Restrict to some members (ex : lupochen;kiwiflave;jeanyves)</label>";
    echo "<input type=\"text\" id=\"Usernames\" name=\"Usernames\" value=\"" . GetStrParam("Usernames", ""), "\" />\n";
    echo "</div>";
    echo "<div class=\"type-select\">";
    echo "<label for=\"CountryIsoCode\">Choose a country</label>";
    echo "<select id=\"CountryIsoCode\" name=\"CountryIsoCode\">";
    echo "<option value=\"0\">All countries</option>";
    for ($ii = 0; $ii < count($TCountries); $ii++) {
        echo "<option value=\"", $TCountries[$ii]->isoCode . '"';
        if (strcmp($TCountries[$ii]->isoCode, $CountryIsoCode) === 0) {
            echo " selected";
        }
        echo ">", $TCountries[$ii]->Name;
        echo "</option>";
    }
    echo "</select>\n";
    echo "</div>";
    echo "<div class=\"type-select\">";
    echo "<label for=\"IdGroup\">Choose a group</label>";
    echo "<select id=\"IdGroup\" name=\"IdGroup\">";
    echo "<option value=\"0\">All groups</option>";
    for ($ii = 0; $ii < count($TGroupList); $ii++) {
        echo "<option value=", $TGroupList[$ii]->id;
        if ($TGroupList[$ii]->id == $IdGroup) {
            echo " selected";
        }
        echo ">", $TGroupList[$ii]->Name, ":", $TGroupList[$ii]->Name;
        echo "</option>";
    }
    echo "</select>\n";
    echo "</div>";
    echo "<div class=\"type-text\">";
    echo "<label for =\"MemberStatus\">Member with status</label>";
    echo "<input type=\"text\" id=\"MemberStatus\" name=\"MemberStatus\" value=\"" . GetStrParam("MemberStatus", "Active") . "\" />\n";
    echo "</div>";
    echo '<div class="type-text">';
    echo '<label for="Limit">Maximum number of members (i.e. 100)</label>';
    echo '<input type="text" id="limit" name="limit" value="' . GetStrParam("limit", "") . '" />';
    echo '</div>';
    if (GetStrParam("random_order", "") == "on") {
        $random_order_checked = ' checked="checked"';
    } else {
        $random_order_checked = '';
    }
    echo '<div class="type-check">';
    echo '<p>';
    echo '<input type="checkbox"' . $random_order_checked . ' id="random_order" name="random_order" /> ';
    echo '<label for="random_order">Select random members</label>';
    echo '<br>Note: If this option is checked the recipients list below is only an example and does not reflect the list of members the mail will actually be sent to. Members will be randomly selected again when pressing "enqueue".';
    echo '</p>';
    echo '</div>';
    if (HasRight('MassMail', "test")) {
        if (GetStrParam("hide_recipients", "") == "on") {
            $checked = ' checked="checked"';
        } else {
            $checked = '';
        }
        echo '<div class="type-check">';
        echo '<p>';
        echo '<input type="checkbox"' . $checked . ' id="hide_recipients" name="hide_recipients" /> ';
        echo '<label for="hide_recipients">Hide recipients list</label>';
        echo '</p>';
        echo '</div>';
        echo '<p>';
        echo '<input type="submit" name="action" value="test" />';
        echo ' (Shows number of matching members and list of recipients)';
        echo '</p>';
    }
    // if it was a test action display the result build from previous filtering
    if (GetStrParam("action") == "test") {
        $max = count($TData);
        echo "<h3>This newsletter will be sent to {$max} members</h3>\n";
        if (GetStrParam("hide_recipients", "") != "on") {
            echo "<table>\n";
            echo "<tr align=left><th>Username</th><th>country</th>";
            if (IsAdmin()) {
                echo "<th>email</th>";
            }
            echo "<th>Status</th><th>Will try in</th></tr>";
            for ($ii = 0; $ii < $max; $ii++) {
                $m = $TData[$ii];
                echo "<tr class=\"highlight\">";
                echo "<td>", $m->Username, "</td>";
                echo "<td>", getcountrynamebycode($m->isoCode), "</td>";
                if (IsAdmin()) {
                    echo "<td>", GetEmail($m->id), "</td>";
                }
                echo "<td>", $m->Status, "</td>";
                $iLang = GetDefaultLanguage($m->id);
                $PrefLanguageName = LanguageName($iLang);
                echo "<td>", $PrefLanguageName, "</td>";
                echo "</tr>\n";
                echo "<tr>";
                echo "<td colspan=5 class=\"blank\">";
                echo getBroadCastElement("BroadCast_Title_" . $Name, $iLang, $m->Username), "<br />";
                echo getBroadCastElement("BroadCast_Body_" . $Name, $iLang, $m->Username), "<br />";
                echo "</td>";
                echo "</tr>";
            }
            echo "</table>\n";
        }
    }
    if (HasRight('MassMail', "enqueue")) {
        echo "<div class=\"note\">";
        echo "<div class=\"type-check\">";
        echo "<input type=\"checkbox\" id=\"enqueuetick\"  name=\"enqueuetick\" />";
        echo "<label for=\"enqueuetick\">Tick this if you really want to enqueue the messages to send and click on enqueue</label>";
        echo "</div>";
        echo "<div class=\"type-button\">";
        echo "<input type=\"submit\" name=\"action\" value=\"enqueue\" />\n";
        echo "</div>";
        echo "</div>";
    }
    echo "</form>\n";
    echo "<div> <!-- info -->\n";
    require_once "footer.php";
}
Beispiel #7
0
 $_TTsqry = array();
 $_rrQuery = array();
 $tQuery = explode(";", $rrQuery->Query);
 for ($jj = 0; $jj < count($tQuery); $jj++) {
     $sQry = ltrim($tQuery[$jj]);
     if (empty($sQry)) {
         continue;
     }
     $Message = "";
     $TResult = array();
     $TTitle = array();
     $Param1 = mysql_real_escape_string(stripslashes(GetStrParam("param1", "")));
     $Param2 = mysql_real_escape_string(stripslashes(GetStrParam("param2", "")));
     $Param3 = mysql_real_escape_string(stripslashes(GetStrParam("param3", "")));
     $Param4 = mysql_real_escape_string(stripslashes(GetStrParam("param4", "")));
     $Param5 = mysql_real_escape_string(stripslashes(GetStrParam("param5", "")));
     $sQuery = $sQry;
     // echo " \$rrQuery->Query=",$rrQuery->Query," \$Param1=[$Param1]<br>"  ;
     if (!empty($Param1) and !empty($Param2)) {
         if (stripos($sQry, '%s') !== 0) {
             $sQuery = sprintf($sQry, $Param1, $Param2);
         }
     } else {
         if (!empty($Param1)) {
             if (stripos($sQry, '%s') !== 0) {
                 $sQuery = sprintf($sQry, $Param1);
             }
         }
     }
     $sQuery = str_ireplace("\$P1", $Param1, $sQuery);
     $sQuery = str_ireplace("\$P2", $Param2, $sQuery);
Beispiel #8
0
if ($andS2 != "") {
    $where .= " AND Str LIKE '%" . $andS2 . "%'";
}
$notAndS1 = GetStrParam("NotandS1", "");
if ($notAndS1 != "") {
    $where .= " AND Str NOT LIKE '%" . $notAndS1 . "%'";
}
$notAndS2 = GetStrParam("NotandS2", "");
if ($notAndS2 != "") {
    $where .= " AND Str NOT LIKE '%" . $notAndS2 . "%'";
}
$ip = GetStrParam("ip", "");
if ($ip != "") {
    $where .= " AND IpAddress=" . ip2long($ip) . "";
}
$type = GetStrParam("Type", "");
if ($type != "") {
    $where .= " AND Type='" . $type . "'";
}
// If there is a Scope limit logs to the type in this Scope (unless it his own logs)
if (!HasRight('Logs', "\"All\"")) {
    $scope = RightScope("Logs");
    str_replace($scope, "\"", "'");
    $where .= " AND (Type IN (" . $scope . ") OR IdMember=" . $_SESSION["IdMember"] . ") ";
}
switch (GetParam("action")) {
    case "del":
        // case a delete is requested
        break;
}
$tData = array();
Beispiel #9
0
         echo "For this you need the scope <b>" . $action . "</b> within <b>Pannel</b> rights<br>";
         exit(0);
     }
     break;
 case "SaveToDB":
     if (!HasRight('Pannel', $action)) {
         // Check the rights
         echo "For this you need the scope <b>" . $action . "</b> within <b>Pannel</b> rights<br>";
         exit(0);
     }
     $ii = 0;
     $str = "truncate hcvol_config";
     sql_query($str);
     $str = "insert into hcvol_config(comment) values(concat('generated by " . $_SESSION["Username"] . " using AdminPannel ',now()))";
     while (GetStrParam("SYSHCvol_key_" . $ii) != "" or GetStrParam("SYSHCvol_value_" . $ii) != "" or GetStrParam("SYSHCvol_comment_" . $ii) != "") {
         $str = "insert into hcvol_config(syskey,value,comment) values('" . GetStrParam("SYSHCvol_key_" . $ii) . "','" . GetStrParam("SYSHCvol_value_" . $ii) . "','" . GetStrParam("SYSHCvol_comment_" . $ii) . "')";
         sql_query($str);
         $ii++;
     }
     $Message = "Storing content in Database";
     LogStr("Saving file to base", "AdminPannel");
     DisplayPannel(LoadingData("FromBase"), $Message);
     // call the layout
     exit(0);
     break;
 case "LoadFromDB":
     if (!HasRight('Pannel', $action)) {
         // Check the rights
         echo "For this you need the scope <b>" . $action . "</b> within <b>Pannel</b> rights<br>";
         exit(0);
     }
Beispiel #10
0
function DisplayUpdateMandatory($Username = "", $FirstName = "", $SecondName = "", $LastName = "", $pIdCountry = 0, $pIdRegion = 0, $pIdCity = 0, $HouseNumber = "", $StreetName = "", $Zip = "", $Gender = "", $MessageError = "", $BirthDate = "", $HideBirthDate = "No", $HideGender = "No", $MemberStatus = "", $CityName = "")
{
    global $title, $IsVolunteerAtWork;
    $title = ww('UpdateMandatoryPage');
    require_once "header.php";
    Menu1($title, ww('UpdateMandatoryPage'));
    // Displays the top menu
    ?>
  <SCRIPT SRC="lib/select_area.js" TYPE="text/javascript"></SCRIPT>
<?php 
    Menu2("", ww('UpdateMandatoryPage'));
    // Displays the second menu
    $stitle = $title;
    $stitle .= " - " . $Username;
    DisplayHeaderShortUserContent($stitle);
    $IdCountry = $pIdCountry;
    $IdCity = $pIdCity;
    if ($IdCity != 0) {
        $IdRegion = GetIdRegionForCity($IdCity);
    } else {
        $IdRegion = $pIdRegion;
    }
    $scountry = ProposeCountry($IdCountry, "updatemandatory");
    echo "    <div id=\"col3\" style=\"margin:0;\"> \n";
    echo "      <div id=\"col3_content\" class=\"clearfix\"> \n";
    echo "        <div class=\"info clearfix\">\n";
    echo "<input type=hidden name=IdRegion value=-1>";
    $scity = ProposeCity($IdCity, $IdRegion, "updatemandatory", $CityName, $IdCountry);
    echo "<form method=post name=\"updatemandatory\" action=\"updatemandatory.php\">\n";
    echo "<table  style=\"font-size: 12;\">\n";
    echo "<input type=hidden name=action value=updatemandatory>\n";
    if (GetStrParam("cid") != "") {
        echo "<input type=hidden name=cid value=\"", GetStrParam("cid"), "\">\n";
    }
    if ($MessageError != "") {
        echo "\n<tr><th colspan=3>", ww("SignupPleaseFixErrors"), ":<br><font color=red>", $MessageError, "</font></th>";
    } else {
        echo "\n<tr><th colspan=3 align=left>", ww('UpdateMandatoryIntroduction'), "</th>";
    }
    echo "\n<tr><td colspan=3 align=center><hr /></td>";
    echo "\n<input name=Username type=hidden value=\"{$Username}\">";
    echo "\n<tr><td>", ww('SignupName'), "</td><td><input name=FirstName type=text value=\"{$FirstName}\" size=12> <input name=SecondName type=text value=\"{$SecondName}\" size=8> <input name=LastName type=text value=\"{$LastName}\" size=14></td><td style:\"font-size=2\">", ww('SignupNameDescription'), "</td>";
    echo "\n<tr><td colspan=3 align=center><hr /></td>";
    echo "\n<tr><td>", ww('SignupIdCity'), "</td><td>";
    echo $scountry, " ";
    if ($IdCountry != 0) {
        echo "\n<br>" . ww("City") . " <input type=text name=CityName value=\"" . $CityName . "\" onChange=\"change_region('updatemandatory')\">";
    }
    echo $scity;
    echo "</td><td>", ww('SignupIdCityDescription'), "</td>";
    echo "\n<tr><td>", ww('SignupHouseNumber'), "</td><td><input name=HouseNumber type=text value=\"{$HouseNumber}\" size=8></td><td>", ww('SignupHouseNumberDescription'), "</td>";
    echo "\n<tr><td>", ww('SignupStreetName'), "</td><td><input name=StreetName type=text value=\"{$StreetName}\" size=30></td><td>", ww('SignupStreetNameDescription'), "</td>";
    echo "\n<tr><td>", ww('SignupZip'), "</td><td><input name=Zip type=text value=\"{$Zip}\"></td><td>", ww('SignupZipDescription'), "</td>";
    echo "\n<tr><td colspan=3 align=center><hr /></td>";
    echo "\n<tr><td colspan=2>";
    echo ww("Gender"), " ";
    echo "<select name=Gender>";
    echo "<option value=\"\"></option>";
    // set to not initialize at beginning
    /*
      echo "<option value=\"IDontTell\"";
      if ($Gender=="IDontTell") echo " selected";
      echo ">",ww("IDontTell"),"</option>";
    */
    echo "<option value=\"male\"";
    if ($Gender == "male") {
        echo " selected";
    }
    echo ">", ww("male"), "</option>";
    echo "<option value=\"female\"";
    if ($Gender == "female") {
        echo " selected";
    }
    echo ">", ww("female"), "</option>";
    echo "</select>\n ";
    echo " ", ww("Hidden"), " \n<input type=checkbox Name=HideGender";
    if ($HideGender == 'Yes') {
        echo " checked";
    }
    echo ">\n";
    echo "</td><td>", ww("SignupGenderDescription"), "</td>";
    echo "\n<tr><td colspan=3 align=center><hr /></td>";
    echo "\n<tr><td>", ww('SignupBirthDate'), "</td><td><input name=BirthDate type=text value=\"{$BirthDate}\" size=10>";
    echo " ", ww("AgeHidden"), " \n<input type=checkbox Name=HideBirthDate";
    if ($HideBirthDate == 'Yes') {
        echo " checked";
    }
    echo ">\n";
    echo "</td><td>", ww('SignupBirthDateDescription', ww('AgeHidden')), "</td>";
    echo "\n<tr><td colspan=3 align=center><hr /></td>";
    echo "\n<tr><td>", ww('FeedbackUpdateMandatory'), "</td><td><textarea name=Comment cols=60 rows=4>", GetStrParam("Comment"), "</textarea></td><td>", ww('FeedbackUpdateMandatoryDesc'), "</td>";
    echo "\n<tr><td colspan=3 align=center><hr /></td>";
    if ($IsVolunteerAtWork) {
        $tt = sql_get_enum("members", "Status");
        // Get the different available status
        $maxtt = count($tt);
        echo "\n<tr>";
        echo "<td>Status <select name=Status>\n";
        echo "<option value=\" - undefined - \"> - undefined - </option>";
        for ($ii = 0; $ii < $maxtt; $ii++) {
            echo "<option value=\"", $tt[$ii], "\"";
            if ($tt[$ii] == $MemberStatus) {
                echo " selected";
            }
            echo ">", $tt[$ii], "</option>\n";
        }
        echo "</select>\n</td>\n";
        echo "<td colspan=2 align=center>";
        echo "<input type=\"submit\" id=\"submit\">\n";
        echo "</td>";
    } else {
        echo "\n<tr><td colspan=3 align=center>";
        echo "<input type=\"submit\" id=\"submit\" onclick=\"return confirm('", str_replace("\n", "", ww('UpdateMandatoryConfirmQuestion')), "');\">\n";
        echo "</td>";
    }
    echo "\n</table>\n";
    echo "</form>\n";
    require_once "footer.php";
}
Beispiel #11
0
Menu2("main.php", "DB_MAINTENANCE");
// Displays the second menu
if (!HasRight("Admin")) {
    echo "<p> this need Admin rights</p>";
    require_once "layout/footer.php";
    die(1);
}
$MenuAction = "            <li><a href=\"" . bwlink("admin/dbmaintenance.php") . "\">db maintenance</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=updateid") . "\">update new ids</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=filltrads") . "\">fill the forum_trads</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=filltag_threads") . "\">recreate tags_threads</a></li>\n";
$MenuAction .= "            <li><a href=\"" . bwlink("admin/dbmaintenance.php?action=updatetagcounters") . "\">update tags counters</a></li>\n";
DisplayHeaderShortUserContent("Db Maintenance", $MenuAction, "");
// Display the header
ShowLeftColumn($MenuAction, "");
$action = GetStrParam("action", "");
switch ($action) {
    case "updateid":
        sql_query("update forums_tags set id=tagid");
        // dealing with redundant values
        sql_query("update forums_threads set id=threadid");
        // dealing with redundant values
        sql_query("update forums_posts set id=postid");
        // dealing with redundant values
        echo "<br />Id updated</p>";
        break;
    case "updatetagcounters":
        echo "<p>updating tags counter according to new tags_threads<br />";
        $str = " UPDATE forums_tags SET counter = (select count(*) from tags_threads where forums_tags.id=tags_threads.IdTag)";
        echo "<br />" . $str . "<br />";
        sql_query($str);
Beispiel #12
0
$lastaction = "";
switch ($action) {
    case "update":
        $Message = " Updated comment #" . GetParam("IdComment");
        $c = LoadRow("select * from comments where id=" . GetParam("IdComment"));
        // Build string for length database field
        $lengthArray = array();
        foreach ($_SYSHCVOL['LenghtComments'] as $checkbox) {
            if (GetParam("Comment_" . $checkbox)) {
                $lengthArray[] = $checkbox;
            }
        }
        $length = implode(",", $lengthArray);
        $quality = GetStrParam("Quality");
        $textWhere = GetStrParam("TextWhere");
        $textFree = GetStrParam("TextFree");
        $id = GetParam("IdComment");
        $str = "\n            UPDATE\n                comments\n            SET\n                Lenght='{$length}',\n                Quality='{$quality}',\n                TextWhere='{$textWhere}',\n                TextFree='{$textFree}'\n            WHERE\n                id={$id}\n        ";
        sql_query($str);
        LogStr("Updating comment #" . GetParam("IdComment") . " previous where=" . $c->TextWhere . " previous text=" . $c->TextFree . " previous Quality=" . $c->Quality, "AdminComment");
        // call the layout
        DisplayAdminComments(loaddata("", " and comments.id=" . GetParam("IdComment")), $Message);
        exit(0);
        break;
    case "AdminAbuserMustCheck":
        $Message = "Set comment to be checked by Admin Comment";
        $str = "Update comments set AdminAction='AdminAbuserMustCheck' where id=" . Getparam("IdComment");
        sql_query($str);
        LogStr(" Setting to <b>tobe check by Admin Abuser</b> for IdComment #" . Getparam("IdComment"), "AdminComment");
        break;
    case "AdminCommentMustCheck":
Beispiel #13
0
function GetParam($param, $defaultvalue = "")
{
    return GetStrParam($param, $defaultvalue);
}