Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > xBTiT
Reply
Thread Tools
  #1  
Old 21st April 2013, 07:12
setul34 setul34 is offline
Member
 
Join Date: Apr 2013
P2P
Posts: 2
Default need help with making Blocks in the sidebar
Hey guys i want to make a block on my site like this

Click the image to open in full size.


can anyone help me with this ?
Reply With Quote
  #2  
Old 21st April 2013, 17:23
DiemThuy's Avatar
DiemThuy DiemThuy is offline
Senior Member
 
Join Date: Apr 2009
Netherlands
Posts: 36
Default
just add the php/html code what you want to use to a php file called something_block.php , add that file in trackerroot/blocks , select and enable that block in acp/blocksettings , and last add a blocktitle

btw , good source that dt fm you use ;)
Reply With Quote
  #3  
Old 24th April 2013, 14:31
Joe Joe is offline
Senior Member
 
Join Date: Apr 2010
P2P
Posts: 167
Default
here try something like this

it was grabed from u-232.com

PHP Code:
///Custom blocks made by FreakyNuts an Moded by cm27
 
if ($CURUSER)
        {
          
$htmlout .= "
        <table class='main' width='100%' cellspacing='0' cellpadding='0' border='0'>
       <tr>"
;

 if (
$CURUSER){
        
$htmlout .="<td valign='top' class='clear' width='180' style='padding-top: 20px; '>";
        if(!empty(
$CURUSER['avatar']))
        {
        
$avatar "<center><img src='{$CURUSER['avatar']}' width='{$CURUSER['av_w']}' height='{$CURUSER['av_h']}' alt='' /></center>";
        }
        else
        {
        
$avatar "<center><img src='{$sourcecode['pic_base_url']}forumicons/default_avatar.gif' alt='' /></center>";
        }
        
$upped mksize($CURUSER['uploaded']);
        
$downed mksize($CURUSER['downloaded']);
        
$ratio $CURUSER['downloaded'] > $CURUSER['uploaded']/$CURUSER['downloaded'] : 0;
         
$ratio number_format($ratio2);
 if (!empty(
$seed['conn'])) {
       switch (
$seed['conn']){
       case 
1:
         
$connectable "<img src='{$sourcecode['pic_base_url']}notcon.png' alt='Not Connectable' title='Not Connectable' />";
       break;
       case 
2:
         
$connectable "<img src='{$sourcecode['pic_base_url']}yescon.png' alt='Connectable' title='Connectable' />";
       break;
       default :
         
$connectable "N/A";
       }
    }
    else
        
$connectable 'N/A';
        
$IsDonor '';
if (
$CURUSER['donor'] == "yes")
         
$IsDonor "<img src='pic/star.gif' alt='donor' title='donor' />";
         
$salty md5("Th15T3xtis5add3dto66uddy6he@water...".$CURUSER['username']."");
        
$warn '';
if (
$CURUSER['warned'] == "yes")
         
$warn "<img src='pic/warned.gif' alt='warned' title='warned' />";
        
$res1 sql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " AND unread='yes'") or sqlerr(__LINE__,__FILE__);
        
$arr1 mysqli_fetch_row($res1);
        
$unread $arr1[0];
        
$inbox = ($unread == "$unread&nbsp;{$lang['gl_msg_singular']}"$unread&nbsp;{$lang['gl_msg_plural']}");
        
$usrclass="";
if (
$CURUSER['override_class'] != 255$usrclass "&nbsp;<b>(".get_user_class_name($CURUSER['class']).")</b>&nbsp;";
        else

       
$res2 sql_query("SELECT seeder, COUNT(*) AS pCount FROM peers WHERE userid=".$CURUSER['id']." GROUP BY seeder") or sqlerr(__LINE__,__FILE__);
       
$seedleech = array('yes' => '0''no' => '0');
       while( 
$row mysqli_fetch_assoc($res2) ) {
if(
$row['seeder'] == 'yes')
      
$seedleech['yes'] = $row['pCount'];
      else
       
$seedleech['no'] = $row['pCount'];
       }
        
$member_reputation get_reputation($CURUSER1);
        
$htmlout .= begin_block("{$CURUSER['username']}");
if (
$CURUSER['class'] >= UC_STAFF)
       
$usrclass "<a href='./setclass.php'><b>(".get_user_class_name($CURUSER['class']).")</b></a>";
        
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='left'><style='float:left;color:white;'>{$lang['gl_msg_welcome']}</style>,
        "
.format_username($CURUSER)."&nbsp;{$usrclass}&nbsp;
        <tr><td align='left'>"
.$avatar."<br />
       <font size='2'>
       
{$lang['gl_act_torrents']}:&nbsp;<img alt='{$lang['gl_seed_torrents']}' title='{$lang['gl_seed_torrents']}' src='pic/arrowup.gif' />{$seedleech['yes']}
       <img alt='
{$lang['gl_leech_torrents']}' title='{$lang['gl_leech_torrents']}' src='pic/arrowdown.gif' />{$seedleech['no']}<br />
       Bonus:&nbsp;<a href='./mybonus.php'>
{$CURUSER['seedbonus']}</a><br />
       Achievements&nbsp;<a href='./achievementhistory.php?id=
{$CURUSER['id']}'>".(int)$Achievement_Points['achpoints']."</a> <br />
       Share Ratio&nbsp;"
.member_ratio($CURUSER['uploaded'], $sourcecode['ratio_free'] ? "0" $CURUSER['downloaded'])." ";
     if (
$sourcecode['ratio_free']) {
      
$StatusBar.= "Uploaded&nbsp;$upped";
            } else {
      
$StatusBar.= "
         Uploaded&nbsp;
$upped <br />
         Downloaded&nbsp;
$downed<br />";
                 }
      
$htmlout .="
       Invites:&nbsp;<a href='./invite.php'>
{$CURUSER['invites']}</a><br />
       
$member_reputation<br />
       Connectable&nbsp;
{$connectable}<br />
       Personal Settings&nbsp;<a href='usercp.php?action=default'><img src='./templates/1/images/Profile.png' alt='Settings' title='Personal Settings' /></a><br />
      <a href='pm_system.php'><img src='templates/1/images/mail_box.png' alt='messages' title='Your Private Messages' /></a><br /></font>
      <a href='logout.php?hash_please=
{$salty}'><img src='templates/1/images/logout.png' alt='Logout' title='SignOut' /></a>
       </td></tr></table>"
;
        
$htmlout .= end_block();

        
$htmlout .= begin_block("Site Info");
        
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='left'>
        <tr><td align='left'> <font size='2'>
        <a href='forums.php'>Forums</a><br />
        <a href='./donate.php'>Donate to us</a><br />
        <a href='announcement.php'>Announcements</a><br />
        <a href='contactstaff.php'>Contact Staff</a><br />
        <a href='chat.php'>IRC Chat</a><br />
        <a href='friends.php'>Friends List</a><br />
       </font></td></tr></table>"
;
        
$htmlout .= end_block();

        
$htmlout .= begin_block("Torrents");
        
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='left'>
       <tr><td align='left'> <font size='2'>
        <a href='browse.php'>Browse</a><br />
        "
.(isset($CURUSER) && $CURUSER['class'] >= UC_UPLOADER"<a href='upload.php'>Upload</a> ":"")." <br />
        <a href='mytorrents.php'>My Torrents</a><br />
        <a href='requests.php'>Requests</a><br />
        <a href='topten.php'>Top 10</a><br />
        Need seeds&nbsp;<a href='./needseed.php?needed=seeders'><font color='red'>Click Here</font> </a><br />
        </font></td></tr></table>"
;
        
$htmlout .= end_block();

        if (
$CURUSER['class']> UC_POWER_USER){
        
$htmlout .= begin_block("Power Users");
        
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='left'>
        <tr><td align='left'> <font size='2'>
        <a href='#' onclick='radio();'>Radio</a><br />
        <a href='#' onclick='themes();'>Themes</a><br />
        <a href='friends.php'>Friends List</a><br />
        <a href='getrss.php'>RSS Feed</a><br />
        </font></td></tr></table>"
;
        
$htmlout .= end_block();
       }

      if (
$CURUSER['class']> UC_VIP){
        
$htmlout .= begin_block("Vip Users");
        
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='left'>
         <tr><td align='left'> <font size='2'>
         "
.(isset($CURUSER) && $CURUSER['got_blocks'] == 'yes' "My Blocks&nbsp;<a href='./user_blocks.php'><font color='red'>Click Here</font> </a>" "")."<br />
        "
.(isset($CURUSER) && $CURUSER['got_moods'] == 'yes' "My Unlocks&nbsp;<a href='./user_unlocks.php'><font color='red'>Click Here</font> </a>" "")."<br />
        Uploader App&nbsp;<a href='./uploadapp.php'><font color='red'>Here</font></a><br />
        </font></td></tr></table>"
;
        
$htmlout .= end_block();
       }



        
$htmlout .= begin_block("Games");
        
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='left'>
        <tr><td align='left'> <font size='2'>
        <a href='blackjack.php'>Blackjack</a><br />
        <a href='casino.php'>Casino</a><br />
        <a href='lottery.php'>Lottery</a><br />
        <a href='arcade.php'>Arcade</a><br />
        <a href='slotmachine.php'>Slots</a><br />
        </font></td></tr></table>"
;
        
$htmlout .= end_block();


        if (
$CURUSER['class']> UC_MODERATOR){
        
$htmlout .= begin_block("Admin");
        
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='left'>
        <tr><td align='left'> <font size='2'>
        <a href='staffpanel.php'>Staff Panel</a><br />
        <a href='staffpanel.php?tool=usersearch'>User Search</a><br />
        <a href='staffbox.php'>StaffBox</a><br />
        </font></td></tr></table>"
;
        
$htmlout .= end_block();
        }
         
$htmlout .="</td>";
      }
        
$htmlout .="<td valign='top' align='center' class='clear' style='padding-top: 20px; padding-bottom: 20px'>";
       
///end of custom blocks
    
$htmlout .= "


        <!-- U-232 Source - Print Global Messages -->
        <div id='base_globelmessage'>
        <div id='gm_taps'>
        <ul class='gm_taps'>
       <br /><li><b>Current Site Alerts:</b></li>"
;
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_REPORTS && $BLOCKS['global_staff_report_on']) {
            require_once (
BLOCK_DIR.'global/report.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_UPLOADAPP && $BLOCKS['global_staff_uploadapp_on']) {
            require_once (
BLOCK_DIR.'global/uploadapp.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_HAPPYHOUR && $BLOCKS['global_happyhour_on']) {
            require_once (
BLOCK_DIR.'global/happyhour.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_STAFF_MESSAGE && $BLOCKS['global_staff_warn_on']) {
            require_once (
BLOCK_DIR.'global/staffmessages.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_NEWPM && $BLOCKS['global_message_on']) {
            require_once (
BLOCK_DIR.'global/message.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_DEMOTION && $BLOCKS['global_demotion_on']) {
            require_once (
BLOCK_DIR.'global/demotion.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_FREELEECH && $BLOCKS['global_freeleech_on']) {
            require_once (
BLOCK_DIR.'global/freeleech.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_CRAZYHOUR && $BLOCKS['global_crazyhour_on']) {
            require_once (
BLOCK_DIR.'global/crazyhour.php');
        }
        if (
curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_BUG_MESSAGE && $BLOCKS['global_bug_message_on']) {
            require_once (
BLOCK_DIR.'global/bugmessages.php');
        }
        
$htmlout.= "</ul></div></div>";
    }
    
$htmlout.= " </div>
        <table class='mainouter2' width='100%' border='0' cellspacing='0' cellpadding='10'>

        <tr><td align='center' class='outer' style='padding-bottom: 10px'>"
;
    return 
$htmlout;

// stdhead 
Then add this to your bittorrent
require_once INCL_DIR.'menu.php';

add that to your include folder

PHP Code:
<?php
    $lang 
array_merge(load_language('global') , load_language('index'));
    function 
begin_block($caption ""$center false$padding 10)
    {
    
    
$htmlout '';
    
$hide "<img src='./pic/minus.gif' alt='Hide' title='Hide' border='0'/>"
    
$show "<img src='./pic/plus.gif' alt='Show' title='Show' border='0'/>"
$htmlout .= '<script type="text/javascript" src="scripts/jquery.js"></script>
    <script type="text/javascript" src="scripts/jquery.cookie.js"></script>
    <script type="text/javascript">
    //<![CDATA[

        $(document).ready(function() {
            
            // the div that will be hidden/shown
            var panel = $("#box'
.$caption.'");
            //the button that will toggle the panel
            var button = $("#top'
.$caption.' a");
            // do you want the panel to start off collapsed or expanded?
            var initialState = "collapsed"; // "expanded" OR "collapsed"
            // the class added when the panel is hidden
            var activeClass = "hidden";
            // the text of the button when the panels expanded
            var visibleHtml = "'
.$hide.'";
            // the text of the button when the panels collapsed
            var hiddenHtml = "'
.$show.'";

            
            //---------------------------
            // dont    edit    below    this    line,
            // unless you really know what youre doing
            //---------------------------
            
            if($.cookie("panelState'
.$caption.'") == undefined) {
                $.cookie("panelState'
.$caption.'", initialState);
            } 
            
            var state = $.cookie("panelState'
.$caption.'");
            
            if(state == "collapsed") {
                panel.hide();
                button.html(hiddenHtml);
                button.addClass(activeClass);
            }
           
            button.click(function(){
                if($.cookie("panelState'
.$caption.'") == "expanded") {
                    $.cookie("panelState'
.$caption.'", "collapsed");
                    button.html(hiddenHtml);
                    button.addClass(activeClass);
                } else {
                    $.cookie("panelState'
.$caption.'", "expanded");
                    button.html(visibleHtml);
                    button.removeClass(activeClass);
                }
                
                panel.slideToggle("slow");
                
                return false;
            });
        });
        //]]>

    </script>
'
;

        
$htmlout .="<div id='wrap$caption'><table class='main' width='160' align='center' border='0' cellspacing='1' cellpadding='10'>
        <tr><td class='colhead'><div id='top
$caption'><a href='#' id='$caption'>$hide</a>
<b>"
.$caption."</b></div></td>
                      </tr></table>
                    <div id='box"
.$caption."' ><table class='main' width='160' align='center' border='0' cellspacing='1' cellpadding='10'><tr>
                        <td align='center'>"
;        
                        return 
$htmlout;
    }
      
    function 
end_block()
    {
        return 
"</td></tr>

        </table></div></div><br />\n"
;
        
    }

    
#left side blocks

    #Personal block
    
function block_a(){
    global 
$INSTALLER09$CURUSER$lang;
    
    
$htmlout '';    
    if(!empty(
$CURUSER['avatar']))
    {
    
$avatar "<center><img src='{$CURUSER['avatar']}' width='{$CURUSER['av_w']}' height='{$CURUSER['av_h']}' alt='' /></center>";
    }
    else
    {
    
$avatar "<center><img src='{$INSTALLER09['pic_base_url']}forumicons/default_avatar.gif' width='100' alt='' /></center>";
    }
    
$upped mksize($CURUSER['uploaded']);
    
$downed mksize($CURUSER['downloaded']);
    
$ratio $CURUSER['downloaded'] > $CURUSER['uploaded']/$CURUSER['downloaded'] : 0;
    
$ratio number_format($ratio2);
    
$IsDonor '';
    if (
$CURUSER['donor'] == "yes")
    
$IsDonor "<img src='pic/star.gif' alt='donor' title='donor' />";
    
$warn '';
    if (
$CURUSER['warned'] == "yes")
    
$warn "<img src='pic/warned.gif' alt='warned' title='warned' />";
    
$res1 = @sql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " AND unread='yes'") or sqlerr(__LINE__,__FILE__);
    
$arr1 mysqli_fetch_row($res1);
    
$unread $arr1[0];
    
$inbox = ($unread == "$unread&nbsp;{$lang['gl_msg_singular']}"$unread&nbsp;{$lang['gl_msg_plural']}");
    
$res2 = @sql_query("SELECT seeder, COUNT(*) AS pCount FROM peers WHERE userid=".$CURUSER['id']." GROUP BY seeder") or sqlerr(__LINE__,__FILE__);
    
$seedleech = array('yes' => '0''no' => '0');
    while( 
$row mysql_fetch_assoc($res2) ) {
    if(
$row['seeder'] == 'yes')
    
$seedleech['yes'] = $row['pCount'];
    else
    
$seedleech['no'] = $row['pCount'];    
    }
    
$member_reputation get_reputation($CURUSER1);
    
$class get_user_class_name($CURUSER['class']);
    
//////connectable////////
    
$res2 sql_query("SELECT COUNT(*) FROM peers WHERE userid=" $CURUSER["id"] . " AND seeder='yes'") or print(mysql_error());
    
$row mysqli_fetch_row($res2);
    
$activeseed $row[0];
    
$res2 sql_query("SELECT COUNT(*) FROM peers WHERE userid=" $CURUSER["id"] . " AND seeder='no'") or print(mysql_error());
    
$row mysqli_fetch_row($res2);
    
$activeleech $row[0];
    
$res3 sql_query("SELECT connectable FROM peers WHERE userid=" sqlesc($CURUSER["id"]) . " LIMIT 1") or print(mysql_error());
    if(
$row mysqli_fetch_row($res3)){
    
$connect $row[0];
    if(
$connect == "yes"){
    
$connectable "<b><img src='pic/yes.gif' alt='Connectable' title='Connectable'/></b>";
    }else{
    
$connectable "<b><img src='pic/no.gif' alt='Not Connectable' title='Not Connectable'/></b>";
    }
    }else{
    
$connectable ="<b><img src='pic/na1.gif' alt='N/A' title='N/A'/></b>";
    }
    
///////////////END///////////// 

    
$htmlout .= begin_block("{$lang['sidebar_personal']}");
    
$htmlout .="<table width='100%' border='1' cellspacing='1' cellpadding='1' align='center'><tr><td align='left'><br /><center><a href='userdetails.php?id=" $CURUSER["id"] . "' target='_blank'><font color='#" get_user_class_color$CURUSER['class'] ) . "'>"htmlspecialchars$CURUSER['username'] ) . "</font></a>$IsDonor$warn</center><br />".$avatar."<br />
    <font class='small'>
{$lang['sidebar_class']}:$class<br /> 
    
{$lang['sidebar_ratio']}:$ratio<br />
    
{$lang['sidebar_uploaded']}:$upped<br />
    
{$lang['sidebar_downloaded']}:$downed<br />
    
{$lang['sidebar_act_torrents']}:&nbsp;<img alt='{$lang['sidebar_seed_torrents']}' title='{$lang['sidebar_seed_torrents']}' src='pic/arrowup.gif' />{$seedleech['yes']}
    <img alt='
{$lang['sidebar_leech_torrents']}' title='{$lang['sidebar_leech_torrents']}' src='pic/arrowdown.gif' />{$seedleech['no']}<br />
    
{$lang['sidebar_connect']}$connectable<br />
    
$member_reputation<br />
    <a href='messages.php'>
$inbox</a><br />
    </font>
    <br /></td></tr></table><br />
    <table width='100%' border='0' cellspacing='1' cellpadding='1' align='center'>
    <tr><td align='center' width='100%'><a href='my.php'>
{$lang['sidebar_myp']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='messages.php'>
{$lang['sidebar_mym']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='mytorrents.php'>
{$lang['sidebar_myt']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='logout.php'><font color='red'>[
{$lang['sidebar_logout']}]</font></a><br /></td></tr>
    </table>"
;
    
$htmlout .= end_block();
     return 
$htmlout;
    }
    
    
    
#navigation block
    
function block_b()
    {
    global 
$INSTALLER09$CURUSER$lang;
    
$htmlout ='';             
    
$htmlout .= begin_block("{$lang['sidebar_nav']}");
    
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='center'>
    <tr><td align='center' width='100%'><a href='index.php'>
{$lang['sidebar_home']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='browse.php'>
{$lang['sidebar_browse']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='search.php'>
{$lang['sidebar_search']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='upload.php'>
{$lang['sidebar_upload']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='chat.php'>
{$lang['sidebar_chat']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='forums.php'>
{$lang['sidebar_forums']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='topten.php'>
{$lang['sidebar_top']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='rules.php'>
{$lang['sidebar_rules']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='faq.php'>
{$lang['sidebar_faq']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='links.php'>
{$lang['sidebar_links']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='staff.php'>
{$lang['sidebar_staff']}</a></td></tr>
    </table>"
;
    
$htmlout .= end_block();
    return 
$htmlout;
    }
    
    
    
#search block
    
function block_c()
    {
    global 
$INSTALLER09$CURUSER$lang;
    
    
$keywords = isset($_GET["keywords"]) ? trim($_GET["keywords"]) : '';
    
    
$htmlout ='';    
    
    
$htmlout .= begin_block("{$lang['sidebar_fsearch']}");
    
$htmlout .="<form method='get' action='forums1.php?'>
    <table width='100%' border='0' cellspacing='1' cellpadding='1' align='center'>
    <tr><td class='colhead'>
{$lang['sidebar_forumsearch']}</td></tr>
    <tr><td align='center' width='100%'>
    <input type='hidden' name='action' value='search' />
    
{$lang['sidebar_search_words']}<br />
    <input type='text' size='18' name='keywords' value='"
htmlspecialchars($keywords)."' /><br />
    <font class='small' size='-1'>
{$lang['sidebar_search_3chars']}</font></td>
    </tr>
    <tr>
    <td align='center' colspan='2'><input type='submit' value='
{$lang['sidebar_search_btn']}' class='btn' /></td>
    </tr>
    </table></form><br />
    
    <form method='get' action='browse.php'>
    <table width='100%' border='0' cellspacing='1' cellpadding='1' align='center'>
    <tr><td class='colhead'>
{$lang['sidebar_tsearch']}</td></tr>
    <tr><td align='center' width='100%'>
    
{$lang['sidebar_ssearch']}<br />
    <input type='text' name='search' size='18' value='' />
    
{$lang['sidebar_search_in']}<br />
    <select name='cat'>
    <option value='0'>
{$lang['sidebar_all_types']}</option>";
    
$cats genrelist();
    
$catdropdown "";
    foreach (
$cats as $cat) {
    
$catdropdown .= "<option value=\"" $cat["id"] . "\"";
    
$getcat = (isset($_GET["cat"])?$_GET["cat"]:'');
    if (
$cat["id"] == $getcat)
    
$catdropdown .= " selected='selected'";
    
$catdropdown .= ">" htmlspecialchars($cat["name"]) . "</option>\n";
    }
    
$deadchkbox "<input type='checkbox' name='incldead' value='1'";
    if (isset(
$_GET["incldead"]))
    
$deadchkbox .= " checked='checked'";
    
$deadchkbox .= " /> {$lang['sidebar_inc_dead']}<br />";


    
$htmlout .= $catdropdown;
    
    
$htmlout .= "</select>
    
$deadchkbox
    <input type='submit' value='
{$lang['sidebar_search_btn']}' class='btn' />
    </td></tr></table></form>"
;
    
$htmlout .= end_block();
    return 
$htmlout;
    }
    
    
#categories block
    
function block_e()
    {
    global 
$INSTALLER09$CURUSER$lang;
    
$htmlout ='';    
    
$htmlout .= begin_block("{$lang['sidebar_cats']}");
    
$htmlout .= "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" class=\"forumline\" align=\"center\">
    <tr><td class=\"row1\" align=\"center\"><a href=\"browse.php?all=1\"><b>
{$lang['sidebar_showall']}</b></a></td></tr>
    <tr><td class=\"row2\">"
;
    
$rq "SELECT id, name FROM categories ORDER BY name";
    
$res sql_query($rq);
    while (
$row mysql_fetch_array($res))
    {
    
extract ($row);
    
$htmlout .= "<font color=\"red\">-</font>&nbsp;<a href=\"browse.php?cat=$id\">$name</a><br/>";
    }
    
$htmlout .= "</td></tr>";
    
$htmlout .= "</table>";
    
$htmlout .= end_block();
    return 
$htmlout;
    }    
    
    
    
#admin block
    
function block_d()
    {
    global 
$INSTALLER09$CURUSER$lang;
    
$htmlout ='';            
    if (
$CURUSER['class']> UC_MODERATOR){
    
$htmlout .= begin_block("{$lang['sidebar_aadmin']}");
    
$htmlout .="<table width='100%' border='0' cellspacing='1' cellpadding='1' align='center'>
    <tr><td align='center' width='100%'><a href='admin.php'>
{$lang['sidebar_adminp']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='admin.php?action=testip'>
{$lang['sidebar_ip']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='admin.php?action=stats'>
{$lang['sidebar_astats']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='tags.php'>
{$lang['sidebar_tags']}</a></td></tr>
    <tr><td align='center' width='100%'><a href='admin.php?action=news'>
{$lang['sidebar_news']}</a></td></tr>
    </table><br />
    <table width='100%' border='1' cellspacing='1' cellpadding='1' align='center'>
    <tr><td class='colhead'>
{$lang['sidebar_search']}</td></tr>
    <tr><td align='center' width='100%'>"
;
    
$search = isset($_GET['search']) ? strip_tags(trim($_GET['search'])) : '';
    
$class = isset($_GET['class']) ? $_GET['class'] : '-';
    
$letter '';
    
$q '';
    if (
$class == '-' || !ctype_digit($class))
    
$class '';
    if (
$search != '' || $class)
    {
    
$query "username LIKE " sqlesc("%$search%") . " AND status='confirmed'";
    if (
$search)
    
$q "search=" htmlspecialchars($search);
    }
    else
    {
    
$letter = isset($_GET['letter']) ? trim((string)$_GET["letter"]) : '';
    if (
strlen($letter) > 1)
    die;
    if (
$letter == "" || strpos("abcdefghijklmnopqrstuvwxyz0123456789"$letter) === false)
    
$letter "";
    
$query "username LIKE '$letter%' AND status='confirmed'";
    
$q "letter=$letter";
    }
    if (
ctype_digit($class))
    {
    
$query .= " AND class=$class";
    
$q .= ($q "&amp;" "") . "class=$class";
    }
    
$htmlout .= "<form method='get' action='users.php?'>
    <input type='text' size='18' name='search' /><br />
    <select name='class'><option value='-'>(any class)</option>"
;
    for (
$i 0;;++$i)
    {
    if (
$c get_user_class_name($i))
    
$htmlout .= "<option value='$i'" . (ctype_digit($class) && $class == $i " selected='selected'" "") . ">$c</option>";
    else
    break;
    }
    
$htmlout .= "</select>
    <input type='submit' value='
{$lang['sidebar_btn']}' class='btn' />
    </form>
    <br /></td></tr></table>"
;
    
$htmlout .= end_block();
    }
    return 
$htmlout;
    }

    
#stats block
    
function block_f(){
    global 
$INSTALLER09$CURUSER$lang;
    
//==Stats Begin
    
$cache_stats "./cache/stats.txt";
    
$cache_stats_life 60// 5min
    
if (file_exists($cache_stats) && is_array(unserialize(file_get_contents($cache_stats))) && (time() - filemtime($cache_stats)) < $cache_stats_life)
    
$row unserialize(@file_get_contents($cache_stats));
    else {
    
$stats sql_query("SELECT *, seeders + leechers AS peers, seeders / leechers AS ratio, unconnectables / (seeders + leechers) AS ratiounconn FROM stats WHERE id = '1' LIMIT 1") or sqlerr(__FILE____LINE__);
    
$row mysqli_fetch_assoc($stats);
    
$handle fopen($cache_stats"w+");
    
fwrite($handleserialize($row));
    
fclose($handle);
    }

    
$seeders number_format($row['seeders']);
    
$leechers number_format($row['leechers']);
    
$registered number_format($row['regusers']);
    
$unverified number_format($row['unconusers']);
    
$torrents number_format($row['torrents']);
    
$torrentstoday number_format($row['torrentstoday']);
    
$ratiounconn $row['ratiounconn'];
    
$unconnectables $row['unconnectables'];
    
$ratio round(($row['ratio'] * 100));
    
$peers number_format($row['peers']);
    
$numactive number_format($row['numactive']);
    
$donors number_format($row['donors']);
    
$forumposts number_format($row['forumposts']);
    
$forumtopics number_format($row['forumtopics']);
    
$users number_format($row['users']);
    
$pusers number_format($row['pusers']);
    
$vips number_format($row['vips']);
    
$uploaders number_format($row['uploaders']);
    
$mods number_format($row['mods']);
    
$admins number_format($row['admins']);
    
$sysops number_format($row['sysops']);
    
$disabled number_format($row['disabled']);
    
$warnedu number_format($row['warnedu']);
    
    
//==End    
    
$htmlout '';    
    
$htmlout .= begin_block("{$lang['sidebar_stats']}");    
    
$htmlout .="<table width='100%' border='1' cellspacing='1' cellpadding='1' align='center'><tr><td class='colhead'>{$lang['sidebar_user']}</td></tr>
    <tr><td align='center'><table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
    <tr><td class='embedded'>
{$lang['sidebar_reged']}</td><td class='embedded'>{$registered}</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_unconf']}</td><td class='embedded'>{$unverified}</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_disabled']}<img src='pic/disabled.gif' alt=''/></td><td class='embedded'>".$disabled."</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_warned']}<img src='pic/warned.gif' alt=''/></td><td class='embedded'>".$warnedu."</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_donor']}<img src='pic/star.gif' alt=''/></td><td class='embedded'>".$donors."</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_online']}</td><td class='embedded'>".$numactive."</td></tr>
    </table><br />
    <table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
    <tr><td class='embedded'><font color='#" 
get_user_class_color(UC_USER) . "'>{$lang['sidebar_user']}</font></td><td class='embedded'>".$users."</td></tr>
    <tr><td class='embedded'><font color='#" 
get_user_class_color(UC_POWER_USER) . "'>{$lang['sidebar_puser']}</font></td><td class='embedded'>".$pusers."</td></tr>
    <tr><td class='embedded'><font color='#" 
get_user_class_color(UC_VIP) . "'>{$lang['sidebar_vip']}</font></td><td class='embedded'>".$vips."</td></tr>
    <tr><td class='embedded'><font color='#" 
get_user_class_color(UC_UPLOADER) . "'>{$lang['sidebar_uploader']}</font></td><td class='embedded'>".$uploaders."</td></tr>
    <tr><td class='embedded'><font color='#" 
get_user_class_color(UC_MODERATOR) . "'>{$lang['sidebar_mod']}</font></td><td class='embedded'>".$mods."</td></tr>
    <tr><td class='embedded'><font color='#" 
get_user_class_color(UC_ADMINISTRATOR) . "'>{$lang['sidebar_admin']}</font></td><td class='embedded'>".$admins."</td></tr>
    <tr><td class='embedded'><font color='#" 
get_user_class_color(UC_SYSOP) . "'>{$lang['sidebar_sysop']}</font></td><td class='embedded'>".$sysops."</td></tr>
    </table></td></tr>
    </table><br />
    <table width='100%' border='1' cellspacing='1' cellpadding='1' align='center'>
    <tr><td class='colhead'>
{$lang['sidebar_torrents']}</td></tr><tr><td align='center'>
    <table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
    <tr><td class='embedded'>
{$lang['sidebar_torrents']}</td><td class='embedded'>{$torrents}</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_newtor']}</td><td class='embedded'>{$torrentstoday}</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_peers']}</td><td class='embedded'>{$peers}</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_unconpeer']}</td><td class='embedded'>{$unconnectables}</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_seeders']}</td><td class='embedded'>{$seeders}</td></tr>
    <tr><td class='embedded' align='right'>
{$lang['sidebar_unconratio']}</td><td class='embedded'>".round($ratiounconn 100)."</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_leechers']}</td><td class='embedded'>{$leechers}</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_slratio']}</td><td class='embedded'>{$ratio}</td></tr></table>  
    </td></tr>            
    </table>
    <br /><table width='100%' border='1' cellspacing='1' cellpadding='1' align='center'>
    <tr><td class='colhead'>
{$lang['sidebar_forum']}</td></tr><tr><td align='center'>
    <table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
    <tr><td class='embedded'>
{$lang['sidebar_topics']}</td><td class='embedded'>".$forumtopics."</td></tr>
    <tr><td class='embedded'>
{$lang['sidebar_posts']}</td><td class='embedded'>".$forumposts."</td></tr>
    </table></td></tr>
    </table>"
;    
    
$htmlout .= end_block();
     return 
$htmlout;
    }
        
    
#torrents with poster
    
function block_g()
    {
    global 
$INSTALLER09$CURUSER$lang;
    
$htmlout ='';
    
$htmlout .= begin_block("{$lang['sidebar_latest']}");
    
$htmlout .="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
    <tr><td class='embedded'><p align='center'><b>
{$lang['sidebar_latest1']}</b></p>";
    
// 09 poster mod - UNCOMMENT IF YOU HAVE THIS
$query "SELECT id, name, poster FROM torrents WHERE poster <> '' ORDER BY added DESC limit 15";
    
$result sql_query$query );
    
$num mysqli_num_rows$result );
    
// count rows
    
$htmlout .="<script type='text/javascript' src='{$INSTALLER09['baseurl']}/scripts/scroll.js'></script>";
    
$htmlout .="<div style=\"overflow:hidden\">
    <div id=\"marqueecontainer\" onmouseover=\"copyspeed=pausespeed\" onmouseout=\"copyspeed=marqueespeed\"> 
    <span id=\"vmarquee\" style=\"position: absolute; width: 100%;\"><span style=\"white-space: nowrap;\">"
;
    
$i 20;
    while ( 
$row mysqli_fetch_assoc$result ) ) {
     
$id = (int) $row['id'];
     
$name htmlspecialchars$row['name'] );
     
$poster htmlspecialchars$row['poster'] );
     
$name str_replace'_'' ' $name );
     
$name str_replace'.'' ' $name );
     
$name substr$name050 );
     if ( 
$i == )
     
$htmlout .= "</span></span><span id=\"vmarquee2\" style=\"position:absolute; width: 98%;\"></span></div></div><div style=\"overflow:hidden\">
     <div id=\"marqueecontainer\" onmouseover=\"copyspeed=pausespeed\" onmouseout=\"copyspeed=marqueespeed\"> <span id=\"vmarquee\" style=\"position: absolute; width: 98%;\"><span style=\"white-space:nowrap;\">"
;
     
$htmlout .= "<a href='{$INSTALLER09['baseurl']}/details.php?id=$id'><img src='".htmlspecialchars($poster)."' alt='$name' title='$name' width='100' height='120' border='0' /></a>&nbsp;&nbsp;&nbsp;";
     
$i++;
    }
    
$htmlout .= "</span></span><span id=\"vmarquee2\" style=\"position: absolute; width: 98%;\"></span></div></div>
\n"
;
    
//== end 09 poster mod
$htmlout .= "</td></tr>
    </table>"
;    
    
$htmlout .= end_block();
    return 
$htmlout;
    }    
    
?>
$INSTALLER09 << this will need changed

you may need to add different paths an change a bit of the code just look at your files and compare.. :)
Reply With Quote
Reply

Tags
blocks , making , sidebar


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 22:49. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.