SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: WasdMan on July 09, 2012, 04:00:48 AM

Title: New member block
Post by: WasdMan on July 09, 2012, 04:00:48 AM
I made a PHP block:

Code: [Select]
<?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)
Title: Re: New member block
Post by: phantomm on July 09, 2012, 04:08:34 AM
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?
Title: Re: New member block
Post by: phantomm on July 09, 2012, 04:13:32 AM
you could replace:
Code: [Select]
$url = 'http://yourforum.net/'; // Give me your exact addresswith
Code: [Select]
global $scripturl;

and

Code: [Select]
.$url.'index.phpwith
Code: [Select]
.$scripturl
and user just have to copy and paste code into block :)

//sorry for double post :/
Title: Re: New member block
Post by: WasdMan on July 09, 2012, 04:14:04 AM
Attached is the picture changes.
Title: Re: New member block
Post by: WasdMan on July 09, 2012, 04:19:46 AM
I did this for a SimplePortal block in php-code and works well.
SimplePortal 2.3.8 © 2008-2024, SimplePortal