コード例 #1
0
function GetFollowings($pages)
{
    global $cookie_file;
    $pages = 1;
    $followings = array();
    while (true) {
        Msg(0, "Page number is '{$pages}'.\n");
        $url = 'http://www.pixiv.net/bookmark.php?type=user&rest=show&p=' . $pages;
        list($html, $info) = @Curl($url, '');
        # 今見ているページのfollowingsを取得
        $q = '//section/div[ @class = "members" ]/ul/li/div[ @class = "usericon" ]/a';
        $res = HtmlParse($html, $q);
        if ($res->length != 0) {
            foreach ($res as $node) {
                $href = $node->getAttribute('href');
                //  srcは実際に表示されているとき
                $matchs = array();
                preg_match('/\\w+\\.\\w+\\?\\w+=(\\d+)/', $href, $matchs);
                array_push($followings, $matchs[1]);
            }
        } else {
            return false;
        }
        # 次のページありゅ?
        $q = '//section/div[ @class = "pages" ]/ol/li/a[ @rel = "next"]';
        // next page
        $res = HtmlParse($html, $q);
        if ($res->length == 2) {
            $pages = $pages + 1;
        } else {
            return $followings;
        }
    }
}
コード例 #2
0
ファイル: Csv.php プロジェクト: pinkienort/PixivArchive
function WriteCsv($userlist, $userlist_file)
{
    $handle = fopen($userlist_file, 'w');
    fputs($handle, "user_id,last_artwork_id,display_name\n");
    // 列名を初めにかく
    foreach ($userlist as $user) {
        fputs($handle, $user['user_id'] . ',' . @$user['last_artwork_id'] . ',' . @$user['display_name'] . "\n");
        // 書き出し
    }
    fclose($handle);
    Msg(0, "Write: updated userlist\n");
    return 0;
}
コード例 #3
0
ファイル: mklink.php プロジェクト: pinkienort/PixivArchive
function CreateLink($userlist)
{
    global $image_dir, $link_dir;
    MakeDirectory("{$link_dir}_windows");
    $handle = fopen('mklink.bat', 'w');
    foreach ($userlist as $user) {
        @($user_id = $user['user_id']);
        @($display_name = $user['display_name']);
        fwrite($handle, "mklink /d {$link_dir}_windows\\{$display_name} {$image_dir}\\{$user_id}" . "\r\n");
    }
    fclose($handle);
    Msg('succeed', "Create bat file 'mklink.bat'.\n");
}
コード例 #4
0
ファイル: login.php プロジェクト: pinkienort/PixivArchive
function login($pixiv_id, $password)
{
    global $cookie_file;
    $url = 'https://www.secure.pixiv.net/login.php';
    $param = array('mode' => 'login', 'pixiv_id' => $pixiv_id, 'pass' => $password, 'submit' => 'ログイン', 'skip' => '1');
    date_default_timezone_set('Asia/Tokyo');
    $session_id = date('ymdHis');
    // セッションごとにlogフォルダを生成
    $dump_file = 'log/login/login_' . $session_id . '.log';
    $html_file = 'log/login/login_' . $session_id . '.html';
    //  cookieの取得
    $handle = fopen($html_file, 'w');
    $ch = curl_init($url);
    // curlの初期設定
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    // redirectionを有効化
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    // プレーンテキストで出力
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
    // cookie情報を保存する
    curl_setopt($ch, CURLOPT_POST, true);
    // postを行う
    curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
    // postするデータを設定
    curl_setopt($ch, CURLOPT_FILE, $handle);
    $html_file = curl_exec($ch);
    fclose($handle);
    $info = curl_getinfo($ch);
    // 実行結果
    curl_close($ch);
    // curl終了
    $res = print_r($info, true);
    $handle = fopen($dump_file, 'w');
    fputs($handle, $res);
    fclose($handle);
    if ($info['url'] == 'http://www.pixiv.net/') {
        Msg(0, "Your login is successful!.\n");
        Msg(0, "Cookie file is " . dirname(__FILE__) . "/" . $cookie_file . "\n");
    } else {
        Msg(0, "Failed your login...\n");
    }
}
コード例 #5
0
ファイル: index.php プロジェクト: Qwaz/solved-hacking-problem
function ClassLoaderSandbox($c, $p1, $p2)
{
    $c = strtolower($c);
    $cl = strlen(explode('"', $c)[0]);
    $p1l = strlen(explode('"', $p1)[0]);
    $p2l = strlen(explode('"', $p2)[0]);
    $classLoader = 'O:8:"stdClass":%size:{s:1:"c";s:' . $cl . ':"' . $c . '";s:2:"p1";s:' . $p1l . ':"' . $p1 . '";s:2:"p2";s:' . $p2l . ':"' . $p2 . '";}';
    $sz = explode('{', $classLoader)[1];
    $sz = round((count(explode('"', $sz)) - 1) / 4);
    $classLoader = str_replace('%size', $sz, $classLoader);
    var_dump($classLoader);
    $classLoader = unserialize($classLoader);
    // block class for security reason, only enable reading stuff
    $classLoader->c = "finfo";
    /* justin <strike>bieber</strike>case.. */
    if (in_array($classLoader->c, ['splfileobject', 'globiterator', 'directoryiterator', 'filesystemiterator'])) {
        $vulnerable = Msg("Blocked Classes");
    }
    $vulnerable = new $classLoader->c($classLoader->p1, $classLoader->p2);
    return $vulnerable;
}
コード例 #6
0
function CookieLogin()
{
    // cookie_fileでログインできるか?
    global $session_id;
    $url = 'https://www.secure.pixiv.net/login.php';
    $log_file_name = 'cookie_login';
    list($html, $info) = @Curl($url);
    // urlからcontentを引っ張ってくる
    HtmlDump($html, $log_file_name);
    if ($info['url'] == 'http://www.pixiv.net/') {
        // 成功
        Msg(0, "Your login is successful!\n");
        return 0;
    } else {
        // 失敗
        Msg('error', "Failed your login...\n", 'error');
        Msg(0, "Please pass a login with 'login.php' before execution {$argv['0']}.\n");
        exit(1);
        // 失敗したらオシマイ
    }
}
コード例 #7
0
<?php

$lib = new Legenda();
$MSG = '';
if (!empty($_POST['dodaj_legenda'])) {
    if ($lib->addLegenda($_POST['opis_legenda'], $_POST['symbol_legenda'])) {
        $message = 'Legenda została pomyślnie dodana';
        $MSG = Msg($message, 1);
    } else {
        $message = 'Błąd dodawania legendy';
        $MSG = Msg($message, 0);
    }
}
if (!empty($_POST['zapisz_legenda'])) {
    if ($lib->updateLegenda($_POST['id_legenda'], $_POST['opis_legenda'], $_POST['symbol_legenda'])) {
        $message = 'Legenda została pomyślnie zaktualizowana';
        $MSG = Msg($message, 1);
    } else {
        $message = 'Błąd aktualizacji legendy';
        $MSG = Msg($message, 0);
    }
}
if (!empty($_POST['usun_legenda'])) {
    if ($lib->deleteLegenda($_POST['id_legenda'])) {
        $message = 'Legenda została pomyślnie usunięta';
        $MSG = Msg($message, 1);
    } else {
        $message = 'Błąd usuwania legendy';
        $MSG = Msg($message, 0);
    }
}
コード例 #8
0
ファイル: search.php プロジェクト: OvBB/v1.0
function ViewResultPosts($aResultInfo)
{
    global $CFG, $dbConn, $aViewedThreads, $aPostIcons;
    $aUsers = array();
    // Did this user create the result they're trying to view?
    if ($aResultInfo['author']) {
        if ($aResultInfo['author'] != $_SESSION['userid']) {
            // Nope.
            Msg("Invalid search result specified.{$CFG['msg']['invalidlink']}");
        }
    } else {
        if ($aResultInfo['ipaddress'] != $_SESSION['userip'] || $CFG['iplogging'] == FALSE) {
            // Nope.
            Msg("Invalid search result specified.{$CFG['msg']['invalidlink']}");
        }
    }
    // Parse the result information.
    $iResultID = $aResultInfo['id'];
    $strQueryString = $aResultInfo['querystring'];
    $aResults = explode(',', $aResultInfo['results']);
    list($iSortBy, $bSortOrder) = explode(',', $aResultInfo['sortinfo']);
    // Get the user's per-page settings.
    $iPostsPerPage = $_SESSION['postsperpage'];
    // User-specified value takes precedence.
    if ((int) $_REQUEST['perpage']) {
        $iPostsPerPage = abs($_REQUEST['perpage']);
    }
    // What page do they want to view?
    $iPage = (int) $_REQUEST['page'];
    if ($iPage < 1) {
        // They don't know what they want. Give them the first page.
        $iPage = 1;
    }
    // Calculate the offset.
    $iOffset = $iPage * $iPostsPerPage - $iPostsPerPage;
    // Calculate the number of pages this result is made of.
    $iNumberPages = ceil(count($aResults) / $iPostsPerPage);
    // Is the page they asked for out of range?
    if ($iPage > $iNumberPages) {
        // Yes, give them the last page and recalculate offset.
        $iPage = $iNumberPages;
        $iOffset = $iPage * $iPostsPerPage - $iPostsPerPage;
    }
    // Did they specify by what to sort?
    if (isset($_REQUEST['sortby'])) {
        // Yes, so use it.
        $strSortBy = strtolower($_REQUEST['sortby']);
        switch ($strSortBy) {
            // They specified us something valid.
            case 'topic':
            case 'forum':
            case 'author':
            case 'postcount':
            case 'viewcount':
            case 'date':
                break;
                // They don't know what they want. We'll sort by post date.
            // They don't know what they want. We'll sort by post date.
            default:
                $strSortBy = 'date';
                break;
        }
    } else {
        // No, so use what was stored in the search result.
        $aSortBy = array('topic', 'forum', 'author', 'postcount', 'viewcount', 'date');
        $strSortBy = $aSortBy[$iSortBy];
        unset($aSortBy);
    }
    // Did they specify a sort order?
    if (isset($_REQUEST['sortorder'])) {
        // Yes, so use it.
        $strSortOrder = strtoupper($_REQUEST['sortorder']);
        if ($strSortOrder != 'ASC' && $strSortOrder != 'DESC') {
            // They don't know what they want. Are they sorting by post date?
            if ($strSortBy == 'date') {
                // Yes, we'll sort descending.
                $strSortOrder = 'DESC';
            } else {
                // No, we'll sort ascending.
                $strSortOrder = 'ASC';
            }
        }
    } else {
        // No, so use the one stored in the search result.
        $strSortOrder = $bSortOrder ? 'DESC' : 'ASC';
    }
    // Get the posts.
    $strPostIDs = implode(', ', $aResults);
    $dbConn->query("SELECT DISTINCT p.id, p.title AS topic, p.icon, p.body, p.author, p.datetime_posted AS date, t.id, t.title, t.icon, t.postcount, t.viewcount, b.id, b.name AS forum, t.closed, t.lpost FROM post AS p LEFT JOIN thread AS t ON (t.id = p.parent) LEFT JOIN board AS b ON (b.id = t.parent) WHERE p.id IN ({$strPostIDs}) AND t.visible=1 ORDER BY {$strSortBy} {$strSortOrder}, t.id {$strSortOrder} LIMIT {$iPostsPerPage} OFFSET {$iOffset}");
    while ($aSQLResult = $dbConn->getresult()) {
        // Store the post information into the master array.
        $iPostID = $aSQLResult[0];
        $aPosts[$iPostID][TITLE] = $aSQLResult[1];
        $aPosts[$iPostID][ICON][URL] = "{$CFG['paths']['posticons']}{$aPostIcons[$aSQLResult[2]]['filename']}";
        $aPosts[$iPostID][ICON][ALT] = $aPostIcons[$aSQLResult[2]]['title'];
        $aPosts[$iPostID][BODY] = substr(RemoveBBCode($aSQLResult[3]), 0, 255);
        $aPosts[$iPostID][AUTHOR] = $aSQLResult[4];
        $aPosts[$iPostID][POSTDATE] = $aSQLResult[5];
        $aPosts[$iPostID][PARENT] = $aSQLResult[6];
        // Store the thread information into the thread array.
        $iThreadID = $aSQLResult[6];
        if (!isset($aThreads[$iThreadID])) {
            $aThreads[$iThreadID][TITLE] = $aSQLResult[7];
            $aThreads[$iThreadID][ICON][URL] = "{$CFG['paths']['posticons']}{$aPostIcons[$aSQLResult[8]]['filename']}";
            $aThreads[$iThreadID][ICON][ALT] = $aPostIcons[$aSQLResult[8]]['title'];
            $aThreads[$iThreadID][PCOUNT] = $aSQLResult[9];
            $aThreads[$iThreadID][VCOUNT] = $aSQLResult[10];
            $aThreads[$iThreadID][PARENT] = $aSQLResult[11];
            $aThreads[$iThreadID][ISOPEN] = !$aSQLResult[13];
            $aThreads[$iThreadID][NEWPOSTS] = !isset($aViewedThreads[$iThreadID]) && $aSQLResult[14] > $_SESSION['lastactive'] || isset($aViewedThreads[$iThreadID]) && $aViewedThreads[$iThreadID] < $aSQLResult[14] ? TRUE : FALSE;
        }
        // Store the forum in the forum list.
        $iForumID = $aSQLResult[11];
        if (!isset($aForums[$iForumID])) {
            $aForums[$iForumID] = $aSQLResult[12];
        }
        // Is there a post title?
        if ($aPosts[$iPostID][TITLE] == '') {
            // No, so let's use the thread's title.
            $aPosts[$iPostID][TITLE] = $aThreads[$iThreadID][TITLE];
        }
        // Add the post author to our list of users to get names for.
        $aUsers[] = $aPosts[$iPostID][AUTHOR];
    }
    // Get the usernames.
    $aUsernames = GetUsernames($aUsers);
    unset($aUsers);
    // Results page template
    require "./skins/{$CFG['skin']}/search/postresults.tpl.php";
    // Send the page.
    exit;
}
コード例 #9
0
include 'part_tabs_menu.php';
?>

                <div style="position: relative">
                <TABLE class="content pageBlock" cellSpacing=0 cellPadding=0 width="100%" border=0>
                        <TR>
                            <TD width="100%" vAlign=top style="padding-top: 5px;">
                                <!-- Tab Navigation Breadcrumb // -->
                                <DIV style="padding-left: 15px;">
                                    <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                                        <TR class="top">
                                        <TD noWrap width="90%"><a href="admin.php" style="font-weight: bold; font-size: 10pt; margin: 0px; color: #000000; font-family: Tahoma, sans-serif;"><?php 
Msg('ADMIN_MENU_PAGE_NAME');
?>
</a><span class="categorySeparatorCharacter">&nbsp;&gt;&gt;&nbsp;</span><?php 
Msg('ADMIN_CZ_LAYOUTS_PAGE_NAME');
?>
</nobr></TD>
                                        <TD noWrap style="padding-right: 8px;"><?php 
PageHelpLink('admin_cz_layouts_info');
?>
&nbsp;</TD>
                                        <TD noWrap style="padding-right: 8px;"><?php 
VideoTutorialLink('admin_cz_layouts_info');
?>
&nbsp;</TD>
                                        </TR>
                                    </TABLE>
                                </DIV>
                                <!-- // Tab Navigation Breadcrumb -->
                            </TD>
コード例 #10
0
ファイル: forumdisplay.php プロジェクト: spookdogg/v1.0
            $aForums[$aSQLResult[0]][THREADCOUNT] = $aSQLResult[10];
            break;
    }
}
// Free memory.
unset($aSQLResult);
// Display the forum.
if (isset($aCategories[$iForumID])) {
    DisplayCategory($iForumID, $aCategories[$iForumID]);
} else {
    if (isset($aForums[$iForumID])) {
        DisplayForum($iForumID, $aForums[$iForumID]);
    }
}
// They didn't specify a valid forum ID.
Msg("Invalid forum specified.{$CFG['msg']['invalidlink']}");
// *************************************************************************** \\
// Renders the regular forum display.
function DisplayForum($iForumID, $aForum)
{
    global $CFG, $dbConn, $aViewedThreads, $aCategories, $aForums, $aPostIcons;
    $aUsers = array();
    // Get the name of the forum's parent.
    $aForum[PARENTNAME] = $aCategories[$aForum[PARENT]][NAME];
    // Get the user's view settings.
    $iThreadsPerPage = $_SESSION['threadsperpage'];
    $iPostsPerPage = $_SESSION['postsperpage'];
    $iDaysPrune = $_SESSION['threadview'];
    // User-specified values take precedence.
    if (isset($_REQUEST['perpage']) && (int) $_REQUEST['perpage']) {
        $iThreadsPerPage = abs($_REQUEST['perpage']);
コード例 #11
0
ファイル: n_search.php プロジェクト: hardy419/2015-7-27
</head>

<body>
	<p class="title">校長的話</p><BR>
	  
	<table width="650" border="0" align="left" cellpadding="5" cellspacing="0" class="small">
		<form action="" method="get" name="form1" id="form1" style="border:0" ><?php 
if ($msg != "") {
    ?>
			<tr>
				<td>
					<table width="100%"  border="0" cellspacing="1" cellpadding="10">
						<tr>
							<td><font class=style8 color=red><?php 
    if ($msg) {
        echo Msg($msg);
    }
    ?>
</font></td>
						</tr>
					</table>
					<hr style="height:1px;color=ECECEC;">
				</td>
			</tr>

	<?php 
}
?>
			<tr>
				<td>
					<table width="100%" border="0" cellpadding="5" cellspacing="1" class="small">
コード例 #12
0
function listadoTablas($dbname = '', $msg = '')
{
    global $vConex, $enlace;
    $pestanas = getPestanasHtml($enlace, 'seleccion-db');
    if (empty($dbname)) {
        $Base_Datos = post('Nombre');
    } else {
        $Base_Datos = $dbname;
    }
    $btn = "<div class='botIconS'><i class='icon-arrow-left'></i></div>]" . $enlace . "?action=seleccion-db&Base_Datos=" . $Base_Datos . "]cuerpo}";
    $btn .= "Actualizar Tabla]" . $enlace . "?action=actualizar-tabla&dbname=" . $Base_Datos . "]cuerpo]CHECK}";
    $btn = Botones($btn, 'botones1', 'sys_tabla_modelo');
    $titulo = "<span>Importar Tablas </span><p>" . $Base_Datos . "</p><div class='bicel'></div>";
    $btn_titulo = tituloBtnPn($titulo, $btn, "380px", "TituloA");
    $sql = "(\n\tSELECT\n\t\ttab1.Codigo AS Tabla,\n\t\tIF( ISNULL(tab1.Codigo), '', CONCAT(\n\t\t\t'<input type=\"radio\" value=\"',tab1.Codigo,'\" name=\"ky1\">'\n\t\t) ) AS 'Check Modelo',\n\t\ttab2.Codigo AS Tabla2,\n\t\tIF( ISNULL(tab2.Codigo), '', CONCAT(\n\t\t\t'<input type=\"radio\" value=\"',tab1.Codigo,'\" name=\"ky2\">'\n\t\t) ) AS 'Check Destino'\n\tFROM\n\t\towlgroup_owl.sys_tabla tab1\n\tLEFT JOIN {$Base_Datos}.sys_tabla tab2 ON tab1.Codigo = tab2.Codigo\n        )\n        UNION ALL\n                (\n\t\tSELECT\n\t\t\ttab1.Codigo AS Tabla,\n\t\t\tIF( ISNULL(tab1.Codigo), '', CONCAT(\n\t\t\t'<input type=\"radio\" value=\"',tab1.Codigo,'\" name=\"ky1\">'\n\t\t\t) ) AS 'Check Modelo',\n\t\t\ttab2.Codigo AS Tabla2,\n\t\t\tIF( ISNULL(tab2.Codigo), '', CONCAT(\n\t\t\t'<input type=\"radio\" value=\"',tab1.Codigo,'\" name=\"ky2\">'\n\t\t) ) AS 'Check Destino'\n\t\tFROM\n\t\t\towlgroup_owl.sys_tabla tab1\n\t\tRIGHT JOIN {$Base_Datos}.sys_tabla tab2 ON tab1.Codigo = tab2.Codigo\n\t)";
    $clase = 'reporteA';
    $enlaceCod = 'codigoForm';
    $url = $enlace . "?Tablas=Importar-Seleccion-UPTab&Base_Datos=" . $Base_Datos . "";
    $panel = 'cuerpo';
    $reporte = ListR2('', $sql, $vConex, $clase, '', $url, $enlaceCod, $panel, 'sys_tabla_modelo', 'form', '');
    $mensaje = !empty($msg) ? Msg($msg, 'C') : '';
    $html = '<div id = "cuerpo" style="float:left;width:50%;" >' . $mensaje . $reporte . '</div>';
    WE($pestanas . $btn_titulo . $html);
}
コード例 #13
0
ファイル: dl.php プロジェクト: pinkienort/PixivArchive
#!/usr/bin/php
<?php 
require_once dirname(__FILE__) . '/src/CookieLogin.php';
require_once dirname(__FILE__) . '/src/Csv.php';
require_once dirname(__FILE__) . '/src/PixivArtWorkDownload.php';
list($image_dir, $link_dir, $cookie_file, $userlist_file) = SetParam();
// ログフォルの作成
date_default_timezone_set('Asia/Tokyo');
$dir = 'log/dl/' . date('ymdHis');
$log_file = $dir . '/dl.log';
if (!MakeDirectory($dir)) {
    Msg("error", "Couldn't make the directory " . $dir . "'\n");
    exit(1);
}
# クッキーの処理
CookieLogin();
# csvファイルの読み込み
$userlist = ReadCsv($userlist_file);
# 童貞が喜ぶぐへへな画像をdl
# 世界の中心はここね❤
PixivArtWorkDownload($userlist, $userlist_file);
exit(0);
?>

コード例 #14
0
ファイル: editpost.php プロジェクト: OvBB/v1.0
function SavePost($aPostInfo)
{
    global $CFG, $dbConn, $iRootID, $aAttachments, $aPostIcons;
    $iPostID = $aPostInfo['id'];
    $iThreadID = $aPostInfo['parent'];
    // Initiate some variables.
    $aToDelete = array();
    $iAddedAttachments = 0;
    $iRemovedAttachments = 0;
    // Grab the info. specified by the user.
    $strSubject = $_REQUEST['subject'];
    $strThreadDesc = $_REQUEST['description'];
    $iPostIcon = (int) $_REQUEST['icon'];
    $strBody = $_REQUEST['message'];
    $bParseURLs = (bool) $_REQUEST['parseurls'];
    $bParseEMails = (bool) $_REQUEST['parseemails'];
    $bDisableSmilies = (int) (bool) $_REQUEST['dsmilies'];
    $aDeleteAttachments = $_REQUEST['deleteattach'];
    // Subject
    if (trim($strSubject) == '' && $iPostID == $iRootID) {
        // This post is the thread root, and they either put in only whitespace or nothing at all.
        $aError[] = 'You must specify a subject.';
    } else {
        if (strlen($strSubject) > $CFG['maxlen']['subject']) {
            // The subject they specified is too long.
            $aError[] = "The subject you specified is longer than {$CFG['maxlen']['subject']} characters.";
        }
    }
    $strCleanSubject = $dbConn->sanitize($strSubject);
    // Description
    if (strlen($strThreadDesc) > $CFG['maxlen']['desc']) {
        // The description they specified is too long.
        $aError[] = "The description you specified is longer than {$CFG['maxlen']['desc']} characters.";
    }
    $strThreadDesc = $dbConn->sanitize($strThreadDesc);
    // Icon
    if ($iPostIcon < 0 || $iPostIcon > count($aPostIcons) - 1) {
        // They don't know what icon they want. We'll give them none.
        $iPostIcon = 0;
    }
    // Body
    if (trim($strBody) == '') {
        // They either put in only whitespace or nothing at all.
        $aError[] = 'You must specify a message.';
    } else {
        if (strlen($strBody) > $CFG['maxlen']['messagebody']) {
            // The body they specified is too long.
            $aError[] = "The message you specified is longer than {$CFG['maxlen']['messagebody']} characters.";
        }
    }
    $strCleanBody = $dbConn->sanitize($strBody);
    // Attachment
    if (isset($_FILES['attachment']) && $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE) {
        // What is the problem?
        switch ($_FILES['attachment']['error']) {
            // Upload was successful?
            case UPLOAD_ERR_OK:
                // Is it bigger than the allowable maximum?
                if ($_FILES['attachment']['size'] > $CFG['uploads']['maxsize']) {
                    $aError[] = "The attachment you uploaded is too large. The maximum allowable filesize is {$CFG['uploads']['maxsize']} bytes.";
                }
                // Is it an invalid filetype?
                if (!isset($CFG['uploads']['oktypes'][strtolower(substr(strrchr($_FILES['attachment']['name'], '.'), 1))])) {
                    $aError[] = 'The file you uploaded is an invalid type of attachment. Valid types are: ' . htmlsanitize(implode(', ', array_keys($CFG['uploads']['oktypes']))) . '.';
                }
                // If there are no errors, grab the data from the temporary file.
                if (!is_array($aError)) {
                    $strAttachmentName = $dbConn->sanitize($_FILES['attachment']['name']);
                    if ($fileUploaded = fopen($_FILES['attachment']['tmp_name'], 'rb')) {
                        $blobAttachment = $dbConn->sanitize(fread($fileUploaded, 65536), TRUE);
                    } else {
                        $aError[] = 'There was a problem while reading the attachment. If this problem persists, please contact the Webmaster.';
                    }
                }
                break;
                // File is too big?
            // File is too big?
            case UPLOAD_ERR_INI_SIZE:
            case UPLOAD_ERR_FORM_SIZE:
                $aError[] = "The attachment you uploaded is too large. The maximum allowable filesize is {$CFG['uploads']['maxsize']} bytes.";
                break;
                // File was partially uploaded?
            // File was partially uploaded?
            case UPLOAD_ERR_PARTIAL:
                $aError[] = 'The attachment was only partially uploaded.';
                break;
                // WTF happened?
            // WTF happened?
            default:
                $aError[] = 'There was an error while uploading the attachment.';
                break;
        }
    }
    // If there was an error, let's return it.
    if ($aError) {
        return $aError;
    }
    // Update the post's record.
    $dbConn->query("UPDATE post SET datetime_edited={$CFG['globaltime']}, title='{$strCleanSubject}', body='{$strCleanBody}', icon={$iPostIcon}, dsmilies={$bDisableSmilies} WHERE id={$iPostID}");
    // Was this post the thread root?
    if ($iPostID == $iRootID) {
        // Yes, update the thread description.
        $dbConn->query("UPDATE thread SET title='{$strCleanSubject}', icon={$iPostIcon}, description='{$strThreadDesc}' WHERE id={$iThreadID}");
    }
    // Store the attachment, if there is one.
    if ($fileUploaded) {
        // Insert the first chunk of the file.
        $dbConn->query("INSERT INTO attachment(filename, filedata, viewcount, parent) VALUES('{$strAttachmentName}', '{$blobAttachment}', 0, {$iPostID})");
        // Get the ID of the attachment we just created.
        $iAttachmentID = $dbConn->getinsertid('attachment');
        // Insert the rest of the file, if any, into the database.
        while (!feof($fileUploaded)) {
            $blobAttachment = $dbConn->sanitize(fread($fileUploaded, 65536), TRUE);
            $dbConn->squery(CONCAT_ATTACHMENT, $blobAttachment, $iAttachmentID);
        }
        // Close the temporary file.
        fclose($fileUploaded);
        // Increment the added attachment count.
        $iAddedAttachments++;
    }
    // Are there any attachments to delete?
    if (is_array($aDeleteAttachments) && is_array($aAttachments)) {
        // Yes, so remove the ones that don't belong to this post.
        foreach ($aDeleteAttachments as $iAttachmentID => $null) {
            // Is the attachment in this post?
            if (array_key_exists($iAttachmentID, $aAttachments) && !array_search($iAttachmentID, $aToDelete)) {
                // Yes, so add the attachment to the list to delete.
                $aToDelete[] = $iAttachmentID;
            }
        }
        // Are there still attachments to delete?
        if (is_array($aToDelete)) {
            // Yes, so delete them.
            $strToDelete = implode(', ', $aToDelete);
            $dbConn->query("DELETE FROM attachment WHERE id IN ({$strToDelete})");
            // Set the removed attachments counter.
            $iRemovedAttachments = count($aToDelete);
        }
    }
    // Are there any changes to the number of attachments in this post (and therefore the parent thread)?
    $iAttachmentCount = $iAddedAttachments - $iRemovedAttachments;
    if ($iAttachmentCount != 0) {
        // Yes, so update the thread's record.
        $dbConn->query("UPDATE thread SET attachcount=attachcount+({$iAttachmentCount}) WHERE id={$iThreadID}");
    }
    // Remove all searchindexes for this post.
    $dbConn->query("DELETE FROM searchindex WHERE postid={$iPostID}");
    // Now let's re-add the message into the search engine index.
    AddSearchIndex($iPostID, $strSubject, $strBody);
    // Update the user.
    Msg("<b>Your changes have been successfully saved.</b><br /><br /><span class=\"smaller\">You should be redirected to your post momentarily. Click <a href=\"thread.php?threadid={$iThreadID}&amp;postid={$iPostID}#post{$iPostID}\">here</a> if you do not want to wait any longer or if you are not redirected.</span>", "thread.php?threadid={$iThreadID}&postid={$iPostID}#post{$iPostID}");
}
コード例 #15
0
ファイル: register.php プロジェクト: OvBB/v1.0
function Success($iUserID)
{
    global $CFG, $dbConn;
    // Get the information about the user that was just created.
    $dbConn->query("SELECT * FROM citizen WHERE id={$iUserID}");
    $aSQLResult = $dbConn->getresult(TRUE);
    // Store the member information into the session.
    LoadUser($aSQLResult);
    // Delete any guest entries from the session table.
    $dbConn->query("DELETE FROM guest WHERE id='" . session_id() . "'");
    // Render the page.
    Msg("<b>Thank you for registering.</b><br /><br /><span class=\"smaller\">You should be redirected to the forum index momentarily. Click <a href=\"index.php\">here</a><br />if you do not want to wait any longer or if you are not redirected.</span>", 'index.php');
}
コード例 #16
0
ファイル: newreply.php プロジェクト: spookdogg/v1.0
function SubmitPost()
{
    global $CFG, $dbConn, $aPostIcons, $iThreadID, $iForumID;
    // Get the values from the user.
    $strSubject = $_REQUEST['subject'];
    $iPostIcon = (int) $_REQUEST['icon'];
    $strMessage = $_REQUEST['message'];
    $bParseEMails = (int) (bool) $_REQUEST['parseemails'];
    $bDisableSmilies = (int) (bool) $_REQUEST['dsmilies'];
    // Floodcheck
    if (!$_SESSION['permissions']['cbypassflood'] && $_SESSION['lastpost'] + $CFG['floodcheck'] > $CFG['globaltime']) {
        Msg("Sorry! The administrator has specified that users can only post one message every {$CFG['floodcheck']} seconds.", '', 'justify');
    }
    // Subject
    if (strlen($strSubject) > $CFG['maxlen']['subject']) {
        // The subject they specified is too long.
        $aError[] = "The subject you specified is longer than {$CFG['maxlen']['subject']} characters.";
    }
    $strCleanSubject = $dbConn->sanitize($strSubject);
    // Icon
    if ($iPostIcon < 0 || $iPostIcon > count($aPostIcons) - 1) {
        // They don't know what icon they want. We'll give them none.
        $iPostIcon = 0;
    }
    // Message
    if (trim($strMessage) == '') {
        // They either put in only whitespace or nothing at all.
        $aError[] = 'You must specify a message.';
    } else {
        if (strlen($strMessage) > $CFG['maxlen']['messagebody']) {
            // The message they specified is too long.
            $aError[] = "The message you specified is longer than {$CFG['maxlen']['messagebody']} characters.";
        }
    }
    if ($bParseEMails) {
        $strMessage = ParseEMails($strMessage);
    }
    $strCleanMessage = $dbConn->sanitize($strMessage);
    // Attachment
    if (isset($_FILES['attachment']) && $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE) {
        // What is the problem?
        switch ($_FILES['attachment']['error']) {
            // Upload was successful?
            case UPLOAD_ERR_OK:
                // Is it bigger than 100KB?
                if ($_FILES['attachment']['size'] > $CFG['uploads']['maxsize']) {
                    $aError[] = "The attachment you uploaded is too large. The maximum allowable filesize is {$CFG['uploads']['maxsize']} bytes.";
                }
                // Is it an invalid filetype?
                if (!isset($CFG['uploads']['oktypes'][strtolower(substr(strrchr($_FILES['attachment']['name'], '.'), 1))])) {
                    $aError[] = 'The file you uploaded is an invalid type of attachment. Valid types are: ' . htmlsanitize(implode(', ', array_keys($CFG['uploads']['oktypes']))) . '.';
                }
                // If there are no errors, grab the data from the temporary file.
                if (!is_array($aError)) {
                    $strAttachmentName = $dbConn->sanitize($_FILES['attachment']['name']);
                    if ($fileUploaded = fopen($_FILES['attachment']['tmp_name'], 'rb')) {
                        $blobAttachment = $dbConn->sanitize(fread($fileUploaded, 65536), TRUE);
                    } else {
                        $aError[] = 'There was a problem while reading the attachment. If this problem persists, please contact the Webmaster.';
                    }
                }
                break;
                // File is too big?
            // File is too big?
            case UPLOAD_ERR_INI_SIZE:
            case UPLOAD_ERR_FORM_SIZE:
                $aError[] = "The attachment you uploaded is too large. The maximum allowable filesize is {$CFG['uploads']['maxsize']} bytes.";
                break;
                // File was partially uploaded?
            // File was partially uploaded?
            case UPLOAD_ERR_PARTIAL:
                $aError[] = 'The attachment was only partially uploaded.';
                break;
                // WTF happened?
            // WTF happened?
            default:
                $aError[] = 'There was an error while uploading the attachment.';
                break;
        }
    }
    // If there was an error, let's return it.
    if (is_array($aError)) {
        return $aError;
    }
    // First we obviously need the post in the post table.
    $dbConn->query("INSERT INTO post(author, datetime_posted, title, body, parent, ipaddress, icon, dsmilies) VALUES({$_SESSION['userid']}, {$CFG['globaltime']}, '{$strCleanSubject}', '{$strCleanMessage}', {$iThreadID}, {$_SESSION['userip']}, {$iPostIcon}, {$bDisableSmilies})");
    // Before we continue, get the ID of the post we just created.
    $iPostID = $dbConn->getinsertid('post');
    // Second, we need to update record of the thread we are posting to.
    $dbConn->query("UPDATE thread SET lpost={$CFG['globaltime']}, lposter={$_SESSION['userid']}, postcount=postcount+1 WHERE id={$iThreadID}");
    // Get the post count of the thread we replied to, so we can figure the last page.
    $dbConn->query("SELECT postcount FROM thread WHERE id={$iThreadID}");
    list($iPostCount) = $dbConn->getresult();
    // Third, we need to update the record of the forum that contains the thread we are posting to.
    $dbConn->query("UPDATE board SET postcount=postcount+1, lpost={$CFG['globaltime']}, lposter={$_SESSION['userid']}, lthread={$iThreadID}, lthreadpcount={$iPostCount} WHERE id={$iForumID}");
    // Fourth, we need to update the poster's postcount.
    $dbConn->query("UPDATE citizen SET postcount=postcount+1 WHERE id={$_SESSION['userid']}");
    // And finally, we need to store the attachment, if there is one.
    if ($fileUploaded) {
        // Insert the first chunk of the file.
        $dbConn->query("INSERT INTO attachment(filename, filedata, viewcount, parent) VALUES('{$strAttachmentName}', '{$blobAttachment}', 0, {$iPostID})");
        // Get the ID of the attachment we just created.
        $iAttachmentID = $dbConn->getinsertid('attachment');
        // Insert the rest of the file, if any, into the database.
        while (!feof($fileUploaded)) {
            $blobAttachment = $dbConn->sanitize(fread($fileUploaded, 65536), TRUE);
            $dbConn->squery(CONCAT_ATTACHMENT, $blobAttachment, $iAttachmentID);
        }
        // Close the temporary file.
        fclose($fileUploaded);
        // Update the attachment count for the thread.
        $dbConn->query("UPDATE thread SET attachcount=attachcount+1 WHERE id={$iThreadID}");
    }
    // Now let's add the message into the search engine index.
    AddSearchIndex($iPostID, $strSubject, $strMessage);
    // Update the forum stats.
    $dbConn->query("UPDATE stats SET content=content+1 WHERE name='postcount'");
    // Set user's last post time.
    $_SESSION['lastpost'] = $CFG['globaltime'];
    // What page is this new post on (so we can redirect them)?
    $iPage = ceil($iPostCount / $_SESSION['postsperpage']);
    // Render the page.
    Msg("<b>Thank you for posting.</b><br /><br /><span class=\"smaller\">You should be redirected to your post momentarily. Click <a href=\"thread.php?threadid={$iThreadID}&amp;page={$iPage}#post{$iPostID}\">here</a> if you do not want to wait any longer or if you are not redirected.</span>", "thread.php?threadid={$iThreadID}&page={$iPage}#post{$iPostID}");
}
コード例 #17
0
ファイル: posters.php プロジェクト: OvBB/v1.0
//***************************************************************************//
//                                                                           //
//  Copyright (c) 2015-2016 OvBB Software                                    //
//  All rights reserved.                                                     //
//                                                                           //
//  This program is free software. You may use, modify, and/or redistribute  //
//  it under the terms of the MIT License.                                   //
//                                                                           //
//***************************************************************************//
// Initialize OvBB.
require './includes/init.inc.php';
// Constants
define('USERNAME', 0);
define('POSTCOUNT', 1);
// What thread do they want?
$iThreadID = (int) $_REQUEST['threadid'];
// Get each poster in the thread and their number of posts in the thread.
$dbConn->query("SELECT citizen.id, citizen.username, COUNT(post.id) as postcount FROM citizen INNER JOIN post ON (post.author = citizen.id) WHERE post.parent={$iThreadID} GROUP BY citizen.id, citizen.username ORDER BY postcount ASC");
while ($aSQLResult = $dbConn->getresult()) {
    $iPosterID = $aSQLResult[0];
    $aPosters[$iPosterID][USERNAME] = $aSQLResult[1];
    $aPosters[$iPosterID][POSTCOUNT] = $aSQLResult[2];
    // Add the posts to the total count.
    $iTotalPosts = $iTotalPosts + $aSQLResult[2];
}
// Is it a valid thread?
if (!isset($aPosters)) {
    Msg("Invalid thread specified.{$CFG['msg']['invalidlink']}");
}
// Template
require "./skins/{$CFG['skin']}/showposters.tpl.php";
コード例 #18
0
ファイル: member.php プロジェクト: spookdogg/v1.0
function MarkRead()
{
    global $CFG;
    // Set their lastactive value.
    $_SESSION['lastactive'] = $CFG['globaltime'];
    // Let them know it was a success.
    Msg("<b>All forums have been marked as read, and the new post indicators will now be off.</b><br /><br /><span class=\"smaller\">You should be redirected momentarily. Click <a href=\"index.php\">here</a> if you do not want to wait any longer or if you are not redirected.</span>", 'index.php');
}
コード例 #19
0
ファイル: calendar.php プロジェクト: OvBB/v1.0
function ViewEvent()
{
    global $CFG, $dbConn, $aSmilies;
    // Does the user have authorization to use the calendar?
    if (!$_SESSION['permissions']['ccalendar']) {
        // No. Let them know the bad news.
        Unauthorized();
    }
    // What event do they want to view?
    $iEventID = (int) $_REQUEST['eventid'];
    // Get the information for this event.
    $dbConn->query("SELECT author, startdate, title, body, private, dsmilies FROM event WHERE id={$iEventID}");
    if (!(list($iAuthor, $strDate, $strTitle, $strEventInfo, $bPrivate, $bDisableSmilies) = $dbConn->getresult())) {
        Msg("Invalid event specified.{$CFG['msg']['invalidlink']}");
    }
    $bPublic = !$bPrivate;
    // Are they allowed to view this event?
    if (!$bPublic && $iAuthor != $_SESSION['userid']) {
        // Nope. Give them the Unauthorized page.
        Unauthorized();
    }
    // Parse the message.
    $strEventInfo = ParseMessage($strEventInfo, $bDisableSmilies);
    // Template
    require "./skins/{$CFG['skin']}/viewevent.tpl.php";
    // Send the page.
    exit;
}
コード例 #20
0
ファイル: private.php プロジェクト: OvBB/v1.0
function Move()
{
    global $CFG, $dbConn;
    // Get the list of messages to be moved.
    $aMessages = $_REQUEST['id'];
    // Get the destination.
    $iDestinationID = (int) $_REQUEST['dest'];
    // Get a list of our custom folders.
    $dbConn->query("SELECT pmfolders FROM citizen WHERE id={$_SESSION['userid']}");
    list($strFolders) = $dbConn->getresult();
    $aFolders = unserialize($strFolders);
    // Move the messages.
    if (is_array($aMessages) && isset($aFolders[$iDestinationID])) {
        $strMessages = $dbConn->sanitize(implode(', ', $aMessages));
        $dbConn->query("UPDATE pm SET parent={$iDestinationID} WHERE id IN ({$strMessages}) AND ownerid={$_SESSION['userid']}");
    }
    // Render the page.
    Msg("<b>The message(s) were successfully moved.</b><br /><br /><span class=\"smaller\">You should be redirected momentarily. Click <a href=\"private.php\">here</a> if you do not want to wait any longer or if you are not redirected.</span>", 'private.php');
}
コード例 #21
0
ファイル: messages.php プロジェクト: Volkodav-vvs/Micron
function MsgErr($message)
{
    return Msg($message, 'msg-err');
}
コード例 #22
0
ファイル: poll.php プロジェクト: spookdogg/v1.0
function ValidatePoll($iThreadID)
{
    global $CFG, $dbConn;
    // Get the values from the user.
    $strQuestion = $_REQUEST['question'];
    $aChoices = (array) $_REQUEST['choice'];
    $bMultipleChoices = (int) (bool) $_REQUEST['multiplechoices'];
    $iTimeout = (int) $_REQUEST['timeout'];
    // Question
    if (trim($strQuestion) == '') {
        // They either put in only whitespace or nothing at all.
        $aError[] = 'You must specify a question.';
    } else {
        if (strlen($strQuestion) > $CFG['maxlen']['pollquestion']) {
            // The question they specified is too long.
            $aError[] = "The question you specified is longer than {$CFG['maxlen']['pollquestion']} characters.";
        }
    }
    $strQuestion = $dbConn->sanitize($strQuestion);
    // Choices
    if (count($aChoices)) {
        // Clean up the list of choices.
        while (list($iChoiceID) = each($aChoices)) {
            $aChoices[$iChoiceID] = trim($aChoices[$iChoiceID]);
            if ($aChoices[$iChoiceID] != '') {
                if (strlen($aChoices[$iChoiceID]) < $CFG['maxlen']['pollchoice']) {
                    $aTemp[] = $aChoices[$iChoiceID];
                } else {
                    // The choice they specified is too long.
                    $aError[] = "A choice you specified is longer than {$CFG['maxlen']['pollchoice']} characters.";
                }
            }
        }
        $aChoices = $aTemp;
        unset($aTemp);
        // Right number?
        if (count($aChoices) < 2) {
            // Not enough choices given.
            $aError[] = 'You must specify at least two choices.';
        } else {
            if (count($aChoices) > $CFG['maxlen']['pollchoices']) {
                // Too many choices given.
                $aError[] = "The maximum number of choices is {$CFG['maxlen']['pollchoices']}.";
            } else {
                $strChoices = $dbConn->sanitize(serialize($aChoices));
            }
        }
    } else {
        // No choices given.
        $aError[] = 'You must specify at least two choices.';
    }
    // Timeout
    if ($iTimeout < 0 || $iTimeout > 65535) {
        // They don't know what timeout they want. We'll give them none.
        $iTimeout = 0;
    }
    // If there was an error, let's return it.
    if (is_array($aError)) {
        return $aError;
    }
    // Get information on the thread.
    $dbConn->query("SELECT author, visible, closed, poll FROM thread WHERE id={$iThreadID}");
    if (!(list($iThreadAuthorID, $bThreadVisible, $bThreadClosed, $bHasPoll) = $dbConn->getresult())) {
        Msg("Invalid thread specified.{$CFG['msg']['invalidlink']}");
    }
    // Make sure we're the author and the thread is marked for a poll.
    if ($iThreadAuthorID != $_SESSION['userid'] || !$bHasPoll) {
        Unauthorized();
    }
    // Make sure the thread doesn't already have a poll.
    $dbConn->query("SELECT COUNT(*) FROM poll WHERE id={$iThreadID}");
    list($bReallyHasPoll) = $dbConn->getresult();
    if ($bReallyHasPoll) {
        Msg('The thread specified already has a poll.');
    }
    // What is the forum we're in?
    $dbConn->query("SELECT parent FROM thread WHERE id={$iThreadID}");
    list($iForumID) = $dbConn->getresult();
    // Save the poll to the database.
    $dbConn->query("INSERT INTO poll(id, datetime, question, answers, multiplechoices, timeout) VALUES({$iThreadID}, {$CFG['globaltime']}, '{$strQuestion}', '{$strChoices}', {$bMultipleChoices}, {$iTimeout})");
    // Finish "submitting" the thread this poll belongs to.
    $dbConn->query("UPDATE thread SET poll=1, closed=0, visible=1 WHERE id={$iThreadID}");
    $dbConn->query("UPDATE board SET postcount=postcount+1, threadcount=threadcount+1, lpost={$CFG['globaltime']}, lposter={$_SESSION['userid']}, lthread={$iThreadID}, lthreadpcount=1 WHERE id={$iForumID}");
    $dbConn->query("UPDATE citizen SET postcount=postcount+1 WHERE id={$_SESSION['userid']}");
    // Update the forum stats.
    $dbConn->query("UPDATE stats SET content=content+1 WHERE name IN ('postcount', 'threadcount')");
    // Render page.
    Msg("<b>Thank you for posting.</b><br /><br /><span class=\"smaller\">You should be redirected momentarily. Click <a href=\"thread.php?threadid={$iThreadID}\">here</a> if you do not want to wait any longer or if you are not redirected.</span>", "thread.php?threadid={$iThreadID}");
}
コード例 #23
0
ファイル: usercp.php プロジェクト: OvBB/v1.0
function ListError()
{
    global $CFG;
    // Render an error page.
    Msg("Invalid user ID specified.{$CFG['msg']['invalidlink']}");
}
コード例 #24
0
	<div class="alert alert-info">
		<B><?php 
Msg('SIGN_IN_JS_DISABLED_ERR_006');
?>
</B><br /><br />
		<?php 
Msg('SIGN_IN_JS_DISABLED_ERR_007');
?>
	</div>
	<div class="alert alert-info">
		<B><?php 
Msg('SIGN_IN_JS_DISABLED_ERR_008');
?>
</B><br /><br />
		<?php 
Msg('SIGN_IN_JS_DISABLED_ERR_009');
?>
	</div>
	<div class="copyright">Online Ordering System for Appliances Store with Stock Management</div>
</div>
</NOSCRIPT>
</div>
<!-- END LOGIN -->

<?php 
asc_enqueue_script('jquery.validate');
asc_enqueue_script('jquery-backstretch');
asc_enqueue_script('select2');
asc_enqueue_script('asc-admin');
asc_enqueue_script('admin-layout');
asc_enqueue_script('admin-login-soft');
コード例 #25
0
ファイル: thread.php プロジェクト: spookdogg/v1.0
function ShowThread()
{
    global $CFG, $dbConn, $aViewedThreads, $aPostIcons, $aGroup;
    // What thread do they want?
    $iThreadID = (int) $_REQUEST['threadid'];
    // How many posts per page do they want to view?
    $iPostsPerPage = (int) $_REQUEST['perpage'];
    if ($iPostsPerPage < 1) {
        // They don't know what they want. Use their value.
        $iPostsPerPage = $_SESSION['postsperpage'];
    }
    // What page do they want to view?
    $iPage = (int) $_REQUEST['page'];
    if ($iPage < 1) {
        // They don't know what they want. Give them the first page.
        $iPage = 1;
    }
    // Calculate the offset.
    $iOffset = $iPage * $iPostsPerPage - $iPostsPerPage;
    // Get the thread's information.
    $dbConn->query("SELECT title, parent, postcount, attachcount, poll, closed, visible, sticky, notes FROM thread WHERE id={$iThreadID}");
    if (!($aSQLResult = $dbConn->getresult())) {
        Msg("Invalid thread specified.{$CFG['msg']['invalidlink']}");
    }
    // Store the thread's information.
    $aThread[TITLE] = $aSQLResult[0];
    $aThread[PARENT] = $aSQLResult[1];
    $aThread[POSTCOUNT] = $aSQLResult[2];
    $aThread[ATTACHCOUNT] = $aSQLResult[3];
    $aThread[POLL] = $aSQLResult[4];
    $aThread[CLOSED] = $aSQLResult[5];
    $aThread[VISIBLE] = $aSQLResult[6];
    $aThread[STICKY] = $aSQLResult[7];
    $aThread[NOTES] = $aSQLResult[8];
    // Is the thread visible?
    if (!$aThread[VISIBLE]) {
        // No.
        Msg("Invalid thread specified.{$CFG['msg']['invalidlink']}");
    }
    // Calculate the number of pages this thread is made of.
    $iNumberPages = ceil($aThread[POSTCOUNT] / $iPostsPerPage);
    // Is the page they asked for out of range?
    if ($iPage > $iNumberPages) {
        // Yes, give them the last page and recalculate the offset.
        $iPage = $iNumberPages;
        $iOffset = $iPage * $iPostsPerPage - $iPostsPerPage;
    }
    // Do they want to go to a specific post?
    if (isset($_REQUEST['postid'])) {
        $iPostID = (int) $_REQUEST['postid'];
        // Get the page the post is on.
        $dbConn->query("SELECT id FROM post WHERE parent={$iThreadID} ORDER BY datetime_posted");
        for ($iPosition = 1; list($iPost) = $dbConn->getresult(); $iPosition++) {
            if ($iPost == $iPostID) {
                break;
            }
        }
        // Is the post in this thread?
        if ($iPosition <= $aThread[POSTCOUNT]) {
            // Yes, reset the page and recalculate the offset.
            $iPage = ceil($iPosition / $iPostsPerPage);
            $iOffset = $iPage * $iPostsPerPage - $iPostsPerPage;
        }
    } else {
        if ($_REQUEST['goto'] == 'newest') {
            // Yes, so set what the minimum newest post time is.
            $tNewest = isset($aViewedThreads[$iThreadID]) ? $aViewedThreads[$iThreadID] : $_SESSION['lastactive'];
            // Get the newest post's ID.
            $dbConn->query("SELECT id FROM post WHERE parent={$iThreadID} AND datetime_posted > {$tNewest} ORDER BY datetime_posted LIMIT 1");
            if (list($iPostID) = $dbConn->getresult()) {
                // Redirect the user to the newest post.
                $strSID = SID ? '&' . SID : '';
                header("Location: thread.php?threadid={$iThreadID}&postid={$iPostID}{$strSID}#post{$iPostID}");
                exit;
            }
        }
    }
    // Get the information of all the categories and forums.
    list($aCategories, $aBoards) = GetForumInfo();
    // Save our forum name, as well as the ID and name of the category we belong to.
    $iCategoryID = $aBoards[$aThread[PARENT]][0];
    $strCategoryName = $aCategories[$iCategoryID];
    $strForumName = $aBoards[$aThread[PARENT]][1];
    // Get the information of each post and poster in this thread.
    $dbConn->query("SELECT post.id, post.author, post.datetime_posted, post.datetime_edited, post.title AS ptitle, post.body, post.icon, post.dsmilies, post.ipaddress, citizen.username, citizen.datejoined, citizen.title AS mtitle, citizen.signature, citizen.residence, citizen.website, citizen.lastactive, citizen.loggedin, citizen.postcount, citizen.usergroup, citizen.invisible FROM post LEFT JOIN citizen ON (post.author = citizen.id) WHERE post.parent={$iThreadID} ORDER BY post.datetime_posted ASC LIMIT {$iPostsPerPage} OFFSET {$iOffset}");
    while ($aSQLResult = $dbConn->getresult(TRUE)) {
        // Store the post information.
        $iPostID = $aSQLResult['id'];
        $aPosts[$iPostID][AUTHOR] = $aSQLResult['author'];
        $aPosts[$iPostID][DT_POSTED] = $aSQLResult['datetime_posted'];
        $aPosts[$iPostID][DT_EDITED] = $aSQLResult['datetime_edited'];
        $aPosts[$iPostID][TITLE] = $aSQLResult['ptitle'];
        $aPosts[$iPostID][BODY] = $aSQLResult['body'];
        $aPosts[$iPostID][ICON] = $aSQLResult['icon'];
        $aPosts[$iPostID][DSMILIES] = $aSQLResult['dsmilies'];
        $aPosts[$iPostID][LOGGEDIP] = $aSQLResult['ipaddress'] === NULL ? FALSE : TRUE;
        // Store member's information into the Users array.
        if (!isset($aUsers[$aSQLResult['author']])) {
            $aUsers[$aPosts[$iPostID][AUTHOR]][USERNAME] = $aSQLResult['username'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][JOINDATE] = $aSQLResult['datejoined'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][TITLE] = $aSQLResult['mtitle'] ? $aSQLResult['mtitle'] : $aGroup[$aSQLResult['usergroup']]['usertitle'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][RESIDENCE] = $aSQLResult['residence'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][SIGNATURE] = $aSQLResult['signature'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][WWW] = $aSQLResult['website'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][LASTACTIVE] = $aSQLResult['lastactive'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][ONLINE] = $aSQLResult['loggedin'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][POSTCOUNT] = $aSQLResult['postcount'];
            $aUsers[$aPosts[$iPostID][AUTHOR]][INVISIBLE] = (bool) $aSQLResult['invisible'];
        }
    }
    // Get the information of any attachments.
    if ($aThread[ATTACHCOUNT]) {
        $dbConn->query("SELECT post.id AS parent, attachment.id, attachment.filename, attachment.viewcount FROM post INNER JOIN attachment ON (attachment.parent = post.id) WHERE post.parent={$iThreadID}");
        while (list($iPostID, $iAttachmentID, $strFilename, $iViewCount) = $dbConn->getresult()) {
            // Store the attachments' information into the Attachments array.
            $aAttachments[$iPostID][$iAttachmentID][0] = $strFilename;
            $aAttachments[$iPostID][$iAttachmentID][1] = $iViewCount;
        }
    }
    // Tally the votes if we have a poll.
    if ($aThread[POLL]) {
        // Get the poll information.
        $iPollID = $iThreadID;
        $dbConn->query("SELECT question, answers, multiplechoices, timeout, datetime FROM poll WHERE id={$iPollID}");
        list($strPollQuestion, $strPollAnswers, $bMultipleChoices, $iTimeout, $tPosted) = $dbConn->getresult();
        $aPollAnswers = unserialize($strPollAnswers);
        $bClosed = $iTimeout && $CFG['globaltime'] > $tPosted + $iTimeout * 86400 ? TRUE : FALSE;
        // Get the votes.
        $dbConn->query("SELECT ownerid, vote FROM pollvote WHERE parent={$iPollID}");
        while (list($iOwnerID, $iVote) = $dbConn->getresult()) {
            // Tally the vote.
            $aVotes[$iVote]++;
            // Increment the vote counter.
            $iVoteCount++;
            // Is this our vote?
            if ($iOwnerID == $_SESSION['userid']) {
                // Yes.
                $bHasVoted = TRUE;
            }
        }
    }
    // Add to the thread's viewcount.
    $dbConn->query("UPDATE thread SET viewcount=viewcount+1 WHERE id={$iThreadID}");
    // Update the user's last visit of this thread.
    $tLastViewed = isset($aViewedThreads[$iThreadID]) ? $aViewedThreads[$iThreadID] : $_SESSION['lastactive'];
    // Update the user's viewed threads cookie.
    $aViewedThreads[$iThreadID] = $CFG['globaltime'];
    setcookie('viewedthreads', base64_encode(serialize($aViewedThreads)), 0, $CFG['paths']['cookies']);
    // Template
    require "./skins/{$CFG['skin']}/thread.tpl.php";
    // Send the page.
    exit;
}
コード例 #26
0
	<a href="index.php">
	<img src="images/logo-login.png" alt= ""/>
	</a>
</div>
	<div class="content">
			<h3><?php 
Msg('SIGN_IN_PAGE_NAME');
?>
</h3>
			<p><?php 
Msg('SIGN_IN_BLOCKED_001');
?>
</p>
		<div class="form-group">
		<p><?php 
Msg('COPYRIGHT_TEXT');
?>
</p>
		</div>
	</div>
<?php 
asc_enqueue_script('jquery-backstretch');
do_action('admin_print_scripts');
?>
<script>
jQuery(document).ready(function() {

       // init background slide images
       jQuery.backstretch([
        "images/1.jpg",
        "images/2.jpg",
コード例 #27
0
?>
&nbsp;</TD>
                                        </TR>
                                    </TABLE>
                                </DIV>
                                <!-- // Tab Navigation Breadcrumb -->
                            </TD>
                        </TR>
                        <TR>
                            <TD valign="top" style="padding-top: 0px; padding-left: 3px;">
                                <!-- Page Content // -->
                                <div class="fixed_height_menu_tab_page" style="padding: 3px 7px 0px 7px;">
                                    <TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
                                        <TR class="title">
                                            <TD><span style="padding-left: 6px;"><?php 
Msg('CTLG_TAB_SEARCH_MENU_TITLE');
?>
</span></td>
                                        </TR>
                                        <TR>
                                            <TD vAlign=top style="padding-top: 3px;">
                                                <p><?php 
SearchForm();
?>
</p>
                                            </TD>
                                        </TR>
                                        <TR>
                                            <TD vAlign=top style="padding-top: 3px;">
                                                <p><?php 
SearchResult();
コード例 #28
0
        if (!isset($_COOKIE[date("Ymd")])) {
            setcookie(date("Ymd"), 1, $day_last);
        } else {
            setcookie(date("Ymd"), $_COOKIE[date("Ymd")] + 1, $day_last);
            $today_hits++;
        }
    } else {
        $smarty->assign("answer", false);
        $trans = $question[$count]['translation'];
        $sql = "update lang_german set misses=misses+1,level=0,lasthit=lasthit,\r               datein=datein where word='{$word}'";
    }
    mysql_query($sql) or die(mysql_error());
} else {
    $_SESSION['question'] = null;
    $question = null;
    $count = BuildQuestions($_SESSION['question']);
    if ($count == 0) {
        Msg("There are not new words you need to learn... yet!");
    } else {
        $question = $_SESSION['question'];
    }
}
// Now we must ask the word
$count--;
$smarty->assign("translation", $question[$count]['translation']);
$smarty->assign("tip_word", $question[$count]['tip_word']);
$smarty->assign("tip_trans", $question[$count]['tip_trans']);
$smarty->assign("today_asked", $_COOKIE["asked_" . date("Ymd")]);
$smarty->assign("today", $today_hits);
$smarty->assign("counter", $count);
$smarty->display('study/learn.tpl');
コード例 #29
0
ファイル: admincp.php プロジェクト: spookdogg/v1.0
function RemoveCensoredWord()
{
    global $CFG, $dbConn, $aCensored;
    // Get the censored word's key.
    while (list($key, $aCensoredWord) = each($aCensored)) {
        if ($aCensoredWord[0] == $_REQUEST['word']) {
            $wordToRemove = $key;
            break;
        }
    }
    // Remove the censored word.
    unset($aCensored[$wordToRemove]);
    $strCensored = $dbConn->sanitize(serialize($aCensored));
    $dbConn->query("UPDATE configuration SET content='{$strCensored}' WHERE name='censored'");
    // Let the user know it was a success.
    Msg("<b>Censored Word successfully removed.</b><br /><br /><span class=\"smaller\">You should be redirected to the Admin Control Panel momentarily. Click <a href=\"admincp.php?section=censored\">here</a><br />if you do not want to wait any longer or if you are not redirected.</span>", 'admincp.php?section=censored');
}
コード例 #30
0
					<li class="dropdown dropdown-user">
						<a title="<?php 
Msg('ADMIN_INFO_PAGE_TITLE');
?>
" href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" >
							<span class="username username-hide-on-mobile"> <?php 
echo $admin_info['firstname'] . ' ' . $admin_info['lastname'];
?>
 </span>
							<i class="fa fa-angle-down"></i>
						</a>

						<ul class="dropdown-menu">
							<li>
								<a title="<?php 
Msg('ADMIN_INFO_PAGE_TITLE');
?>
" href="admin_member_info.php?asc_action=SetSelectedUser/uid=<?php 
echo modApiFunc('Users', 'getCurrentUserID');
?>
/edit=1"> <i class="fa fa-user"></i> My Profile </a>
							</li>
							<li>
								<a href="javascript:updateStoreStatus()" title="<?php 
msg('LFTBX_HEADER_STORE_STATUS_HINT');
?>
"> <i class="fa fa-check"></i> <?php 
msg($store_status ? 'LFTBX_HEADER_CLSD' : 'LFTBX_HEADER_ONLN');
?>
</a>
							</li>