Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[MyBB] MyPlaza v0.5 (beta version)
Author Message
Pirata Nervo
NervOS Developer

Posts: 699.4765
Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
Offline
Post: #226
RE: [MyBB] MyPlaza v0.41 (preview version 8)
so i must do the upgrade edits by hand, ok..
im talking about the upgrade script not the username formatting..

EDIT:
I found a bug zinga.
Function db_insert_rows

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function db_insert_rows($table, $rows, $check_all = false)
{
	global $db;
	// if checking all, see if less than threshold value
	if($check_all && count($rows) < 4)
	{
		// just use normal insert
		foreach($rows as $row)
			$db->insert_query(MY_TABLE_PREFIX.$table, $row);
		return;
	}
	
	if($check_all)
	{
		foreach($rows as $row)
		{
			foreach($row as $fdname => $data)
				if(!isset($fields[$fdname]))
					$fields[$fdname] = $fdname;
		}
	}
	else
	{
		$fields = array_keys(reset($rows));
	}
	
	$insertsql = '';
	foreach($rows as $row)
	{
		if($check_all)
		{
			$insertsql .= '(';
			foreach($fields as $field)
			{
				if(isset($row[$field]))
					$insertsql .= '\''.$row[$field].'\',';
				else
					$insertsql .= '\'\',';
			}
			$insertsql = substr($insertsql, 0, strlen($insertsql)-1).'),';
		}
		else
			$insertsql .= '(\''.implode('\',\'', $row).'\'),';
	}
	// remove trailing comma
	db_write_query('INSERT INTO '.TABLE_PREFIX.$table.'('.implode(',', $fields).')
		VALUES '.substr($insertsql, 0, strlen($insertsql)-1));
}

Note:
db_write_query('INSERT INTO '.TABLE_PREFIX.$table.'('.implode(',', $fields).')

	
	
VALUES '.substr($insertsql, 0, strlen($insertsql)-1));
you wrote TABLE_PREFIX.

Now, in userformatting.php

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
db_insert_rows(TABLE_PREFIX."plaza_uformat_styles", array(
		array(
			'style' => 'color',
			'friendlyname' => $lang->userformat_color,
			'filter' => $db->escape_string("#([a-zA-Z]*|\#?[0-9a-fA-F]{6})#")
		),
		array(
			'style' => 'font-family',
			'friendlyname' => $lang->userformat_font,
			'filter' => $db->escape_string("#([a-zA-Z0-9 ,\-]+?)#")
		)
	));


You wrote TABLE_PREFIX again, so the actual code will be localhost.prefix_prefix_tablename.
that means nothing, I already fixed that line of code on my forum (i was getting a mysql error because of that).
I removed the TABLE_PREFIX from the userformatting.php.

I hope you can fix my other problem :)


(This post was last modified: 24/12/2007 07:32 AM by Pirata Nervo.)
24/12/2007 05:25 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [MyBB] MyPlaza v0.41 (preview version 8) - Pirata Nervo - 24/12/2007 05:25 AM
Thread Revived!!! - Necro-Bot - 26/07/2009, 10:57 AM

Forum Jump:


User(s) browsing this thread: 9 Guest(s)

 Quick Theme: