Seite 1 von 1

Hack list

Verfasst: 08.09.2003 01:35
von Spidy
Hi
ich habe mir den MOD Hacks list instaliert nur wenn ich im ACP
auf den link gehe bekomme ich volgende Fehlermeldung

Code: Alles auswählen

Error querying the Hacks List Table.

DEBUG MODE

SQL Error : 1146 Table 'usr_pd40157_1.hacks_list_table' doesn't exist

SELECT * FROM HACKS_LIST_TABLE

Line : 46
File : G:\minixampp\htdocs\phpBB2\includes\functions_hacks_list.php
Die Tabellen in der DB sind aber vorhanden.
Hier mal der Code der functions_hacks_list.php bis ca zeile 60
vieleicht findet einer einen Fehler.

Code: Alles auswählen

<?php
/***************************************************************************
*                    $RCSfile: functions_hacks_list.php,v $
*                            -------------------
*   copyright            : (C) 2003 Nivisec.com
*   email                : support@nivisec.com
*
*   $Id: functions_hacks_list.php,v 1.1 2003/07/10 16:50:23 nivisec Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/
if (!defined('IN_PHPBB'))
{
	die('Hacking attempt');
}

/****************************************************************************
/** Constants and Main Vars.
/***************************************************************************/
/* Sub-dir to scan for .hl files.  Notice the trailing /!!! */
define('HL_DIR', 'hl/');
/* This will turn all author e-mails into a cryptic item; for example
user@domain.ext => user at domain dot ext */
define('USE_CRYPTIC_EMAIL', true);
/* Setting this to true will print out TONS debug information I use */
define('DEBUG_THIS_MOD', false);
$hl_cache_list = array();


function setup_hacks_list_array()
{
	global $db, $lang, $hl_cache_list;
	
	$sql = 'SELECT * FROM ' . HACKS_LIST_TABLE;
	if(!$result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, $lang['Error_Hacks_List_Table'], '', __LINE__, __FILE__, $sql);
	}
	$i = 0;
	while ($row = $db->sql_fetchrow($result))
	{
		$hl_cache_list[$row['hack_file']] = $row;
	}
}

function cryptize_hl_email($email)
{
	$cr_email = preg_replace("/@/", " at ", $email);
	$cr_email = preg_replace("/\./", " dot ", $cr_email);
	
	return $cr_email;
}

function scan_hl_files()
{
	global $board_config, $lang, $hl_cache_list, $phpbb_root_path;
	
	if (DEBUG_THIS_MOD) $board_config['hacks_list_hl_dir'] = 'hl/';
	
	//The list of dirs to scan.  By default this is the main phpbb root
	// path and the dir set in the options.
	$scan_dir_list = array(
	$phpbb_root_path,
	$phpbb_root_path . HL_DIR
	);
	
	foreach($scan_dir_list as $dir_item)
	{
		$dir_handle = opendir($dir_item);
		
		while (false !== ($file = readdir($dir_handle)))
		{
			if (substr($file, -3, 3) == '.hl')
			{
				if (DEBUG_THIS_MOD) print "<font color=\"red\">DEBUG - HL File Found: $file<br></font>";
				if (!isset($hl_cache_list[$dir_item.$file]) || $hl_cache_list[$dir_item.$file]['hack_file_mtime'] != filemtime($dir_item.$file))
				{
					update_hl_file_cache($dir_item.$file);
				}
			}
		}
		closedir($dir_handle);
	}
}

function update_hl_file_cache($filename)
{
	global $db, $lang, $hl_cache_list;
	
	if (DEBUG_THIS_MOD) print "<font color=\"blue\">DEBUG - Updating File Cache: $filename<br></font>";
	
	if (file_exists($filename))
	{
		//Open up the file and read in the data to send to the parse function
		// in an array for each newline
		$parsed_array = parse_hl_file(@file($filename));
		$parsed_array['hack_file'] = $filename;
		$parsed_array['hack_file_mtime'] = filemtime($filename);
		
		//Make the sql replace command
		$sql_1 = '';
		$sql_2 = '';
		foreach ($parsed_array as $key => $val)
		{
			if ($sql_1 != '') $sql_1 .= ', ';
			if ($sql_2 != '') $sql_2 .= ', ';
			
			$sql_1 .= $key;
			//Version is also considered numeric here, but we don't want it to be!
			$sql_2 .= (is_numeric($val) && $key != 'hack_version') ? $val : "'".addslashes($val)."'";
		}
		$sql = 'REPLACE INTO ' . HACKS_LIST_TABLE . " ($sql_1) VALUES ($sql_2)";
		if(!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, $lang['Error_Hacks_List_Table'], '', __LINE__, __FILE__, $

Verfasst: 08.09.2003 02:23
von MGD
Hast du vieleicht damals beim installieren des boardes von standart phpbb_ auf z.B. phpbb2_ geendert?

Da der fehler aussagt das die db nicht exestiert.


MFG MGD

Verfasst: 09.09.2003 15:57
von Spidy
Nein der Präfix in der DB ist phpbb

Verfasst: 29.12.2003 15:15
von BZebra
Bei mir hat die Tabellen-Installation nicht geklappt:

Code: Alles auswählen

CREATE TABLE `phpbb_hacks_list` (
  `hack_id` mediumint(8) unsigned NOT NULL auto_increment,
  `hack_name` varchar(255) NOT NULL default '',
  `hack_desc` varchar(255) NOT NULL default '',
  `hack_author` varchar(255) NOT NULL default '',
  `hack_author_email` varchar(255) NOT NULL default '',
  `hack_author_website` tinytext NOT NULL,
  `hack_version` varchar(32) NOT NULL default '',
  `hack_hide` enum('Yes','No') NOT NULL default 'No',
  `hack_download_url` tinytext NOT NULL,
  `hack_file` varchar(255) NOT NULL default '',
  `hack_file_mtime` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`hack_id`),
  UNIQUE KEY `hack_name` (`hack_name`),
  KEY `hack_file` (`hack_file`)
  KEY `hack_hide` (`hack_hide`)
) TYPE=MyISAM
Ergibt die Fehlermeldung:

You have an error in your SQL syntax near 'KEY `hack_hide` ( `hack_hide` ) ) TYPE = MYISAM ' at line 14

Kann mir da jemand helfen?

Danke,
BZebra

Verfasst: 29.12.2003 15:40
von oxpus
KEY `hack_file` (`hack_file`)
Da fehlt ein Komma am Ende der Zeile. Also versuche mal dieses:

Code: Alles auswählen

CREATE TABLE `phpbb_hacks_list` ( 
  `hack_id` mediumint(8) unsigned NOT NULL auto_increment, 
  `hack_name` varchar(255) NOT NULL default '', 
  `hack_desc` varchar(255) NOT NULL default '', 
  `hack_author` varchar(255) NOT NULL default '', 
  `hack_author_email` varchar(255) NOT NULL default '', 
  `hack_author_website` tinytext NOT NULL, 
  `hack_version` varchar(32) NOT NULL default '', 
  `hack_hide` enum('Yes','No') NOT NULL default 'No', 
  `hack_download_url` tinytext NOT NULL, 
  `hack_file` varchar(255) NOT NULL default '', 
  `hack_file_mtime` int(10) unsigned NOT NULL default '0', 
  PRIMARY KEY  (`hack_id`), 
  UNIQUE KEY `hack_name` (`hack_name`), 
  KEY `hack_file` (`hack_file`),
  KEY `hack_hide` (`hack_hide`) 
) TYPE=MyISAM

Verfasst: 29.12.2003 15:44
von Acid
Setze mal nach KEY `hack_file` (`hack_file`) noch ein Komma.

Verfasst: 29.12.2003 15:50
von BZebra
Jap, danke, jetzt funzt's. :grin: