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


PHP pwg_query函数代码示例

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


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

示例1: execute_sqlfile

/**
 * Loads a SQL file and executes all queries.
 * Before executing a query, $replaced is... replaced by $replacing. This is
 * useful when the SQL file contains generic words. Drop table queries are
 * not executed.
 *
 * @param string $filepath
 * @param string $replaced
 * @param string $replacing
 */
function execute_sqlfile($filepath, $replaced, $replacing, $dblayer)
{
    $sql_lines = file($filepath);
    $query = '';
    foreach ($sql_lines as $sql_line) {
        $sql_line = trim($sql_line);
        if (preg_match('/(^--|^$)/', $sql_line)) {
            continue;
        }
        $query .= ' ' . $sql_line;
        // if we reached the end of query, we execute it and reinitialize the
        // variable "query"
        if (preg_match('/;$/', $sql_line)) {
            $query = trim($query);
            $query = str_replace($replaced, $replacing, $query);
            // we don't execute "DROP TABLE" queries
            if (!preg_match('/^DROP TABLE/i', $query)) {
                if ('mysql' == $dblayer) {
                    if (preg_match('/^(CREATE TABLE .*)[\\s]*;[\\s]*/im', $query, $matches)) {
                        $query = $matches[1] . ' DEFAULT CHARACTER SET utf8' . ';';
                    }
                }
                pwg_query($query);
            }
            $query = '';
        }
    }
}
开发者ID:donseba,项目名称:Piwigo,代码行数:38,代码来源:functions_install.inc.php

示例2: upgrade_250_255

function upgrade_250_255()
{
    global $conf;
    // Add new field in Register_FluxBB ID links table
    $query = 'ALTER TABLE ' . Register_FluxBB_ID_TABLE . ' ADD PwdSynch VARCHAR(3) NULL DEFAULT NULL;';
    pwg_query($query);
}
开发者ID:Eric-Piwigo,项目名称:Register_FluxBB,代码行数:7,代码来源:upgradedb.inc.php

示例3: upgrade65_change_table_to_charset

function upgrade65_change_table_to_charset($table, $field_definitions, $db_charset)
{
    $changes = array();
    foreach ($field_definitions as $row) {
        if (!isset($row['Collation']) or $row['Collation'] == 'NULL') {
            continue;
        }
        $query = $row['Field'] . ' ' . $row['Type'];
        $query .= ' CHARACTER SET ' . $db_charset;
        if (strpos($row['Collation'], '_bin') !== false) {
            $query .= ' BINARY';
        }
        if ($row['Null'] != 'YES') {
            $query .= ' NOT NULL';
            if (isset($row['Default'])) {
                $query .= ' DEFAULT "' . addslashes($row['Default']) . '"';
            }
        } else {
            if (!isset($row['Default'])) {
                $query .= ' DEFAULT NULL';
            } else {
                $query .= ' DEFAULT "' . addslashes($row['Default']) . '"';
            }
        }
        if ($row['Extra'] == 'auto_increment') {
            $query .= ' auto_increment';
        }
        $changes[] = 'MODIFY COLUMN ' . $query;
    }
    if (count($changes)) {
        $query = 'ALTER TABLE `' . $table . '` ' . implode(', ', $changes);
        pwg_query($query);
    }
}
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:34,代码来源:65-database.php

示例4: uninstall

 function uninstall()
 {
     global $conf;
     conf_delete_param('forecast_conf');
     $q = 'DROP VIEW forecast;';
     pwg_query($q);
 }
开发者ID:antodippo,项目名称:piwigo-forecast,代码行数:7,代码来源:maintain.class.php

示例5: vjs_begin_delete_elements

function vjs_begin_delete_elements($ids)
{
    if (count($ids) == 0) {
        return 0;
    }
    $vjs_extensions = array('ogg', 'ogv', 'mp4', 'm4v', 'webm', 'webmv');
    $files_ext = array_merge(array(), $vjs_extensions, array_map('strtoupper', $vjs_extensions));
    // Find details base on ID and if supported video files
    $query = '
SELECT
    id,
    path,
    representative_ext
  FROM ' . IMAGES_TABLE . '
  WHERE id IN (' . implode(',', $ids) . ') AND ' . SQL_VIDEOS . '
;';
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        if (url_is_remote($row['path'])) {
            continue;
        }
        $files = array();
        $files[] = get_element_path($row);
        $ok = true;
        if (!isset($conf['never_delete_originals'])) {
            foreach ($files as $path) {
                // Don't delete the actual video or representative
                // It is done by PWG core
                // Delete any other video source format
                $file_wo_ext = pathinfo($path);
                $file_dir = dirname($path);
                foreach ($files_ext as $file_ext) {
                    $path_ext = $file_dir . "/pwg_representative/" . $file_wo_ext['filename'] . "." . $file_ext;
                    if (is_file($path_ext) and !unlink($path_ext)) {
                        $ok = false;
                        trigger_error('"' . $path_ext . '" cannot be removed', E_USER_WARNING);
                        break;
                    }
                }
                // Delete video thumbnails
                $filematch = $file_dir . "/pwg_representative/" . $file_wo_ext['filename'] . "-th_*";
                $matches = glob($filematch);
                if (is_array($matches)) {
                    foreach ($matches as $filename) {
                        if (is_file($filename) and !unlink($filename)) {
                            $ok = false;
                            trigger_error('"' . $filename . '" cannot be removed', E_USER_WARNING);
                            break;
                        }
                    }
                }
                // End videos thumbnails
            }
            // End for each files
        }
        // End IF
    }
    // End While
}
开发者ID:naryoss,项目名称:piwigo-videojs,代码行数:59,代码来源:admin_boot.php

示例6: uninstall

 function uninstall()
 {
     global $prefixeTable;
     $query = 'ALTER TABLE ' . IMAGES_TABLE . ' DROP pqv_validated;';
     pwg_query($query);
     $query = 'DROP TABLE ' . GROUPS_TABLE . ' DROP pqv_enabled;';
     pwg_query($query);
 }
开发者ID:plegall,项目名称:Piwigo-photo_quick_validation,代码行数:8,代码来源:maintain.class.php

示例7: plugin_uninstall

function plugin_uninstall()
{
    $query = '
    DELETE FROM ' . CONFIG_TABLE . '
    WHERE param=\'eml\'
  ;';
    pwg_query($query);
}
开发者ID:wbbg,项目名称:piwigo-eml,代码行数:8,代码来源:maintain.inc.php

示例8: uninstall

 function uninstall()
 {
     global $prefixeTable;
     pwg_query('DROP TABLE ' . $prefixeTable . 'pshare_keys;');
     pwg_query('DROP TABLE ' . $prefixeTable . 'pshare_log;');
     $query = 'DROP TABLE ' . GROUPS_TABLE . ' DROP pshare_enabled;';
     pwg_query($query);
 }
开发者ID:plegall,项目名称:Piwigo-private_share,代码行数:8,代码来源:maintain.class.php

示例9: plugin_uninstall

function plugin_uninstall()
{
    if (is_dir(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'GThumb')) {
        gtdeltree(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'GThumb');
    }
    $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="GThumb" LIMIT 1;';
    pwg_query($query);
}
开发者ID:lcorbasson,项目名称:Piwigo-GThumb,代码行数:8,代码来源:maintain.inc.php

示例10: plugin_uninstall

function plugin_uninstall()
{
    global $prefixeTable;
    $query = '
    DROP TABLE ' . $prefixeTable . 'stereo
    ;';
    pwg_query($query);
}
开发者ID:ejegg,项目名称:piwigo-stereo,代码行数:8,代码来源:maintain.inc.php

示例11: get_summary

function get_summary($year = null, $month = null, $day = null)
{
    $query = '
SELECT
    year,
    month,
    day,
    hour,
    nb_pages
  FROM ' . HISTORY_SUMMARY_TABLE;
    if (isset($day)) {
        $query .= '
  WHERE year = ' . $year . '
    AND month = ' . $month . '
    AND day = ' . $day . '
    AND hour IS NOT NULL
  ORDER BY
    year ASC,
    month ASC,
    day ASC,
    hour ASC
;';
    } elseif (isset($month)) {
        $query .= '
  WHERE year = ' . $year . '
    AND month = ' . $month . '
    AND day IS NOT NULL
    AND hour IS NULL
  ORDER BY
    year ASC,
    month ASC,
    day ASC
;';
    } elseif (isset($year)) {
        $query .= '
  WHERE year = ' . $year . '
    AND month IS NOT NULL
    AND day IS NULL
  ORDER BY
    year ASC,
    month ASC
;';
    } else {
        $query .= '
  WHERE year IS NOT NULL
    AND month IS NULL
  ORDER BY
    year ASC
;';
    }
    $result = pwg_query($query);
    $output = array();
    while ($row = pwg_db_fetch_assoc($result)) {
        $output[] = $row;
    }
    return $output;
}
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:57,代码来源:stats.php

示例12: plugin_uninstall

function plugin_uninstall()
{
    $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param = "jplayer_skin";';
    pwg_query($q);
    $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param = "jplayer_autoplay";';
    pwg_query($q);
    $q = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param = "jplayer_jplayer_representative_as_poster";';
    pwg_query($q);
    // TODO : Do we need to purge the videos from the images table?
}
开发者ID:achmafooma,项目名称:piwigo-jplayer,代码行数:10,代码来源:maintain.inc.php

示例13: uninstall

 function uninstall()
 {
     global $prefixeTable;
     $query = 'DROP TABLE ' . $prefixeTable . 'pfemail_mailboxes;';
     pwg_query($query);
     $query = 'DROP TABLE ' . $prefixeTable . 'pfemail_pendings;';
     pwg_query($query);
     // delete configuration
     pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param IN ("pfemail_last_check");');
 }
开发者ID:plegall,项目名称:Piwigo-photo_from_email,代码行数:10,代码来源:maintain.class.php

示例14: plugin_uninstall

function plugin_uninstall()
{
    global $conf;
    if (isset($conf['PruneHistory'])) {
        $q = '
DELETE FROM ' . CONFIG_TABLE . '
WHERE param="PruneHistory"
;';
        pwg_query($q);
    }
}
开发者ID:Eric-Piwigo,项目名称:Prune_History,代码行数:11,代码来源:maintain.inc.php

示例15: get_site_url

function get_site_url($category_id)
{
    global $page;
    $query = '
SELECT galleries_url
  FROM ' . SITES_TABLE . ' AS s,' . CATEGORIES_TABLE . ' AS c
  WHERE s.id = c.site_id
    AND c.id = ' . $category_id . '
;';
    $row = pwg_db_fetch_assoc(pwg_query($query));
    return $row['galleries_url'];
}
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:12,代码来源:cat_modify.php


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