MyBB Community Forums

Full Version: Make custom PHP pages for your forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I run http://revenueden.com

I need help regarding a simple custom php page I'm making, a ban list. I lack the skills to code and incorporate simple commands. But if anyone out there can help me out I'd really appreciate it.

My current progress: http://revenueden.com/banlist.php

PHP coding
<?php 
    define('IN_MYBB', 1);
    require_once("global.php");

    add_breadcrumb("Ban List", $_SERVER['PHP_SELF']); 

    eval("\$page = \"".$templates->get("ban_list")."\";"); 

    output_page($page);
?>

HTML coding
 <html>
<head>
<title>RevenueDen Ban List</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr><td class="thead" colspan="5"><strong>{$lang->ban_banned}</strong></td></tr>
<tr>
<td class="tcat"><span class="smalltext"><strong>{$lang->username}</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>{$lang->reason}</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>{$lang->ban_bannedby}</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>{$lang->start_date}</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>{$lang->end_date}</strong></span></td>
</tr>
{$bannedtablerows}
</table>
{$footer}
</body>
</html>

it's a code that I extracted from an existing banlist plugin which can be viewed here http://revenueden.com/misc.php?page=banlist

In fact I need to make it exactly like that, but without any plugins and querries. Thanks
Use this PHP code


$query = $db->simple_select("banned", "COUNT(uid) AS count");
$totalbanned = $db->fetch_field($query, "count");

$i = 1;

$query = $db->query("SELECT * FROM `".TABLE_PREFIX."banned` ORDER BY `dateline` DESC");
while($banned = $db->fetch_array($query))
{
    if($i < $totalbanned)
    {
        $seperate = ', ';
    }
    else
    {
        $seperate = '';
    }

    $uid = intval($banned['uid']);
    $user = get_user($uid);
    $bannedmember = build_profile_link($user['username'],$banned['uid']);
    
    $bannedmembers .= $bannedmember.$seperate;
    
    $i++;
}
    $template = "<html>
    <head>
    <title>Banned Members</title>
    {$headerinclude}
    </head>
    <body>
    {$header}
    <table class=\"tborder\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\">
    <tr>
    <td class=\"thead\"><strong>Banned Members</strong></td>
    </tr>
    <tr>
    <td class=\"tcat\" width=\"23%\"><span class=\"smalltext\">Below is the list of all banned members.</span></td>
    </td>
    </tr>
    <td class=\"trow1\"><span class=\"smalltext\">
            
    {$bannedmembers}
    
    </span></td></table>
    <br />
    Total Banned Members: <b>{$totalbanned}</b>
    {$footer}
    </body>
    </html>"; 
This code is for the plugin which enables php editting, I'm using a custom php file with global templates,and global templates don't allow php to be added?
(2013-11-26, 01:40 AM)Yota Wrote: [ -> ]This code is for the plugin which enables php editting, I'm using a custom php file with global templates,and global templates don't allow php to be added?

create a custom php file, include that code.
templates and style > your theme templates > name of php file
add html

win?
(2013-11-26, 03:27 AM)Addiction Wrote: [ -> ]
(2013-11-26, 01:40 AM)Yota Wrote: [ -> ]This code is for the plugin which enables php editting, I'm using a custom php file with global templates,and global templates don't allow php to be added?

create a custom php file, include that code.
templates and style > your theme templates > name of php file
add html

win?

That's where I'm stuck at, the html part, I was hoping someone could write it for me :3
(2013-11-26, 04:15 AM)Yota Wrote: [ -> ]
(2013-11-26, 03:27 AM)Addiction Wrote: [ -> ]
(2013-11-26, 01:40 AM)Yota Wrote: [ -> ]This code is for the plugin which enables php editting, I'm using a custom php file with global templates,and global templates don't allow php to be added?

create a custom php file, include that code.
templates and style > your theme templates > name of php file
add html

win?

That's where I'm stuck at, the html part, I was hoping someone could write it for me :3

use the html you originally posted