Request

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support

Request

Post by Stoker »

Its not only the number you have to change.
You need to change the entire code bit.

Request

Post by mikef35 »

Stoker wrote:Its not only the number you have to change.
You need to change the entire code bit.

can you give me an example?

Request

Post by Stoker »

Yes, replace the entire code on index.php with this:

Code: Select all

switch ($db->sql_layer)
{
   case 'postgres':
      $order_by = 'RANDOM()';
   break;

   case 'mssql':
   case 'mssql_odbc':
      $order_by = 'NEWID()';
   break;
   
   default:
      $order_by = 'RAND()';
   break;
}

$sql = 'SELECT user_id, user_type, username, user_colour
   FROM ' . USERS_TABLE . ' WHERE group_id = 7
   ORDER BY ' . $order_by;
$result = $db->sql_query_limit($sql, 1);

while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('users', array(
'BOT_NAME'      => $row['username'],
'BOT_COLOUR'   => $row['user_colour'],
));
}
$db->sql_freeresult($result);

Request

Post by mikef35 »

Stoker wrote:Yes, replace the entire code on index.php with this:

Code: Select all

switch ($db->sql_layer)
{
   case 'postgres':
      $order_by = 'RANDOM()';
   break;

   case 'mssql':
   case 'mssql_odbc':
      $order_by = 'NEWID()';
   break;
   
   default:
      $order_by = 'RAND()';
   break;
}

$sql = 'SELECT user_id, user_type, username, user_colour
   FROM ' . USERS_TABLE . ' WHERE group_id = 7
   ORDER BY ' . $order_by;
$result = $db->sql_query_limit($sql, 1);

while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('users', array(
'BOT_NAME'      => $row['username'],
'BOT_COLOUR'   => $row['user_colour'],
));
}
$db->sql_freeresult($result);
I have done that, nothing shows up. I have to change the 7 back to a 2 and then i get bots again.

Request

Post by mikef35 »

Stoker,

Thanks, I figured it out! Simple mistake on my part. Works now.