Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Rejected] More options for not permitted forums
#21
Implementing stuff in core is always easier, than having it via plugin ^^ But having everything imaginable in core ... MyBB 2 would never be released and would be impossible to maintain.

Maybe you're successful with suggesting a hook for 1.8 when you can explain what is not possible and why it is not possible.

I suggested a way, but sure I just had a very rough look at it. Feel free to contact me, here or the German MyBB forums, I'll try to have a more detailed look at it.
You found my signature? Well done : - )
Reply
#22
(03-26-2016, 12:35 PM)Amaryllion Wrote: I think, I just give up and just edit the file over and over again with every update.

Patches plugin also exists for a good reason.
Reply
#23
Okay, I will try suggesting a hook for 1.8 Smile
Reply
#24
(03-26-2016, 12:52 PM)Nik101010 Wrote: Implementing stuff in core is always easier, than having it via plugin ^^ But having everything imaginable in core ... MyBB 2 would never be released and would be impossible to maintain.

Maybe you're successful with suggesting a hook for 1.8 when you can explain what is not possible and why it is not possible.

Okay, I don't get further feedback on how successful my suggestion is or was. I think it will just fade away forgotten because nobody needs it. So I will have to deal with it.

(03-26-2016, 02:44 PM)Destroy666 Wrote:
(03-26-2016, 12:35 PM)Amaryllion Wrote: I think, I just give up and just edit the file over and over again with every update.

Patches plugin also exists for a good reason.

Yes, but I thought it exists for exotic code changes. And I admit, I don't trust a plugin to do my code changes in core files.
But this is a basic thing: Providing the last poster info and counter info whether you are allowed to enter a forum or not. Really, every other board software can do that.

You just need one more template (forumbit_depth2_forum_hidden) and it would not effect any person who does not want these infos. All the other MyBB users could just change two templates (forumbit_depth2_forum_hidden, forumbit_depth2_forum_lastpost_hidden) and there add some variables and they would be done.

For I don't have MyBB 2.0 perhaps someone could move this thread to the 1.8 section?

I could do this modification in core if it just is a question of manpower. Smile
I simply do not know where and how exactly to help.
Reply
#25
Hey,

I'm just here to ask:
Is there a possibility for this change or the plugin?
I really, really need it... 

@Amaryllion
Did you find a solution?
If yes.. can you help me with my board?
Reply
#26
Yes I have a solution. Editing the php file is a demanding task after every update. But it is a solution.

1. Create a new template. Name: forumbit_depth2_forum_hidden
Content:
<tr>
<td class="{$bgcolor}" align="center" valign="center" width="1"><span class="forum_status forum_{$lightbulb['folder']} ajax_mark_read" title="{$lightbulb['altonoff']}" id="mark_read_{$forum['fid']}"></span></td>
<td class="{$bgcolor}" valign="top">
 <span class="lockedforumname">{$forum['name']}</span>{$forum_viewers_text}<div class="smalltext">{$forum['description']}{$modlist}{$subforums}</div>
</td>
<td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$threads}{$unapproved['unapproved_threads']}</td>
<td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$posts}{$unapproved['unapproved_posts']}</td>
<td class="{$bgcolor}" valign="top" align="right" style="white-space: nowrap">{$lastpost}</td>
</tr>


2. Create a new template. Name: forumbit_depth3_hidden
Content:
{$comma}{$statusicon}<span class="lockedforumname">{$forum['name']}</span>

3. Change template: forumbit_depth2_forum_lastpost_hidden
New content (adjust to your own needs):
<div class="smalltext center"><strong>{$lastpost_subject}</strong><br>{$lastpost_date}<br />{$lang->by} {$lastpost_profilelink}</div>


4. Change file inc/functions_forumlist.php as follows:
replace:
if(isset($permissions['canviewthreads']) && $permissions['canviewthreads'] != 1)
{
   $hideinfo = true;
}

with:

if(isset($permissions['canviewthreads']) && $permissions['canviewthreads'] != 1)
{
   $hideinfo = true;
// EDIT: => Lock forum if no threads permitted!
$forum_url = "";
$showlockicon = 1;
}

-----------------------

replace:
if(isset($permissions['canonlyviewownthreads']) && $permissions['canonlyviewownthreads'] == 1)
{
$hidecounters = true;


with:

if(isset($permissions['canonlyviewownthreads']) && $permissions['canonlyviewownthreads'] == 1)
{
// EDIT: => Show Counters for everyone!
// $hidecounters = true;

-----------------------


replace:
// If we are hiding information (lastpost) because we aren't authenticated against the password for this forum, remove them
if($hidelastpostinfo == true)
{
$lastpost_data = array(
'lastpost' => 0,
'lastposter' => ''
);
}


with:
// If we are hiding information (lastpost) because we aren't authenticated against the password for this forum, remove them
// EDIT: => No, don't!
/*
if($hidelastpostinfo == true)
{
$lastpost_data = array(
'lastpost' => 0,
'lastposter' => ''
);
}
*/

-----------------------


replace:
// Increment the counters for the parent forum (returned later)
if($hideinfo != true && $hidecounters != true)

with:
// Increment the counters for the parent forum (returned later)
// EDIT: => only no counters when explicitly no counters wanted
// if($hideinfo != true && $hidecounters != true)
if($hidecounters != true)

-----------------------


replace:
// Fetch the template and append it to the list
eval("\$forum_list .= \"".$templates->get("forumbit_depth3", 1, 0)."\";");

with:
// Fetch the template and append it to the list
// EDIT: => hidden if no url:
if($forum_url == "") {
eval("\$forum_list .= \"".$templates->get("forumbit_depth3_hidden", 1, 0)."\";");
} 
else {
eval("\$forum_list .= \"".$templates->get("forumbit_depth3", 1, 0)."\";");
}

-----------------------


replace:
// Forum is a standard forum, set template type
else
{
$forumcat = '_forum';
}

with:
// Forum is a standard forum, set template type
else
{

// EDIT: => hidden if no url:
if($forum_url == "") {
$forumcat = '_forum_hidden';
} 
else {
$forumcat = '_forum';
}
}
           
-----------------------


replace:
if($forum['linkto'] == '')
{
// No posts have been made in this forum - show never text
if(($lastpost_data['lastpost'] == 0 || $lastpost_data['lastposter'] == '') && $hideinfo != true)
{
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost_never")."\";");
}
elseif($hideinfo != true)

with:
if($forum['linkto'] == '')
{
// EDIT: => Last Date for everyone!
// Format lastpost date and time
$lastpost_date = my_date('relative', $lastpost_data['lastpost']);
               $lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);
$lastpost_subject = $full_lastpost_subject = $parser->parse_badwords($lastpost_data['lastpostsubject']);
               
// Call hidden lastpost template
if($depth != 1)
{
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost_hidden")."\";");
}

// No posts have been made in this forum - show never text
// EDIT: => Last Date for everyone!
// if(($lastpost_data['lastpost'] == 0 || $lastpost_data['lastposter'] == '') && $hideinfo != true)
if(($lastpost_data['lastpost'] == 0 || $lastpost_data['lastposter'] == ''))
{
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost_never")."\";");
}
elseif($hideinfo != true)

-----------------------


replace:
// If this forum is a link or is password protected and the user isn't authenticated, set counters to "-"
if($forum['linkto'] != '' || $hideinfo == true || $hidecounters == true)
{
$posts = "-";
$threads = "-";
}            

with:
// If this forum is a link or is password protected and the user isn't authenticated, set counters to "-"
// EDIT: => Only hide counters when counters should be explicitly hidden
//if($forum['linkto'] != '' || $hideinfo == true || $hidecounters == true)
if($forum['linkto'] != '' || $hidecounters == true)
{
$posts = "-";
$threads = "-";
}            

-----------------------


replace:
// If this forum is a link or is password protected and the user isn't authenticated, set lastpost to "-"
if($forum['linkto'] != '' || $hideinfo == true || $hidelastpostinfo == true)
{
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost_hidden")."\";");
}

with:
// If this forum is a link or is password protected and the user isn't authenticated, set lastpost to "-"
// EDIT: => too late for hideinfo, already done
//if($forum['linkto'] != '' || $hideinfo == true || $hidelastpostinfo == true)
if($forum['linkto'] != '')
{
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost_hidden")."\";");
}
           

-----------------------


replace:
// If the current forums lastpost is greater than other child forums of the current parent and forum info isn't hidden, overwrite it
           if((!isset($parent_lastpost) || $lastpost_data['lastpost'] > $parent_lastpost['lastpost']) && $hideinfo != true)

with:

// If the current forums lastpost is greater than other child forums of the current parent and forum info isn't hidden, overwrite it
           // EDIT: => $hideinfo removed
           // if((!isset($parent_lastpost) || $lastpost_data['lastpost'] > $parent_lastpost['lastpost']) && $hideinfo != true)
if((!isset($parent_lastpost) || $lastpost_data['lastpost'] > $parent_lastpost['lastpost']) )

Reply
#27
Hi,

Your MyBB 2.0 suggestion has unfortunately been rejected. Your suggestion does not fit with the direction that MyBB is heading in as a project at this time.
-Ben

Please do not PM me for support. I am looking to be hired for paid services.

You can view my paid services here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)