[ Príspevok: 1 ] 
AutorSpráva
Offline

Prevádzkovateľ fóra
Prevádzkovateľ fóra
Per-User Avatar Options - Addition in ACP

Registrovaný: 01.05.05
Príspevky: 13416
Témy: 1494 | 1494
Bydlisko: Bratislava

Kód:
###############################################
##   Hack Title:    Per-User Avatar Options - Addition in ACP
##   Hack Version:  1.0.0
##   Author:        JKeats
##
##   Description:   Adds an additional option to the user management screen in the ACP allowing the admin to allow or
##                  disallow the use of the various avatar selection options on a per-user basis.
##
##   Compatibility: 2.0.6 (2.0.0 - 2.0.4 - untested)
##
##   Installation Level: Moderate
##   Installation Time: 10 Minutes
##
##   Files To Edit: 4
##                 /admin/admin_users.php
##            /includes/usercp_register.php
##            /language/lang_english/lang_admin.php
##            /templates/XXXXXX/admin/user_edit_body.tpl
##
##   Included Files: 0
##            None
##
##   History:
##            None
##
##   Author Notes:
##            The SQL below should be altered to meet your needs.  By default, the 3 DB additions will
##            be set to NO (0).  However, you can change any of the 3 0's to 1's instead if you want
##            the default for that option to be YES (1) instead.
##
##   Support:    http://www.phpbbhacks.com/forums
##   Copyright:  ©2003 Per-User Avatar Options - Addition in ACP 1.0.0 - JKeats
##
###############################################
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
##   Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
##   This hack is released under the GPL License.
##   This hack can be freely used, but not distributed, without permission.
##   Intellectual Property is retained by the hack author(s) listed above.
###############################################
##
###############################################
## Before adding this hack to your forum you should back up all related files.
###############################################

#
#-----[ SQL ]------------------------------------------
#

ALTER TABLE phpbb_users ADD `user_allowAVgallery` tinyint(1) NOT NULL default '0';
ALTER TABLE phpbb_users ADD `user_allowAVremote` tinyint(1) NOT NULL default '0';
ALTER TABLE phpbb_users ADD `user_allowAVupload` tinyint(1) NOT NULL default '0';

#
#-----[ OPEN ]------------------------------------------
#

/admin/admin_users.php

#
#-----[ FIND ]------------------------------------------
#

      $user_allowavatar = ( !empty($HTTP_POST_VARS['user_allowavatar']) ) ? intval( $HTTP_POST_VARS['user_allowavatar'] ) : 0;

#
#-----[ AFTER, ADD ]------------------------------------------
#

      $user_allowAVgallery = ( !empty($HTTP_POST_VARS['user_allowAVgallery']) ) ? intval( $HTTP_POST_VARS['user_allowAVgallery'] ) : 0;
      $user_allowAVremote = ( !empty($HTTP_POST_VARS['user_allowAVremote']) ) ? intval( $HTTP_POST_VARS['user_allowAVremote'] ) : 0;
      $user_allowAVupload = ( !empty($HTTP_POST_VARS['user_allowAVupload']) ) ? intval( $HTTP_POST_VARS['user_allowAVupload'] ) : 0;

#
#-----[ FIND ]------------------------------------------
#

, user_allowavatar = $user_allowavatar

#
#-----[ INLINE AFTER, ADD ]------------------------------------------
#

, user_allowAVgallery = $user_allowAVgallery, user_allowAVremote = $user_allowAVremote, user_allowAVupload = $user_allowAVupload

#
#-----[ FIND ]------------------------------------------
#

      $user_allowpm = $this_userdata['user_allow_pm'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

      $user_allowAVgallery = $this_userdata['user_allowAVgallery'];
      $user_allowAVremote = $this_userdata['user_allowAVremote'];
      $user_allowAVupload = $this_userdata['user_allowAVupload'];

#
#-----[ FIND ]------------------------------------------
#

         $s_hidden_fields .= '<input type="hidden" name="user_rank" value="' . $user_rank . '" />';

#
#-----[ AFTER, ADD ]------------------------------------------
#

         $s_hidden_fields .= '<input type="hidden" name="user_allowAVgallery" value="' . $user_allowAVgallery . '" />';
         $s_hidden_fields .= '<input type="hidden" name="user_allowAVremote" value="' . $user_allowAVremote . '" />';
         $s_hidden_fields .= '<input type="hidden" name="user_allowAVupload" value="' . $user_allowAVupload . '" />';

#
#-----[ FIND ]------------------------------------------
#

         'ALLOW_AVATAR_YES' => ($user_allowavatar) ? 'checked="checked"' : '',
         'ALLOW_AVATAR_NO' => (!$user_allowavatar) ? 'checked="checked"' : '',

#
#-----[ AFTER, ADD ]------------------------------------------
#

         'ALLOW_AVGALLERY_YES' => ($user_allowAVgallery) ? 'checked="checked"' : '',
                        'ALLOW_AVGALLERY_NO' => (!$user_allowAVgallery) ? 'checked="checked"' : '',
         'ALLOW_AVREMOTE_YES' => ($user_allowAVremote) ? 'checked="checked"' : '',
                        'ALLOW_AVREMOTE_NO' => (!$user_allowAVremote) ? 'checked="checked"' : '',
         'ALLOW_AVUPLOAD_YES' => ($user_allowAVupload) ? 'checked="checked"' : '',
                        'ALLOW_AVUPLOAD_NO' => (!$user_allowAVupload) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------
#

         'L_ALLOW_AVATAR' => $lang['User_allowavatar'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

         'L_ALLOW_AVGALLERY' => $lang['User_allowAVgallery'],
         'L_ALLOW_AVREMOTE' => $lang['User_allowAVremote'],
         'L_ALLOW_AVUPLOAD' => $lang['User_allowAVupload'],

#
#-----[ OPEN ]------------------------------------------
#

/includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#

   if ( $mode != 'register' )
        {
                if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
                {
                        $template->assign_block_vars('switch_avatar_block', array() );

                        if ( $board_config['allow_avatar_upload'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_path'])) )
                        {
                                if ( $form_enctype != '' )
                                {
                                        $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
                                }
                                $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
                        }

                        if ( $board_config['allow_avatar_remote'] )
                        {
                                $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
                        }

                        if ( $board_config['allow_avatar_local'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
                        {
                                $template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
                        }
                }
        }

#
#-----[ REPLACE WITH ]------------------------------------------
#

   if ( $mode != 'register' )
   {
      if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
      {
         $template->assign_block_vars('switch_avatar_block', array() );
         
         if ( $board_config['allow_avatar_upload'] && $userdata['user_allowAVupload'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_path'])) )
         {
            if ( $form_enctype != '' )
            {
               $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
            }
            $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
         }
         
         if ( $board_config['allow_avatar_remote'] && $userdata['user_allowAVremote'] )
         {
            $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
         }

         if ( $board_config['allow_avatar_local'] && $userdata['user_allowAVgallery'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
         {
            $template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
         }
      }
   }

#
#-----[ OPEN ]------------------------------------------
#

/language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#

$lang['User_allowavatar'] = 'Can display avatar';

#
#-----[ AFTER, ADD ]------------------------------------------
#

$lang['User_allowAVgallery'] = 'Can select gallery avatar';
$lang['User_allowAVremote'] = 'Can remote link an avatar';
$lang['User_allowAVupload'] = 'Can upload an avatar';

#
#-----[ OPEN ]------------------------------------------
#

/templates/XXXXXX/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
#

   <tr>
          <td class="row1"><span class="gen">{L_ALLOW_AVATAR}</span></td>
          <td class="row2">
                <input type="radio" name="user_allowavatar" value="1" {ALLOW_AVATAR_YES} />
                <span class="gen">{L_YES}</span>&nbsp;&nbsp;
                <input type="radio" name="user_allowavatar" value="0" {ALLOW_AVATAR_NO} />
                <span class="gen">{L_NO}</span></td>
        </tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

   <tr>
          <td class="row1"><span class="gen">{L_ALLOW_AVGALLERY}</span></td>
          <td class="row2">
                <input type="radio" name="user_allowAVgallery" value="1" {ALLOW_AVGALLERY_YES} />
                <span class="gen">{L_YES}</span>&nbsp;&nbsp;
                <input type="radio" name="user_allowAVgallery" value="0" {ALLOW_AVGALLERY_NO} />
                <span class="gen">{L_NO}</span></td>
        </tr>
   <tr>
          <td class="row1"><span class="gen">{L_ALLOW_AVREMOTE}</span></td>
          <td class="row2">
                <input type="radio" name="user_allowAVremote" value="1" {ALLOW_AVREMOTE_YES} />
                <span class="gen">{L_YES}</span>&nbsp;&nbsp;
                <input type="radio" name="user_allowAVremote" value="0" {ALLOW_AVREMOTE_NO} />
                <span class="gen">{L_NO}</span></td>
        </tr>
   <tr>
          <td class="row1"><span class="gen">{L_ALLOW_AVUPLOAD}</span></td>
          <td class="row2">
                <input type="radio" name="user_allowAVupload" value="1" {ALLOW_AVUPLOAD_YES} />
                <span class="gen">{L_YES}</span>&nbsp;&nbsp;
                <input type="radio" name="user_allowAVupload" value="0" {ALLOW_AVUPLOAD_NO} />
                <span class="gen">{L_NO}</span></td>
        </tr>

#
#-----[ SAVE & CLOSE ALL FILES ]------------------------------------------
#
#End


_________________
Streacom DA2 | SilverStone Titanium SX800-LTI 800W | ASRock X299E-ITX/ac | Intel Core i9-9980XE & be quiet! Dark Rock TF | Kingston HyperX Impact 64 GB DDR4 2666 MHz | NVIDIA Titan RTX 24 GB | Intel SSD Optane 905P 480 GB NVMe U.2 & Intel SSD 750 1,2 TB NVMe U.2 & Intel SSD 660p 2 TB NVMe M.2 & Seagate BackUp Plus Portable 56 TB USB | 55" 4K OLED Dell Alienware AW5520QF | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech G603 | Logitech F710 | Harman Kardon Sabre SB 35 & Sennheiser RS 175 | Microsoft Windows 11 Enterprise | APC Back-UPS BE-850 VA | Lenovo ThinkPad X250 & Microsoft Windows 11 Professional | iPhone 15 Pro 256 GB & Pitaka Aramid | SilverStone ML05B Milo | Corsair SF600 SFX 600W | ASRock X99E-ITX/ac | Intel Xeon E5-2683 v4 & NOCTUA NH-L12S | Kingston HyperX Savage 32 GB DDR4 2400 MHz | NVIDIA GeForce GT 710 1 GB | Intel SSD Optane Memory 32 GB NVMe M.2 & Intel SSD 730 240 GB SATA | Ubuntu 24.04.1 LTS
 [ Príspevok: 1 ] 


Per-User Avatar Options - Addition in ACP



Podobné témy

 Témy  Odpovede  Zobrazenia  Posledný príspevok 
V tomto fóre nie sú ďalšie neprečítané témy.

phpbb_users of ACP

v Redakčné systémy

3

431

13.05.2007 10:17

mokus

V tomto fóre nie sú ďalšie neprečítané témy.

Actions per Second - Metóda merania výkonu v online hrách.

v Články

0

973

03.07.2010 15:59

Mir

V tomto fóre nie sú ďalšie neprečítané témy.

Advanced boot options

v Operačné systémy Microsoft

2

458

24.03.2010 17:34

olsojin

V tomto fóre nie sú ďalšie neprečítané témy.

COD 4 options

v Počítačové hry

2

499

07.12.2007 18:14

shiro

V tomto fóre nie sú ďalšie neprečítané témy.

AMI BIOS options

v nVidia čipové sady

4

1945

26.06.2008 21:29

5rnka

V tomto fóre nie sú ďalšie neprečítané témy.

GT750M /Acer V3-772G/ HDMI, Bios advanced options, Nvidia control panel a ine...

v nVidia grafické karty

0

458

11.04.2015 13:21

ShadowSong

V tomto fóre nie sú ďalšie neprečítané témy.

avatar

v Správy pre vedenie fóra

7

1864

12.11.2010 18:32

OmeGa

V tomto fóre nie sú ďalšie neprečítané témy.

Avatar

v Správy pre vedenie fóra

2

3081

20.01.2020 14:41

Koroner

V tomto fóre nie sú ďalšie neprečítané témy.

avatar-otazka

v PHP, ASP

2

1149

08.07.2009 14:16

mark6000

V tomto fóre nie sú ďalšie neprečítané témy.

upload avatar

v Správy pre vedenie fóra

3

1893

18.07.2006 17:27

javo

V tomto fóre nie sú ďalšie neprečítané témy.

WordPress avatar

v Redakčné systémy

3

953

04.05.2014 18:55

chrono

V tomto fóre nie sú ďalšie neprečítané témy.

Default avatar

v Redakčné systémy

0

1280

14.10.2006 14:46

JanoF

V tomto fóre nie sú ďalšie neprečítané témy.

Avatar z URL

v Správy pre vedenie fóra

3

1668

08.01.2010 16:52

riki137

V tomto fóre nie sú ďalšie neprečítané témy.

icq avatar upload

v Sieťové a internetové programy

0

1216

07.12.2006 20:10

Fenius

V tomto fóre nie sú ďalšie neprečítané témy.

Avatar - PC hra

v Predám

6

526

22.11.2023 15:11

Tommy- T

V tomto fóre nie sú ďalšie neprečítané témy.

hra Avatar 3D

v Počítačové hry

7

1604

06.01.2010 23:34

Qpkqkma



© 2005 - 2024 PCforum, edited by JanoF