Browse Source

! fix for sqlite install of boards table.
! fix query so it was multi-db friendly

Signed-off-by: Spuds <[email protected]>

Spuds 12 years ago
parent
commit
a606a25d7c
2 changed files with 6 additions and 6 deletions
  1. 3 3
      Sources/Who.php
  2. 3 3
      other/install_2-1_sqlite.sql

+ 3 - 3
Sources/Who.php

@@ -702,12 +702,12 @@ function Credits($in_admin = false)
 	if (($mods = cache_get_data('mods_credits', 86400)) === null)
 	{
 		$mods = array();
-		$request = $smcFunc['db_query']('', '
+		$request = $smcFunc['db_query']('substring', '
 			SELECT version, name, credits
 			FROM {db_prefix}log_packages
 			WHERE install_state = {int:installed_mods}
 				AND credits != {string:empty}
-				AND SUBSTRING(filename FROM 1 FOR 9) != {string:patch_name}',
+				AND SUBSTRING(filename, 1, 9) != {string:patch_name}',
 			array(
 				'installed_mods' => 1,
 				'patch_name' => 'smf_patch',
@@ -726,7 +726,7 @@ function Credits($in_admin = false)
 
 			// build this one out and stash it away
 			$mod_name = empty($credit_info['url']) ? $title : '<a href="' . $credit_info['url'] . '">' . $title . '</a>';
-			$mods[] =  $mod_name . (!empty($license) ? ' | ' . $license  : '') . (!empty($copyright) ? ' | ' . $copyright  : '');
+			$mods[] = $mod_name . (!empty($license) ? ' | ' . $license  : '') . (!empty($copyright) ? ' | ' . $copyright  : '');
 		}
 		cache_put_data('mods_credits', $mods, 86400);
 	}

+ 3 - 3
other/install_2-1_sqlite.sql

@@ -506,12 +506,12 @@ CREATE TABLE {$db_prefix}boards (
   override_theme smallint NOT NULL default '0',
   unapproved_posts smallint NOT NULL default '0',
   unapproved_topics smallint NOT NULL default '0',
-  redirect varchar(255) NOT NULL default ''
-  deny_member_groups varchar(255) NOT NULL default '',
+  redirect varchar(255) NOT NULL default '',
+  deny_member_groups varchar(255) NOT NULL default ''
 );
 
 #
-# Indexes for table `ban_items`
+# Indexes for table `boards`
 #
 
 CREATE UNIQUE INDEX {$db_prefix}boards_categories ON {$db_prefix}boards (id_cat, id_board);