Skip to content
Commits on Source (963)
......@@ -8,18 +8,21 @@
deny from all
</Files>
# Deny directory listings:
# Set some options
Options -Indexes
Options FollowSymLinks
# Customized server error messages:
ErrorDocument 400 /error.php
ErrorDocument 402 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
ErrorDocument 404 /index.php
# Set the default handler to index.php:
DirectoryIndex index.php
# Overload PHP variables:
<IfModule mod_php4.c>
# If you are using Apache 2, you have to use <IfModule sapi_apache2.c>
# instead of <IfModule mod_php4.c>.
php_value register_globals 0
php_value track_vars 1
php_value short_open_tag 1
php_value magic_quotes_gpc 0
......@@ -27,17 +30,22 @@ ErrorDocument 500 /error.php
php_value magic_quotes_sybase 0
php_value arg_separator.output "&amp;"
php_value session.cache_expire 200000
php_value session.gc_maxlifetime 200000
php_value session.cookie_lifetime 2000000
php_value session.auto_start 0
php_value session.save_handler user
php_value session.cache_limiter none
php_value allow_call_time_pass_reference Off
php_value allow_call_time_pass_reference On
</IfModule>
# Various rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
# Modify the RewriteBase if you are using Drupal in a subdirectory and the
# rewrite rules are not working properly:
#RewriteBase /drupal
# Rewrite old-style URLS of the form 'node.php?id=x':
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
......
Drupal 4.2.0, xxxx-xx-xx (to be released)
Drupal 4.4.2, 2004-07-04
------------------------
- fixed bugs: no critical bugs were identified.
Drupal 4.4.1, 2004-05-01
------------------------
- fixed bugs: no critical bugs were identified.
Drupal 4.4.0, 2004-04-01
------------------------
- added support for the MetaWeblog API and MovableType extensions.
- added a file API: enables better document management.
- improved the watchdog and search module to log search keys.
- news aggregator:
* added support for conditional GET.
* added OPML feed subscription list.
* added support for <image>, <pubDate>, <dc:date>, <dcterms:created>, <dcterms:issued> and <dcterms:modified>.
- comment module:
* made it possible to disable the "comment viewing controls".
- performance:
* improved module loading when serving cached pages.
* made it possible to automatically disable modules when under heavy load.
* made it possible to automatically disable blocks when under heavy load.
* improved performance and memory footprint of the locale module.
- theme system:
* made all theme functions start with 'theme_'.
* made all theme functions return their output.
* migrated away from using the BaseTheme class.
* added many new theme functions and refactored existing theme functions.
* added avatar support to 'Xtemplate'.
* replaced theme 'UnConeD' by 'Chameleon'.
* replaced theme 'Marvin' by 'Pushbutton'.
- usability:
* added breadcrumb navigation to all pages.
* made it possible to add context-sensitive help to all pages.
* replaced drop-down menus by radio buttons where appropriate.
* removed the 'magic_quotes_gpc = 0' requirement.
* added a 'book navigation' block.
- accessibility:
* made themes degrade gracefully in absence of CSS.
* grouped form elements using '<fieldset>' and '<legend>' tags.
* added '<label>' tags to form elements.
- refactored 404 (file not found) handling to support custom 404 pages.
- documentation:
* added PHPDoc/Doxygen comments.
- improved the filter system to prevent conflicts between filters:
* made it possible to change the order in which filters are applied.
Drupal 4.3.2, 2004-01-01
------------------------
- fixed bugs: no critical bugs were identified.
Drupal 4.3.1, 2003-12-01
------------------------
- fixed bugs: no critical bugs were identified.
Drupal 4.3.0, 2003-11-01
------------------------
- added support for configurable URLs.
- added support for sortable table columns.
- database backend:
* added support for selective database table prefixing.
- performance:
* optimized many SQL queries for speed by converting left joins to inner joins.
- comment module:
* rewrote the comment housekeeping code to be much more efficient and scalable.
* changed the comment module to use the standard pager.
- user module:
* added support for multiple sessions per user.
* added support for anonymous user sessions.
- forum module:
* improved the forum views and the themability thereof.
- book module:
* improved integration of non-book nodes in the book outline.
- usability:
* added support for "mass node operations" to ease repetitive tasks.
* added support for breadcrumb navigation to several modules' user pages.
* integrated the administration pages with the normal user pages.
Drupal 4.2.0, 2003-08-01
------------------------
- added support for clean URLs.
......@@ -10,17 +99,17 @@ Drupal 4.2.0, xxxx-xx-xx (to be released)
* improved the look and feel.
* added context-sensitive help.
- database backend:
* fixed numereous SQL queries to make Drupal ANSI compliant.
* fixed numerous SQL queries to make Drupal ANSI compliant.
* added MSSQL database scheme.
- search module:
* changed the search module to use implicit AND'ing instead of implicit OR'ing.
- node system improvements:
- node system:
* replaced the "post content" permission by more fine-grained permissions.
* improved content submission:
+ improved teasers: teasers are now optional, teaser length can be configured, teaser and body are edited in a single textarea, users will no longer be bother with teasers when the post is too short for a teaser.
+ improved teasers: teasers are now optional, teaser length can be configured, teaser and body are edited in a single textarea, users will no longer be bothered with teasers when the post is too short for one.
+ added the ability to preview both the short and the full version of your posts.
* extended the node API which allows for better integration.
* added default node settings to control the behaviour for promotion, moderation and other options.
* added default node settings to control the behavior for promotion, moderation and other options.
- themes:
* replaced theme "Goofy" by "Xtemplate", a template driven theme.
- removed the 'register_globals = on' requirement.
......@@ -65,11 +154,11 @@ Drupal 4.0.0, 2002-06-15
* speeds up pages for anonymous users and reduces system load.
- added support for external SMTP libraries.
- added an archive extension to the calendar.
- added blogger API support.
- added support for the Blogger API.
- themes:
* cleaned up the theme system.
* moved themes that are not maintained to contributions CVS repository.
- database abstraction:
- database backend:
* changed to PEAR database abstraction layer.
* using ANSI SQL queries to be more portable.
- rewrote the user system:
......@@ -82,11 +171,12 @@ Drupal 4.0.0, 2002-06-15
* blocks can now be enabled and/or be set by the user.
* blocks can be set to only show up on some pages.
* merged box module with block module.
- node system improvements:
- node system:
* fixed node retrieval based on titles.
* blogs can be updated.
* teasers (abstracts) on all node types.
* improved error checking and usability changes.
* improved error checking.
* usability improvements.
* content versioning support.
- improved book module to support text, HTML and PHP pages.
- improved comment module to mark new comments.
......@@ -125,9 +215,9 @@ Drupal 3.0.0, 2001-09-15
- rewrote headline code and renamed it to import.module and export.module:
* added various improvements, including a better parser, bundles and better control over individual feeds.
- rewrote section code and renamed it to meta.module:
* supports unlimeted amount of nested topics. Topics can be nested to create a multi-level hierarchy.
* supports unlimited amount of nested topics. Topics can be nested to create a multi-level hierarchy.
- rewrote configuration file resolving:
* Drupal tries to locate a configuration file that matches your domainname or uses conf.php if the former failed. Note also that the configuration files got renamed from .conf to .php for security's sake on mal-configured Drupal sites.
* Drupal tries to locate a configuration file that matches your domain name or uses conf.php if the former failed. Note also that the configuration files got renamed from .conf to .php for security's sake on mal-configured Drupal sites.
- added caching support which makes Drupal extremely scalable.
- added access.module:
* allows you to setup 'roles' (groups) and to bind a set of permissions to each group.
......
......@@ -3,11 +3,11 @@
REQUIREMENTS
------------
Drupal requires a webserver, PHP4 (http://www.php.net/) and a database
server supported by the PHP PEAR API (pear.php.net)
Drupal requires a web server, PHP4 (http://www.php.net/) and MySQL or a
database server supported by the PHP PEAR API (http://pear.php.net/)
NOTE: The Apache webserver and MySQL database are strongly recommended;
other webserver and database combinations such as IIS and PostgreSQL
NOTE: The Apache web server and MySQL database are strongly recommended;
other web server and database combinations such as IIS and PostgreSQL
are possible but tested to a lesser extend.
SERVER CONFIGURATION
......@@ -15,7 +15,6 @@ SERVER CONFIGURATION
Your PHP must have the following settings:
magic_quotes_gpc 0
session.save_handler user
In addition, we recommend the following settings:
......@@ -42,7 +41,7 @@ INSTALLATION
1. DOWNLOAD DRUPAL
You can obtain the latest Drupal release from http://www.drupal.org/.
You can obtain the latest Drupal release from http://drupal.org/.
Download the current tar.gz format and extract the files:
$ wget http://drupal.org/drupal/drupal-x.x.x.tgz
......@@ -50,7 +49,7 @@ INSTALLATION
This will create a new directory drupal-x.x.x/ containing all
Drupal files and directories. Move the contents of that directory
into a directory within your webserver's document root or your
into a directory within your web server's document root or your
public HTML directory:
$ mv drupal-x.x.x /var/www/html
......@@ -60,26 +59,33 @@ INSTALLATION
2. CREATE THE DRUPAL DATABASE
These instructions are for MySQL. If you are using another database,
check the database documentation. In the following examples,
"dba_user" is an example MySQL user which has the CREATE and GRANT
privileges. You will need to use the appropriate user name for your
system.
First, you must create a new database for your Drupal site:
$ mysqladmin -u root -p create dupal
$ mysqladmin -u dba_user -p create drupal
MySQL will prompt for the root database password and then create
MySQL will prompt for the dba_user database password and then create
the initial database files. Next you must login and set the access
database rights:
$ mysql -u root -p
$ mysql -u dba_user -p
Again, you will be asked for the root database password. At the
Again, you will be asked for the dba_user database password. At the
MySQL prompt, enter following command:
GRANT ALL PRIVILEGES ON drupal.*
TO nobody@localhost IDENTIFIED BY 'PASSWORD';
TO nobody@localhost IDENTIFIED BY 'password';
where
'drupal' is the name of your database
'nobody@localhost' is the userid of your webserver MySQL account.
'nobody@localhost' is the userid of your webserver MySQL account
'password' is the password required to log in as the MySQL user
If successful, MySQL will reply with
......@@ -95,7 +101,7 @@ INSTALLATION
Once you have a database, you must load the required tables:
$ mysql -u nobody -p drupal < database/database.mysql
$ mysql -u nobody -p drupal < database/database.mysql
4. CONNECTING DRUPAL
......@@ -104,18 +110,19 @@ INSTALLATION
Drupal allows for multiple virtual host installations; to configure
a virtual server host, you can create the configuration file
includes/www.yourserver.com.php
includes/www.example.com.php
where www.yourserver.com is your website's URL.
where www.example.com is your website's URL.
Before you can run Drupal, you must set the database URL option.
Copy conf.php to hostname.php and edit the $db_url line to match
the database defined in the previous steps:
Before you can run Drupal, you must set the database URL and the
base URL to the web site. Open the configuration file and edit the
$db_url line to match the database defined in the previous steps:
$db_url = "mysql://username:password@localhost/drupal";
Also set your site's $base_url as explained in the configuration
file.
Set $base_url to match the address to your web site:
$base_url = "http://www.example.com";
NOTE: for more information about multiple virtual hosts or the
configuration settings, consult the Drupal handbook at drupal.org.
......@@ -129,7 +136,7 @@ INSTALLATION
6. CRON TASKS
Many drupal modules have periodic tasks that must be triggered by a
Many Drupal modules have periodic tasks that must be triggered by a
cron job. To activate these tasks, you must call the cron page;
this will pass control to the modules and the modules will decide
if and what they must do.
......@@ -137,7 +144,7 @@ INSTALLATION
The following example crontab line will activate the cron script
on the hour:
0 * * * * wget -O /dev/null http://HOSTNAME/cron.php
0 * * * * wget -O - -q http://HOSTNAME/cron.php
More information about the cron scripts are available in the admin
help pages and in the Drupal handbook at drupal.org. Example
......@@ -146,12 +153,22 @@ INSTALLATION
DRUPAL ADMINISTRATION
---------------------
Your Drupal website defaults to a very basic configuration with only
a few active modules, one theme, and no user access rights.
Upon a new installation, your Drupal website defaults to a very basic
configuration with only a few active modules, one theme, and no user
access rights.
Standard services can be selected and configured through the
administration panel; additional community-contributed modules and
themes are available from drupal.org.
Use your administration panel to enable and configure services. For
example, set some general settings for your site with "Administration -
configuration". Enable modules via "Administration - configuration -
modules". User permissions can be set with "Administration - accounts
- permissions".
For more information on configuration options, read through the
instructions which accompany the different configuration settings and
consult the various help pages available in the administration panel.
Note that additional community-contributed modules and themes are
available at http://drupal.org/.
CUSTOMIZING YOUR THEME(S)
-------------------------
......@@ -160,19 +177,34 @@ Now that your server is running, you will want to customize the look
of your site. Several sample themes are included in the Drupal
installation and more can be downloaded from drupal.org.
Customizing each theme depends on the theme. In general, each theme
Customizing each theme depends on the theme. In general, each theme
contains a PHP file themename.theme which defines a function header()
that can be changed to reference your own logos.
Most themes also contain stylesheets or PHP configuration files to
tune the colours and layouts; check the themes/ directory for README
tune the colors and layouts; check the themes/ directory for README
files describing each alternate theme.
UPGRADING
---------
1. Backup your database and Drupal directory - especially your
configuration file (www.example.com.conf or includes/conf.php).
2. Log on as the user with user ID 1.
3. Overwrite all the old Drupal files with the new Drupal files.
4. Modify the new configuration file to make sure it has the
correct information.
5. Run update.php by visiting http://www.example.com/update.php.
MORE INFORMATION
----------------
For platform specific configuration issues and other installation and
administration assistance, please consult the Drupal handbook at
http://www.drupal.org/. You can also find support at the Drupal
support forum or through the Drupal mailing lists.
http://drupal.org/. You can also find support at the Drupal support
forum or through the Drupal mailing lists.
......@@ -16,12 +16,8 @@ LEGEND
--------------------------------------------------------------------------------
BLOCK SYSTEM
M: Kjartan Mannes <kjartan@drop.org>
S: maintained
BLOGGER API MODULE
M: Greg Tyrelle <greg@nodalpoint.org>
BLOG API
M:James Walker <walkah@walkah.net>
S: maintained
CODING STYLE CHECKER
......@@ -32,44 +28,24 @@ DISTRIBUTED AUTHENTICATION MODULES
M: Moshe Weitzman <weitzman@tejasa.com>
S: maintained
FORUM MODULE
M: Marco Molinari <marco@porciletto.org>
S: maintained
POLL MODULE
M: Steven Wittens <unconed@drop.org>
S: maintained
MSSQL PORT
M: Moshe Weitzman <weitzman@tejasa.com>
LOCALE MODULE
M: Gabor Hojtsy <goba@php.net>
S: maintained
POSTGRES PORT
M: James Arthur <j_a_arthur@yahoo.com>
S: maintained
SEARCH MODULE
M: Simon Lindsay <simon@iseek.ws>
M: Adrian Rossouw <adrian@obsidian.co.za>
S: maintained
STATISTICS MODULE
M: Jeremy Andrews <jeremy@kerneltrap.com>
S: maintained
TAXONOMY SYSTEM
M: Marco Molinari <marco@porciletto.org>
S: maintained
THEME GOOFY, THEME UNCONED
M: Steven Wittens <unconed@drop.org>
S: maintained
USER SYSTEM
M: Moshe Weitzman <weitzman@tejasa.com>
S: maintained
DEBIAN PACKAGE
M: Hugo Espuny <hec@debian.org>
M: Hilko Bengen <bengen@debian.org>
S: maintained
THE REST:
......
<?php
// $Id$
include_once "includes/bootstrap.inc";
include_once "includes/common.inc";
/*
** If not in 'safe mode', increase the maximum execution time:
*/
if (!get_cfg_var("safe_mode")) {
if (!ini_get("safe_mode")) {
set_time_limit(240);
}
......@@ -15,9 +16,7 @@
** Iterate through the modules calling their cron handlers (if any):
*/
foreach (module_list() as $module) {
module_invoke($module, "cron");
}
module_invoke_all("cron");
watchdog("message", "cron run completed");
watchdog("regular", "cron run completed");
?>
CREATE TABLE [dbo].[access] (
[aid] [smallint] NULL ,
[mask] [varchar] (255) NOT NULL ,
[type] [varchar] (255) NOT NULL ,
[status] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[accesslog] (
[nid] [numeric](11, 0) NULL ,
[url] [varchar] (255) NULL ,
[hostname] [varchar] (128) NULL ,
[uid] [numeric](10, 0) NULL ,
[timestamp] [numeric](11, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[authmap] (
[aid] [numeric](10, 0) NULL ,
[uid] [int] NOT NULL ,
[authname] [varchar] (128) NOT NULL ,
[module] [varchar] (128) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[blocks] (
[module] [varchar] (64) NOT NULL ,
[delta] [varchar] (32) NOT NULL ,
[status] [smallint] NOT NULL ,
[weight] [smallint] NOT NULL ,
[region] [smallint] NOT NULL ,
[path] [varchar] (255) NOT NULL ,
[custom] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[book] (
[nid] [numeric](4, 0) NOT NULL ,
[parent] [int] NOT NULL ,
[weight] [smallint] NOT NULL ,
[format] [smallint] NULL ,
[log] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[boxes] (
[bid] [smallint] NULL ,
[title] [varchar] (64) NOT NULL ,
[body] [text] NULL ,
[info] [varchar] (128) NOT NULL ,
[type] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[bundle] (
[bid] [int] NULL ,
[title] [varchar] (255) NOT NULL ,
[attributes] [varchar] (255) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[cache] (
[cid] [varchar] (255) NOT NULL ,
[data] [text] NULL ,
[expire] [int] NOT NULL ,
[created] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[comments] (
[cid] [int] NULL ,
[pid] [int] NOT NULL ,
[nid] [int] NOT NULL ,
[uid] [int] NOT NULL ,
[subject] [varchar] (64) NOT NULL ,
[comment] [varchar] (8000) NOT NULL ,
[hostname] [varchar] (128) NOT NULL ,
[timestamp] [int] NOT NULL ,
[link] [varchar] (16) NULL ,
[score] [int] NOT NULL ,
[status] [tinyint] NOT NULL ,
[users] [varchar] (8000) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[directory] (
[link] [varchar] (255) NOT NULL ,
[name] [varchar] (128) NOT NULL ,
[mail] [varchar] (128) NOT NULL ,
[slogan] [text] NOT NULL ,
[mission] [text] NOT NULL ,
[timestamp] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[feed] (
[fid] [int] NULL ,
[title] [varchar] (255) NOT NULL ,
[url] [varchar] (255) NOT NULL ,
[refresh] [int] NOT NULL ,
[timestamp] [int] NULL ,
[attributes] [varchar] (255) NULL ,
[link] [varchar] (255) NULL ,
[description] [varchar] (8000) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[forum] (
[nid] [numeric](10, 0) NOT NULL ,
[tid] [numeric](10, 0) NOT NULL ,
[icon] [varchar] (255) NOT NULL ,
[shadow] [numeric](10, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[history] (
[uid] [int] NOT NULL ,
[nid] [int] NOT NULL ,
[timestamp] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[item] (
[iid] [int] NULL ,
[fid] [int] NOT NULL ,
[title] [varchar] (255) NOT NULL ,
[link] [varchar] (255) NOT NULL ,
[author] [varchar] (255) NOT NULL ,
[description] [text] NOT NULL ,
[timestamp] [int] NULL ,
[attributes] [varchar] (255) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[locales] (
[lid] [int] NULL ,
[location] [varchar] (128) NOT NULL ,
[string] [nvarchar] (4000) NOT NULL ,
[da] [text] NULL ,
[fi] [text] NULL ,
[fr] [text] NULL ,
[en] [text] NULL ,
[es] [text] NULL ,
[nl] [text] NULL ,
[no] [text] NULL ,
[sw] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[menu] (
[name] [varchar] (255) NOT NULL ,
[link] [varchar] (255) NOT NULL ,
[help] [text] NULL ,
[title] [varchar] (255) NOT NULL ,
[parent] [varchar] (255) NOT NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[moderation_filters] (
[fid] [numeric](10, 0) NULL ,
[filter] [varchar] (255) NOT NULL ,
[minimum] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[moderation_roles] (
[rid] [numeric](4, 0) NOT NULL ,
[mid] [numeric](4, 0) NOT NULL ,
[value] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[moderation_votes] (
[mid] [numeric](10, 0) NULL ,
[vote] [varchar] (255) NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[node] (
[nid] [numeric](10, 0) NULL ,
[type] [varchar] (16) NOT NULL ,
[title] [varchar] (128) NOT NULL ,
[score] [int] NOT NULL ,
[votes] [int] NOT NULL ,
[uid] [int] NOT NULL ,
[status] [int] NOT NULL ,
[created] [int] NOT NULL ,
[comment] [int] NOT NULL ,
[promote] [int] NOT NULL ,
[moderate] [int] NOT NULL ,
[users] [text] NULL ,
[attributes] [varchar] (255) NULL ,
[teaser] [text] NOT NULL ,
[body] [text] NOT NULL ,
[changed] [int] NOT NULL ,
[revisions] [text] NULL ,
[static] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[page] (
[nid] [numeric](10, 0) NOT NULL ,
[link] [varchar] (128) NOT NULL ,
[format] [smallint] NOT NULL ,
[description] [varchar] (128) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[permission] (
[rid] [numeric](4, 0) NOT NULL ,
[perm] [text] NULL ,
[tid] [numeric](4, 0) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[poll] (
[nid] [numeric](4, 0) NOT NULL ,
[runtime] [int] NOT NULL ,
[voters] [text] NOT NULL ,
[active] [numeric](4, 0) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[poll_choices] (
[chid] [numeric](10, 0) NULL ,
[nid] [numeric](10, 0) NOT NULL ,
[chtext] [varchar] (128) NOT NULL ,
[chvotes] [int] NOT NULL ,
[chorder] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[role] (
[rid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
[name] [varchar] (32) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[search_index] (
[word] [varchar] (50) NOT NULL ,
[lno] [numeric](10, 0) NOT NULL ,
[type] [varchar] (16) NULL ,
[count] [numeric](10, 0) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[sequences] (
[name] [varchar] (255) NOT NULL ,
[id] [numeric](10, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[site] (
[sid] [numeric](10, 0) NULL ,
[name] [varchar] (128) NOT NULL ,
[link] [varchar] (255) NOT NULL ,
[size] [text] NOT NULL ,
[changed] [int] NOT NULL ,
[checked] [int] NOT NULL ,
[feed] [varchar] (255) NOT NULL ,
[refresh] [int] NOT NULL ,
[threshold] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[statistics] (
[nid] [int] NOT NULL ,
[totalcount] [numeric](20, 0) NOT NULL ,
[daycount] [numeric](4, 0) NOT NULL ,
[timestamp] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[system] (
[filename] [varchar] (255) NOT NULL ,
[name] [varchar] (255) NOT NULL ,
[type] [varchar] (255) NOT NULL ,
[description] [varchar] (255) NOT NULL ,
[status] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_data] (
[tid] [numeric](10, 0) NOT NULL ,
[vid] [numeric](10, 0) NOT NULL ,
[name] [varchar] (255) NOT NULL ,
[description] [text] NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_hierarchy] (
[tid] [numeric](4, 0) NOT NULL ,
[parent] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_node] (
[nid] [numeric](4, 0) NOT NULL ,
[tid] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_relation] (
[tid1] [numeric](4, 0) NOT NULL ,
[tid2] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_synonym] (
[tid] [numeric](10, 0) NOT NULL ,
[name] [varchar] (255) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[users] (
[uid] [bigint] IDENTITY (1, 1) NOT NULL ,
[name] [varchar] (60) NOT NULL ,
[pass] [varchar] (32) NOT NULL ,
[mail] [varchar] (64) NULL ,
[homepage] [varchar] (128) NULL ,
[mode] [smallint] NOT NULL ,
[sort] [smallint] NULL ,
[threshold] [smallint] NULL ,
[theme] [varchar] (255) NULL ,
[signature] [varchar] (255) NULL ,
[timestamp] [float] NOT NULL ,
[hostname] [varchar] (128) NULL ,
[status] [smallint] NOT NULL ,
[timezone] [varchar] (8) NULL ,
[rating] [float] NULL ,
[language] [char] (2) NULL ,
[sid] [varchar] (128) NULL ,
[init] [varchar] (128) NULL ,
[session] [text] NULL ,
[data] [varchar] (8000) NULL ,
[rid] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[variable] (
[name] [varchar] (32) NOT NULL ,
[value] [varchar] (8000) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[vocabulary] (
[vid] [numeric](10, 0) NULL ,
[name] [varchar] (255) NOT NULL ,
[description] [text] NULL ,
[relations] [tinyint] NOT NULL ,
[hierarchy] [tinyint] NOT NULL ,
[multiple] [tinyint] NOT NULL ,
[required] [tinyint] NOT NULL ,
[types] [text] NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[watchdog] (
[wid] [int] IDENTITY (1, 1) NOT NULL ,
[uid] [int] NOT NULL ,
[type] [varchar] (16) NOT NULL ,
[message] [text] NOT NULL ,
[link] [varchar] (255) NOT NULL ,
[location] [varchar] (128) NOT NULL ,
[hostname] [varchar] (128) NOT NULL ,
[timestamp] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[role] WITH NOCHECK ADD
CONSTRAINT [PK_role] PRIMARY KEY CLUSTERED
(
[rid]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[watchdog] WITH NOCHECK ADD
PRIMARY KEY CLUSTERED
(
[wid]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[cache] WITH NOCHECK ADD
CONSTRAINT [DF_cache_created] DEFAULT (0) FOR [created]
GO
CREATE INDEX [forum_tid_idx] ON [dbo].[forum]([tid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[node] WITH NOCHECK ADD
CONSTRAINT [DF_node_score] DEFAULT (0) FOR [score],
CONSTRAINT [DF_node_votes] DEFAULT (0) FOR [votes],
CONSTRAINT [DF_node_uid] DEFAULT (0) FOR [uid],
CONSTRAINT [DF_node_status] DEFAULT (1) FOR [status],
CONSTRAINT [DF_node_created] DEFAULT (0) FOR [created],
CONSTRAINT [DF_node_comment] DEFAULT (2) FOR [comment],
CONSTRAINT [DF_node_promote] DEFAULT (0) FOR [promote],
CONSTRAINT [DF_node_moderate] DEFAULT (0) FOR [moderate],
CONSTRAINT [DF_node_changed] DEFAULT (0) FOR [changed],
CONSTRAINT [DF_node_static] DEFAULT (0) FOR [static]
GO
CREATE INDEX [IX_role] ON [dbo].[role]([rid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[term_data] WITH NOCHECK ADD
CONSTRAINT [DF_term_data_vid] DEFAULT (0) FOR [vid]
GO
ALTER TABLE [dbo].[users] WITH NOCHECK ADD
CONSTRAINT [DF_users_mode] DEFAULT (0) FOR [mode],
CONSTRAINT [DF_users_sort] DEFAULT (0) FOR [sort],
CONSTRAINT [DF_users_threshold] DEFAULT (0) FOR [threshold]
GO
CREATE INDEX [IX_sid] ON [dbo].[users]([sid]) ON [PRIMARY]
GO
CREATE INDEX [IX_users] ON [dbo].[users]([uid]) ON [PRIMARY]
GO
CREATE INDEX [IX_timestamp] ON [dbo].[users]([timestamp]) ON [PRIMARY]
GO
CREATE INDEX [users_sid_idx] ON [dbo].[users]([sid]) ON [PRIMARY]
GO
CREATE INDEX [users_timestamp_idx] ON [dbo].[users]([timestamp]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[watchdog] WITH NOCHECK ADD
CONSTRAINT [DF__watchdog__uid__41EDCAC5] DEFAULT ('0') FOR [uid],
CONSTRAINT [DF__watchdog__type__42E1EEFE] DEFAULT ('') FOR [type],
CONSTRAINT [DF__watchdog__messag__43D61337] DEFAULT ('') FOR [message],
CONSTRAINT [DF__watchdog__link__44CA3770] DEFAULT ('') FOR [link],
CONSTRAINT [DF__watchdog__locati__45BE5BA9] DEFAULT ('') FOR [location],
CONSTRAINT [DF__watchdog__hostna__46B27FE2] DEFAULT ('') FOR [hostname],
CONSTRAINT [DF__watchdog__timest__47A6A41B] DEFAULT ('0') FOR [timestamp]
GO
--
-- Insert some default values
--
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1);
INSERT INTO system VALUES ('modules/block.module','block','module','',1);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1);
INSERT INTO system VALUES ('modules/help.module','help','module','',1);
INSERT INTO system VALUES ('modules/node.module','node','module','',1);
INSERT INTO system VALUES ('modules/page.module','page','module','',1);
INSERT INTO system VALUES ('modules/story.module','story','module','',1);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1);
INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2002-05-15";');
INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";');
INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1');
INSERT INTO blocks(module,delta,status) VALUES('user', '1', '1');
---
--- Functions. Functions first available in SQL Server 2000. GREATEST() used by forum.module, tracker.module at the moment.
---
CREATE FUNCTION GREATEST (@a int, @b int)
RETURNS int AS
BEGIN
IF (@a > @b)
BEGIN
RETURN @a;
END
RETURN @b;
END
......@@ -25,7 +25,8 @@ CREATE TABLE accesslog (
url varchar(255) default NULL,
hostname varchar(128) default NULL,
uid int(10) unsigned default '0',
timestamp int(11) unsigned NOT NULL default '0'
timestamp int(11) unsigned NOT NULL default '0',
KEY accesslog_timestamp (timestamp)
) TYPE=MyISAM;
--
......@@ -52,7 +53,8 @@ CREATE TABLE blocks (
weight tinyint(1) DEFAULT '0' NOT NULL,
region tinyint(1) DEFAULT '0' NOT NULL,
path varchar(255) DEFAULT '' NOT NULL,
custom tinyint(2) DEFAULT '0' NOT NULL
custom tinyint(2) DEFAULT '0' NOT NULL,
throttle tinyint(1) DEFAULT '0' NOT NULL
) TYPE=MyISAM;
--
......@@ -64,9 +66,8 @@ CREATE TABLE book (
parent int(10) NOT NULL default '0',
weight tinyint(3) NOT NULL default '0',
format tinyint(2) default '0',
log text,
log longtext,
PRIMARY KEY (nid),
KEY nid (nid),
KEY parent (parent)
) TYPE=MyISAM;
......@@ -77,7 +78,7 @@ CREATE TABLE book (
CREATE TABLE boxes (
bid tinyint(4) NOT NULL auto_increment,
title varchar(64) NOT NULL default '',
body text,
body longtext,
info varchar(128) NOT NULL default '',
type tinyint(2) NOT NULL default '0',
PRIMARY KEY (bid),
......@@ -103,9 +104,10 @@ CREATE TABLE bundle (
CREATE TABLE cache (
cid varchar(255) NOT NULL default '',
data mediumtext,
data longtext,
expire int(11) NOT NULL default '0',
created int(11) NOT NULL default '0',
headers text,
PRIMARY KEY (cid)
) TYPE=MyISAM;
......@@ -119,13 +121,13 @@ CREATE TABLE comments (
nid int(10) NOT NULL default '0',
uid int(10) NOT NULL default '0',
subject varchar(64) NOT NULL default '',
comment text NOT NULL,
comment longtext NOT NULL,
hostname varchar(128) NOT NULL default '',
timestamp int(11) NOT NULL default '0',
link varchar(16) NOT NULL default '',
score mediumint(9) NOT NULL default '0',
status tinyint(3) unsigned NOT NULL default '0',
users mediumtext,
thread varchar(255) NOT NULL,
users longtext,
PRIMARY KEY (cid),
KEY lid (nid)
) TYPE=MyISAM;
......@@ -138,8 +140,8 @@ CREATE TABLE directory (
link varchar(255) NOT NULL default '',
name varchar(128) NOT NULL default '',
mail varchar(128) NOT NULL default '',
slogan text NOT NULL,
mission text NOT NULL,
slogan longtext NOT NULL,
mission longtext NOT NULL,
timestamp int(11) NOT NULL default '0',
PRIMARY KEY (link)
) TYPE=MyISAM;
......@@ -153,15 +155,28 @@ CREATE TABLE feed (
title varchar(255) NOT NULL default '',
url varchar(255) NOT NULL default '',
refresh int(10) NOT NULL default '0',
timestamp int(10) NOT NULL default '0',
checked int(10) NOT NULL default '0',
attributes varchar(255) NOT NULL default '',
link varchar(255) NOT NULL default '',
description text NOT NULL,
description longtext NOT NULL,
image longtext NOT NULL default '',
etag varchar(255) NOT NULL default '',
modified int(10) NOT NULL default '0',
PRIMARY KEY (fid),
UNIQUE KEY link (url),
UNIQUE KEY title (title)
) TYPE=MyISAM;
--
-- Table structure for table 'filters'
--
CREATE TABLE filters (
module varchar(64) NOT NULL default '',
weight tinyint(2) DEFAULT '0' NOT NULL,
KEY weight (weight)
) TYPE=MyISAM;
--
-- Table structure for table 'forum'
--
......@@ -169,9 +184,9 @@ CREATE TABLE feed (
CREATE TABLE forum (
nid int(10) unsigned NOT NULL default '0',
tid int(10) unsigned NOT NULL default '0',
icon varchar(255) NOT NULL default '',
shadow int(10) unsigned NOT NULL default '0',
PRIMARY KEY (nid)
PRIMARY KEY (nid),
KEY tid (tid)
) TYPE=MyISAM;
--
......@@ -195,7 +210,7 @@ CREATE TABLE item (
title varchar(255) NOT NULL default '',
link varchar(255) NOT NULL default '',
author varchar(255) NOT NULL default '',
description text NOT NULL,
description longtext NOT NULL,
timestamp int(11) default NULL,
attributes varchar(255) NOT NULL default '',
PRIMARY KEY (iid)
......@@ -270,19 +285,19 @@ CREATE TABLE node (
comment int(2) NOT NULL default '0',
promote int(2) NOT NULL default '0',
moderate int(2) NOT NULL default '0',
users text NOT NULL,
attributes varchar(255) NOT NULL default '',
teaser text NOT NULL,
body text NOT NULL,
users longtext NOT NULL,
teaser longtext NOT NULL,
body longtext NOT NULL,
changed int(11) NOT NULL default '0',
revisions text NOT NULL,
revisions longtext NOT NULL,
static int(2) NOT NULL default '0',
PRIMARY KEY (nid),
KEY type (type),
KEY title (title,type),
KEY promote (promote),
KEY node_type (type(4)),
KEY node_title_type (title,type(4)),
KEY status (status),
KEY uid (uid)
KEY uid (uid),
KEY node_moderate (moderate),
KEY node_promote_status (promote, status)
) TYPE=MyISAM;
--
......@@ -294,8 +309,20 @@ CREATE TABLE page (
link varchar(128) NOT NULL default '',
format tinyint(2) NOT NULL default '0',
description varchar(128) NOT NULL default '',
PRIMARY KEY (nid),
KEY nid (nid)
PRIMARY KEY (nid)
) TYPE=MyISAM;
--
-- Table structure for table 'url_alias'
--
CREATE TABLE url_alias (
pid int(10) unsigned NOT NULL auto_increment,
src varchar(128) NOT NULL default '',
dst varchar(128) NOT NULL default '',
PRIMARY KEY (pid),
UNIQUE KEY dst (dst),
UNIQUE KEY src (src)
) TYPE=MyISAM;
--
......@@ -304,7 +331,7 @@ CREATE TABLE page (
CREATE TABLE permission (
rid int(10) unsigned NOT NULL default '0',
perm text,
perm longtext,
tid int(10) unsigned NOT NULL default '0',
KEY rid (rid)
) TYPE=MyISAM;
......@@ -316,7 +343,7 @@ CREATE TABLE permission (
CREATE TABLE poll (
nid int(10) unsigned NOT NULL default '0',
runtime int(10) NOT NULL default '0',
voters text NOT NULL,
voters longtext NOT NULL,
active int(2) unsigned NOT NULL default '0',
PRIMARY KEY (nid)
) TYPE=MyISAM;
......@@ -360,39 +387,36 @@ CREATE TABLE search_index (
) TYPE=MyISAM;
--
-- Table structure for table 'sequences'
-- Table structure for table 'sessions'
--
CREATE TABLE sequences (
name varchar(255) NOT NULL default '',
id int(10) unsigned NOT NULL default '0',
PRIMARY KEY (name)
CREATE TABLE sessions (
uid int(10) unsigned NOT NULL,
sid varchar(32) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp int(11) NOT NULL default '0',
session longtext,
KEY uid (uid),
KEY sid (sid(4)),
KEY timestamp (timestamp)
) TYPE=MyISAM;
--
-- Table structure for table 'site'
-- Table structure for table 'sequences'
--
CREATE TABLE site (
sid int(10) unsigned NOT NULL auto_increment,
name varchar(128) NOT NULL default '',
link varchar(255) NOT NULL default '',
size text NOT NULL,
changed int(11) NOT NULL default '0',
checked int(11) NOT NULL default '0',
feed varchar(255) NOT NULL default '',
refresh int(11) NOT NULL default '0',
threshold int(11) NOT NULL default '0',
PRIMARY KEY (sid),
UNIQUE KEY url (link),
UNIQUE KEY title (name)
CREATE TABLE sequences (
name varchar(255) NOT NULL default '',
id int(10) unsigned NOT NULL default '0',
PRIMARY KEY (name)
) TYPE=MyISAM;
--
-- Table structure for table 'statistics'
-- Table structure for table 'node_counter'
--
CREATE TABLE statistics (
CREATE TABLE node_counter (
nid int(11) NOT NULL default '0',
totalcount bigint(20) unsigned NOT NULL default '0',
daycount mediumint(8) unsigned NOT NULL default '0',
......@@ -413,6 +437,8 @@ CREATE TABLE system (
type varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
status int(2) NOT NULL default '0',
throttle tinyint(1) DEFAULT '0' NOT NULL,
bootstrap int(2) NOT NULL default '0',
PRIMARY KEY (filename)
) TYPE=MyISAM;
......@@ -424,7 +450,7 @@ CREATE TABLE term_data (
tid int(10) unsigned NOT NULL auto_increment,
vid int(10) unsigned NOT NULL default '0',
name varchar(255) NOT NULL default '',
description text,
description longtext,
weight tinyint(4) NOT NULL default '0',
PRIMARY KEY (tid),
KEY vid (vid)
......@@ -479,30 +505,24 @@ CREATE TABLE term_synonym (
--
CREATE TABLE users (
uid int(10) unsigned NOT NULL auto_increment,
uid int(10) unsigned NOT NULL default '0',
name varchar(60) NOT NULL default '',
pass varchar(32) NOT NULL default '',
mail varchar(64) default '',
homepage varchar(128) NOT NULL default '',
mode tinyint(1) NOT NULL default '0',
sort tinyint(1) default '0',
threshold tinyint(1) default '0',
theme varchar(255) NOT NULL default '',
signature varchar(255) NOT NULL default '',
timestamp int(11) NOT NULL default '0',
hostname varchar(128) NOT NULL default '',
status tinyint(4) NOT NULL default '0',
timezone varchar(8) default NULL,
rating decimal(8,2) default NULL,
language char(2) NOT NULL default '',
sid varchar(32) NOT NULL default '',
init varchar(64) default '',
session text,
data text,
data longtext,
rid int(10) unsigned NOT NULL default '0',
PRIMARY KEY (uid),
UNIQUE KEY name (name),
KEY sid (sid(4)),
KEY timestamp (timestamp)
) TYPE=MyISAM;
......@@ -511,8 +531,8 @@ CREATE TABLE users (
--
CREATE TABLE variable (
name varchar(32) NOT NULL default '',
value text NOT NULL,
name varchar(48) NOT NULL default '',
value longtext NOT NULL,
PRIMARY KEY (name)
) TYPE=MyISAM;
......@@ -523,12 +543,12 @@ CREATE TABLE variable (
CREATE TABLE vocabulary (
vid int(10) unsigned NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
description text,
description longtext,
relations tinyint(3) unsigned NOT NULL default '0',
hierarchy tinyint(3) unsigned NOT NULL default '0',
multiple tinyint(3) unsigned NOT NULL default '0',
required tinyint(3) unsigned NOT NULL default '0',
types text,
nodes longtext,
weight tinyint(4) NOT NULL default '0',
PRIMARY KEY (vid)
) TYPE=MyISAM;
......@@ -541,7 +561,7 @@ CREATE TABLE watchdog (
wid int(5) NOT NULL auto_increment,
uid int(10) NOT NULL default '0',
type varchar(16) NOT NULL default '',
message text NOT NULL,
message longtext NOT NULL,
link varchar(255) NOT NULL default '',
location varchar(128) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
......@@ -553,18 +573,25 @@ CREATE TABLE watchdog (
-- Insert some default values
--
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1);
INSERT INTO system VALUES ('modules/block.module','block','module','',1);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1);
INSERT INTO system VALUES ('modules/help.module','help','module','',1);
INSERT INTO system VALUES ('modules/node.module','node','module','',1);
INSERT INTO system VALUES ('modules/page.module','page','module','',1);
INSERT INTO system VALUES ('modules/story.module','story','module','',1);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1);
INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1,0,0);
INSERT INTO system VALUES ('modules/block.module','block','module','',1,0,0);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1,0,0);
INSERT INTO system VALUES ('modules/help.module','help','module','',1,0,0);
INSERT INTO system VALUES ('modules/node.module','node','module','',1,0,0);
INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0);
INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0);
INSERT INTO system VALUES ('themes/xtemplate/xtemplate.theme','xtemplate','theme','Internet explorer, Netscape, Opera',1,0,0);
INSERT INTO users (uid, name, mail, rid) VALUES ('0', '', '', '1');
INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
INSERT INTO permission VALUES (1,'access content',0);
INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
REPLACE variable SET name='update_start', value='s:10:"2003-04-19;"';
REPLACE variable SET name='theme_default', value='s:6:"marvin";';
REPLACE variable SET name='update_start', value='s:10:"2004-02-21;"';
REPLACE variable SET name='theme_default', value='s:9:"xtemplate";';
REPLACE blocks SET module = 'user', delta = '0', status = '1';
REPLACE blocks SET module = 'user', delta = '1', status = '1';
......
......@@ -25,6 +25,7 @@ CREATE TABLE accesslog (
uid integer default '0',
timestamp integer NOT NULL default '0'
);
CREATE INDEX accesslog_timestamp_idx ON accesslog (timestamp);
--
-- Table structure for authmap
......@@ -50,7 +51,8 @@ CREATE TABLE blocks (
weight smallint NOT NULL default '0',
region smallint NOT NULL default '0',
path varchar(255) NOT NULL default '',
custom smallint NOT NULL default '0'
custom smallint NOT NULL default '0',
throttle smallint NOT NULL default '0'
);
--
......@@ -104,6 +106,7 @@ CREATE TABLE cache (
data text default '',
expire integer NOT NULL default '0',
created integer NOT NULL default '0',
headers text default '',
PRIMARY KEY (cid)
);
......@@ -120,9 +123,9 @@ CREATE TABLE comments (
comment text NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp integer NOT NULL default '0',
link varchar(16) NOT NULL default '',
score integer NOT NULL default '0',
status smallint NOT NULL default '0',
thread varchar(255) default '',
users text default '',
PRIMARY KEY (cid)
);
......@@ -151,15 +154,28 @@ CREATE TABLE feed (
title varchar(255) NOT NULL default '',
url varchar(255) NOT NULL default '',
refresh integer NOT NULL default '0',
timestamp integer NOT NULL default '0',
checked integer NOT NULL default '0',
attributes varchar(255) NOT NULL default '',
link varchar(255) NOT NULL default '',
description text NOT NULL default '',
image text NOT NULL default '',
etag varchar(255) NOT NULL default '',
modified integer NOT NULL default '0',
PRIMARY KEY (fid),
UNIQUE (title),
UNIQUE (url)
);
--
-- Table structure for table 'filters'
--
CREATE TABLE filters (
module varchar(64) NOT NULL default '',
weight smallint DEFAULT '0' NOT NULL,
PRIMARY KEY (weight)
);
--
-- Table structure for table 'forum'
--
......@@ -167,7 +183,6 @@ CREATE TABLE feed (
CREATE TABLE forum (
nid integer NOT NULL default '0',
tid integer NOT NULL default '0',
icon varchar(255) NOT NULL default '',
shadow integer NOT NULL default '0',
PRIMARY KEY (nid)
);
......@@ -270,7 +285,6 @@ CREATE TABLE node (
promote integer NOT NULL default '0',
moderate integer NOT NULL default '0',
users text NOT NULL default '',
attributes varchar(255) NOT NULL default '',
teaser text NOT NULL default '',
body text NOT NULL default '',
changed integer NOT NULL default '0',
......@@ -280,9 +294,25 @@ CREATE TABLE node (
);
CREATE INDEX node_type_idx ON node(type);
CREATE INDEX node_title_idx ON node(title,type);
CREATE INDEX node_promote_idx ON node(promote);
CREATE INDEX node_status_idx ON node(status);
CREATE INDEX node_uid_idx ON node(uid);
CREATE INDEX node_moderate_idx ON node (moderate);
CREATE INDEX node_promote_status_idx ON node (promote, status);
--
-- Table structure for table 'node_counter'
--
CREATE TABLE node_counter (
nid integer NOT NULL default '0',
totalcount integer NOT NULL default '0',
daycount integer NOT NULL default '0',
timestamp integer NOT NULL default '0',
PRIMARY KEY (nid)
);
CREATE INDEX node_counter_totalcount_idx ON node_counter(totalcount);
CREATE INDEX node_counter_daycount_idx ON node_counter(daycount);
CREATE INDEX node_counter_timestamp_idx ON node_counter(timestamp);
--
-- Table structure for page
......@@ -297,6 +327,18 @@ CREATE TABLE page (
);
CREATE INDEX page_nid_idx ON page(nid);
--
-- Table structure for table 'url_alias'
--
CREATE TABLE url_alias (
pid serial,
dst varchar(128) NOT NULL default '',
src varchar(128) NOT NULL default '',
PRIMARY KEY (pid)
);
CREATE INDEX url_alias_src_idx ON url_alias(src);
CREATE INDEX url_alias_dst_idx ON url_alias(dst);
--
-- Table structure for permission
--
......@@ -358,6 +400,19 @@ CREATE TABLE search_index (
CREATE INDEX search_index_lno_idx ON search_index(lno);
CREATE INDEX search_index_word_idx ON search_index(word);
--
-- Table structure for sessions
--
CREATE TABLE sessions (
uid integer NOT NULL,
sid varchar(32) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp integer NOT NULL default '0',
session text,
PRIMARY KEY (sid)
);
--
-- Table structure for sequences
-- This is only used under MySQL, co commented out
......@@ -369,40 +424,6 @@ CREATE INDEX search_index_word_idx ON search_index(word);
-- PRIMARY KEY (name)
-- );
--
-- Table structure for site
--
CREATE TABLE site (
sid SERIAL,
name varchar(128) NOT NULL default '',
link varchar(255) NOT NULL default '',
size text NOT NULL default '',
changed integer NOT NULL default '0',
checked integer NOT NULL default '0',
feed varchar(255) NOT NULL default '',
refresh integer NOT NULL default '0',
threshold integer NOT NULL default '0',
PRIMARY KEY (sid),
UNIQUE (name),
UNIQUE (link)
);
--
-- Table structure for table 'statistics'
--
CREATE TABLE statistics (
nid integer NOT NULL default '0',
totalcount integer NOT NULL default '0',
daycount integer NOT NULL default '0',
timestamp integer NOT NULL default '0',
PRIMARY KEY (nid)
);
CREATE INDEX statistics_totalcount_idx ON statistics(totalcount);
CREATE INDEX statistics_daycount_idx ON statistics(daycount);
CREATE INDEX statistics_timestamp_idx ON statistics(timestamp);
--
-- Table structure for system
--
......@@ -413,11 +434,11 @@ CREATE TABLE system (
type varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
status integer NOT NULL default '0',
throttle smallint NOT NULL default '0',
bootstrap integer NOT NULL default '0',
PRIMARY KEY (filename)
);
--
-- Table structure for term_data
--
......@@ -481,39 +502,35 @@ CREATE INDEX term_synonym_name_idx ON term_synonym(name);
--
CREATE TABLE users (
uid SERIAL,
uid integer NOT NULL default '0',
name varchar(60) NOT NULL default '',
pass varchar(32) NOT NULL default '',
mail varchar(64) default '',
homepage varchar(128) NOT NULL default '',
mode smallint NOT NULL default '0',
sort smallint default '0',
threshold smallint default '0',
theme varchar(255) NOT NULL default '',
signature varchar(255) NOT NULL default '',
timestamp integer NOT NULL default '0',
hostname varchar(128) NOT NULL default '',
status smallint NOT NULL default '0',
timezone varchar(8) default NULL,
rating decimal(8,2) default NULL,
language char(2) NOT NULL default '',
sid varchar(32) NOT NULL default '',
init varchar(64) default '',
session text default '',
data text default '',
rid integer NOT NULL default '0',
PRIMARY KEY (uid),
UNIQUE (name)
);
CREATE INDEX users_sid_idx ON users(sid);
CREATE INDEX users_timestamp_idx ON users(timestamp);
CREATE SEQUENCE users_uid_seq INCREMENT 1 START 1;
--
-- Table structure for variable
--
CREATE TABLE variable (
name varchar(32) NOT NULL default '',
name varchar(48) NOT NULL default '',
value text NOT NULL default '',
PRIMARY KEY (name)
);
......@@ -530,7 +547,7 @@ CREATE TABLE vocabulary (
hierarchy smallint NOT NULL default '0',
multiple smallint NOT NULL default '0',
required smallint NOT NULL default '0',
types text default '',
nodes text default '',
weight smallint NOT NULL default '0',
PRIMARY KEY (vid)
);
......@@ -555,18 +572,25 @@ CREATE TABLE watchdog (
-- Insert some default values
--
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1);
INSERT INTO system VALUES ('modules/block.module','block','module','',1);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1);
INSERT INTO system VALUES ('modules/help.module','help','module','',1);
INSERT INTO system VALUES ('modules/node.module','node','module','',1);
INSERT INTO system VALUES ('modules/page.module','page','module','',1);
INSERT INTO system VALUES ('modules/story.module','story','module','',1);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1);
INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1,0,0);
INSERT INTO system VALUES ('modules/block.module','block','module','',1,0,0);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1,0,0);
INSERT INTO system VALUES ('modules/help.module','help','module','',1,0,0);
INSERT INTO system VALUES ('modules/node.module','node','module','',1,0,0);
INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0);
INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0);
INSERT INTO system VALUES ('themes/xtemplate/xtemplate.theme','xtemplate','theme','Internet explorer, Netscape, Opera',1,0,0);
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2004-02-21";');
INSERT INTO variable(name,value) VALUES('theme_default','s:9:"xtemplate";');
INSERT INTO users(uid,name,mail,rid) VALUES(0,'','', '1');
INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
INSERT INTO permission VALUES (1,'access content',0);
INSERT INTO variable(name,value) VALUES('update_start', 'S:10:"2003-04-19";');
INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";');
INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1');
INSERT INTO blocks(module,delta,status) VALUES('user', '1', '1');
......@@ -584,3 +608,8 @@ BEGIN
END;
' LANGUAGE 'plpgsql';
CREATE FUNCTION "rand"() RETURNS float AS '
BEGIN
RETURN random();
END;
' LANGUAGE 'plpgsql';
This diff is collapsed.
<?php
// $Id$
include_once "includes/common.inc";
$errors = array(500 => "500 error: internal server error", 404 => "404 error: '".`$_SERVER["REDIRECT_URL"] ."' not found", 403 => "403 error: access denied - forbidden", 401 => "401 error: authorization required", 400 => "400 error: bad request");
watchdog("httpd", $errors[$_SERVER["REDIRECT_STATUS"]);
drupal_goto($base_url);
?>
favicon.ico

4.6 KiB | W: | H:

favicon.ico

8.23 KiB | W: | H:

favicon.ico
favicon.ico
favicon.ico
favicon.ico
  • 2-up
  • Swipe
  • Onion skin
<?php
/* $Id$ */
function conf_init() {
/*
** Try finding a matching configuration file by stripping the website's
** URI from left to right. If no configuration file is found, return a
** default value 'conf'.
*/
$uri = $_SERVER["PHP_SELF"];
$file = strtolower(strtr($_SERVER["HTTP_HOST"] . substr($uri, 0, strrpos($uri, "/")), "/:", ".."));
while (strlen($file) > 4) {
if (file_exists("includes/$file.php")) {
return $file;
}
else {
$file = substr($file, strpos($file, ".") + 1);
}
}
return "conf";
}
function variable_init($conf = array()) {
$result = db_query("SELECT * FROM {variable} ");
while ($variable = db_fetch_object($result)) {
if (!isset($conf[$variable->name])) {
$conf[$variable->name] = unserialize($variable->value);
}
}
return $conf;
}
function variable_get($name, $default) {
global $conf;
return isset($conf[$name]) ? $conf[$name] : $default;
}
function variable_set($name, $value) {
global $conf;
db_query("DELETE FROM {variable} WHERE name = '%s'", $name);
db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", $name, serialize($value));
$conf[$name] = $value;
}
function variable_del($name) {
global $conf;
db_query("DELETE FROM {variable} WHERE name = '%s'", $name);
unset($conf[$name]);
}
function cache_get($key) {
$cache = db_fetch_object(db_query("SELECT data, created, headers FROM {cache} WHERE cid = '%s'", $key));
return $cache->data ? $cache : 0;
}
function cache_set($cid, $data, $expire = 0, $headers = NULL) {
db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid);
if (!db_affected_rows()) {
db_query("INSERT INTO {cache} (cid, data, created, expire, headers) VALUES('%s', '%s', %d, %d, '%s')", $cid, $data, time(), $expire, $headers);
}
}
function cache_clear_all($cid = NULL) {
if (empty($cid)) {
db_query("DELETE FROM {cache} WHERE expire <> 0");
}
else {
db_query("DELETE FROM {cache} WHERE cid = '%s'", $cid);
}
}
function page_set_cache() {
global $user;
if (!$user->uid && $_SERVER["REQUEST_METHOD"] == "GET") {
if ($data = ob_get_contents()) {
cache_set(request_uri(), $data, 1, drupal_get_headers());
}
}
}
function page_get_cache() {
global $user;
$cache = NULL;
if (!$user->uid && $_SERVER["REQUEST_METHOD"] == "GET") {
$cache = cache_get(request_uri());
if (empty($cache)) {
ob_start();
}
}
return $cache;
}
function drupal_page_header() {
if (variable_get("dev_timer", 0)) {
timer_start();
}
if (variable_get("cache", 0)) {
if ($cache = page_get_cache()) {
// Set default values:
$date = gmdate("D, d M Y H:i:s", $cache->created) ." GMT";
$etag = '"'. md5($date) .'"';
// Check http headers:
$modified_since = isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) ? $_SERVER["HTTP_IF_MODIFIED_SINCE"] == $date : NULL;
if (!empty($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && ($timestamp = strtotime($_SERVER["HTTP_IF_MODIFIED_SINCE"])) != -1) {
$modified_since = $cache->created <= $timestamp;
}
else {
$modified_since = NULL;
}
$none_match = !empty($_SERVER["HTTP_IF_NONE_MATCH"]) ? $_SERVER["HTTP_IF_NONE_MATCH"] == $etag : NULL;
// The type checking here is very important, be careful when changing entries.
if (($modified_since !== NULL || $none_match !== NULL) && $modified_since !== false && $none_match !== false) {
header("HTTP/1.0 304 Not Modified");
exit();
}
// Send appropriate response:
header("Last-Modified: $date");
header("ETag: $etag");
/*
** Send the original request's headers. We send them one after
** another so PHP's header() function can deal with duplicate
** headers.
*/
$headers = explode("\n", $cache->headers);
foreach ($headers as $header) {
header($header);
}
print $cache->data;
/*
** call all init() and exit() hooks without including all modules
** only use those hooks for critical operations
*/
foreach (bootstrap_hooks() as $hook) {
module_invoke_all($hook);
}
exit();
}
}
}
// critical hooks called even when serving a cached page
function bootstrap_hooks() {
return array('init', 'exit');
}
/*
** Unserializes and appends elements from a serialized string
** $obj is the object to which we shall append
** $field is the element whose value is a serialized string
*/
function drupal_unpack($obj, $field = 'data') {
if ($obj->$field && $data = unserialize($obj->$field)) {
foreach ($data as $key => $value) {
if (!isset($obj->$key)) {
$obj->$key = $value;
}
}
}
return $obj;
}
function referer_uri() {
if (isset($_SERVER["HTTP_REFERER"])) {
return check_url($_SERVER["HTTP_REFERER"]);
}
}
function arg($index) {
static $arguments, $q;
if (empty($arguments) || $q != $_GET["q"]) {
$arguments = explode("/", $_GET["q"]);
}
return $arguments[$index];
}
function check_query($text) {
return addslashes($text);
}
function check_url($uri) {
$uri = htmlspecialchars($uri, ENT_QUOTES);
/*
** We replace ( and ) with their entity equivalents to prevent XSS
** attacks.
*/
$uri = strtr($uri, array("(" => "&040;", ")" => "&041;"));
return $uri;
}
function request_uri() {
/*
** Since request_uri() is only available on Apache, we generate
** equivalent using other environment vars.
*/
if (isset($_SERVER["REQUEST_URI"])) {
$uri = $_SERVER["REQUEST_URI"];
}
else {
$uri = $_SERVER["PHP_SELF"] ."?". $_SERVER["argv"][0];
}
return check_url($uri);
}
function timer_start() {
global $timer;
list($usec, $sec) = explode(" ", microtime());
$timer = (float)$usec + (float)$sec;
}
function watchdog($type, $message, $link = NULL) {
global $user;
db_query("INSERT INTO {watchdog} (uid, type, message, link, location, hostname, timestamp) VALUES (%d, '%s', '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $link, request_uri(), $_SERVER['REMOTE_ADDR'], time());
}
unset($conf);
$config = conf_init();
include_once "includes/$config.php";
include_once "includes/database.inc";
include_once "includes/session.inc";
include_once "includes/module.inc";
// initialize configuration variables, using values from conf.php if available:
$conf = variable_init(isset($conf) ? $conf : array());
?>
This diff is collapsed.
......@@ -14,10 +14,14 @@
# $db_url = "mysql://user:password@hostname/database";
# $db_url = "pgsql://user:password@hostname/database";
# $db_url = "mssql://user:password@hostname/database";
$db_url = "mysql://drupal:drupal@localhost/drupal";
# If $db_prefix is specified all database table names will be
# prepended with this string. Be sure to use valid database
# characters only, usually alphanumeric and underscore. If no
# prefixes are desired, set to empty string "".
$db_prefix = "";
#
# Base URL:
#
......
<?php
// $Id$
function db_prefix_tables($sql) {
global $db_prefix;
if (is_array($db_prefix)) {
$prefix = $db_prefix["default"];
foreach ($db_prefix as $key => $val) {
if ($key !== "default") {
$sql = strtr($sql, array("{". $key. "}" => $val. $key));
}
}
}
else {
$prefix = $db_prefix;
}
return strtr($sql, array("{" => $prefix, "}" => ""));
}
$db_type = substr($db_url, 0, strpos($db_url, "://"));
......@@ -11,4 +29,5 @@
db_connect($db_url);
?>
\ No newline at end of file
?>
......@@ -21,12 +21,27 @@ function db_connect($url) {
*/
}
/**
* Runs a query in the database.
*
* @param $query SQL query, followed by a variable number of arguments which
* are substituted into query by sprintf.
* @return a MySQL result or FALSE if the query was not executed correctly.
*/
function db_query($query) {
$args = func_get_args();
$query = db_prefix_tables($query);
if (count($args) > 1) {
$args = array_map("check_query", $args);
$args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args));
if(is_array($args[1])){
$args1 = array_map("check_query", $args[1]);
$nargs = array_merge(array($query), $args1);
}
else {
$nargs = array_map("check_query", $args);
$nargs[0] = $query;
}
return _db_query(call_user_func_array("sprintf", $nargs));
}
else {
return _db_query($query);
......@@ -36,10 +51,17 @@ function db_query($query) {
// debug version
function db_queryd($query) {
$args = func_get_args();
$query = db_prefix_tables($query);
if (count($args) > 1) {
$args = array_map("check_query", $args);
$args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args), 1);
if(is_array($args[1])){
$args1 = array_map("check_query", $args[1]);
$nargs = array_merge(array($query), $args1);
}
else {
$nargs = array_map("check_query", $args);
$nargs[0] = $query;
}
return _db_query(call_user_func_array("sprintf", $nargs), 1);
}
else {
return _db_query($query, 1);
......@@ -111,9 +133,10 @@ function db_next_id($name) {
** when needed
*/
db_query("LOCK TABLES sequences WRITE");
$id = db_result(db_query("SELECT id FROM sequences WHERE name = '%s'", $name)) + 1;
db_query("REPLACE INTO sequences VALUES ('%s', %d)", $name, $id);
$name = db_prefix_tables($name);
db_query("LOCK TABLES {sequences} WRITE");
$id = db_result(db_query("SELECT id FROM {sequences} WHERE name = '%s'", $name)) + 1;
db_query("REPLACE INTO {sequences} VALUES ('%s', %d)", $name, $id);
db_query("UNLOCK TABLES");
return $id;
......@@ -126,9 +149,11 @@ function db_affected_rows() {
/**
* Runs a LIMIT query in the database.
*
* @param mixed $query SQL query, followed by a variable number of arguments which are substituted into query by sprintf, followed by 'from' and 'count' parameters. 'from' is the row to start fetching, 'count' the numbers of rows to fetch.
* @return resource a MySQL result or FALSE if the query was not executed correctly.
* @access public
* @param $query SQL query, followed by a variable number of arguments which
* are substituted into query by sprintf, followed by 'from' and 'count'
* parameters. 'from' is the row to start fetching, 'count' the numbers of
* rows to fetch.
* @return a MySQL result or FALSE if the query was not executed correctly.
*/
function db_query_range($query) {
$args = func_get_args();
......@@ -136,11 +161,13 @@ function db_query_range($query) {
$from = array_pop($args);
if (count(func_get_args()) > 3) {
$args = array_map("check_query", $args);
$query = db_prefix_tables($query);
$args[0] = $query;
$query = call_user_func_array("sprintf", $args);
}
else {
$query = func_get_arg(0);
$query = db_prefix_tables($query);
}
$query .= " LIMIT $from, $count";
return _db_query($query);
......
......@@ -18,17 +18,25 @@ function db_connect($url) {
/**
* Runs a query in the database.
*
* @param $query SQL query
* @param $type module type of this item
* @return sql result resource
* @param $query SQL query, followed by a variable number of arguments which
* are substituted into query by sprintf.
* @return a DB_Result object or a DB_Error
*/
function db_query($query) {
$args = func_get_args();
$query = db_prefix_tables($query);
if (count($args) > 1) {
$args = array_map("check_query", $args);
$args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args));
if(is_array($args[1])){
$args1 = array_map("check_query", $args[1]);
$nargs = array_merge(array($query), $args1);
}
else {
$nargs = array_map("check_query", $args);
$nargs[0] = $query;
}
return _db_query(call_user_func_array("sprintf", $nargs));
}
else {
return _db_query($query);
......@@ -38,10 +46,17 @@ function db_query($query) {
// debug version
function db_queryd($query) {
$args = func_get_args();
$query = db_prefix_tables($query);
if (count($args) > 1) {
$args = array_map("check_query", $args);
$args[0] = $query;
return _db_query(call_user_func_array("sprintf", $args), 1);
if(is_array($args[1])){
$args1 = array_map("check_query", $args[1]);
$nargs = array_merge(array($query), $args1);
}
else {
$nargs = array_map("check_query", $args);
$nargs[0] = $query;
}
return _db_query(call_user_func_array("sprintf", $nargs), 1);
}
else {
return _db_query($query, 1);
......@@ -71,7 +86,7 @@ function _db_query($query, $debug = 0) {
}
if (DB::isError($result)) {
watchdog("error", "database: ". $result->getMessage() ."\nquery: ". htmlspecialchars($query));
trigger_error($result->getMessage() ."\nquery: ". htmlspecialchars($query), E_USER_ERROR);
}
else {
return $result;
......@@ -112,9 +127,10 @@ function db_error() {
function db_next_id($name) {
global $db_handle;
$name = db_prefix_tables($name);
$result = $db_handle->nextID($name);
if (DB::isError($result)) {
watchdog("error", "database: ". $result->getMessage() ."\nquery: ". htmlspecialchars($query));
watchdog("error", "database: ". $result->getMessage() ."\nsequence table: $name");
}
else {
return $result;
......@@ -130,9 +146,11 @@ function db_affected_rows() {
/**
* Runs a LIMIT query in the database.
*
* @param mixed $query SQL query followed by a variable number of arguments which are substituted into query by sprintf, followed by 'from' and 'count' parameters. 'from' is the row to start fetching, 'count' the numbers of rows to fetch.
* @return mixed a DB_Result object or a DB_Error
* @access public
* @param $query SQL query followed by a variable number of arguments which
* are substituted into query by sprintf, followed by 'from' and 'count'
* parameters. 'from' is the row to start fetching, 'count' the numbers of
* rows to fetch.
* @return a DB_Result object or a DB_Error
*/
function db_query_range($query) {
global $db_handle, $queries;
......@@ -147,11 +165,14 @@ function db_query_range($query) {
$from = array_pop($args);
if (count(func_get_args()) > 3) {
$args = array_map("check_query", $args);
$query = db_prefix_tables($query);
$args[0] = $query;
$result = $db_handle->limitQuery(call_user_func_array("sprintf", $args), $from, $count);
}
else {
$result = $db_handle->limitQuery(func_get_arg(0), $from, $count);
$query = func_get_arg(0);
$query = db_prefix_tables($query);
$result = $db_handle->limitQuery( $query, $from, $count);
}
if (variable_get("dev_query", 0)) {
......
This diff is collapsed.
This diff is collapsed.