Jump to content
xisto Community

Deaths Aprentice

Members
  • Content Count

    125
  • Joined

  • Last visited

Posts posted by Deaths Aprentice


  1. Thanks :).My site is mainly going to be about gaming reviews and previews.I am planning on buying/renting a server in romania (or however thats spelled) or somewhere where the copyright law isnt taken seriously.On that server , I will be uploading all kinds off wares , mostly music and movies :D.but for now it will be about gaming reviews and previews , we might add some more stuff to it , but we're gonna have to think about what to add ^^.EDIT : About the hacks : I am planning on adding some more stuff , and I hope my mIRC suggestion will be used , then I can also use the mIRC hack :D.


  2. I have spend a lot of time in installing a lot of hacks at my forums :P.
    Take a look at them here , and tell me what you think.

    Also , you guys think I should code a little "hide hack" with which you can hide some forums (and ofcourse unhide :))?
    I'll code it and put it on a test forum <_<

    EDIT : Ow , and , some hacks you guys cant see :
    Need # postcount to view a forum (# can be defined in the ACP)

    (PS I know the icons arent that great yet , and some are missing)


  3. This is how I think about it :People that cant install Mods (but want to) , and cant code any HTML nor PHP :PHPBB : Best by far , mostly because of its easy setup and the Mod installer .IPB : Since you cant code HTML/PHP , and suck in installing mods , this board isnt advisedvB : Have some respect for this board will ya?People that cant install mods , and dont want to :PHPBB : This is an OK board for you.IPB : This is the best board .vB : This is an OK board , but its a waste of money to pay 8x$ for a board which you use like any other one...People that can install mods , and want to :PHPBB : This board is an option , but not recomended.IPB : This board will be a good choice , but it has its limitsvB : By far the best board for you. Its options are almost unlimited , but you must knpw PHP , and learn the vB language.Thats my view on those boards , I never tested the mercury board thing , so I dont know <_<.


  4. The running slow part was only while browsing the internet , and as it later turned out , I exceeded my bandwith , and I was put back to a slower connection (made me pay 5 $ <_<).And yes , explenation would be nice , I'm always in for improvement :).Also , why did you guys choose this program?With me it was actually a coincidence , my friend gave it to me , so I tested it out , and found that it has a way better notepad (lol you think , but I use notepad for PHP and HTML coding , and KWrite has a very good color notation!) :P.After that , I discovered more of its features , and now I cant live without it :P


  5. Well , I installed PHPBB 2.0.10 a while ago (with the setup thing) , and now I want to uninstall it.The problem is , when I go to the setup thing , it says at the bottum "remove an existing installation" , and below that there's a dropdown box.When I click on the dropdown , there's nothing there <_< .Can I just manualy delete my PHPBB directory , or will this screw up my database?Or should I maybe delete the whole directory , then delete the MYSQL database used with it?Thanks


  6. Hey there,

     

    I have installed some mods on my board , and they all worked fine untill I tryd installing the last 1.

     

    I get this error :

    Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/arnoud/public_html/forum/sources/Boards.php on line 1085

    I tryd everything , but I just cant find the error.

    If someone could help me find line 1086 that would be appreciated allready <_< .

    I have added a comment in red on the line which i think is 1086 , but Im not sure...

     

    Thanks already :)

     

    Here's the code (sorry , its kinda long :P):

    <?php

     

    /*

    +--------------------------------------------------------------------------

    |  Invision Power Board v1.2

    |  ========================================

    |  by Matthew Mecham

    |  © 2001 - 2003 Invision Power Services

    https://invisionpower.com/

    |  ========================================

    |  Web: https://invisionpower.com/features/apps

    |  Email: matt@invisionpower.com

    |  Licence Info: https://invisionpower.com/features/apps?license

    +---------------------------------------------------------------------------

    |

    |  > Board index module

    |  > Module written by Matt Mecham

    |  > Date started: 17th February 2002

    |

    | > Module Version Number: 1.0.0

    +--------------------------------------------------------------------------

    */

     

     

    $idx = new Boards;

     

    class Boards {

     

        var $output  = "";

        var $base_url = "";

        var $html    = "";

        var $forums  = array();

        var $mods    = array();

        var $cats    = array();

        var $children = array();

        var $nav;

       

        var $news_topic_id = "";

        var $news_forum_id = "";

        var $news_title    = "";

        var $sep_char      = "";

       

        function Boards()

        {

            global $ibforums, $DB, $std, $print, $skin_universal;

           

            $this->base_url = $ibforums->base_url;

     

            // Get more words for this invocation!

           

            $ibforums->lang = $std->load_words($ibforums->lang, 'lang_boards', $ibforums->lang_id);

           

            $this->html = $std->load_template('skin_boards');

           

            $this->sep_char = trim( $this->html->active_list_sep() );

           

            if (! $ibforums->member['id'] )

            {

            $ibforums->input['last_visit'] = time();

            }

           

            $this->output .= $this->html->PageTop( $std->get_date( $ibforums->input['last_visit'], 'LONG' ) );

    //---------------------------------------

    // Latest Posts

    //---------------------------------------

            if($ibforums->member[id] !=0) {

            $query = $DB->query("SELECT latest_posts, latest_post_show FROM trap17_ipbmembers WHERE id=".$ibforums->member[id]);

            $row = $DB->fetch_row($query);

                $dbquery = "forum_id in ($row[latest_posts])";

        $show = $row[latest_post_show];

            } else {

                foreach ($ibforums->perm_id_array as $i)

        $fast .= "OR f.read_perms LIKE '".$i."' OR f.read_perms LIKE '%,".$i."' OR f.read_perms LIKE '".$i.",%' OR f.read_perms LIKE '%,".$i.",%' ";

                $dbquery = "f.read_perms = '*' $fast";

        $show = 8;

            }

     

            if(!$row[latest_posts] && $ibforums->member[id] !=0) {

            $post_data .= "<tr bgcolor=#E4EAF2>

                      <td align=center colspan=3>You have no forums selected. Select them from your UserCP.</td>

                              </tr>";

                $this->output .= $this->html->latest_posts($post_data,$show);

            } else {

            $query = $DB->query("SELECT t.last_poster_name, t.last_poster_id, t.title, t.tid, t.forum_id, t.last_post, f.name ".

                    "FROM trap17_ipbtopics AS t LEFT JOIN trap17_ipbforums AS f ON f.id=t.forum_id ".

                                "WHERE " . $dbquery .

            " ORDER BY last_post DESC LIMIT 0,".$show);

      while($out = $DB->fetch_row($query))

      {

        $post_data  .= "<tr bgcolor=#E4EAF2>"

                            . "<td align=left>"

                      . "<a href='{$ibforums->base_url}showtopic=$out[tid]&view=getlastpost'>$out[title]</a></td>"

                            . "<td align=left>"

                      . "<a href='{$ibforums->base_url}showforum=$out[forum_id]'>$out[name]</a></font></td>"

                            . "<td align=left>"

                      . "<a href='{$ibforums->base_url}act=Profile&CODE=03&MID=$out[last_poster_id]'>$out[last_poster_name]</a></td>"

                            . "</tr>";

     

      }

            $this->output .= $this->html->latest_posts($post_data,$show);

            }

     

    //---------------------------------------

    // End Latest Posts

    //---------------------------------------

           

            // Get the forums and category info from the DB

           

            $last_c_id = -1;

           

            $DB->query("SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as cat_state, c.name as cat_name, c.description as cat_desc,

                c.image, c.url, m.member_name as mod_name, m.member_id as mod_id, m.is_group, m.group_id, m.group_name, m.mid

                FROM trap17_ipbforums f, trap17_ipbcategories c

                  LEFT JOIN trap17_ipbmoderators m ON (f.id=m.forum_id)

                WHERE c.id=f.category

                ORDER BY c.position, f.position");

               

               

            while ( $r = $DB->fetch_row() )

            {

            if ($last_c_id != $r['cat_id'])

            {

              $this->cats[ $r['cat_id'] ] = array( 'id'          => $r['cat_id'],

                        'position'    => $r['cat_position'],

                        'state'      => $r['cat_state'],

                        'name'        => $r['cat_name'],

                        'description' => $r['cat_desc'],

                        'image'      => $r['image'],

                        'url'        => $r['url'],

                        );

                       

              $last_c_id = $r['cat_id'];

            }

           

            if ($r['parent_id'] > 0)

      {

        $this->children[ $r['parent_id'] ][$r['id']] = $r;

      }

      else

      {

        $this->forums[ $r['id'] ] = $r;

      }

     

      if ($r['mod_id'] != "")

      {

        $this->mods[ $r['id'] ][ $r['mid'] ] = array( 'name' => $r['mod_name'],

                    'id'  => $r['mod_id'],

                    'isg'  => $r['is_group'],

                    'gname'=> $r['group_name'],

                    'gid'  => $r['group_id'],

                  );

      }

            }

           

            //-----------------------------------

            // What are we doing?

            //-----------------------------------

           

            if ($ibforums->input['c'] != "")

            {

            $this->show_single_cat();

            $this->nav[] = $this->cats[ $ibforums->input['c'] ]['name'];

            }

            else

            {

            $this->process_all_cats();

            }

           

            //*********************************************/

      // Add in show online users

      //*********************************************/

     

      $active = array( 'TOTAL'  => 0 ,

          'NAMES'  => "",

          'GUESTS'  => 0 ,

          'MEMBERS' => 0 ,

          'ANON'    => 0 ,

            );

           

      $stats_html = "";

     

      if ($ibforums->vars['show_active'])

      {

     

      if ($ibforums->vars['au_cutoff'] == "")

      {

        $ibforums->vars['au_cutoff'] = 15;

      }

     

      // Get the users from the DB

     

      $cut_off = $ibforums->vars['au_cutoff'] * 60;

      $time    = time() - $cut_off;

     

     

      $DB->query("SELECT s.id, s.member_id, s.member_name, s.login_type, g.suffix, g.prefix

                  FROM trap17_ipbsessions s

                    LEFT JOIN trap17_ipbgroups g ON (g.g_id=s.member_group)

                  WHERE running_time > $time

                  ORDER BY s.running_time DESC");

     

      // cache all printed members so we don't double print them

     

      $cached = array();

     

      while ($result = $DB->fetch_row() )

      {

        if ( strstr( $result['id'], '_session' ) )

        {

        if ( $ibforums->vars['spider_anon'] )

        {

          if ( $ibforums->member['mgroup'] == $ibforums->vars['admin_group'] )

          {

          $active['NAMES'] .= "{$result['member_name']}*{$this->sep_char} \n";

          }

        }

        else

        {

          $active['NAMES'] .= "{$result['member_name']}{$this->sep_char} \n";

        }

        }

        else if ($result['member_id'] == 0 )

        {

        $active['GUESTS']++;

        }

        else

        {

        if ( empty( $cached[ $result['member_id'] ] ) )

        {

          $cached[ $result['member_id'] ] = 1;

          if ($result['login_type'] == 1)

          {

          if ( ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) and ($ibforums->vars['disable_admin_anon'] != 1) )

          {

            $active['NAMES'] .= "<a href='{$ibforums->base_url}showuser={$result['member_id']}'>{$result['prefix']}{$result['member_name']}{$result['suffix']}</a>*{$this->sep_char} \n";

            $active['ANON']++;

          }

          else

          {

            $active['ANON']++;

          }

          }

          else

          {

          $active['MEMBERS']++;

          $active['NAMES'] .= "<a href='{$ibforums->base_url}showuser={$result['member_id']}'>{$result['prefix']}{$result['member_name']}{$result['suffix']}</a>{$this->sep_char} \n";

          }

        }

        }

      }

     

      $active['NAMES'] = preg_replace( "/".preg_quote($this->sep_char)."$/", "", trim($active['NAMES']) );

     

      $active['TOTAL'] = $active['MEMBERS'] + $active['GUESTS'] + $active['ANON'];

     

      // Show a link?

     

      if ($ibforums->vars['allow_online_list'])

      {

        $active['links'] = $this->html->active_user_links();

      }

     

      $ibforums->lang['active_users'] = sprintf( $ibforums->lang['active_users'], $ibforums->vars['au_cutoff'] );

     

      $stats_html .= $this->html->ActiveUsers($active, $ibforums->vars['au_cutoff']);

      }

     

      //-----------------------------------------------

      // Are we viewing the calendar?

      //-----------------------------------------------

     

      if ($ibforums->vars['show_birthdays'])

      {

     

      $a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $std->get_time_offset() ) );

     

      $day  = $a[2];

      $month = $a[1];

      $year  = $a[0];

     

      $birthstring = "";

      $count      = 0;

     

      $DB->query("SELECT id, name, bday_day as DAY, bday_month as MONTH, bday_year as YEAR

          FROM trap17_ipbmembers WHERE bday_day=$day and bday_month=$month");

     

      while ( $user = $DB->fetch_row() )

      {

        $birthstring .= "<a href='{$this->base_url}showuser={$user['id']}'>{$user['name']}</a>";

       

        if ($user['YEAR'])

        {

        $pyear = $year - $user['YEAR'];  // $year = 2002 and $user['YEAR'] = 1976

        $birthstring .= "(<b>$pyear</b>)";

        }

       

        $birthstring .= $this->sep_char."\n";

       

        $count++;

      }

     

      $birthstring = preg_replace( "/".$this->sep_char."$/", "", trim($birthstring) );

     

      $lang = $ibforums->lang['no_birth_users'];

     

      if ($count > 0)

      {

        $lang = ($count > 1) ? $ibforums->lang['birth_users'] : $ibforums->lang['birth_user'];

        $stats_html .= $this->html->birthdays( $birthstring, $count, $lang  );

      }

      else

      {

        $count = "";

       

        if ( ! $ibforums->vars['autohide_bday'] )

        {

        $stats_html .= $this->html->birthdays( $birthstring, $count, $lang  );

        }

      }

      }

     

     

      //-----------------------------------------------

      // Are we viewing the calendar?

      //-----------------------------------------------

     

      if ($ibforums->vars['show_calendar'])

      {

     

      if ($ibforums->vars['calendar_limit'] < 2)

      {

        $ibforums->vars['calendar_limit'] = 2;

      }

     

      $our_unix        = time() + $std->get_time_offset();

      $max_date        = $our_unix + ($ibforums->vars['calendar_limit'] * 86400);

     

      $DB->query("SELECT eventid, title, read_perms, priv_event, userid, unix_stamp

                  FROM trap17_ipbcalendar_events WHERE unix_stamp > $our_unix and unix_stamp < $max_date ORDER BY unix_stamp ASC");

     

      $show_events = array();

     

      while ($event = $DB->fetch_row())

      {

        if ($event['priv_event'] == 1 and $ibforums->member['id'] != $event['userid'])

        {

        continue;

        }

       

        //-----------------------------------------

        // Do we have permission to see the event?

        //-----------------------------------------

       

        if ( $event['read_perms'] != '*' )

        {

        if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $event['read_perms'] ) )

        {

          continue;

        }

        }

       

        $c_time = date( 'j-F-y', $event['unix_stamp']);

       

        $show_events[] = "<a href='{$ibforums->base_url}act=calendar&code=showevent&eventid={$event['eventid']}' title='$c_time'>".$event['title']."</a>";

      }

     

      $ibforums->lang['calender_f_title'] = sprintf( $ibforums->lang['calender_f_title'], $ibforums->vars['calendar_limit'] );

     

      if ( count($show_events) > 0 )

      {

        $event_string = implode( $this->sep_char.' ', $show_events );

        $stats_html .= $this->html->calendar_events( $event_string  );

      }

      else

      {

        if ( ! $ibforums->vars['autohide_calendar'] )

        {

        $event_string = $ibforums->lang['no_calendar_events'];

        $stats_html .= $this->html->calendar_events( $event_string  );

        }

      }

      }

     

      //*********************************************/

      // Add in show stats

      //*********************************************/

     

     

      if ($ibforums->vars['show_totals'])

      {

     

      $DB->query("SELECT * FROM trap17_ipbstats");

      $stats = $DB->fetch_row();

     

      // Update the most active count if needed

     

      if ($active['TOTAL'] > $stats['MOST_COUNT'])

      {

        $DB->query("UPDATE trap17_ipbstats SET MOST_DATE='".time()."', MOST_COUNT='".$active[TOTAL]."'");

        $stats['MOST_COUNT'] = $active[TOTAL];

        $stats['MOST_DATE']  = time();

      }

     

      $most_time = $std->get_date( $stats['MOST_DATE'], 'LONG' );

     

      $ibforums->lang['most_online'] = str_replace( "<#NUM#>" ,  $std->do_number_format($stats['MOST_COUNT'])  , $ibforums->lang['most_online'] );

      $ibforums->lang['most_online'] = str_replace( "<#DATE#>",                  $most_time                    , $ibforums->lang['most_online'] );

     

      $total_posts = $stats['TOTAL_REPLIES'] + $stats['TOTAL_TOPICS'];

     

      $total_posts        = $std->do_number_format($total_posts);

      $stats['MEM_COUNT'] = $std->do_number_format($stats['MEM_COUNT']);

     

      $link = $ibforums->base_url."showuser=".$stats['LAST_MEM_ID'];

     

      $ibforums->lang['total_word_string'] = str_replace( "<#posts#>" , "$total_posts"          , $ibforums->lang['total_word_string'] );

      $ibforums->lang['total_word_string'] = str_replace( "<#reg#>"  , $stats['MEM_COUNT']    , $ibforums->lang['total_word_string'] );

      $ibforums->lang['total_word_string'] = str_replace( "<#mem#>"  , $stats['LAST_MEM_NAME'] , $ibforums->lang['total_word_string'] );

      $ibforums->lang['total_word_string'] = str_replace( "<#link#>"  , $link                  , $ibforums->lang['total_word_string'] );

     

      $stats_html .= $this->html->ShowStats($ibforums->lang['total_word_string']);

     

      }

     

      if ($stats_html != "")

      {

      $this->output .= $this->html->stats_header();

      $this->output .= $stats_html;

      $this->output .= $this->html->stats_footer();

      }

     

      //---------------------------------------

      // Add in board info footer

      //---------------------------------------

     

      $this->output .= $this->html->bottom_links();

     

      //---------------------------------------

      // Check for news forum.

      //---------------------------------------

     

      if ($this->news_title and $this->news_topic_id and $this->news_forum_id)

      {

      $t_html = $this->html->newslink( $this->news_forum_id, stripslashes($this->news_title) , $this->news_topic_id);

      $this->output = str_replace( "<!-- IBF.NEWSLINK -->" , "$t_html" , $this->output );

      }

     

    //*********************************************/

    // Welcome Panel Mod

    //*********************************************/

     

      //--------------------------------------------

      // Get the forums we're allowed to search in

      //--------------------------------------------

     

      $allow_forums  = array();

     

      $allow_forums[] = '0';

     

      $DB->query('SELECT id, read_perms, password FROM trap17_ipbforums');

     

      while( $i = $DB->fetch_row() ) {

      $pass = 1;

     

      if ($i['password'] != '') {

        if ( ! $c_pass = $std->my_getcookie('iBForum'.$i['id']) ) {

        $pass = 0;

        }

     

        if ( $c_pass == $i['password'] ) {

        $pass = 1;

        } else {

        $pass = 0;

        }

      }

     

      if ($pass == 1) {

        if ( $std->check_perms($i['read_perms']) == TRUE ) {

        $allow_forums[] = $i['id'];

        }

      }

      }

     

      $allow_forums = implode( ',', $allow_forums );

     

      if ($ibforums->vars['show_totals'])

      {

      $data['stats'] = $stats;

      }

      else

      {

      $DB->query('SELECT * FROM trap17_ipbstats');

      $data['stats'] = $DB->fetch_row();

      // Update the most active count if needed

     

      if ($active['TOTAL'] > $data['stats']['MOST_COUNT'])

      {

        $DB->query('UPDATE trap17_ipbstats SET MOST_DATE='.time().', MOST_COUNT='.$active['TOTAL']);

        $data['stats']['MOST_COUNT'] = $active['TOTAL'];

        $data['stats']['MOST_DATE']  = time();

      }

     

      $ibforums->lang['most_online'] = str_replace( '<#NUM#>' , $data['stats']['MOST_COUNT'], $ibforums->lang['most_online'] );

      $ibforums->lang['most_online'] = str_replace( '<#DATE#>', $std->get_date( $data['stats']['MOST_DATE'], 'LONG'), $ibforums->lang['most_online'] );

      }

     

      if (!$ibforums->vars['show_active'])

      {

      $DB->query('SELECT member_id FROM trap17_ipbsessions WHERE running_time > '.(time() - $ibforums->vars['au_cutoff'] * 60));

      $active['TOTAL'] = $DB->get_num_rows();

      $ibforums->lang['active_users'] = sprintf( $ibforums->lang['active_users'], $ibforums->vars['au_cutoff'] );

      }

     

      $data['time'] = $std->get_date(time(), LONG);

     

      if ($ibforums->member['id'])

      {

      $DB->query('SELECT avatar_size, avatar FROM trap17_ipbmembers WHERE id='.$ibforums->member['id']);

      $member = $DB->fetch_row();

     

      //--------------------------------------------

      // Get the number of posts and topics since the last visit.

      //--------------------------------------------

     

      if (! $ibforums->member['last_visit'] )

      {

        $ibforums->member['last_visit'] = time() - 3600;

      }

     

      $DB->query('SELECT COUNT(pid) as posts, COUNT(DISTINCT(topic_id)) as topics FROM trap17_ipbposts WHERE post_date > '.$ibforums->member['last_visit'].' AND queued <> 1 AND forum_id IN('.$allow_forums.')');

      $row = $DB->fetch_row();

     

      $data['posts_scince'] = ($row['posts'] < 1) ? 0 : $row['posts'];

      $data['topics_scince'] = ($row['topics'] < 1) ? 0 : $row['topics'];

     

      $data['stats']['TOTAL']    = $active['TOTAL'];

      $data['stats']['TOTAL_POSTS']  = $std->do_number_format($data['stats']['TOTAL_REPLIES'] + $data['stats']['TOTAL_TOPICS']);

      $data['stats']['MEM_COUNT']  = $std->do_number_format($data['stats']['MEM_COUNT']);

      $data['stats']['TOTAL_TOPICS']  = $std->do_number_format($data['stats']['TOTAL_TOPICS']);

      //$data['stats']['TOTAL_REPLIES'] = $std->do_number_format($data['stats']['TOTAL_REPLIES']);

      $data['lastv']      = $std->get_date($ibforums->member['last_visit'], 'LONG');

     

      if (!$data['avatar'] = $std->get_avatar( $member['avatar'], 1, $member['avatar_size'] ))

      {

        $data['avatar'] = '<img src="'.$ibforums->vars['img_url'].'/noavatar.gif" />';

      }

     

      $t_html = $this->html->welcomepanel($data);

      }

      else

      {

      $date = getdate();

      //$today = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']);

      $DB->query('SELECT COUNT(pid) as posts, COUNT(DISTINCT(topic_id)) as topics FROM trap17_ipbposts WHERE post_date > '.mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']).' AND queued <> 1 AND forum_id IN('.$allow_forums.')');

      $row = $DB->fetch_row();

     

      $data['posts_scince'] = ($row['posts'] < 1) ? 0 : $row['posts'];

      $data['topics_scince'] = ($row['topics'] < 1) ? 0 : $row['topics'];

     

      $t_html = $this->html->guestpanel($data);

      }

     

      $this->output = str_replace( '<!-- WELCOMEPANEL -->', $t_html, $this->output );

     

    //*********************************************/

    // EOM

    //*********************************************/

     

      //---------------------------------------

      // Display quick log in if we're not a member

      //---------------------------------------

     

      if ($ibforums->member['id'] < 1)

      {

      $this->output = str_replace( "<!--IBF.QUICK_LOG_IN-->" , $this->html->quick_log_in() , $this->output );

      }

     

            $print->add_output("$this->output");

           

            $cp = " (Powered by Invision Power Board)";

           

            if ($ibforums->vars['ips_cp_purchase'])

            {

            $cp = "";

            }

           

            $print->do_output( array( 'TITLE' => $ibforums->vars['board_name'].$cp, 'JS' => 0, 'NAV' => $this->nav ) );

           

    }

     

       

    //*********************************************/

    //

    // PROCESS ALL CATEGORIES

    //

    //*********************************************/

     

    function process_all_cats() {

     

      global $std, $DB, $ibforums;   

           

            if($ibforums->member['id']!=0) {

                $DB->query("SELECT board_layout FROM trap17_ipbmembers WHERE id='".$ibforums->member['id']."'");

                $r=$DB->fetch_row();$list = explode(",",$r['board_layout']);$contr=array();$fm_s=-1;

                foreach ($list as $l)

                {   

                    if(substr($l,1,1)=="c")

                    {

                        if(isset($c_id)) {

                            if(! isset($contr[$c_id])) {$contr[$c_id]=$fm_s;}

                            else {$contr[$c_id]=$fm_s;$fm_s=-1;} //-1 no forums,0 show contract,1 some something

                        }

                        $c_id=substr($l,2);

                        $cs[$c_id]=substr($l,0,1);

                        if(! isset($contr[$c_id])) {$contr[$c_id]=$fm_s;}

                        else {$contr[$c_id]=$fm_s;$fm_s=-1;} //-1 no forums,0 show contract,1 some something

                       

                    }

                    elseif(substr($l,1,1)=="f")

                    {

                        $fs[substr($l,2)]=substr($l,0,1);

                        if($fm_s!=1) $fm_s=substr($l,0,1);

                    }

                }

                if(isset($c_id)) {

                    if(! isset($contr[$c_id])) {$contr[$c_id]=$fm_s;}

                    else {$contr[$c_id]=$fm_s;$fm_s=-1;} //-1 no forums,0 show contract,1 some something

                }           

            }

            foreach ($this->cats as $cat_id => $cat_data)

            {

                $child=-1;

                if($cs[$cat_data['id']]==1 or $cs[$cat_data['id']]=="" or $ibforums->member['id']==0) $showcat=1; else $showcat=0;

                foreach ($this->forums as $forum_id => $forum_data)

                {

                    if ($forum_data['category'] == $cat_id)

                    {

                        //-----------------------------------

                        // We store the HTML in a temp var so

                        // we can make sure we have cats for

                        // this forum, or hidden forums with a

                        // cat will show the cat strip - we don't

                        // want that, no - we don't.

                        //-----------------------------------

                        if ( (isset($this->children[$forum_id])) and (count($this->children[$forum_id]) > 0 ) )

                        foreach($this->children[$forum_id] as $rm)    {if($std->check_perms($rm['read_perms']) != TRUE ) continue;$child=1;}

                        else {if ( $std->check_perms($forum_data['read_perms']) != TRUE ) continue;$child=1;}

                        if($fs[$forum_id]==1 or $fs[$forum_id]=="" or $ibforums->member['id']==0) $showfor=1; else $showfor=0;

                        if($cat_data['state'] != 0 and $showcat==1 and ($showfor==1 or $contr[$cat_id]==0)) $temp_html .= $this->process_forum($forum_id, $forum_data);

                    }

                }

                if ($temp_html != "" and $child==1 and $contr[$cat_id]==0 and isset($contr[$cat_id]))

                    $this->output .= $this->html->CatHeader_Expanded($cat_data+array('contract_on'=>'show','expanded_on'=>'none')).$temp_html.$this->html->end_this_cat();           

                elseif ($temp_html != "")

                {

                $this->output .= $this->html->CatHeader_Expanded($cat_data+array('contract_on'=>'none','expanded_on'=>'show'));

                {

                $this->output .= $this->html->CatHeader_Expanded($cat_data+array('contract_on'=>'none','expanded_on'=>'show'));

     

                $this->output .= $temp_html;

                $this->output .= $this->html->end_this_cat();

                }

               

                unset($temp_html);

            }

           

            $this->output .= $this->html->end_all_cats();

           

        }

     

     

    //*********************************************/

    //

    // SHOW A SINGLE CATEGORY

    //

    //*********************************************/ 

       

    function show_single_cat() {

     

      global $std, $DB, $ibforums;   

           

            $cat_id = $ibforums->input['c'];

           

            if (!is_array( $this->cats[ $cat_id ] ) )

            {

            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );

            }

           

            $cat_data = $this->cats[ $cat_id ];

           

      //----------------------------

      // Is this category turned on?

      //----------------------------

           

      if ( $cat_data['state'] == 0 )

      {

      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );

      }

     

      foreach ($this->forums as $forum_id => $forum_data)

      {

      if ($forum_data['category'] == $cat_id)

      {

        //-----------------------------------

        // We store the HTML in a temp var so

        // we can make sure we have cats for

        // this forum, or hidden forums with a

        // cat will show the cat strip - we don't

        // want that, no - we don't.

        //-----------------------------------

       

        $temp_html .= $this->process_forum($forum_id, $forum_data);

      }

      }

     

      if ($temp_html != "")

      {

      $this->output .= $this->html->CatHeader_Expanded($cat_data);

      $this->output .= $temp_html;

      $this->output .= $this->html->end_this_cat();

      }

      else

      {

      $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );

      }

      unset($temp_html);

     

      $this->output .= $this->html->end_all_cats();

        }

       

    //*********************************************/

    //

    // RENDER A FORUM

    //

    //*********************************************/ 

       

        function process_forum($forum_id="", $forum_data="")

        {

        global $std, $ibforums;

       

       

        if ($forum_data['subwrap'] == 1)

        {

       

          $printed_children = 0;

          $can_see_root = FALSE;

         

          //--------------------------------------

          // This is a sub cat forum...

          //--------------------------------------

         

          // Do we have any sub forums here?

         

          if ( (isset($this->children[ $forum_data['id'] ])) and (count($this->children[ $forum_data['id'] ]) > 0 ) )

          {

         

          // Are we allowed to see the postable forum stuff?

         

          if ($forum_data['sub_can_post'] == 1 and $forum_data['redirect_on'] != 1)

          {

            if ( $std->check_perms($forum_data['read_perms']) )

        {

          $forum_data['fid'] = $forum_data['id'];

          $newest = $forum_data;

          $can_see_root = TRUE;

         

          if (isset($forum_data['last_title']) and $forum_data['last_id'] != "")

          {

          if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $forum_data['id']) )

          {

           

              $this->news_topic_id = $forum_data['last_id'];

              $this->news_forum_id = $forum_data['id'];

              $this->news_title    = $forum_data['last_title'];

           

          }

          }

        }

        else

        {

          $newest = array();

        }

        }

         

          foreach($this->children[ $forum_data['id'] ] as $idx => $data)

        {

            //--------------------------------------

        // Check permissions...

        //--------------------------------------

       

        if ( $std->check_perms($data['read_perms']) != TRUE )

        {

          continue;

        }

       

        // Do the news stuff first

       

        if (isset($data['last_title']) and $data['last_id'] != "")

        {

          if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $data['id']) )

          {

         

            $this->news_topic_id = $data['last_id'];

            $this->news_forum_id = $data['id'];

            $this->news_title    = $data['last_title'];

         

          }

        }

       

        if ($data['last_post'] > $newest['last_post'])

        {

         

          $newest['last_post']        = $data['last_post'];

          $newest['fid']              = $data['id'];

          //$newest['id']              = $data['id'];

          $newest['last_id']          = $data['last_id'];

          $newest['last_title']      = $data['last_title'];

          $newest['password']        = $data['password'];

          $newest['last_poster_id']  = $data['last_poster_id'];

          $newest['last_poster_name'] = $data['last_poster_name'];

          $newest['status']          = $data['status'];

        }

       

        $newest['posts']  += $data['posts'];

        $newest['topics'] += $data['topics'];

       

        $printed_children++;

       

        }

       

        if ( ($printed_children < 1) && ($can_see_root != TRUE) )

        {

        // If we don't have permission to view any forums

        // and we can't post in this root forum

        // then simply return and the row won't be printed

        //

       

        return "";

       

        }

       

        // Fix up the last of the data

       

        $newest['last_title'] = strip_tags($newest['last_title']);

        $newest['last_title'] = str_replace( "!" , "!" , $newest['last_title'] );

        $newest['last_title'] = str_replace( """, "\"", $newest['last_title'] );

       

        if (strlen($newest['last_title']) > 30)

        {

        $newest['last_title'] = substr($newest['last_title'],0,27) . "...";

        $newest['last_title'] = preg_replace( '/&(#(\d+;?)?)?(\.\.\.)?$/', '...', $newest['last_title'] );

        }

        if ($newest['password'] != "")

        {

        $newest['last_topic'] = $ibforums->lang['f_protected'];

        }

        else if($newest['last_title'] != "")

        {

        $newest['last_unread'] = $this->html->forumrow_lastunread_link($newest['fid'], $newest['last_id']);

        $newest['last_topic'] = "<a href='{$ibforums->base_url}showtopic={$newest['last_id']}&view=getnewpost' title='{$ibforums->lang['tt_gounread']}'>{$newest['last_title']}</a>";

        }

        else

        {

        $newest['last_topic'] = $ibforums->lang['f_none'];

        }

       

        if ( isset($newest['last_poster_name']))

        {

        $newest['last_poster'] = $newest['last_poster_id'] ? "<a href='{$ibforums->base_url}showuser={$newest['last_poster_id']}'>{$newest['last_poster_name']}</a>"

                          : $newest['last_poster_name'];

        }

        else

        {

        $newest['last_poster'] = $ibforums->lang['f_none'];

        }

       

        $newest['img_new_post'] = $std->forum_new_posts($newest, $printed_children > 0 ? 1: 0);

       

        if ( $newest['img_new_post'] == '<{C_ON_CAT}>' )

        {

        $newest['img_new_post'] = $this->html->subforum_img_with_link($newest['img_new_post'], $forum_data['id']);

        }

     

        $newest['last_post'] = $std->get_date($newest['last_post'], 'LONG');

       

        $newest['posts']  = $std->do_number_format($newest['posts']);

        $newest['topics'] = $std->do_number_format($newest['topics']);

       

        foreach($newest as $k => $v)

        {

        if ($k == 'id')

        {

          continue;

        }

        $forum_data[$k] = $v;

        }

         

          $forum_data['moderator'] = $this->get_moderators($forum_id);

         

          return $this->html->ForumRow($forum_data);

         

          }

          else

          {

          return "";

          }

       

        }

        else

        {

       

      //--------------------------------------

      // Check permissions...

      //--------------------------------------

     

      if ( $std->check_perms($forum_data['read_perms']) != TRUE )

      {

        return "";

      }

     

      //--------------------------------------

      // Redirect only forum?

      //--------------------------------------

     

      if ( $forum_data['redirect_on'] )

      {

        // Simply return with the redirect information

       

        if ( $forum_data['redirect_loc'] != "" )

        {

        $forum_data['redirect_target'] = " target='".$forum_data['redirect_loc']."' ";

        }

       

        $forum_data['redirect_hits'] = $std->do_number_format($forum_data['redirect_hits']);

       

        return $this->html->forum_redirect_row($forum_data);

       

      }

     

      //--------------------------------------

      // No - normal forum..

      //--------------------------------------

     

      $forum_data['img_new_post'] = $std->forum_new_posts($forum_data);

     

      if ( $forum_data['img_new_post'] == '<{C_ON}>' )

      {

        $forum_data['img_new_post'] = $this->html->forum_img_with_link($forum_data['img_new_post'], $forum_data['id']);

      }

     

      $forum_data['last_post'] = $std->get_date($forum_data['last_post'], 'LONG');

         

      $forum_data['last_topic'] = $ibforums->lang['f_none'];

     

      if (isset($forum_data['last_title']) and $forum_data['last_id'])

      {

     

        if ( ( $ibforums->vars['index_news_link'] == 1 ) and (! empty($ibforums->vars['news_forum_id']) ) and ($ibforums->vars['news_forum_id'] == $forum_data['id']) )

        {

       

          $this->news_topic_id = $forum_data['last_id'];

          $this->news_forum_id = $forum_data['id'];

          $this->news_title    = $forum_data['last_title'];

       

        }

       

        $forum_data['last_title'] = strip_tags($forum_data['last_title']);

        $forum_data['last_title'] = str_replace( "!" , "!", $forum_data['last_title'] );

        $forum_data['last_title'] = str_replace( """, "\"", $forum_data['last_title'] );

       

        if (strlen($forum_data['last_title']) > 30)

        {

        $forum_data['last_title'] = substr($forum_data['last_title'],0,27) . "...";

        $forum_data['last_title'] = preg_replace( "/&(#(\d+;?)?)?\.\.\.$/", '...', $forum_data['last_title'] );

        }

        else

        {

        $forum_data['last_title'] = preg_replace( "/&(#(\d+?)?)?$/", '', $forum_data['last_title'] );

        }

       

        if ($forum_data['password'] != "")

        {

        $forum_data['last_topic'] = $ibforums->lang['f_protected'];

        }

        else

        {

        $forum_data['last_unread'] = $this->html->forumrow_lastunread_link($forum_data['id'], $forum_data['last_id']);

        $forum_data['last_topic']  = "<a href='{$ibforums->base_url}showtopic={$forum_data['last_id']}&view=getnewpost' title='{$ibforums->lang['tt_gounread']}'>{$forum_data['last_title']}</a>";

        }

      }

     

         

      if ( isset($forum_data['last_poster_name']))

      {

        $forum_data['last_poster'] = $forum_data['last_poster_id'] ? "<a href='{$ibforums->base_url}showuser={$forum_data['last_poster_id']}'>{$forum_data['last_poster_name']}</a>"

                        : $forum_data['last_poster_name'];

      }

      else

      {

        $forum_data['last_poster'] = $ibforums->lang['f_none'];

      }

      if ($forum_data['iconimg']) {

     

                    $forum_data['ficonimg'] =  "<img src='{$forum_data['iconimg']}' border='0'>";

                }

                else {

                    $forum_data['ficonimg'] = '';

                }

      //---------------------------------

      // Moderators

      //---------------------------------

     

      $forum_data['moderator'] = $this->get_moderators($forum_data['id']);

     

      $forum_data['posts']  = $std->do_number_format($forum_data['posts']);

      $forum_data

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.