[ 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: 12422
Témy: 1447 | 1447
Bydlisko: Bratislava
Vek: 32

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


_________________
SilverStone SST CS01 | Corsair SF600 600W SFX | ASRock X99E-ITX/ac | Intel Xeon E5-2683 v4 (16 Cores / 32 Threads) & Noctua NH-U9DX i4 | Kingston HyperX Savage 32 GB DDR4 2400 MHz | PNY NVIDIA Quadro K1200 DP 4 GB DDR5 | Intel SSD 750 1.2 TB NVMe & Intel SSD 730 240 GB SATA & Seagate BackUp Plus Portable 12 TB USB | 31.5" 4K LCD EIZO FlexScan EV3237 & 2 x 24" LCD EIZO FlexScan EV2451 | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech Wireless G700s | Harman Kardon Nova | Microsoft Windows 7 Ultimate | APC Back-UPS ES 700 | Lenovo ThinkPad X250 - Intel Core i7 5600U, 8 GB DDR3 1600 MHz, Intel HD Graphics 5500, SanDisk SSD 512 GB, 12.5 FHD LED IPS, WWAN 3G 4G LTE, Microsoft Windows 7 Ultimate | Nintendo Classic Mini | BlackBerry Passport 96 GB
 [ 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

288

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

580

03.07.2010 15:59

Mir

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

COD 4 options

v Počítačové hry

2

281

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

1658

26.06.2008 21:29

5rnka

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

Advanced boot options

v Operačné systémy Microsoft

2

229

24.03.2010 17:34

olsojin

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

avatar

v Správy pre vedenie fóra

7

915

12.11.2010 18:32

OmeGa

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

WordPress avatar

v Redakčné systémy

3

96

04.05.2014 18:55

chrono

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

upload avatar

v Správy pre vedenie fóra

3

1043

18.07.2006 17:27

javo

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

Default avatar

v Redakčné systémy

0

266

14.10.2006 14:46

JanoF

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

avatar-otazka

v PHP, ASP

2

286

08.07.2009 14:16

mark6000

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

Avatár v phpBB

v Redakčné systémy

2

940

24.05.2006 1:35

JanoF

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

hra Avatar 3D

v Počítačové hry

7

649

06.01.2010 23:34

Qpkqkma

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

Avatar the Movie

[ Choď na stránku:Choď na stránku: 1, 2, 3, 4, 5 ]

v Kultúra, umenie, filmy, hudba, história, média

128

5546

12.03.2010 15:57

sedlák

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

Problem nahrať avatar

v Správy pre vedenie fóra

2

660

06.01.2011 17:30

Qpkqkma

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

icq avatar upload

v Sieťové a internetové programy

0

337

07.12.2006 20:10

Fenius

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

Avatar z URL

v Správy pre vedenie fóra

3

787

08.01.2010 16:52

riki137



© 2005 - 2017 PCforum, edited by JanoF