mod - New Forums Hidden Until Ready

phpBB geliştirme, performans ve hızını arttırmak.

mod - New Forums Hidden Until Ready

İleti sabri ünal 03.01.2007, 06:20

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.
Mutluyum, biraz komedi takılıyorum! sakın kızmayın yakında geçer, sebebini ben de bilmiyorum! yeni bir aşk da bulmuş değilim!
Kullanıcı avatarı
sabri ünal
Üye
Üye
 
İleti: 1325
Kayıt: 27.10.2005, 15:49
Konum: İstanbul

İleti BuzLaş 03.01.2007, 09:27

Üstad bu phpBB2 değilmi? kafam karıştı :(
Belki Üstümüzden Bir Kuş Geçer Kanadından Bir Tüğ Düşer (:

ღ Ölesiye Sevgi Besliyorum İçinde ღ
BuzLaş
Genel Yetkili
Genel Yetkili
 
İleti: 77
Kayıt: 09.09.2006, 21:54
Konum: İzmir

İleti

ALEXIS
11.01.2007, 14:12

phpbb2 olsa gerek, phpbb düzenlenecek forumunu silmiştik
Kullanıcı avatarı
ALEXIS
Site Yöneticisi
Site Yöneticisi
 
İleti: 2563
Kayıt: 30.06.2005, 09:08

İleti CeRBeR 11.01.2007, 14:39

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 :)
Kullanıcı avatarı
CeRBeR
Üye
Üye
 
İleti: 232
Kayıt: 05.10.2005, 20:37

İleti sabri ünal 11.01.2007, 19:54

mod 2. serisi için... daha doğrusu ders :) modunu yaparsak modu olacak...
Mutluyum, biraz komedi takılıyorum! sakın kızmayın yakında geçer, sebebini ben de bilmiyorum! yeni bir aşk da bulmuş değilim!
Kullanıcı avatarı
sabri ünal
Üye
Üye
 
İleti: 1325
Kayıt: 27.10.2005, 15:49
Konum: İstanbul


phpBB Geliştirme



Kimler çevrimiçi

Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir

cron