Browse code

#5 fix for not working userlist with php display errors

Jimako authored on 2023/09/06 02:47:18
Showing 1 changed files
... ...
@@ -1,4 +1,8 @@
1 1
 <?php
2
+ini_set('display_errors', 0);
3
+ini_set('display_startup_errors', 0);
4
+error_reporting(-1);
5
+
2 6
 define("_BASEDIR", "../");
3 7
 include("../config.php");
4 8
 include("../includes/dbfunctions.php");
Browse code

Start Point - version 3.5.5 + fixes

Jimako authored on 2023/09/05 17:01:08
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+<?php
2
+define("_BASEDIR", "../");
3
+include("../config.php");
4
+include("../includes/dbfunctions.php");
5
+list($tableprefix, $language) = dbrow(dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '$sitekey'"));
6
+define("TABLEPREFIX", $tableprefix);
7
+if(file_exists(_BASEDIR."languages/{$language}.php")) include (_BASEDIR."languages/{$language}.php");
8
+else include (_BASEDIR."languages/en.php");
9
+include("../includes/queries.php");
10
+
11
+header("Content-Type: text/html; charset="._CHARSET);
12
+
13
+$users = dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as username FROM "._AUTHORTABLE." WHERE LOWER(".
14
+	_PENNAMEFIELD.") LIKE \"".escapestring($_GET['str'])."%\" ORDER BY username ASC limit 10");
15
+echo "var element = '".$_GET['element']."';\n";
16
+while($u = dbassoc($users)) {
17
+	$userlist[$u['uid']] = $u['username'];
18
+}
19
+if(count($userlist) > 0) {
20
+	$x = 0;
21
+	foreach($userlist as $k => $v) {
22
+		echo "userList[$x] =  new Array('$k','$v');\n";
23
+		$x++;
24
+	}
25
+}
26
+?>
0 27
\ No newline at end of file