SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: WasdMan on July 09, 2012, 04:00:48 AM
-
I made a PHP block:
<?php
// Created by WasdMan
// 2012
$url = 'http://yourforum.net/'; // Give me your exact address
$prefix = 'smf_'; // The table prefix in this forum
// All posts not based group
$result=mysql_query("SELECT id_group, group_name, online_color FROM `".$prefix."membergroups` WHERE min_posts = -1");
$accounts = 0;
while($row=mysql_fetch_array($result))
{
$count = 0;
echo '<b><font color="'.$row['online_color'].'">'.$row['group_name'].'</font></b><br>';
$result2=mysql_query('SELECT id_member, real_name FROM `'.$prefix.'members` WHERE id_group = '.$row['id_group']);
echo '<ul class="sp_list">';
while($row2=mysql_fetch_array($result2))
{
$username = $row2['real_name'];
echo '<li>'.sp_embed_image('dot').' <a href="'.$url.'index.php?action=profile;u='.$row2['id_member'].'"><font color="'.$row['online_color'].'">'.$row2['real_name'].'</font></a></li>';
$count++;
$accounts++;
}
if($count == 0) echo "<li><i><b>User not found ...</b></i></li>";
echo "</ul>";
}
echo "<br><center><i>(<b>".$accounts."</b> user)</i></center>";
?>
Mod image:
(http://smf-portal.hu/Download/Topicfaq/csoportok_php.png)
-
Change [quote] tag to [code] :)
This displays what? For me it shows users in regular groups.
And if this is PHP block - why don't use $scripturl as $url?
-
you could replace:
$url = 'http://yourforum.net/'; // Give me your exact address
with
global $scripturl;
and
.$url.'index.php
with
.$scripturl
and user just have to copy and paste code into block :)
//sorry for double post :/
-
Attached is the picture changes.
-
I did this for a SimplePortal block in php-code and works well.