1 sayfadan 1. sayfa

mod - New Forums Hidden Until Ready

İletiTarih: 03.01.2007, 06:20
sabri ünal
yeni forumlar, yöneticiler açana kadar misafirlere kapalı! ingilizce olarak kounyu anladım, bir de bunu mod şablonuna uygun hale getirip siteye eklemek var, mod, mod şablonuna uygun olarak hazırlanmamış, daha çok benim ders mantığımla anlatılmış...

Kod: Tümünü seç
Description: This MOD solves a particularly irritating problem for many.

When you create a new forum the permissions default to:

View: All (including guests)
Read: All (including guests)
Post: All (including guests)
Reply: All (including guests)
Edit: Registered Members
Delete: Registered Members
Sticky: Moderator
Announcement: Moderator
Vote: Registered Members
Create Poll: Registered Members


Now this is fine if you want people to be able to post without registering. But many boards do not want guests to be
able to post. Another aspect of creating a new forum... permissions are set at the forum level and not the category level.

If you have a category that has zero forums in it, the category is not displayed. That works even if the category has
private forums. To a non-authorized visitor, the category is empty because they don't have access to the private forums.

Now suppose you want to create a new private forum. For the brief moment in between when you create the forum and you get
a chance to update the default permissions, that forum is visible. If a member is online at that time, they will see
the new category! This may or may not be an issue for you.

In any case, this simple change will show you how to update your default forum permissions. We set ours like this:


View: Admin
Read: Admin
Post: Admin
Reply: Admin
Edit: Admin
Delete: Admin
Sticky: Admin
Announcement: Admin
Vote: Admin
Create Poll: Admin


This makes the forum invisible to everyone on the board except for the ADMIN level users. You can change the description,
change the permissions, move it up or down in the category order... none of these changes will be visible to
"normal" members of your forum. Here's the change.

Open

admin/admin_forums.php

Find

$forum_auth_ary = array(
        "auth_view" => AUTH_ALL,
        "auth_read" => AUTH_ALL,
        "auth_post" => AUTH_ALL,
        "auth_reply" => AUTH_ALL,
        "auth_edit" => AUTH_REG,
        "auth_delete" => AUTH_REG,
        "auth_sticky" => AUTH_MOD,
        "auth_announce" => AUTH_MOD,
        "auth_vote" => AUTH_REG,
        "auth_pollcreate" => AUTH_REG
);

Change the AUTH_ALL to AUTH_ADMIN to make the forum hidden to all but ADMINs to start with.
In our case, we've done this:

$forum_auth_ary = array(
        'auth_view' => AUTH_ADMIN,
        'auth_read' => AUTH_ADMIN,
        'auth_post' => AUTH_ADMIN,
        'auth_reply' => AUTH_ADMIN,
        'auth_edit' => AUTH_ADMIN,
        'auth_delete' => AUTH_ADMIN,
        'auth_sticky' => AUTH_ADMIN,
        'auth_announce' => AUTH_ADMIN,
        'auth_vote' => AUTH_ADMIN,
        'auth_pollcreate' => AUTH_ADMIN
);

Those of you that are particularly observant Smile might notice that all of the double quotes " have been
replaced by single quotes ' in this update as well. The admin files are - for the most part - written using double
quotes for all text strings, and that is not necessary. Double quotes are only used when there
are $variables to evaluate within the string. Single quotes are processed faster because they are
literal strings with no substitutions.

And here's a bonus change. There has been more than one case
where - because of the new defaults - we forgot to go back and update permissions
so that "normal" members could see the forum! Embarassed So this additional line will add text to the forum
description while viewed on the index.

open

index.php

if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id )
{
$display_forums = true;


// BEGIN Admin Forum Description Notes (www.phpBBDoctor.com)
if ($is_auth_ary[$forum_data[$j]['forum_id']]['auth_view_type'] == $lang['Auth_Administrators'])
{
   $forum_data[$j]['forum_desc'] .= $lang['Admin_only_forum'];
}
// END Admin Forum Description Notes (www.phpBBDoctor.com)

Finally, a language entry.

Open

language/lang_english/lang_main.php

Find

?>

Before, add

// BEGIN Admin Forum Description Notes (www.phpBBDoctor.com)
$lang['Admin_only_forum'] = '<span style="color:red"> Admin Only Forum</span>';
// END Admin Forum Description Notes (www.phpBBDoctor.com)

That's it! Now if you use this MOD to temporarily "hide" your new forums while you adjust permissions and
position in your forum list, you won't forget. There should be a nice note automatically added to your
forum description that only ADMINs will see. Cool

This MOD has been installed at the phpBBDoctor.com.

İletiTarih: 03.01.2007, 09:27
BuzLaş
Üstad bu phpBB2 değilmi? kafam karıştı :(

İletiTarih: 11.01.2007, 14:12
ALEXIS
phpbb2 olsa gerek, phpbb düzenlenecek forumunu silmiştik

İletiTarih: 11.01.2007, 14:39
CeRBeR
aslında böyle mod yüklemek daha zor ama insanı robotlaşmaktan kurtarıp zekasını çalıştırmaya zorluyor yoku şunu bul altına bunu koy demektense şu dosylaarda şunları bul onları bunlarla değiş demek daha zevkli

tabii herşey userlar için :)

İletiTarih: 11.01.2007, 19:54
sabri ünal
mod 2. serisi için... daha doğrusu ders :) modunu yaparsak modu olacak...