Welcome, Guest. Please Login or Register.
September 30, 2024, 07:37:31 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Sub Forums « previous next »
Pages: 1 [2] Reply Ignore Print
Author Topic: Sub Forums  (Read 2186 times)
KenTeamBG
Jr. Member
**
Posts: 74


TeamBG rules!!!

WWW
Re:Sub Forums
« Reply #15 on: January 16, 2002, 03:47:20 PM »
Reply with quote

1) added the "Open All Categories" link (of course)

2) enclosed the code for getting the board data and printing out the table rows with this if statement:

   if($GLOBALS[opened] == "$row_cat[ID_CAT]" || $GLOBALS[opened] == "all"){

   }

See, 3 lines.  ;)

EDIT:
Ooops...4 lines, the html to make the board names into links, of course...drat...4 lines, I am so ashamed!!!



As an additional note, I realize this mod is somewhat basic and incomplete, as if I were to continue with it I would make sure all links back to the BoardIndex remembered your selection via passing the variable or using a cookie...but this works for now...and I would do more, except it would be for nothing with a super version of this already in the works.
« Last Edit: January 16, 2002, 04:41:11 PM by KenTeamBG » Logged

KenTeamBG
Jr. Member
**
Posts: 74


TeamBG rules!!!

WWW
Re:Sub Forums
« Reply #16 on: January 16, 2002, 03:55:19 PM »
Reply with quote

Alan, I look forward to your advanced and more intense version.  ;D

This will do in the meanwhile.  hehe

I didn't even bother with not linking text when a category is already open nor removing the Open All link if they are all showing, just a great quicky that works well and has the basic functionality...and I have no reason to make it more complex with yours coming.  ;)

Your's will make muliple forums in one forum a reality, basically.  I hope it does work well with the search feature though.

Logged

irbrian
Sr. Member
****
Posts: 489


I create. Therefore I am.

brian@inverse-reality.com WWW
Re:Sub Forums
« Reply #17 on: January 16, 2002, 08:48:16 PM »
Reply with quote

I think, sadly, I may have misunderstood the question in this post.  :'(  You see, I actually have TWO SEPERATE INSTALLATIONS of YaBB SE, as two completely seperate forums. They are Intentionally seperate, I do not want them to be combined...  I want the messages, the threads, the boards, the categories, the news, EVERYTHING.. to be seperate.

EXCEPT the MEMBERS. I Want members to have access to YaBB SE Forum B simply by registering for YaBB SE Forum A. Well, that and instant messages. I want the IM system combined too. But EVERYTHING ELSE MUST be Seperate -- seperate databases, everything.

I was hoping that you guys were asking how to do this. Maybe I was wrong.

I've been asking about this in PHP Scripting Help and in various other boards, but no one really seems able to help me too much. The best advice I got was along the lines of "Change all instances of the string:
{$db_prefix}membersto
{$db_memberPrefix}membersand just use that."

Which was a good idea, and a good start, but I have no idea how many times I need to change it, or more importantly, where to store and where/how to handle the variable.
Logged

Imparting great wisdom daily to those who will mistake my words as such.
Alan Cramer
Sr. Member
****
Posts: 258


***Insert Evil Cackle Here***

WWW
Re:Sub Forums
« Reply #18 on: January 17, 2002, 03:20:02 AM »
Reply with quote

Well this option once complete fully won't force you to merge your YaBB SE Boards.  It is for those who like to keep things together, but may want to have the one forum software, and only show certain boards on request via URL.  It is also incase someone has way too many boards, and want to have them collapsable, only to show the categories.  I am writing this mainly for personal sake, as my web site is a network, which has boards for the different sites in the Nextux.NETwork.  I only want to show certain boards and sites I host, I want them to have their boards only shown.  But other people may have uses of their own, such as to have a hidden family board or something, so my job is to make this mod public.

But it is no way intending to merge your forums at all.
Logged

Alan Cramer - Nextux - [email protected]

If you want my MSN, YIM, ICQ, AIM details, please IM me for them.  If you just want support, please use these forums, as that is what they are here for!
irbrian
Sr. Member
****
Posts: 489


I create. Therefore I am.

brian@inverse-reality.com WWW
Re:Sub Forums
« Reply #19 on: January 17, 2002, 06:45:37 PM »
Reply with quote

Well, there is, but it will still just require lots of coding. :( oh well.. guess i'll do it the old fashioned way and just plod through the whole code base one step at a time :(
Logged

Imparting great wisdom daily to those who will mistake my words as such.
KenTeamBG
Jr. Member
**
Posts: 74


TeamBG rules!!!

WWW
Re:Sub Forums
« Reply #20 on: January 18, 2002, 12:29:32 AM »
Reply with quote

Quote from: Alan M. Cramer on January 17, 2002, 03:20:02 AMWell this option once complete fully won't force you to merge your YaBB SE Boards.  It is for those who like to keep things together, but may want to have the one forum software, and only show certain boards on request via URL.  It is also incase someone has way too many boards, and want to have them collapsable, only to show the categories.  I am writing this mainly for personal sake, as my web site is a network, which has boards for the different sites in the Nextux.NETwork.  I only want to show certain boards and sites I host, I want them to have their boards only shown.  But other people may have uses of their own, such as to have a hidden family board or something, so my job is to make this mod public.

But it is no way intending to merge your forums at all.

Alan, I welcome your advanced verion of this.  My forum that I altered with my small version of collapsable categories is, in fact, the forum for 3 different websites...so I am in a very similar situation as you...except to say that the 3 sites are all related so even having all the boards showing was alright, but the boardindex was quite large and my simple mod and your more intense mod will help with focus and speed of loading the boardindex.  I also like the idea of some user configuration options.  ;)

Logged

Alan Cramer
Sr. Member
****
Posts: 258


***Insert Evil Cackle Here***

WWW
Re:Sub Forums
« Reply #21 on: January 18, 2002, 06:49:58 AM »
Reply with quote

KenTeamBG: Did you get my IM?  Also can you post more complete instructions for users who read this thread to be able to do it themselves for the time being.  Like include which files you modified and where.
Logged

Alan Cramer - Nextux - [email protected]

If you want my MSN, YIM, ICQ, AIM details, please IM me for them.  If you just want support, please use these forums, as that is what they are here for!
KenTeamBG
Jr. Member
**
Posts: 74


TeamBG rules!!!

WWW
Re:Sub Forums
« Reply #22 on: January 18, 2002, 07:58:39 AM »
Reply with quote

I have added some more to this, below is a manual install script (I did not use the language file for my strings, so if you do...just alter what you need for that(no biggy)):

FILE: BoardIndex.php

FIND:

   print <<<EOT
<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="$color[bordercolor]" class="bordercolor"><tr><td>
<table border=0 width="100%" cellspacing="1" cellpadding="5" bgcolor="$color[bordercolor]" class="bordercolor">
  <tr>
    <td class="titlebg" bgcolor="$color[titlebg]" colspan="2"><font class="text1" color="$color[titletext]" size="66%"><b>$txt[20]</b></font></td>
    <td class="titlebg" bgcolor="$color[titlebg]" width="6%" align="center"><font class="text1" color="$color[titletext]" size="2"><b>$txt[330]</b></font></td>
    <td class="titlebg" bgcolor="$color[titlebg]" width="6%" align="center"><font class="text1" color="$color[titletext]" size="2"><b>$txt[21]</b></font></td>
    <td class="titlebg" bgcolor="$color[titlebg]" width="22%" align="center"><font class="text1" color="$color[titletext]" size="2"><b>$txt[22]</b></font></td>
  </tr>
EOT;

REPLACE WITH:

   if($GLOBALS[opened] != "all"){
      $expando1 = "&nbsp;<font size=\"-2\">[<a href=\"?opened=all\">Open All Categories</a>]</font>";
   }
   print <<<EOT
<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="$color[bordercolor]" class="bordercolor"><tr><td>
<table border=0 width="100%" cellspacing="1" cellpadding="5" bgcolor="$color[bordercolor]" class="bordercolor">
  <tr>
    <td class="titlebg" bgcolor="$color[titlebg]" colspan="2"><font class="text1" color="$color[titletext]" size="66%"><b>$txt[20]</b>$expando1</font></td>
    <td class="titlebg" bgcolor="$color[titlebg]" width="6%" align="center"><font class="text1" color="$color[titletext]" size="2"><b>$txt[330]</b></font></td>
    <td class="titlebg" bgcolor="$color[titlebg]" width="6%" align="center"><font class="text1" color="$color[titletext]" size="2"><b>$txt[21]</b></font></td>
    <td class="titlebg" bgcolor="$color[titlebg]" width="22%" align="center"><font class="text1" color="$color[titletext]" size="2"><b>$txt[22]</b></font></td>
  </tr>
EOT;

FILE: BoardIndex.php

FIND:

   $result = mysql_query("SELECT name,ID_CAT FROM {$db_prefix}categories WHERE ('$settings[7]'='Administrator' || '$settings[7]'='Global Moderator' || FIND_IN_SET('$settings[7]',memberGroups)!=0 || memberGroups='') ORDER BY catOrder");

   while ($row_cat = mysql_fetch_array($result))
   {
      print <<<EOT
  <tr>
    <td colspan="5" class="catbg" bgcolor="$color[catbg]" height="18"><a name="$row_cat[ID_CAT]"><font size="2"><b>$row_cat[ID_CAT]</b></font></a></td>
  </tr>
EOT;

REPLACE WITH:

   $result = mysql_query("SELECT name,ID_CAT FROM {$db_prefix}categories WHERE ('$settings[7]'='Administrator' || '$settings[7]'='Global Moderator' || FIND_IN_SET('$settings[7]',memberGroups)!=0 || memberGroups='') ORDER BY catOrder");

   while ($row_cat = mysql_fetch_array($result))
   {
      if($GLOBALS[opened] == "$row_cat[ID_CAT]"){
         $expando2 = "$row_cat[name]";
      }else{
         if($GLOBALS[opened] == "all"){
            $expando2 = "<a href=\"?opened=$row_cat[ID_CAT]\">$row_cat[name]</a>";
         }else{
            $expando2 = "<a href=\"?opened=$row_cat[ID_CAT]\">$row_cat[name]</a>&nbsp;&nbsp;<font size=\"-2\">«&nbsp;click&nbsp;to&nbsp;open</font>";
         }
      }
      print <<<EOT
  <tr>
    <td colspan="5" class="catbg" bgcolor="$color[catbg]" height="18"><table width="100%" cellpadding="0" cellspacing="0"><tr><td width="95%"><a name="$row_cat[ID_CAT]"><font size="2"><b>$expando2</b></font></a></td><td align="right"><font size="1"><a href="#pageTop">Back&nbsp;To&nbsp;Top</a></font></td></tr></table></td>
  </tr>
EOT;
   if($GLOBALS[opened] == "$row_cat[ID_CAT]" || $GLOBALS[opened] == "all"){


continued...
« Last Edit: January 18, 2002, 08:35:28 AM by KenTeamBG » Logged

KenTeamBG
Jr. Member
**
Posts: 74


TeamBG rules!!!

WWW
Re:Sub Forums
« Reply #23 on: January 18, 2002, 07:59:40 AM »
Reply with quote

FILE: BoardIndex.php

FIND:

    <td class="windowbg" bgcolor="$color[windowbg]" valign="middle" align="center" width="6%"><font size="2">$row_board[numTopics]</font></td>
    <td class="windowbg" bgcolor="$color[windowbg]" valign="middle" align="center" width="6%"><font size="2">$row_board[numPosts]</font></td>
    <td class="windowbg2" bgcolor="$color[windowbg2]" valign="middle" width="22%"><font size="1">$latestPostTime<BR>in <a href="$scripturl?board=$row_board[ID_BOARD];action=display;threadid=$topicID;start=$startPage">$subject</a><br> $txt[525] $latestPostName</font></td>
  </tr>
EOT;

ADD AFTER:

}


FILE: BoardIndex.php

FIND:

function MarkAllRead (){
   global $settings,$username,$db_prefix;
   $result = mysql_query("SELECT c.ID_CAT,b.ID_BOARD FROM {$db_prefix}categories as c,{$db_prefix}boards as b WHERE ('$settings[7]'='Administrator' || '$settings[7]'='Global Moderator' || FIND_IN_SET('$settings[7]',c.memberGroups)!=0 || c.memberGroups='')");

   while (list($ID_CAT,$ID_BOARD) = mysql_fetch_row($result)){
      $request = mysql_query("SELECT logTime FROM {$db_prefix}log_mark_read WHERE (memberName='$username' AND ID_BOARD=$ID_BOARD) LIMIT 1");

      if (mysql_num_rows($request)==0)
         $request = mysql_query("INSERT INTO {$db_prefix}log_mark_read (logTime,memberName,ID_BOARD) VALUES (".time().",'$username',$ID_BOARD)");
      else
         $request = mysql_query("UPDATE {$db_prefix}log_mark_read SET logTime=".time()." WHERE (memberName='$username' AND ID_BOARD=$ID_BOARD)");
   
   }
   BoardIndex();
   obExit();
}

REPLACE:

function MarkAllRead (){
   global $settings,$username,$db_prefix;
   $result = mysql_query("SELECT c.ID_CAT,b.ID_BOARD FROM {$db_prefix}categories as c,{$db_prefix}boards as b WHERE ('$settings[7]'='Administrator' || '$settings[7]'='Global Moderator' || FIND_IN_SET('$settings[7]',c.memberGroups)!=0 || c.memberGroups='')");

   while (list($ID_CAT,$ID_BOARD) = mysql_fetch_row($result)){
      $request = mysql_query("SELECT logTime FROM {$db_prefix}log_mark_read WHERE (memberName='$username' AND ID_BOARD=$ID_BOARD) LIMIT 1");

      if (mysql_num_rows($request)==0)
         $request = mysql_query("INSERT INTO {$db_prefix}log_mark_read (logTime,memberName,ID_BOARD) VALUES (".time().",'$username',$ID_BOARD)");
      else
         $request = mysql_query("UPDATE {$db_prefix}log_mark_read SET logTime=".time()." WHERE (memberName='$username' AND ID_BOARD=$ID_BOARD)");
   
   }
   header("Location: $scripturl?opened=$GLOBALS[opened]");
   //BoardIndex();
   obExit();
}


FILE: MessageIndex.php

FIND:

   # Build the link tree
   $displayLinkTree = $modSettings['enableInlineLinks'] ? "<font size=\"1\" class=\"nav\"><B><a href=\"$scripturl\" class=\"nav\">$mbname</a> </b>&nbsp;|&nbsp;<b> " : "<font size=\"2\" class=\"nav\"><B><img src=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl\" class=\"nav\">$mbname</a><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "<a href=\"$scripturl#$currcat\" class=\"nav\">$cat</a> </b>&nbsp;|&nbsp;<b> " : "<img src=\"$imagesdir/tline.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl#$currcat\" class=\"nav\">$cat</a><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "$curboardurl</b> $showmods</font>" : "<img src=\"$imagesdir/tline2.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;$curboardurl</b> $showmods</font>" ;

REPLACE WITH:

   # Build the link tree
   $displayLinkTree = $modSettings['enableInlineLinks'] ? "<font size=\"1\" class=\"nav\"><B><a href=\"$scripturl\" class=\"nav\">$mbname</a> </b>&nbsp;|&nbsp;<b> " : "<font size=\"2\" class=\"nav\"><B><img src=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl\" class=\"nav\">$mbname</a>&nbsp;&nbsp;<font size=\"-2\">[<a href=\"$scripturl?opened=all\" class=\"nav\">Open All Categories</a>]</font><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "<a href=\"$scripturl?opened=$currcat\" class=\"nav\">$cat</a> </b>&nbsp;|&nbsp;<b> " : "<img src=\"$imagesdir/tline.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl?opened=$currcat\" class=\"nav\">$cat</a><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "$curboardurl</b> $showmods</font>" : "<img src=\"$imagesdir/tline2.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;$curboardurl</b> $showmods</font>" ;


FILE: Display.php

FIND:

# Build the link tree
   $displayLinkTree = $modSettings['enableInlineLinks'] ? "<font size=\"1\" class=\"nav\"><B><a href=\"$scripturl\" class=\"nav\">$mbname</a> </b>&nbsp;|&nbsp;<b> " : "<font size=\"2\" class=\"nav\"><B><img src=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl\" class=\"nav\">$mbname</a><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "<a href=\"$scripturl#$curcat\" class=\"nav\">$cat</a> </b>&nbsp;|&nbsp;<b> " : "<img src=\"$imagesdir/tline.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl#$curcat\" class=\"nav\">$cat</a><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "<a href=\"$cgi\" class=\"nav\">$boardname</a></b> $showmods<b> </b>&nbsp;|&nbsp;<b> " : "<img src=\"$imagesdir/tline2.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$cgi\" class=\"nav\">$boardname</a></b> $showmods<b><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "$txt[118]</b></font>" : "<img SRC=\"$imagesdir/tline3.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;$curthreadurl</b></font>" ;

REPLACE:

# Build the link tree
   $displayLinkTree = $modSettings['enableInlineLinks'] ? "<font size=\"1\" class=\"nav\"><B><a href=\"$scripturl\" class=\"nav\">$mbname</a> </b>&nbsp;|&nbsp;<b> " : "<font size=\"2\" class=\"nav\"><B><img src=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl\" class=\"nav\">$mbname</a>&nbsp;&nbsp;<font size=\"-2\">[<a href=\"$scripturl?opened=all\" class=\"nav\">Open All Categories</a>]</font><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "<a href=\"$scripturl?opened=$curcat\" class=\"nav\">$cat</a> </b>&nbsp;|&nbsp;<b> " : "<img src=\"$imagesdir/tline.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$scripturl?opened=$curcat\" class=\"nav\">$cat</a><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "<a href=\"$cgi\" class=\"nav\">$boardname</a></b> $showmods<b> </b>&nbsp;|&nbsp;<b> " : "<img src=\"$imagesdir/tline2.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;<a href=\"$cgi\" class=\"nav\">$boardname</a></b> $showmods<b><br>" ;
   $displayLinkTree .= $modSettings['enableInlineLinks'] ? "$txt[118]</b></font>" : "<img SRC=\"$imagesdir/tline3.gif\" border=\"0\" alt=\"\"><IMG SRC=\"$imagesdir/open.gif\" border=\"0\" alt=\"\">&nbsp;&nbsp;$curthreadurl</b></font>" ;


FILE: Subs.php

FIND:

      $selecthtml .= "<option value=\"\">-----------------------------</option>\n";
      $selecthtml .= "<option value=\"#$row[1]\">$row[0]</option>\n";
      $selecthtml .= "<option value=\"\">-----------------------------</option>\n";

REPLACE:

      $selecthtml .= "<option value=\"\">-----------------------------</option>\n";
      $selecthtml .= "<option value=\"?opened=$row[1]\">$row[0]</option>\n";
      $selecthtml .= "<option value=\"\">-----------------------------</option>\n";



I think that's all I did...lol...as I was not planning on releasing it, I kept no notes.
Logged

KenTeamBG
Jr. Member
**
Posts: 74


TeamBG rules!!!

WWW
Re:Sub Forums
« Reply #24 on: January 18, 2002, 08:04:03 AM »
Reply with quote

P.S. - I like calling this mod "Expando v1.0" even though its not in any install script (I hate the YSE php installer/package manager).

Logged

Pages: 1 [2] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Sub Forums « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.120 seconds with 21 queries.