• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pwg_query函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: plugin_uninstall

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


示例17: osm_items_have_latlon

function osm_items_have_latlon($items)
{
    $query = '
SELECT id FROM ' . IMAGES_TABLE . '
WHERE latitude IS NOT NULL
  AND id IN (' . implode(',', $items) . ')
ORDER BY NULL
LIMIT 0,1';
    if (pwg_db_num_rows(pwg_query($query)) > 0) {
        return true;
    }
    return false;
}
开发者ID:lcorbasson,项目名称:piwigo-openstreetmap,代码行数:13,代码来源:functions.php


示例18: activate

 function activate($theme_version, &$errors = array())
 {
     global $conf, $prefixeTable;
     if (empty($conf['smartpocket'])) {
         $conf['smartpocket'] = serialize($this->default_conf);
         $query = "\n  INSERT INTO " . CONFIG_TABLE . " (param,value,comment)\n  VALUES ('smartpocket' , '" . pwg_db_real_escape_string($conf['smartpocket']) . "' , 'loop#autohide');";
         pwg_query($query);
     } elseif (count(unserialize($conf['smartpocket'])) != 2) {
         $conff = unserialize($conf['smartpocket']);
         $config = array('loop' => !empty($conff['loop']) ? $conff['loop'] : true, 'autohide' => !empty($conff['autohide']) ? $conff['autohide'] : 5000);
         conf_update_param('smartpocket', pwg_db_real_escape_string(serialize($config)));
         load_conf_from_db();
     }
     $this->installed = true;
 }
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:15,代码来源:maintain.inc.php


示例19: find_available_feed_id

/**
 * search an available feed_id
 *
 * @return string feed identifier
 */
function find_available_feed_id()
{
    while (true) {
        $key = generate_key(50);
        $query = '
SELECT COUNT(*)
  FROM ' . USER_FEED_TABLE . '
  WHERE id = \'' . $key . '\'
;';
        list($count) = pwg_db_fetch_row(pwg_query($query));
        if (0 == $count) {
            return $key;
        }
    }
}
开发者ID:donseba,项目名称:Piwigo,代码行数:20,代码来源:notification.php


示例20: get_oauth_id

function get_oauth_id($user_id)
{
    $query = '
SELECT oauth_id FROM ' . USER_INFOS_TABLE . '
  WHERE user_id = ' . $user_id . '
  AND oauth_id != ""
;';
    $result = pwg_query($query);
    if (!pwg_db_num_rows($result)) {
        return null;
    } else {
        list($oauth_id) = pwg_db_fetch_row($result);
        return $oauth_id;
    }
}
开发者ID:lcorbasson,项目名称:Piwigo-Social-Connect,代码行数:15,代码来源:functions.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP px2mm函数代码示例发布时间:2022-05-15
下一篇:
PHP pwg_db_real_escape_string函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap