Example #1
0
function getUserAddress($paramName, $from) {
        $userAddress = strtolower(getString($paramName, $from));
        if(!preg_match('|^[a-z0-9-]+(\.[a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$|i', $userAddress)) {
                die("Parameter $paramName is '$userAddress' but should be a valid user address");
        }
	return $userAddress;
}
Example #2
0
 public function __construct($hex)
 {
     $this->primaryA = getString($hex, self::MESSAGE_LENGTH * 0, self::MESSAGE_LENGTH);
     $this->primaryB = getString($hex, self::MESSAGE_LENGTH * 1, self::MESSAGE_LENGTH);
     $this->secondA = getString($hex, self::MESSAGE_LENGTH * 2, self::MESSAGE_LENGTH);
     $this->secondB = getString($hex, self::MESSAGE_LENGTH * 3, self::MESSAGE_LENGTH);
     $this->failA = getString($hex, self::MESSAGE_LENGTH * 4, self::MESSAGE_LENGTH);
     $this->failB = getString($hex, self::MESSAGE_LENGTH * 5, self::MESSAGE_LENGTH);
 }
Example #3
0
function drawJumpToStaff($selectedID = false)
{
    global $page;
    $nullable = $selectedID === false;
    $return = drawPanel(getString('jump_to') . ' ' . drawSelectUser('', $selectedID, $nullable, 0, true, true, 'Staff Member:'));
    if ($page['is_admin'] && db_grab('SELECT COUNT(*) FROM users_requests WHERE is_active = 1')) {
        $return = drawMessage('There are pending <a href="requests.php">account requests</a> for you to review.') . $return;
    }
    return $return;
}
Example #4
0
 private function login()
 {
     $Auth = new cAuthentication();
     /// unsuccessful login proces ///
     if (!$Auth->login($_POST['login'], $_POST['password_hmac'], $_POST['challenge'])) {
         $this->aErrors[] = getString("Přihlášení se nezdařilo!", 'login');
         foreach ($Auth->getErrors() as $error) {
             $this->aErrors[] = $error;
         }
         $this->db->delete('core_challenges', array('id', '=', $_POST['challenge']));
     }
 }
 function __initialize($message, $type = 'highlight')
 {
     parent::__initialize('div');
     $this->class = "ui-widget ui-message";
     if (function_exists('translation_string_exists') && translation_string_exists($message)) {
         $message = getString($message);
     }
     $icon = $type == 'highlight' ? 'info' : 'alert';
     $sub = $this->content(new Control('div'));
     $sub->class = "ui-state-{$type} ui-corner-all";
     $sub->content("<span class='ui-icon ui-icon-close' onclick=\"\$(this).parent().parent().slideUp('fast', function(){ \$(this).remove(); })\"></span>");
     $sub->content("<p><span class='ui-icon ui-icon-{$icon}'></span>{$message}</p>");
 }
Example #6
0
function fileSearch()
{
    $wheres = array();
    //input
    if ($_POST['filename'] != "") {
        $filenameValue = $_POST['filename'];
        $filenameQuery = "name LIKE '%" . $filenameValue . "%'";
        array_push($wheres, $filenameQuery);
    }
    if ($_POST['startDate'] != "") {
        $startDateValue = strtotime($_POST['startDate']);
        $startDateQuery = "timestamp > '" . $startDateValue . "'";
        array_push($wheres, $startDateQuery);
    }
    if ($_POST['endDate'] != "") {
        $endDateValue = strtotime($_POST['endDate']);
        $endDateQuery = "timestamp < '" . $endDateValue . "'";
        array_push($wheres, $endDateQuery);
    }
    if (isset($_POST['uploader'])) {
        $uploaders = $_POST['uploader'];
        $uploaderArray = "(";
        for ($i = 0; $i < count($uploaders); $i++) {
            $uploaderArray .= $uploaders[$i] . ',';
        }
        $uploaderArray = substr($uploaderArray, 0, -1) . ')';
        $uploaderQuery = "uploader IN " . $uploaderArray;
        array_push($wheres, $uploaderQuery);
    }
    //create query
    $searchQuery = "SELECT *, file.id AS fileId FROM file, user WHERE file.uploader = user.id";
    for ($i = 0; $i < count($wheres); $i++) {
        $searchQuery .= " AND " . $wheres[$i];
    }
    $searchQuery .= " ORDER BY file.id DESC";
    $filesQuery = getQuery($searchQuery);
    $stringOfFiles = "";
    while ($row = mysqli_fetch_assoc($filesQuery)) {
        $uploader = $row['uploader'];
        $name = $row['display_name'];
        $timestamp = $row['timestamp'];
        $date = date('d.m.Y H:i', $timestamp);
        $filename = $row['name'];
        $stringOfFiles .= getImageTags($filename) . '<a href="download.php?id=' . $row['fileId'] . '" target="_blank">' . $row['name'] . ' ' . getString("uploadedBy") . ' ' . $name . ' ' . $date . '</a>' . ' ' . '<a href="#" onClick= "shareFile(' . $row['fileId'] . ')">' . getString("shareFile") . '</a><br>';
    }
    return $stringOfFiles;
}
Example #7
0
function drawEventForm()
{
    global $page;
    $f = new form('cal_events', @$_GET['id'], $page['title']);
    if (url_id()) {
        $f->set_title_prefix(drawHeader(false, ' '));
    }
    if ($page['is_admin']) {
        $f->set_field(array('name' => 'created_user', 'class' => 'admin', 'type' => 'select', 'sql' => 'SELECT id, CONCAT_WS(", ", lastname, firstname) FROM users WHERE is_active = 1 ORDER BY lastname, firstname', 'default' => $_SESSION['user_id'], 'required' => true, 'label' => getString('posted_by')));
    }
    $f->set_field(array('name' => 'title' . langExt(), 'label' => getString('title'), 'type' => 'text'));
    $f->set_field(array('name' => 'start_date', 'label' => getString('start_date'), 'type' => 'datetime', 'required' => true));
    $f->set_field(array('name' => 'end_date', 'label' => getString('end_date'), 'type' => 'datetime', 'required' => true));
    $f->set_field(array('name' => 'type_id', 'type' => 'select', 'sql' => 'SELECT id, description' . langExt() . ' FROM cal_events_types ORDER BY description', 'label' => getString('category'), 'required' => 'true'));
    $f->set_field(array('name' => 'description' . langExt(), 'label' => getString('description'), 'type' => 'textarea', 'class' => 'tinymce'));
    langUnsetFields($f, 'title,description');
    formAddChannels($f, 'cal_events', 'event_id');
    $f->set_order('created_user,title, start_date, end_date, type_id, description, channels');
    langTranslateCheckbox($f, url_id());
    return $f->draw(false, false);
}
 /**
  * @override
  */
 public function PreRender($args = array())
 {
     if (isset($this->Options['captionEl'])) {
         $title = isset($this->Options['captionTitle']) ? $this->Options['captionTitle'] . ": " : getString("TXT_RATING") . ": ";
         $labTitle = new Label($title);
         $labTitle->class = "userrating";
         $caption_element = "<span id='" . $this->Options['captionEl'] . "'></span>";
         $caption = ", captionEl: \$('#" . $this->Options['captionEl'] . "')}";
         unset($this->Options['captionEl']);
         unset($this->Options['captionTitle']);
         $this->Options = system_to_json($this->Options);
         $this->Options = str_replace("}", $caption, $this->Options);
         $this->content($labTitle);
         $this->content($this->CreateSelect($this->id . "_select"));
         //$this->_content[] = "&nbsp;&nbsp;(".$caption_element.")";
     } else {
         $this->Options = system_to_json($this->Options);
         $this->content($this->CreateSelect($this->id . "_select"));
     }
     $script = "\$('#{$this->id}').stars({$this->Options});";
     $this->script($script);
     parent::PreRender($args);
 }
Example #9
0
 public function __construct($byteString)
 {
     $this->platformID = getShort($byteString, self::HEADER_START);
     $this->flightGroupCount = getShort($byteString, self::HEADER_FG);
     $this->messageCount = getShort($byteString, self::HEADER_MSG);
     for ($i = 0; $i < self::IFF_COUNT; $i++) {
         $this->IFFNames[] = getString($byteString, self::HEADER_IFF + $i * self::IFF_LENGTH, self::IFF_LENGTH);
     }
     for ($r = 0; $r < self::REGION_COUNT; $r++) {
         $this->regionNames[] = getString($byteString, self::HEADER_REGION + $r * self::REGION_LENGTH, self::REGION_LENGTH);
     }
     for ($c = 0; $c < self::CARGO_COUNT; $c++) {
         $this->globalCargos[] = new GlobalCargo(substr($byteString, self::HEADER_CARGO + $c * GlobalCargo::LENGTH, GlobalCargo::LENGTH));
     }
     for ($g = 0; $g < self::GG_COUNT; $g++) {
         $this->globalGroupNames[] = getString($byteString, self::HEADER_GG + $g * self::GG_LENGTH, self::GG_LENGTH);
     }
     $this->hangar = getByte($byteString, self::HEADER_HANGAR);
     $this->timeLimitMinutes = getByte($byteString, self::HEADER_TIME);
     $this->endMissionWhenComplete = getBool($byteString, self::HEADER_END);
     $this->briefingOfficer = getByte($byteString, self::HEADER_OFFICER);
     $this->briefingLogo = getByte($byteString, self::HEADER_LOGO);
     $this->hex = \Hex::hexToStr($byteString);
 }
Example #10
0
<?php

include "../../include.php";
if (url_id('module_id')) {
    $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE module_id = ' . $_GET['module_id'] . ' ORDER BY p.precedence');
} elseif (url_id('modulette_id')) {
    $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE modulette_id = ' . $_GET['modulette_id'] . ' ORDER BY p.precedence');
} else {
    url_change('./');
}
echo drawTop();
//pages list
$t = new table('pages', drawHeader());
$t->set_column('is_hidden', 'd', '&nbsp;');
$t->set_column('draggy', 'd', '&nbsp;');
$t->set_column('title', 'l', getString('title'));
$t->set_column('url');
$t->set_draggable('draggy');
foreach ($result as &$r) {
    $r['is_hidden'] = draw_form_checkbox('foo', !$r['is_hidden'], false, 'ajax_set(\'pages\', \'is_hidden\', ' . $r['id'] . ', ' . abs($r['is_hidden'] - 1) . ');');
    $r['draggy'] = draw_img('/images/icons/move.png');
    $r['title'] = draw_link('page.php?id=' . $r['id'], $r['title']);
    if (empty($r['url'])) {
        $r['url'] = 'index.php';
    }
}
echo $t->draw($result, 'No pages');
echo drawBottom();
Example #11
0
function langTranslateCheckbox($form, $show = true)
{
    if (!getOption('languages')) {
        return false;
    }
    $form->set_field(array('name' => 'translations_do', 'type' => $show ? 'checkbox' : 'hidden', 'label' => getString('translations_do'), 'value' => 0));
}
            $row = mysqli_fetch_array($result);
            if ($row[0] >= 5) {
                echo getString($lang, "many_votes");
            } else {
                //Exei kato apo 5 psifoys to teleytaio pentalept, opote katametroyme thn psifo.
                $query = "INSERT INTO `psifoi` (`id_theshs`, `id_tragoydioy`, `mytimestamp`) VALUES ({$thesh}, {$id}, CURRENT_TIMESTAMP);";
                //echo $query;
                $result = mysqli_query($con, $query);
                if (!$result) {
                    echo getString($lang, "vtnok");
                } else {
                    echo getString($lang, "vtok");
                }
            }
        } else {
            //Kapoio lathos ths mysql
            echo getString($lang, "vtnok");
        }
    } else {
        //Den yparxei to tragoydi.
        echo getString($lang, "vtnok");
    }
    mysqli_close($con);
    echo "</li>";
    echo "</ul>";
    echo "<a class=\"button\" href=\"music_list.php?lang={$lang}&thesh={$thesh}&pass={$pass}\" >" . getString($lang, "bk") . "</a>";
}
?>

 </body>
</html>
<div>
	<div id="login_js_missing" class="error"><?php 
print getString('Pro přihlášení je vyžadován zapnutý Javascript!', 'login');
?>
</div>
	<?php 
if ($login->errors) {
    ?>
		<?php 
    foreach ($login->errors as $err) {
        ?>
			<div class="error"><?php 
        print $err;
        ?>
</div>
		<?php 
    }
    ?>
	<?php 
}
?>
	
	<?php 
if (isset($login->challenge)) {
    ?>
		<form action="<?php 
    print $login->href;
    ?>
" name="form_authentication" id="form_authentication" method="post" >
		<fieldset>
		<input type="hidden" name="challenge" value="<?php 
Example #14
0
<?php

include '../../include.php';
if ($posting) {
    format_post_bits('is_selected');
    langTranslatePost('name,description');
    $id = db_save('soc_members');
    url_change_post('../');
}
echo drawTop();
$f = new form('soc_members', @$_GET['id'], $page['title']);
$f->set_field(array('name' => 'name' . langExt(), 'type' => 'text', 'label' => getString('title')));
$f->set_field(array('name' => 'country_id', 'type' => 'select', 'sql' => 'SELECT id, en FROM jr_countries ORDER BY en'));
$f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'class' => 'tinymce', 'label' => getString('description')));
langUnsetFields($f, 'name,description');
langTranslateCheckbox($f);
$f->set_title_prefix($page['breadcrumbs']);
echo $f->draw();
echo drawBottom();
Example #15
0
/**
 * @shortcut for <getString> but ensuring that it is escaped for use in JS
 */
function getJsString($constant, $arreplace = null, $unbuffered = false, $encoding = null)
{
    $res = getString($constant, $arreplace, $unbuffered, $encoding);
    return substr(json_encode($res), 1, -1);
}
Example #16
0
function showSetting($row, $enabled)
{
    if ($row['settingstype'] == "boolean") {
        td_open(1);
        if ($row['value'] == "true") {
            form_checkbox("setting", $enabled, true);
        } else {
            form_checkbox("setting", $enabled, false);
        }
        td_close();
        td_open(1);
        echo getString("settings_boolean", "Boolsk");
        td_close();
    } else {
        if ($row['settingstype'] == "integer") {
            td_open(1);
            form_textfield("setting", $row['value'], $enabled);
            td_close();
            td_open(1);
            echo getString("settings_integer", "Heltall");
            td_close();
        } else {
            if ($row['settingstype'] == "string") {
                td_open(1);
                form_textfield("setting", $row['value'], $enabled);
                td_close();
                td_open(1);
                echo getString("settings_string", "Tekst");
                td_close();
            } else {
                td_open(1);
                echo $row['value'];
                td_close();
                td_open(1);
                echo getString("settings_unknown_type", "Ukjent datatype");
                td_close();
            }
        }
    }
}
Example #17
0
File: chat.php Project: perrr/svada
							</div>
						</div>
						<div class="tab" id="tab-files">
							<div class="tab-back" onclick="changeTab('chat', false)"><span class="glyphicon glyphicon-arrow-left"></span> <?php 
echo getString('back');
?>
</div>
							<div class="tab-content">
								<?php 
include 'pages/files.php';
?>
							</div>
						</div>
						<div class="tab" id="tab-search">
							<div class="tab-back" onclick="changeTab('chat', false)"><span class="glyphicon glyphicon-arrow-left"></span> <?php 
echo getString('back');
?>
</div>
							<div class="tab-content">
								<?php 
include 'pages/searchresults.php';
?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<!-- Scripts -->
		<script src="js/plugins/jquery.min.js"></script>
Example #18
0
echo getString("logInSvada");
?>
</h3></div>
				  <div class="panel-body">
				  
					<form action="" method="post">
						<div class="form-group">
							<label for="username"><?php 
echo getString("username");
?>
</label>
							<input type="text" name="username" class="form-control" id="username" autofocus>
						</div>
						<div class="form-group">
							<label for="password"><?php 
echo getString("password");
?>
</label>
							<input type="password" name="password" class="form-control" id="password">
						</div>
						<div class="form-group">
						<?php 
echo $message;
?>
</span>
						</div>
						<input type="submit" class="btn btn-primary btn-block" value="Log in">
					</form>
				  </div>
			</div>
		</div>
Example #19
0
function module_polladmin()
{
    // adminpage, stop here if not logged in/right access-level
    if (!isValidAdmin()) {
        echo getString("not_valid_admin", "Administratorside, du må logge inn for å få tilgang her");
        return;
    }
    echo '<a href="http://localhost/avisCMS/index.php?m_c=module_polladmin&page_title=Polladmin">Tilbake til oversikt</a>';
    $pollaction = $_REQUEST['pollaction'];
    if ($pollaction == 'addpoll') {
        if (strlen($_REQUEST['polltitle']) < 1) {
            echo "Husk tittel.";
            return;
        }
        echo '<div class="default_header">Avstemning opprettet.</div>';
        $query = "INSERT INTO poll SET title='" . $_REQUEST['polltitle'] . "';";
        $result = DB_insert($query);
        if ($result) {
            echo '<a href="index.php?m_c=module_polladmin&amp;pollaction=editpoll&amp;pollid=' . mysql_insert_id() . '">Rediger den nye pollen</a>';
        } else {
            echo "Feilmelding: " . mysql_error();
        }
    } else {
        if ($pollaction == 'delpoll') {
            $confirm = $_REQUEST['dc'];
            $pollid = $_REQUEST['pollid'];
            if ($confirm == "yes") {
                $query = "DELETE FROM poll WHERE pollid = " . $pollid . ";";
                $result = DB_update($query);
                $num_results += DB_rows_affected($query);
                $query = "DELETE FROM pollquestion WHERE pollid = " . $pollid . ";";
                $result = DB_update($query);
                $num_results += DB_rows_affected($query);
                $query = "DELETE FROM vote WHERE pollid = " . $pollid . ";";
                $result = DB_update($query);
                $num_results += DB_rows_affected($query);
                if ($num_results < 1) {
                    echo "<br/>Ingenting slettet - feilmelding: " . mysql_error();
                } else {
                    echo "<br/>Avstemningen med tilhørende stemmer og det hele aldeles pulverisert.";
                }
            } else {
                echo "<br/><br/>Sikker på at du vil slette avstemning med id " . $pollid . "? Dette medfører også sletting av alle tilknyttede spørsmål og avlagte stemmer!!<br/>";
                echo '<a href="index.php?m_c=module_polladmin&amp;pollaction=delpoll&amp;dc=yes&amp;pollid=' . $pollid . '">Ja!</a>';
            }
        } else {
            if ($pollaction == 'editpoll') {
                $pollaction2 = $_REQUEST['pollaction2'];
                $pollid = $_REQUEST['pollid'];
                $question = $_REQUEST['question'];
                $description = $_REQUEST['description'];
                if ($pollaction2 == "changetime") {
                    $query = "UPDATE poll SET description = '" . $description . "', time_opened='" . $_REQUEST['time_opened'] . "', time_closed='" . $_REQUEST['time_closed'] . "' WHERE pollid=" . $pollid . ";";
                    DB_update($query);
                    if (!result) {
                        echo 'mysql_error()';
                    }
                }
                if ($pollaction2 == "delquestion") {
                    $altid = $_REQUEST['altid'];
                    $query = "DELETE FROM pollquestion WHERE questionid=" . $altid . " AND pollid=" . $pollid . ";";
                    $result = DB_update($query);
                    //echo $query;
                    if (!$result) {
                        echo mysql_error();
                    }
                }
                if ($pollaction2 == 'addquestion') {
                    $querymax = "SELECT MAX(questionid) as maxid FROM pollquestion;";
                    $row = DB_search($querymax);
                    $newid = $row['maxid'] + 1;
                    $query = "INSERT INTO pollquestion SET pollid=" . $pollid . ", questionid='" . $newid . "', question='" . $question . "';";
                    //echo $query;
                    $result = DB_insert($query);
                    if (!result) {
                        echo mysql_error();
                    }
                }
                $pollid = $_REQUEST['pollid'];
                $query = "SELECT * FROM poll WHERE pollid=" . $pollid . ";";
                $row = DB_search($query);
                $query_questions = "SELECT * FROM pollquestion WHERE pollid=" . $pollid . ";";
                $result = DB_get_table($query_questions);
                $pollid = $row['pollid'];
                echo '<table class="default_table">';
                echo '<tr><td colspan=2><div class="default_header">Rediger spørreundersøkelse</div></td></tr>';
                echo "<tr><td>Tittel</td><td>" . $row['title'] . "</td></tr>";
                form_start_post();
                form_hidden("pollid", $pollid);
                form_hidden("m_c", "module_polladmin");
                form_hidden("pollaction", "editpoll");
                form_hidden("pollaction2", "changetime");
                echo "<tr><td>Beskrivelse (300 tegn)</td><td>" . $row['description'] . "</td><td>";
                form_textarea("description", $row['description'], 10, 10);
                echo "</td></tr>";
                echo "<tr><td>Dato start</td><td>" . $row['time_opened'] . "</td><td>";
                form_textfield("time_opened", $row['time_opened']);
                echo "</td></tr>";
                echo "<tr><td>Date slutt</td><td>" . $row['time_closed'] . "</td><td>";
                form_textfield("time_closed", $row['time_closed']);
                echo "</td></tr>";
                echo "<tr><td colspan=2>Datoformat: 2005-01-31 23:10<br/>Utelat tidspunkt og det settes til 00:00.</td><td>";
                form_submit("submit", "Lagre endringer");
                form_end();
                echo "</tr>";
                while ($row = DB_next_row($result)) {
                    echo '<tr>';
                    echo '<td>' . $row['questionid'] . '</td>';
                    echo '<td>' . $row['question'] . '</td>';
                    echo '<td>';
                    form_start_post();
                    form_submit("submit", "Slett");
                    form_hidden("m_c", "module_polladmin");
                    form_hidden("pollaction2", "delquestion");
                    form_hidden("altid", $row['questionid']);
                    form_hidden("pollaction", "editpoll");
                    form_hidden("pollid", $pollid);
                    form_end();
                    echo '</td>';
                    echo '</tr>';
                }
                echo '</table><br/><br/>';
                echo '<table class="default_table">';
                echo '<tr><td colspan=2>Legg til et alternativ</td></tr>';
                form_start_post();
                echo '<tr><td>Alternativnavn</td><td>';
                form_textfield("question", $_SESSION['question']);
                echo '</td></tr>';
                echo '<tr><td colspan=2>';
                form_submit("submit", "Legg til");
                echo '</td></tr>';
                form_hidden("pollaction", "editpoll");
                form_hidden("pollaction2", "addquestion");
                form_hidden("pollid", $pollid);
                form_hidden("m_c", "module_polladmin");
                form_end();
                echo '</table>';
            } else {
                echo '<table class="default_table">';
                echo '<tr><td colspan=4><div class="default_header">Polladmin</div></td></tr>';
                echo "<tr><td colspan=4>Lag en ny</td></tr>";
                form_start_post();
                echo "<tr><td colspan=2>Tittel</td><td colspan=2>";
                form_textfield("polltitle", $_SESSION['polltitle']);
                echo '</td></tr>';
                echo '<tr><td colspan=4>';
                form_submit("submit", "Opprett(rediger den for å fullføre)");
                echo '</td></tr>';
                form_hidden("pollaction", "addpoll");
                form_hidden("m_c", "module_polladmin");
                form_end();
                echo '<tr><td colspan=2></td></tr>';
                echo '<tr><td colspan=4><div class="default_header">Eksisterende polls</div></td></tr>';
                $query = "SELECT * FROM poll";
                $result = DB_get_table($query);
                echo '<tr><td>Tittel</td><td>Start</td><td>Slutt</td><td>Rediger</td></tr>';
                while ($row = DB_next_row($result)) {
                    echo '<tr><td>' . $row['title'] . '</td><td>' . $row['time_opened'] . '</td>';
                    echo '<td>' . $row['time_closed'] . '</td>';
                    echo '<td><a href="index.php?m_c=module_polladmin&amp;pollaction=editpoll&pollid=' . $row['pollid'] . '">Rediger</a>';
                    echo '<br/><a href="index.php?m_c=module_polladmin&amp;pollaction=delpoll&pollid=' . $row['pollid'] . '">Slett</a></td>';
                    echo '</tr>';
                }
                echo '</table>';
            }
        }
    }
}
Example #20
0
<?php

require "inc.php";
$path_upload = ROOT_PATH . "/" . $setting['path']['upload'] . date("/Y/m/d/");
$script = "";
set_time_limit(0);
$upload = $mystep->getInstance("MyUploader", $path_upload, true);
$upload->DoIt(false);
$watermark = $setting['watermark']['mode'] & 2 ? 1 : 0;
if ($upload->upload_result[0]['error'] == 0) {
    $upload->upload_result[0]['name'] = getString(urldecode($upload->upload_result[0]['name']));
    $ext = strtolower(strrchr($upload->upload_result[0]['name'], "."));
    $name = str_replace($ext, "", $upload->upload_result[0]['name']);
    $upload->upload_result[0]['name'] = substrPro($name, 0, 80) . $ext;
    $ext = str_replace(".", "", $ext);
    $upload->upload_result[0]['new_name'] = str_replace(".upload", "", $upload->upload_result[0]['new_name']);
    $db->insert($setting['db']['pre'] . "attachment", array(0, 0, 0, $upload->upload_result[0]['name'], $upload->upload_result[0]['type'], $upload->upload_result[0]['size'], '', substr($upload->upload_result[0]['new_name'], 0, 13), 0, '', $req->getSession('username'), $watermark));
    $new_id = $db->GetInsertId();
    if ($new_id != 0) {
        $upload->upload_result[0]['att_id'] = $new_id;
        if (strpos($upload->upload_result[0]['type'], "image") === 0) {
            $upload->MakeDir("{$path_upload}/preview/");
            $img_info = GetImageSize("{$path_upload}/" . $upload->upload_result[0]['new_name']);
            $the_width = $img_info[0];
            $the_height = $img_info[1];
            $zoom = 400;
            if ($the_width > $zoom) {
                $the_height *= $zoom / $the_width;
                $the_width = (int) $zoom;
                img_thumb($path_upload . "/" . $upload->upload_result[0]['new_name'], $the_width, $the_height, $path_upload . "/preview/" . $upload->upload_result[0]['new_name']);
            } else {
Example #21
0
    echo drawEmptyResult(getString('staff_requests_empty'));
}
echo drawTableEnd();
//never logged in
echo drawTableStart();
echo drawHeaderRow(getString('staff_never_logged_in'), 3, getString('staff_invite_all'), url_query_add(array("action" => "invite"), false));
$result = db_query("SELECT id, lastname, firstname, created_date FROM users WHERE lastlogin IS NULL AND is_active = 1 ORDER BY lastname");
if (db_found($result)) {
    ?>
	<tr>
		<th width="70%"><?php 
    echo getString('name');
    ?>
</th>
		<th width="30%" class="r"><?php 
    echo getString('date_created');
    ?>
</th>
		<th></th>
	</tr>
	<?php 
    while ($r = db_fetch($result)) {
        ?>
	<tr>
		<td><a href="view.php?id=<?php 
        echo $r["id"];
        ?>
"><?php 
        echo $r["lastname"];
        ?>
, <?php 
 private function _export_get_header()
 {
     $res = array();
     if ($this->header) {
         foreach ($this->header->Rows() as $row) {
             $line = array();
             foreach ($row->Cells() as $cell) {
                 $cc = trim(strip_tags($cell->GetContent()));
                 if (translation_string_exists($cc)) {
                     $cc = getString($cc);
                 }
                 $line[] = $cc;
             }
         }
         $res[] = $line;
     }
     return $res;
 }
Example #23
0
<?php

include "include.php";
if (url_action('delete')) {
    db_delete('bb_topics_types');
    url_drop('action,id');
}
echo drawTop();
$t = new table('bb_topics_types', drawHeader($page['is_admin'] ? array('category_edit.php' => getString('category_new')) : false));
$t->set_column('category', 'l', getString('category'));
$t->set_column('topics', 'r', getString('topics'));
if ($page['is_admin']) {
    $t->set_column('delete', 'd', '&nbsp;');
}
$result = db_table('SELECT 
		y.id, 
		y.title' . langExt() . ' category, 
		(SELECT COUNT(*) FROM bb_topics t WHERE t.type_id = y.id AND t.is_active = 1) topics 
	FROM bb_topics_types y 
	WHERE y.is_active = 1
	ORDER BY y.title');
foreach ($result as &$r) {
    $r['category'] = draw_link('category.php?id=' . $r['id'], $r['category']);
    if ($page['is_admin']) {
        $r['delete'] = draw_img('/images/icons/delete.png', url_query_add(array('action' => 'delete', 'id' => $r['id']), false));
    }
}
echo $t->draw($result, 'No categories added yet');
echo drawBottom();
Example #24
0
        //christmas
        $holidays[25] = "Christmas Day";
        if (date("w", mktime(0, 0, 0, 12, 25, $_GET['year'])) == 6) {
            $holidays[24] = "Christmas";
        }
        if (date("w", mktime(0, 0, 0, 12, 25, $_GET['year'])) == 0) {
            $holidays[26] = "Christmas";
        }
        //obscure possibility that new year's is on a saturday; take friday off (score)
        if (date("w", mktime(0, 0, 0, 12, 31, $_GET['year'])) == 5) {
            $holidays[31] = "New Year's";
        }
    }
}
echo drawTableStart();
echo drawHeaderRow($_josh['months'][$_GET['month'] - 1] . " " . $_GET['year'], 7, getString('add_new'), "#bottom");
echo '<tr>';
foreach ($_josh['days'] as $day) {
    echo draw_container('th', $day, 'c');
}
echo '</tr>';
// === OUTER LOOP: WEEKS ====================================================
for ($week = 1, $thisday = 1; $thisday < $lastday; $week++) {
    ?>
<tr class="calendar"><?php 
    // === INNER LOOP: DAYS======================================================
    for ($day = 1; $day <= 7; $day++) {
        $thisday = 7 * ($week - 1) + $day - $firstday;
        if ($thisday > 0 && $thisday <= $lastday) {
            $bgcolor = "#ffffff";
            if ($_GET['year'] == $_josh['year'] && $_GET['month'] == $_josh['month'] && $thisday == $_josh['today']) {
Example #25
0
            //$r["title"] = str_replace("The Associated Press: ", "", $r["title"]);
        } elseif ($url["domainname"] == "google" && $url["subfolder"] == "afp") {
            $r["publication"] = "AFP";
            $r["title"] = str_replace("Afp: ", "", $r["title"]);
        } elseif ($url["domainname"] == "google" && $url["subfolder"] == "ap") {
            $r["publication"] = "AP";
            $r["title"] = str_replace("The Associated Press: ", "", $r["title"]);
        }
    }
}
//to control return_to redirects.  i'm not sure how i should handle this generally.  it's a problem mainly when the page is included
if ($referrer && $referrer["host"] == $request["host"]) {
    $_josh["referrer"] = false;
}
$f = new form('press_clips', @$_GET['id'], $action);
if (!$included) {
    $f->set_title_prefix($page['breadcrumbs']);
}
$f->set_field(array('name' => 'title' . langExt(), 'type' => 'text', 'label' => getString('title')));
$f->set_field(array('name' => 'url', 'type' => 'text', 'label' => getString('url')));
$f->set_field(array('name' => 'publication' . langExtT(), 'type' => 'text', 'label' => getString('publication')));
$f->set_field(array('name' => 'pub_date', 'type' => 'date', 'label' => getString('published'), 'required' => true));
$f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'label' => getString('description'), 'class' => 'tinymce'));
$f->set_field(array('name' => 'type_id', 'label' => getString('category'), 'type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM press_clips_types ORDER BY precedence', 'required' => true));
formAddChannels($f, 'press_clips', 'clip_id');
langUnsetFields($f, 'title,description,publication');
langTranslateCheckbox($f, url_id());
echo $f->draw(@$r, !$included);
if (!$included) {
    echo drawBottom();
}
Example #26
0
    db_delete('organizations', $_GET['delete_id']);
    url_drop('delete_id,action');
}
echo drawTop();
if (url_id()) {
    //form
    $f = new form('organizations', @$_GET['id']);
    $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title')));
    langUnsetFields($f, 'title');
    langTranslateCheckbox($f);
    echo $f->draw();
} else {
    //modules list
    $t = new table('organizations', drawHeader());
    $t->set_column('draggy', 'd', '&nbsp;');
    $t->set_column('title', 'l', getString('title'));
    $t->set_column('delete', 'd', '&nbsp;');
    $result = db_table('SELECT id, title' . langExt() . ' title FROM organizations WHERE is_active = 1 ORDER BY precedence');
    foreach ($result as &$r) {
        $r['draggy'] = draw_img('/images/icons/move.png');
        $r['title'] = draw_link('organizations.php?id=' . $r['id'], $r['title']);
        $r['delete'] = drawColumnDelete($r['id']);
    }
    echo $t->draw($result, 'No organizations');
    //add new
    $f = new form('organizations');
    $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title')));
    langUnsetFields($f, 'title');
    echo $f->draw(false, false);
}
echo drawBottom();
Example #27
0
	<tr>
		<td class="left"><?php 
echo getString('description');
?>
</td>
		<td class="text"><?php 
echo $r['description'];
?>
</td>
	</tr>
	<?php 
if (getOption('channels')) {
    ?>
	<tr>
		<td class="left"><?php 
    echo getString('channels_label');
    ?>
</td>
		<td>
			<?php 
    $channels = db_query('SELECT
				c.title' . langExt() . ' title
			FROM press_clips_to_channels d2c
			JOIN channels c ON d2c.channel_id = c.id
			WHERE d2c.clip_id = ' . $_GET['id']);
    while ($c = db_fetch($channels)) {
        ?>
				 &#183; <?php 
        echo $c['title'];
        ?>
</a><br>
Example #28
0
function getFrame()
{
    return deserializeMap(getString());
}
Example #29
0
<?php

$pageIsPublic = true;
include "../include.php";
echo drawSimpleTop(getString('password_reset'));
echo drawMessage(getString('password_confirm'));
echo drawSimpleBottom();
Example #30
0
<?php

$pageIsPublic = true;
include "../include.php";
echo drawSimpleTop(getString('login_account_exists'));
echo drawMessage(getString('login_account_exists_msg'));
echo drawSimpleBottom();