当前位置: 首页>>代码示例>>PHP>>正文


PHP Msg函数代码示例

本文整理汇总了PHP中Msg函数的典型用法代码示例。如果您正苦于以下问题:PHP Msg函数的具体用法?PHP Msg怎么用?PHP Msg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Msg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetFollowings

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;
        }
    }
}
开发者ID:pinkienort,项目名称:PixivArchive,代码行数:34,代码来源:followings.php

示例2: WriteCsv

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;
}
开发者ID:pinkienort,项目名称:PixivArchive,代码行数:13,代码来源:Csv.php

示例3: CreateLink

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");
}
开发者ID:pinkienort,项目名称:PixivArchive,代码行数:13,代码来源:mklink.php

示例4: login

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");
    }
}
开发者ID:pinkienort,项目名称:PixivArchive,代码行数:42,代码来源:login.php

示例5: ClassLoaderSandbox

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;
}
开发者ID:Qwaz,项目名称:solved-hacking-problem,代码行数:21,代码来源:index.php

示例6: CookieLogin

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);
        // 失敗したらオシマイ
    }
}
开发者ID:pinkienort,项目名称:PixivArchive,代码行数:21,代码来源:CookieLogin.php

示例7: Legenda

<?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);
    }
}
开发者ID:BGCX261,项目名称:zkmlebork-svn-to-git,代码行数:31,代码来源:form_legenda.php

示例8: ViewResultPosts

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.
//.........这里部分代码省略.........
开发者ID:OvBB,项目名称:v1.0,代码行数:101,代码来源:search.php

示例9: Msg

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>
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:31,代码来源:admin_cz_layouts_info.php

示例10: unset

            $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']);
开发者ID:spookdogg,项目名称:v1.0,代码行数:31,代码来源:forumdisplay.php

示例11: Msg

</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">
开发者ID:hardy419,项目名称:2015-7-27,代码行数:31,代码来源:n_search.php

示例12: listadoTablas

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);
}
开发者ID:dice9030,项目名称:GestionLogistico,代码行数:24,代码来源:adminTablasForms.php

示例13: dirname

#!/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);
?>

开发者ID:pinkienort,项目名称:PixivArchive,代码行数:23,代码来源:dl.php

示例14: SavePost


//.........这里部分代码省略.........
    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}");
}
开发者ID:OvBB,项目名称:v1.0,代码行数:101,代码来源:editpost.php

示例15: Success

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');
}
开发者ID:OvBB,项目名称:v1.0,代码行数:13,代码来源:register.php


注:本文中的Msg函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。