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


PHP COM_applyFilter函数代码示例

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


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

示例1: MG_staticSortMediaSave

function MG_staticSortMediaSave()
{
    global $_USER, $_CONF, $_TABLES, $_MG_CONF, $LANG_MG00, $LANG_MG01, $LANG_MG03, $_POST;
    $startaid = COM_applyFilter($_POST['startaid'], true);
    $sortfield = COM_applyFilter($_POST['sortfield'], true);
    $sortorder = COM_applyFilter($_POST['sortorder'], true);
    $process_subs = COM_applyFilter($_POST['processsub'], true);
    switch ($sortfield) {
        case '0':
            // media_time
            $sql_sort_by = " ORDER BY m.media_time ";
            break;
        case '1':
            // media_upload_time
            $sql_sort_by = " ORDER BY m.media_upload_time ";
            break;
        case '2':
            // media title
            $sql_sort_by = " ORDER BY m.media_title ";
            break;
        case '3':
            // media original filename
            $sql_sort_by = " ORDER BY m.media_original_filename ";
            break;
        default:
            $sql_sort_by = " ORDER BY m.media_time ";
            break;
    }
    switch ($sortorder) {
        case '0':
            // ascending
            $sql_order = " DESC";
            break;
        case '1':
            // descending
            $sql_order = " ASC";
            break;
    }
    if ($process_subs == 0) {
        $sql = "SELECT  *\n                FROM " . $_TABLES['mg_media_albums'] . " as ma LEFT  JOIN " . $_TABLES['mg_media'] . " as m ON m.media_id = ma.media_id\n                WHERE ma.album_id=" . $startaid . $sql_sort_by . $sql_order;
        $order = 10;
        $result = DB_query($sql);
        $numRows = DB_numRows($result);
        for ($x = 0; $x < $numRows; $x++) {
            $row = DB_fetchArray($result);
            $media_id[$x] = $row['media_id'];
            $media_order[$x] = $order;
            $order += 10;
        }
        $media_count = $numRows;
        $i = 0;
        for ($x = 0; $x < $media_count; $x++) {
            $sql = "UPDATE " . $_TABLES['mg_media_albums'] . " SET media_order=" . $media_order[$x] . " WHERE media_id='" . $media_id[$x] . "' AND album_id=" . $startaid;
            $res = DB_query($sql);
        }
    } else {
        MG_staticSortMediaChildren($startaid, $sql_order, $sql_sort_by);
    }
    header("Location: " . $_MG_CONF['admin_url'] . 'index.php?msg=1');
}
开发者ID:spacequad,项目名称:glfusion,代码行数:60,代码来源:staticsortmedia.php

示例2: changeFeedStatus

/**
* Toggle status of a feed from enabled to disabled and back
*
* @param    int     $fid    ID of the feed
* @return   void
*
*/
function changeFeedStatus($fid_arr)
{
    global $_TABLES;
    $changes = false;
    // first disable all
    DB_query("UPDATE {$_TABLES['syndication']} SET is_enabled = 0");
    if (isset($fid_arr)) {
        foreach ($fid_arr as $fid) {
            $feed_id = addslashes(COM_applyFilter($fid, true));
            if (!empty($fid)) {
                // now enable those in the array
                DB_query("UPDATE {$_TABLES['syndication']} SET is_enabled = 1 WHERE fid = '{$fid}'");
                $changes = true;
            }
        }
    }
    if ($changes) {
        $result = DB_query("SELECT filename FROM {$_TABLES['syndication']} WHERE is_enabled = 0");
        $num_feeds_off = DB_numRows($result);
        for ($i = 0; $i < $num_feeds_off; $i++) {
            list($feedfile) = DB_fetchArray($result);
            deleteFeedFile($feedfile);
        }
    }
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:32,代码来源:syndication.php

示例3: MG_usageReport

function MG_usageReport()
{
    global $_TABLES, $_CONF, $_MG_CONF, $LANG_MG02, $LANG_MG01, $LANG30, $_POST;
    $retval = '';
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file('admin', 'usage_rpt.thtml');
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    $T->set_var('plugin', 'mediagallery');
    $rpt_month = COM_applyFilter($_POST['month'], true);
    $rpt_day = COM_applyFilter($_POST['day'], true);
    $rpt_year = COM_applyFilter($_POST['year'], true);
    $user = COM_applyFilter($_POST['user']);
    $alldates = COM_applyFilter($_POST['alldates']);
    if ($alldates == "on" && $user == "") {
        return MG_errorHandler($LANG_MG02['usage_report_error1']);
    }
    if ($alldates == "") {
        $begin_time = mktime(0, 0, 0, $rpt_month, $rpt_day, $rpt_year);
        $end_time = mktime(23, 59, 59, $rpt_month, $rpt_day, $rpt_year);
        $where = " WHERE (time >= {$begin_time} AND time <= {$end_time}) ";
    } else {
        $where = "";
    }
    if ($alldates == "" && $user != "") {
        $where .= "AND ";
    }
    if ($user != "") {
        if ($alldates == "on") {
            $where .= "WHERE ";
        }
        $where .= " user_id='" . $user . "' ";
    }
    $sql = "SELECT * FROM {$_TABLES['mg_usage_tracking']} " . $where . " ORDER BY time";
    $result = DB_query($sql);
    $nRows = DB_numRows($result);
    $i = 0;
    $T->set_block('admin', 'usagerow', 'urow');
    for ($x = 0; $x < $nRows; $x++) {
        $row = DB_fetchArray($result);
        if ($alldates == "on") {
            $view_date = date("d-M-y @ h:i a", $row['time']);
        } else {
            $view_date = date("h:i a", $row['time']);
        }
        $T->set_var(array('usage_time' => $view_date, 'user_id' => $row['user_name'], 'application' => $row['application'], 'album_title' => stripslashes($row['album_title']), 'media_title' => stripslashes($row['media_title']) == "" ? $row['media_id'] ? $row['media_id'] : "" : $row['media_title'], 'media_link' => $_MG_CONF['site_url'] . '/media_popup.php?mid=' . $row['media_id'] . '&aid=0', 'rowclass' => $i % 2 ? '2' : '1'));
        $i++;
        $T->parse('urow', 'usagerow', true);
    }
    if ($alldates == "on") {
        $rpt_date = $LANG_MG01['all_dates'];
    } else {
        $rpt_date = $LANG30[12 + $rpt_month] . ' ' . $rpt_day . ', ' . $rpt_year;
    }
    $T->set_var(array('report_date' => $rpt_date, 's_form_action' => $_MG_CONF['admin_url'] . 'usage_rpt.php', 'lang_usage_report' => $LANG_MG01['usage_report_header'], 'lang_time' => $LANG_MG01['time'], 'lang_user_id' => $LANG_MG01['user_id'], 'lang_application' => $LANG_MG01['application'], 'lang_album_title' => $LANG_MG01['album_title'], 'lang_media_title' => $LANG_MG01['mod_mediatitle'], 'lang_new_report' => $LANG_MG01['new_report']));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:59,代码来源:usage_rpt.php

示例4: databox_custom_templateSetVars

function databox_custom_templateSetVars($templatename, &$template)
{
    switch ($templatename) {
        case 'data':
            $aaa = COM_applyFilter($_POST['aaa']);
            $template->set_var('aaa', $aaa);
            break;
    }
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:9,代码来源:functions_custom.php

示例5: MG_staticSortAlbumsSave

function MG_staticSortAlbumsSave()
{
    global $_USER, $_CONF, $_TABLES, $_MG_CONF, $LANG_MG00, $LANG_MG01, $LANG_MG03, $_POST;
    $startaid = COM_applyFilter($_POST['startaid'], true);
    $sortfield = COM_applyFilter($_POST['sortfield'], true);
    $sortorder = COM_applyFilter($_POST['sortorder'], true);
    $process_subs = COM_applyFilter($_POST['processsub'], true);
    switch ($sortby) {
        case '0':
            // album title
            $sql_sort_by = " ORDER BY album_title ";
            break;
        case '1':
            // media_count
            $sql_sort_by = " ORDER BY media_count ";
            break;
        case '2':
            // last_update
            $sql_sort_by = " ORDER BY last_update ";
            break;
        default:
            $sql_sort_by = " ORDER BY album_title ";
            break;
    }
    switch ($sortorder) {
        case '0':
            // ascending
            $sql_order = " DESC";
            break;
        case '1':
            // descending
            $sql_order = " ASC";
            break;
    }
    if ($process_subs == 0) {
        $sql = "SELECT album_id,album_order FROM {$_TABLES['mg_albums']} WHERE album_parent=" . $startaid . " " . $sql_sort_by . $sql_order;
        $order = 10;
        $result = DB_query($sql);
        $numRows = DB_numRows($result);
        for ($x = 0; $x < $numRows; $x++) {
            $row = DB_fetchArray($result);
            $album_id[$x] = $row['album_id'];
            $album_order[$x] = $order;
            $order += 10;
        }
        $album_count = $numRows;
        $i = 0;
        for ($x = 0; $x < $album_count; $x++) {
            $sql = "UPDATE " . $_TABLES['mg_albums'] . " SET album_order=" . $album_order[$x] . " WHERE album_id=" . $album_id[$x];
            $res = DB_query($sql);
        }
    } else {
        MG_staticSortAlbumChildren($startaid, $sql_order, $sql_sort_by);
    }
    header("Location: " . $_MG_CONF['admin_url'] . 'index.php?msg=1');
}
开发者ID:spacequad,项目名称:glfusion,代码行数:56,代码来源:staticsortalbums.php

示例6: fncComment

function fncComment($id)
{
    global $_CONF;
    global $_TABLES;
    //
    $order = '';
    if (isset($_REQUEST['order'])) {
        $order = COM_applyFilter($_REQUEST['order']);
    }
    $mode = '';
    if (isset($_REQUEST['mode'])) {
        $mode = COM_applyFilter($_REQUEST['mode']);
    }
    $page = 1;
    if (isset($_REQUEST['cpage'])) {
        $page = COM_applyFilter($_REQUEST['cpage']);
    }
    //
    $tbl = $_TABLES['USERBOX_base'];
    //-----
    $sql = "SELECT ";
    $sql .= "commentcode ";
    $sql .= ",owner_id";
    $sql .= ",group_id";
    $sql .= ",perm_owner";
    $sql .= ",perm_group";
    $sql .= ",perm_members";
    $sql .= ",perm_anon";
    $sql .= " FROM ";
    $sql .= " {$tbl} AS t ";
    //base
    $sql .= " WHERE ";
    $sql .= " id=" . $id;
    $sql .= " AND t.draft_flag=0" . LB;
    //アクセス権のないデータ はのぞく
    $sql .= COM_getPermSql('AND');
    //公開日以前のデータはのぞく
    $sql .= " AND (released <= NOW())";
    //公開終了日を過ぎたデータはのぞく
    $sql .= " AND (expired=0 OR expired > NOW())";
    //
    $result = DB_query($sql);
    $numrows = DB_numRows($result);
    if ($numrows > 0) {
        $A = DB_fetchArray($result);
        $A = array_map('stripslashes', $A);
        if ($A['commentcode'] >= 0) {
            $delete_option = SEC_hasRights('userbox.edit') && SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) == 3 ? true : false;
            require_once $_CONF['path_system'] . 'lib-comment.php';
            $retval .= CMT_userComments($id, $A['topic'], 'userbox', $order, $mode, 0, $page, false, $delete_option, $A['commentcode']);
        }
    }
    return $retval;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:54,代码来源:profile.php

示例7: display

 /**
  * Constructor
  */
 function display()
 {
     global $_CONF, $_TABLES, $LANG_SX00;
     $action = '';
     if (isset($_GET['action'])) {
         $action = $_GET['action'];
     } elseif (isset($_POST['paction'])) {
         $action = $_POST['paction'];
     }
     if ($action == 'delete' && SEC_checkToken()) {
         $entry = $_GET['entry'];
         if (!empty($entry)) {
             $dbentry = addslashes($entry);
             DB_delete($_TABLES['spamx'], array('name', 'value'), array('HTTPHeader', $dbentry));
         }
     } elseif ($action == $LANG_SX00['addentry'] && SEC_checkToken()) {
         $entry = '';
         $name = COM_applyFilter($_REQUEST['header-name']);
         $n = explode(':', $name);
         $name = $n[0];
         $value = $_REQUEST['header-value'];
         if (!empty($name) && !empty($value)) {
             $entry = $name . ': ' . $value;
         }
         $dbentry = addslashes($entry);
         if (!empty($entry)) {
             $result = DB_query("INSERT INTO {$_TABLES['spamx']} VALUES ('HTTPHeader','{$dbentry}')");
         }
     }
     $token = SEC_createToken();
     $display = '<hr' . XHTML . '>' . LB . '<p><b>';
     $display .= $LANG_SX00['headerblack'];
     $display .= '</b></p>' . LB . '<ul>' . LB;
     $result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name='HTTPHeader' ORDER BY value");
     $nrows = DB_numRows($result);
     for ($i = 0; $i < $nrows; $i++) {
         list($e) = DB_fetchArray($result);
         $display .= '<li>' . COM_createLink(htmlspecialchars($e), $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditHeader&amp;action=delete&amp;entry=' . urlencode($e) . '&amp;' . CSRF_TOKEN . '=' . $token) . '</li>' . LB;
     }
     $display .= '</ul>' . LB . '<p>' . $LANG_SX00['e1'] . '</p>' . LB;
     $display .= '<p>' . $LANG_SX00['e2'] . '</p>' . LB;
     $display .= '<form method="post" action="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditHeader">' . LB;
     $display .= '<table border="0" width="100%">' . LB;
     $display .= '<tr><td align="right"><b>Header:</b></td>' . LB;
     $display .= '<td><input type="text" size="40" name="header-name"' . XHTML . '> e.g. <tt>User-Agent</tt></td></tr>' . LB;
     $display .= '<tr><td align="right"><b>Content:</b></td>' . LB;
     $display .= '<td><input type="text" size="40" name="header-value"' . XHTML . '> e.g. <tt>Mozilla</tt></td></tr>' . LB;
     $display .= '</table>' . LB;
     $display .= '<p><input type="submit" name="paction" value="' . $LANG_SX00['addentry'] . '"' . XHTML . '>';
     $display .= '<input type="hidden" name="' . CSRF_TOKEN . "\" value=\"{$token}\"" . XHTML . '></p>' . LB;
     $display .= '</form>' . LB;
     return $display;
 }
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:56,代码来源:EditHeader.Admin.class.php

示例8: MG_staticSortMediaSave

function MG_staticSortMediaSave()
{
    global $_TABLES, $_MG_CONF;
    $startaid = !empty($_POST['startaid']) ? COM_applyFilter($_POST['startaid'], true) : 0;
    $sortfield = !empty($_POST['sortfield']) ? COM_applyFilter($_POST['sortfield'], true) : 0;
    $sortorder = !empty($_POST['sortorder']) ? COM_applyFilter($_POST['sortorder'], true) : 0;
    $process_subs = !empty($_POST['processsub']) ? COM_applyFilter($_POST['processsub'], true) : 0;
    switch ($sortfield) {
        case '0':
            // media_time
            $sql_sort_by = " ORDER BY m.media_time ";
            break;
        case '1':
            // media_upload_time
            $sql_sort_by = " ORDER BY m.media_upload_time ";
            break;
        case '2':
            // media title
            $sql_sort_by = " ORDER BY m.media_title ";
            break;
        case '3':
            // media original filename
            $sql_sort_by = " ORDER BY m.media_original_filename ";
            break;
        default:
            $sql_sort_by = " ORDER BY m.media_time ";
            break;
    }
    switch ($sortorder) {
        case '0':
            // ascending
            $sql_order = " DESC";
            break;
        case '1':
            // descending
            $sql_order = " ASC";
            break;
    }
    if ($process_subs == 0) {
        $sql = "SELECT m.media_id FROM {$_TABLES['mg_media_albums']} AS ma " . "LEFT JOIN {$_TABLES['mg_media']} AS m ON m.media_id = ma.media_id " . "WHERE ma.album_id=" . $startaid . $sql_sort_by . $sql_order;
        $result = DB_query($sql);
        $order = 10;
        while ($row = DB_fetchArray($result)) {
            DB_change($_TABLES['mg_media_albums'], 'media_order', $order, array('media_id', 'album_id'), array($row['media_id'], $startaid));
            $order += 10;
        }
    } else {
        MG_staticSortMediaChildren($startaid, $sql_order, $sql_sort_by);
    }
    header("Location: " . $_MG_CONF['admin_url'] . 'index.php?msg=1');
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:51,代码来源:staticsortmedia.php

示例9: MG_saveUser

function MG_saveUser()
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01, $_POST;
    $uid = COM_applyFilter($_POST['uid'], true);
    $quota = COM_applyFilter($_POST['quota'], true) * 1048576;
    $active = COM_applyFilter($_POST['active'], true);
    $result = DB_query("SELECT uid FROM {$_TABLES['mg_userprefs']} WHERE uid=" . $uid);
    $nRows = DB_numRows($result);
    if ($nRows > 0) {
        DB_query("UPDATE {$_TABLES['mg_userprefs']} SET quota=" . $quota . ",active=" . $active . " WHERE uid=" . $uid, 1);
    } else {
        DB_query("INSERT INTO {$_TABLES['mg_userprefs']} SET uid=" . $uid . ", quota=" . $quota . ",active=" . $active, 1);
    }
    echo COM_refresh($_MG_CONF['admin_url'] . 'quotareport.php');
    exit;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:16,代码来源:edituser.php

示例10: MG_staticSortAlbumsSave

function MG_staticSortAlbumsSave()
{
    global $_TABLES, $_MG_CONF;
    $startaid = !empty($_POST['startaid']) ? COM_applyFilter($_POST['startaid'], true) : 0;
    $sortfield = !empty($_POST['sortfield']) ? COM_applyFilter($_POST['sortfield'], true) : 0;
    $sortorder = !empty($_POST['sortorder']) ? COM_applyFilter($_POST['sortorder'], true) : 0;
    $process_subs = !empty($_POST['processsub']) ? COM_applyFilter($_POST['processsub'], true) : 0;
    switch ($sortfield) {
        case '0':
            // album title
            $sql_sort_by = " ORDER BY album_title ";
            break;
        case '1':
            // media_count
            $sql_sort_by = " ORDER BY media_count ";
            break;
        case '2':
            // last_update
            $sql_sort_by = " ORDER BY last_update ";
            break;
        default:
            $sql_sort_by = " ORDER BY album_title ";
            break;
    }
    switch ($sortorder) {
        case '0':
            // ascending
            $sql_order = " DESC";
            break;
        case '1':
            // descending
            $sql_order = " ASC";
            break;
    }
    if ($process_subs == 0) {
        $sql = "SELECT album_id FROM {$_TABLES['mg_albums']} " . "WHERE album_parent=" . $startaid . " " . $sql_sort_by . $sql_order;
        $result = DB_query($sql);
        $order = 10;
        while ($row = DB_fetchArray($result)) {
            DB_change($_TABLES['mg_albums'], 'album_order', $order, 'album_id', $row['album_id']);
            $order += 10;
        }
    } else {
        MG_staticSortAlbumChildren($startaid, $sql_order, $sql_sort_by);
    }
    header("Location: " . $_MG_CONF['admin_url'] . 'index.php?msg=1');
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:47,代码来源:staticsortalbums.php

示例11: MG_saveRSS

function MG_saveRSS()
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $_POST;
    $rss_full_enabled = isset($_POST['rss_full_enabled']) ? COM_applyFilter($_POST['rss_full_enabled'], true) : 0;
    $rss_feed_type = COM_applyFilter($_POST['rss_feed_type']);
    $rss_ignore_empty = isset($_POST['rss_ignore_empty']) ? COM_applyFilter($_POST['rss_ignore_empty'], true) : 0;
    $rss_anonymous_only = isset($_POST['rss_anonymous_only']) ? COM_applyFilter($_POST['rss_anonymous_only'], true) : 0;
    $rss_feed_name = COM_applyFilter($_POST['rss_feed_name']);
    $hide_email = isset($_POST['hide_email']) ? COM_applyFilter($_POST['hide_email'], true) : 0;
    DB_save($_TABLES['mg_config'], "config_name, config_value", "'rss_full_enabled','{$rss_full_enabled}'");
    DB_save($_TABLES['mg_config'], "config_name, config_value", "'rss_feed_type','{$rss_feed_type}'");
    DB_save($_TABLES['mg_config'], "config_name, config_value", "'rss_ignore_empty','{$rss_ignore_empty}'");
    DB_save($_TABLES['mg_config'], "config_name, config_value", "'rss_anonymous_only','{$rss_anonymous_only}'");
    DB_save($_TABLES['mg_config'], "config_name, config_value", "'rss_feed_name','{$rss_feed_name}'");
    DB_save($_TABLES['mg_config'], "config_name, config_value", "'hide_author_email','{$hide_email}'");
    $_MG_CONF['rss_full_enabled'] = $rss_full_enabled;
    MG_buildFullRSS();
    echo COM_refresh($_MG_CONF['admin_url'] . 'index.php?msg=6');
    exit;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:20,代码来源:rss.php

示例12: display

 /**
  * Return HTML widget
  *
  * @return string
  */
 public function display()
 {
     global $LANG_SX00;
     $action = $this->getAction();
     $entry = $this->getEntry();
     if ($action === 'delete' && SEC_checkToken()) {
         $this->deleteEntry($entry);
     } elseif ($action === $LANG_SX00['addentry'] && SEC_checkToken()) {
         $entry = '';
         $name = COM_applyFilter($_REQUEST['header-name']);
         $n = explode(':', $name);
         $name = $n[0];
         $value = $_REQUEST['header-value'];
         if (!empty($name) && !empty($value)) {
             $entry = $name . ': ' . $value;
         }
         $this->addEntry($entry);
     }
     return $this->getWidget();
 }
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:25,代码来源:EditHeader.Admin.class.php

示例13: POLLS_saveVote_AJAX

function POLLS_saveVote_AJAX($pid, $aid)
{
    global $_CONF, $_PO_CONF, $_TABLES, $LANG_POLLS;
    $retval = array('html' => '', 'statusMessage' => '');
    if (POLLS_ipAlreadyVoted($pid)) {
        $retval['statusMessage'] = 'You have already voted on this poll';
        $retval['html'] = POLLS_pollResults($pid, 400, '', '', 2);
    } else {
        setcookie('poll-' . $pid, implode('-', $aid), time() + $_PO_CONF['pollcookietime'], $_CONF['cookie_path'], $_CONF['cookiedomain'], $_CONF['cookiesecure']);
        DB_change($_TABLES['polltopics'], 'voters', "voters + 1", 'pid', DB_escapeString($pid), '', true);
        $answers = count($aid);
        for ($i = 0; $i < $answers; $i++) {
            DB_change($_TABLES['pollanswers'], 'votes', "votes + 1", array('pid', 'qid', 'aid'), array(DB_escapeString($pid), $i, COM_applyFilter($aid[$i], true)), '', true);
        }
        DB_save($_TABLES['pollvoters'], 'ipaddress,date,pid', "'" . DB_escapeString($_SERVER['REMOTE_ADDR']) . "'," . time() . ",'" . DB_escapeString($pid) . "'");
    }
    $eMsg = $LANG_POLLS['savedvotemsg'] . ' "' . DB_getItem($_TABLES['polltopics'], 'topic', "pid = '" . DB_escapeString($pid) . "'") . '"';
    $retval['statusMessage'] = $eMsg;
    $retval['html'] = POLLS_pollResults($pid, 400, '', '', 2);
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:21,代码来源:ajax_handler.php

示例14: display

 /**
  * Constructor
  */
 function display()
 {
     global $_CONF, $LANG_SX00;
     $display = '';
     $max_Log_Size = 100000;
     $action = '';
     if (isset($_POST['action'])) {
         $action = COM_applyFilter($_POST['action']);
     }
     $path = $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=LogView';
     $log = 'spamx.log';
     $display .= "<form method=\"post\" action=\"{$path}\"><div>";
     $display .= "<input type=\"submit\" name=\"action\" value=\"{$LANG_SX00['clearlog']}\"" . XHTML . ">";
     $display .= "</div></form>";
     if ($action == $LANG_SX00['clearlog']) {
         $timestamp = strftime("%c");
         $fd = fopen($_CONF['path_log'] . $log, "w");
         fputs($fd, "{$timestamp} {$LANG_SX00['logcleared']} \n");
         fclose($fd);
     }
     $fsize = filesize($_CONF['path_log'] . $log);
     if ($fsize > $max_Log_Size) {
         $fd = fopen($_CONF['path_log'] . $log, "r");
         fseek($fd, -$max_Log_Size, SEEK_END);
         $data = fgets($fd);
         $data = fread($fd, $max_Log_Size);
         fclose($fd);
         $fd = fopen($_CONF['path_log'] . $log, "w");
         fputs($fd, "{$timestamp} {$LANG_SX00['logcleared']} \n");
         fwrite($fd, $data);
         fclose($fd);
     }
     $display .= "<hr" . XHTML . "><pre>";
     $display .= implode('', file($_CONF['path_log'] . $log));
     $display .= "</pre>";
     return $display;
 }
开发者ID:hostellerie,项目名称:nexpro,代码行数:40,代码来源:LogView.Admin.class.php

示例15: MG_getItems

function MG_getItems(&$album_data)
{
    global $_TABLES, $_MG_CONF;
    $retval = '';
    if (!isset($album_data['album_id']) || $album_data['access'] < 1) {
        return '';
    }
    $aid = $album_data['album_id'];
    $src = isset($_REQUEST['src']) ? COM_applyFilter($_REQUEST['src']) : 'orig';
    if ($src != 'disp' && $src != 'orig') {
        $src = 'orig';
    }
    $sql = MG_buildMediaSql(array('album_id' => $aid, 'fields' => array('media_type', 'media_filename', 'remote_url', 'media_id', 'media_title', 'media_desc')));
    $result = DB_query($sql);
    while ($A = DB_fetchArray($result)) {
        if ($A['media_type'] != 0) {
            continue;
        }
        $PhotoPath = MG_getFilePath($src, $A['media_filename']);
        $ext = pathinfo($PhotoPath, PATHINFO_EXTENSION);
        $RelativePath = $_MG_CONF['mediaobjects_url'] . "/{$src}/";
        $RelativeTNPath = $_MG_CONF['mediaobjects_url'] . '/tn/';
        $RelativePath .= $A['media_filename'][0] . '/' . $A['media_filename'] . '.' . $ext;
        $RelativeTNPath .= $A['media_filename'][0] . '/' . $A['media_filename'] . '_150x150.' . $ext;
        $imgsize = @getimagesize($PhotoPath);
        if ($imgsize == false) {
            continue;
        }
        $title = '<p><b><font color="#ffffff" size="20">' . strip_tags($A['media_title']) . '</font></b></p>';
        $desc = '<p>' . strip_tags($A['media_desc']) . '</p>';
        $retval .= '<image ' . 'imageURL="' . $RelativePath . '" ' . 'thumbURL="' . $RelativeTNPath . '" ' . 'linkURL="' . $RelativePath . '" linkTarget="" >' . LB;
        $retval .= '<caption><![CDATA[' . $title . $desc . ']]></caption>' . LB;
        $retval .= '</image>' . LB;
    }
    return $retval;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:36,代码来源:simpleviewer.php


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