Author Topic: [Mod] Moderatoren für 4images - 4images 1.7.6  (Read 7428 times)

0 Members and 1 Guest are viewing this topic.

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
[Mod] Moderatoren für 4images - 4images 1.7.6
« on: October 14, 2008, 10:56:14 AM »
Danke an excitex2 für die originale Mod in Spanisch: http://www.4homepages.de/forum/index.php?topic=17155.msg91450#msg91450

Mit dieser Mod kannst du Moderatoren zu deiner 4images Gallery hinzufügen.
Du kannst im Adminpanel einstellen, wer ein Moderator sein darf und was der einzelne Moderator dann darf.
Folgende Angaben kann man machen:

- Der Moderator darf Kategorien bearbeiten
- Der Moderator darf Bilder bearbeiten
- Der Moderator darf Kommentare bearbeiten
- Der Moderator darf User bearbeiten

Dieser Version läuft auch unter 4images 1.7.6


Dateien die bearbeitet werden :

details.php
lang/main.php
lang/admin.php
include/constans.php
include/page_header.php
templates/defauld/footer.html
admin/admin_functions.php
admin/email.php
admin/admin_global.php
admin/index.php
admin/users.php



Step 1
Öffne details.php :

Code: [Select]
$admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

Ersetze mit :

Code: [Select]
///// Nuevo tipo de usuarios /////
      /* ******* Antes ********
      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }
      // ******* Ahora *********
      */
      $admin_links = "";
      if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_comentarios'] == 1)) {
      $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }
      ///// Fin nuevo tipo de usuario /////

Suche:

Code: [Select]
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
  $admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}

Ersetze mit:

Code: [Select]
///// Nuevo tipo de usuarios /////
/* ******* Antes ********
// Admin Links
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
  $admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
// ******* Ahora *********
*/
$admin_links = "";
if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_imagenes'] == 1)) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
  $admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
///// Fin nuevo tipo de usuario /////

Step 2

Öffne lang/deutsch/main.php[/b] 

Code: [Select]
$lang['userlevel_admin'] = "Administrador";
Füge darunter :

Code: [Select]
////// Nuevo tipo usuario /////
$lang['userlevel_moderador'] = "Moderador";
///// Fin nuevo tipo usuario ///////

Step 3

Öffne lang/deutsch/admin.php[/b]

Code: [Select]
$lang['userlevel_admin'] = "Administradores";

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario /////
$lang['userlevel_moderador'] = "Moderadores";
/////// Fin nuevo tipo de usuario /////

Suche :

Code: [Select]
$lang['field_usergroup_name'] = "Nombre del grupo de usuarios.";

Füge darunter :

Code: [Select]
/////// Nuevo tipo de usuario //////////
$lang['field_moderador_categorias'] = "Este MODERADOR tendrá control sobre las categorias ? :";
$lang['field_moderador_imagenes'] = "Este MODERADOR tendrá control sobre las imagenes ? :";
$lang['field_moderador_comentarios'] = "Este MODERADOR tendrá control sobre los comentarios ? :";
$lang['field_moderador_usuarios'] = "Este MODERADOR tendrá control sobre los usuarios ? :";
/////// Fin nuevo tipo de usuario ////////

Suche :

Code: [Select]
$lang['nav_users_email'] = "Enviar Email";

Füge darunter :

Code: [Select]
////// Nuevo tipo de usuario //////
$lang['nav_users_moderadores_main'] = "Moderadores";
$lang['nav_users_moderadores_edit'] = "Editar moderadores";
///// Fin nuevo tipo de usuario //////

Step 4

Öffne include/constans.php :[/b]

Code: [Select]
// User levels
define('GUEST', -1);
define('USER_AWAITING', 1);
define('USER', 2);
define('ADMIN', 9);

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
define('MODERADOR', 5);
////// Fin nuevo tipo de usuario ///////

Suche :

Code: [Select]
// Permission levels
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
define('AUTH_MODERADOR', 5);
////// Fin nuevo tipo de usuario ///////

Suche :

Code: [Select]
define('ADMIN_SAFE_LOGIN', 0);

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
define('MODERADOR_SAFE_LOGIN', 0);
////// Fin nuevo tipo de usuario ///////

Step 5

Öffne : include/page_header.php[/b]

Code: [Select]
  "cp_link" => ($user_info['user_level'] != ADMIN) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Admin Control Panel</a>]</p>\n",

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
  "cp_moderador" => ($user_info['user_level'] != MODERADOR) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Moderador Control Panel</a>]</p>\n",
  ////// Fin nuevo tipo de usuario ///////

Öffne : templates/dein-template/footer.html[/b]

Code: [Select]
{cp_link}
Ersetze mit :

Code: [Select]
{cp_link}{cp_moderador}

Step 6

Öffne : admin/admin_functions.php[/b]

Code: [Select]
  echo ">".$lang['userlevel_admin']."</option>\n";
Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
  echo "<option value=\"".MODERADOR."\"";
  if ($userlevel == MODERADOR && $userlevel != "") {
    echo " selected=\"selected\"";
  }
  echo ">".$lang['userlevel_moderador']."</option>\n";
   ////// Fin nuevo tipo de usuario ///////

Suche :

Code: [Select]
echo ">".$lang['userlevel_registered_awaiting']."</option>\n";
  echo "</select>\n</td>\n</tr>\n";
}

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
function show_userlevel_select_row_moderadores($title, $name = "user_level", $userlevel = "") {
  global $lang, $error, $HTTP_POST_VARS;
  if (isset($error[$name])) {
    $title = sprintf("<span class=\"marktext\">%s *</span>", $title);
  }
  if (isset($HTTP_POST_VARS[$name])/* && $userlevel == ""*/) {
    $userlevel = stripslashes($HTTP_POST_VARS[$name]);
  }
  echo "<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n<td>\n";
  echo "<select name=".$name.">\n";
  echo "<option value=\"".GUEST."\"";
  if ($userlevel == GUEST || $userlevel == "") {
    echo " selected=\"selected\"";
  }
  echo ">--</option>\n";
  echo "<option value=\"".USER."\"";
  if ($userlevel == USER && $userlevel != "") {
    echo " selected=\"selected\"";
  }
   echo ">".$lang['userlevel_registered']."</option>\n";
  echo "<option value=\"".USER_AWAITING."\"";
  if ($userlevel == USER_AWAITING && $userlevel != "") {
    echo " selected=\"selected\"";
  }
  echo ">".$lang['userlevel_registered_awaiting']."</option>\n";
  echo "</select>\n</td>\n</tr>\n";
}
//////// Fin nuevo tipo de usuario //////

Step 7

Öffne : admin/email.php[/b]

Code: [Select]
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_admin']."</option>\n";
    }

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
    elseif ($level != $user_level && $user_level == MODERADOR) {
      $select .= "<option value=\"0\">__________________________</option>\n";
      $select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_moderador']."</option>\n";
    }
////// Fin nuevo tipo de usuario //////


Step 8

Öffne : admin/admin_global.php

Code: [Select]
if (defined('ADMIN_SAFE_LOGIN') && ADMIN_SAFE_LOGIN == 1) {
  if ($user_info['user_level'] != GUEST && $user_info['user_level'] == ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
    setcookie("adminon", 1, 0, '/');
    $HTTP_COOKIE_VARS['adminon'] = 1;
  }
  else {
    if ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER || $user_info['user_level'] == USER_AWAITING) {
      $HTTP_COOKIE_VARS['adminon'] = 0;
    }
  }

  if (!isset($HTTP_COOKIE_VARS['adminon']) || $HTTP_COOKIE_VARS['adminon'] == 0) {
    $user_info['user_level'] = GUEST;
  }
  else {
    if ($user_info['user_level'] != GUEST  && $user_info['user_level'] == ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
      setcookie("adminon", 1, 0, '/');
      $HTTP_COOKIE_VARS['adminon'] = 1;
    }
  }
}

Ersetze mit :

Code: [Select]
/////// Nuevo tipo de usuario ///////
/*
///// Antes
if (defined('ADMIN_SAFE_LOGIN') && ADMIN_SAFE_LOGIN == 1) {
  if ($user_info['user_level'] != GUEST && $user_info['user_level'] == ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
    setcookie("adminon", 1, 0, '/');
    $HTTP_COOKIE_VARS['adminon'] = 1;
  }
  else {
    if ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER || $user_info['user_level'] == USER_AWAITING) {
      $HTTP_COOKIE_VARS['adminon'] = 0;
    }
  }

  if (!isset($HTTP_COOKIE_VARS['adminon']) || $HTTP_COOKIE_VARS['adminon'] == 0) {
    $user_info['user_level'] = GUEST;
  }
  else {
    if ($user_info['user_level'] != GUEST  && $user_info['user_level'] == ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
      setcookie("adminon", 1, 0, '/');
      $HTTP_COOKIE_VARS['adminon'] = 1;
    }
  }
}
*/
///////// Ahora
if ((defined('ADMIN_SAFE_LOGIN') && ADMIN_SAFE_LOGIN == 1) || (defined('MODERADOR_SAFE_LOGIN') && MODERADOR_SAFE_LOGIN == 1)){
  if ($user_info['user_level'] != GUEST && $user_info['user_level'] != MODERADOR && $user_info['user_level'] == ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
    setcookie("adminon", 1, 0, '/');
    $HTTP_COOKIE_VARS['adminon'] = 1;
  }
  else {
    if ($user_info['user_level'] == GUEST || $user_info['user_level'] == MODERADOR || $user_info['user_level'] == USER || $user_info['user_level'] == USER_AWAITING) {
      $HTTP_COOKIE_VARS['adminon'] = 0;
    }
  }
if ($user_info['user_level'] != GUEST && $user_info['user_level'] == MODERADOR && $user_info['user_level'] != ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
    setcookie("moderadoron", 1, 0, '/');
    $HTTP_COOKIE_VARS['moderadoron'] = 1;
  }
  else {
    if ($user_info['user_level'] == GUEST || $user_info['user_level'] == ADMIN || $user_info['user_level'] == USER || $user_info['user_level'] == USER_AWAITING) {
      $HTTP_COOKIE_VARS['moderadoron'] = 0;
    }
  }
  if (!isset($HTTP_COOKIE_VARS['adminon']) || $HTTP_COOKIE_VARS['adminon'] == 0 || !isset($HTTP_COOKIE_VARS['moderadoron']) || $HTTP_COOKIE_VARS['moderadoron'] == 0) {
    $user_info['user_level'] = GUEST;
  }
  else {
    if ($user_info['user_level'] != GUEST  && $user_info['user_level'] != MODERADOR && $user_info['user_level'] == ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
      setcookie("adminon", 1, 0, '/');
      $HTTP_COOKIE_VARS['adminon'] = 1;
    }

else {
    if ($user_info['user_level'] != GUEST  && $user_info['user_level'] == MODERADOR  && $user_info['user_level'] != ADMIN && isset($HTTP_POST_VARS['loginusername'])) {
      setcookie("moderadoron", 1, 0, '/');
      $HTTP_COOKIE_VARS['moderadoron'] = 1;
    }
  }
  }
}
////// Fin nuevo tipo de usuario ///////

Suche :

Code: [Select]
if ($user_info['user_level'] != ADMIN) {

Ersetze mit :

Code: [Select]
////// Nuevo tipo de usuario ///////
/*
// Originales
if ($user_info['user_level'] != ADMIN) {
*/
//Modificacion para nuevo tipo de usuario
if ($user_info['user_level'] != ADMIN && $user_info['user_level'] != MODERADOR) {
////// Fin nuevo tipo de usuario ///////

Step 8

Öffne : admin/index.php[/b]

Code: [Select]
show_nav_header($lang['nav_categories_main']);
          show_nav_option($lang['nav_categories_edit'], "categories.php?action=modifycats");
          show_nav_option($lang['nav_categories_add'], "categories.php?action=addcat");

          show_nav_header($lang['nav_images_main']);
          show_nav_option($lang['nav_images_edit'], "images.php?action=modifyimages");
          show_nav_option($lang['nav_images_add'], "images.php?action=addimages");
          show_nav_option($lang['nav_images_validate'], "validateimages.php?action=validateimages");
          show_nav_option($lang['nav_images_check'], "checkimages.php?action=checkimages");
          show_nav_option($lang['nav_images_thumbnailer'], "thumbnailer.php?action=checkthumbnails");
          show_nav_option($lang['nav_images_resizer'], "resizer.php?action=selectoptions");

          show_nav_header($lang['nav_comments_main']);
          show_nav_option($lang['nav_comments_edit'], "comments.php?action=modifycomments");

          show_nav_header($lang['nav_users_main']);
          show_nav_option($lang['nav_users_edit'], "users.php?action=modifyusers");
          if (!defined('USER_INTEGRATION')) {
            show_nav_option($lang['nav_users_add'], "users.php?action=addusers");
          }
          show_nav_option($lang['nav_usergroups'], "usergroups.php?action=modifygroups");
          if (!defined('USER_INTEGRATION')) {
            show_nav_option($lang['nav_users_email'], "email.php?action=emailusers");
          }

          show_nav_header($lang['nav_general_main']);
          show_nav_option($lang['nav_general_settings'], "settings.php?action=modifysettings");
          show_nav_option($lang['nav_general_templates'], "templates.php?action=modifytemplates");
          show_nav_option($lang['nav_general_backup'], "backup.php?action=modifybackups");
          show_nav_option($lang['nav_general_stats'], "stats.php?action=resetstats");
show_nav_option("phpinfo()", "phpinfo.php");

          if (@is_dir("plugins")) {
            show_nav_header("PlugIns");
            $handle = @opendir("plugins/");
            while ($file = @readdir($handle)) {
              if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file)) {
                continue;
              }
              $plugin_file = file("./plugins/".$file);
              $plugin_file[0] = trim($plugin_file[0]);
              if (preg_match("/PLUGIN_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs)) {
                show_nav_option(trim($regs[1]), "./plugins/".$file);
              }
              else {
                show_nav_option($file, "./plugins/".$file);
              }
            }

Ersetze mit :

Code: [Select]
      //// Nuevo tipo de usuario /////////////
          /*
          // ********* Antes ************
          show_nav_header($lang['nav_categories_main']);
          show_nav_option($lang['nav_categories_edit'], "categories.php?action=modifycats");
          show_nav_option($lang['nav_categories_add'], "categories.php?action=addcat");

          show_nav_header($lang['nav_images_main']);
          show_nav_option($lang['nav_images_edit'], "images.php?action=modifyimages");
          show_nav_option($lang['nav_images_add'], "images.php?action=addimages");
          show_nav_option($lang['nav_images_validate'], "validateimages.php?action=validateimages");
          show_nav_option($lang['nav_images_check'], "checkimages.php?action=checkimages");
          show_nav_option($lang['nav_images_thumbnailer'], "thumbnailer.php?action=checkthumbnails");
          show_nav_option($lang['nav_images_resizer'], "resizer.php?action=selectoptions");

          show_nav_header($lang['nav_comments_main']);
          show_nav_option($lang['nav_comments_edit'], "comments.php?action=modifycomments");

          show_nav_header($lang['nav_users_main']);
          show_nav_option($lang['nav_users_edit'], "users.php?action=modifyusers");
          if (!defined('USER_INTEGRATION')) {
            show_nav_option($lang['nav_users_add'], "users.php?action=addusers");
          }
          show_nav_option($lang['nav_usergroups'], "usergroups.php?action=modifygroups");
          if (!defined('USER_INTEGRATION')) {
            show_nav_option($lang['nav_users_email'], "email.php?action=emailusers");
          }

          show_nav_header($lang['nav_general_main']);
          show_nav_option($lang['nav_general_settings'], "settings.php?action=modifysettings");
          show_nav_option($lang['nav_general_templates'], "templates.php?action=modifytemplates");
          show_nav_option($lang['nav_general_backup'], "backup.php?action=modifybackups");
          show_nav_option($lang['nav_general_stats'], "stats.php?action=resetstats");
show_nav_option("phpinfo()", "phpinfo.php");

          if (@is_dir("plugins")) {
            show_nav_header("PlugIns");
            $handle = @opendir("plugins/");
            while ($file = @readdir($handle)) {
              if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file)) {
                continue;
              }
              $plugin_file = file("./plugins/".$file);
              $plugin_file[0] = trim($plugin_file[0]);
              if (preg_match("/PLUGIN_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs)) {
                show_nav_option(trim($regs[1]), "./plugins/".$file);
              }
              else {
                show_nav_option($file, "./plugins/".$file);
              }
            }
          // ********* Ahora ************
          */
          if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_categorias'] == 1)) {
          show_nav_header($lang['nav_categories_main']);
          show_nav_option($lang['nav_categories_edit'], "categories.php?action=modifycats");
          show_nav_option($lang['nav_categories_add'], "categories.php?action=addcat");
          }
          if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_imagenes'] == 1)) {
          show_nav_header($lang['nav_images_main']);
          show_nav_option($lang['nav_images_edit'], "images.php?action=modifyimages");
          show_nav_option($lang['nav_images_add'], "images.php?action=addimages");
          show_nav_option($lang['nav_images_validate'], "validateimages.php?action=validateimages");
          show_nav_option($lang['nav_images_check'], "checkimages.php?action=checkimages");
          show_nav_option($lang['nav_images_thumbnailer'], "thumbnailer.php?action=checkthumbnails");
          show_nav_option($lang['nav_images_resizer'], "resizer.php?action=selectoptions");
          }
          if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_comentarios'] == 1)) {
          show_nav_header($lang['nav_comments_main']);
          show_nav_option($lang['nav_comments_edit'], "comments.php?action=modifycomments");
          }
          if ($user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_usuarios'] == 1)) {
          show_nav_header($lang['nav_users_main']);
          show_nav_option($lang['nav_users_edit'], "users.php?action=modifyusers");
          if (!defined('USER_INTEGRATION')) {
            show_nav_option($lang['nav_users_add'], "users.php?action=addusers");
          }
          show_nav_option($lang['nav_usergroups'], "usergroups.php?action=modifygroups");
          if (!defined('USER_INTEGRATION')) {
            show_nav_option($lang['nav_users_email'], "email.php?action=emailusers");
          }
          }
         
         
    if ($user_info['user_level'] == ADMIN && $user_info['user_level'] != MODERADOR && $user_info['user_level'] != GUEST) {
          show_nav_header($lang['nav_users_moderadores_main']);
          show_nav_option($lang['nav_users_moderadores_edit'], "users.php?action=findusers&usuario=moderadores");
          show_nav_header($lang['nav_general_main']);
          show_nav_option($lang['nav_general_settings'], "settings.php?action=modifysettings");
          show_nav_option($lang['nav_general_templates'], "templates.php?action=modifytemplates");
          show_nav_option($lang['nav_general_backup'], "backup.php?action=modifybackups");
          show_nav_option($lang['nav_general_stats'], "stats.php?action=resetstats");
    show_nav_option("phpinfo()", "phpinfo.php");

          if (@is_dir("plugins")) {
            show_nav_header("PlugIns");
            $handle = @opendir("plugins/");
            while ($file = @readdir($handle)) {
              if (eregi("^\.{1,2}$", $file) || !eregi("\.php$", $file)) {
                continue;
              }
              $plugin_file = file("./plugins/".$file);
              $plugin_file[0] = trim($plugin_file[0]);
              if (preg_match("/PLUGIN_TITLE:([a-zäöüß0-9\-_ ]+)/i", $plugin_file[0], $regs)) {
                show_nav_option(trim($regs[1]), "./plugins/".$file);
              }
              else {
                show_nav_option($file, "./plugins/".$file);
              }
            }
          }
          ////////// Fin nuevo tipo de usuario //////

Step 9

Öffne : admin/users.php[/b]

Code: [Select]
$user_invisible = intval($HTTP_POST_VARS['user_invisible']);
Füge darunter :

Code: [Select]
////// Nuevo tipo de usuario //////
   $user_moderador_categorias = intval($HTTP_POST_VARS['user_moderador_categorias']);
  $user_moderador_imagenes = intval($HTTP_POST_VARS['user_moderador_imagenes']);
  $user_moderador_comentarios = intval($HTTP_POST_VARS['user_moderador_comentarios']);
  $user_moderador_usuarios = intval($HTTP_POST_VARS['user_moderador_usuarios']);
  //// Fin nuevo tipo de usuario ////

Suche :

Code: [Select]
$sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_level")." = $user_level, ".get_user_table_field("", "user_name")." = '$user_name',$passinsert ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_joindate")." = $user_joindate, ".get_user_table_field("", "user_lastaction")." = $user_lastaction, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = $user_id";
    $result = $site_db->query($sql);

Ersertze mit :

Code: [Select]
////////// Nuevo tipo de usuario //////
/* **** Antes *******
 $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_level")." = $user_level, ".get_user_table_field("", "user_name")." = '$user_name',$passinsert ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_joindate")." = $user_joindate, ".get_user_table_field("", "user_lastaction")." = $user_lastaction, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = $user_id";
    $result = $site_db->query($sql);
// ********* Ahora ************
*/
  $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_level")." = $user_level, ".get_user_table_field("", "user_name")." = '$user_name',$passinsert ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_joindate")." = $user_joindate, ".get_user_table_field("", "user_lastaction")." = $user_lastaction, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq', user_moderador_categorias = '$user_moderador_categorias', user_moderador_imagenes = '$user_moderador_imagenes', user_moderador_comentarios = '$user_moderador_comentarios', user_moderador_usuarios = '$user_moderador_usuarios'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = $user_id";
    $result = $site_db->query($sql);
/////// Fin nuevo tipo de usuario //////

Suche :

Code: [Select]
show_userlevel_select_row($lang['field_userlevel'], "user_level", $user_row['user_level']);
Ersetze mit :

Code: [Select]
///// Nuevo tipo de usuario //////
  /* ***** Antes *****
  show_userlevel_select_row($lang['field_userlevel'], "user_level", $user_row['user_level']);
  */
  // ******** Ahora ******
  if ($user_info['user_level'] == ADMIN){
  show_userlevel_select_row($lang['field_userlevel'], "user_level", $user_row['user_level']);
  }
  else {
  show_userlevel_select_row_moderadores($lang['field_userlevel'], "user_level", $user_row['user_level']);
  }
  ////////// Fin nuevo tipo de usuario //////

Suche :

Code: [Select]
show_date_input_row($lang['field_lastaction'].$lang['date_desc'], "user_lastaction", $user_row['user_lastaction'], $textinput_size);

Füge darunter :

Code: [Select]
///// Nuevo tipo de usuario //////
 if ($user_info['user_level'] == ADMIN && $user_row['user_level'] == MODERADOR){
 show_radio_row($lang['field_moderador_categorias'], "user_moderador_categorias", $user_row['user_moderador_categorias'],1);
 show_radio_row($lang['field_moderador_imagenes'], "user_moderador_imagenes", $user_row['user_moderador_imagenes'], 1);
 show_radio_row($lang['field_moderador_comentarios'], "user_moderador_comentarios", $user_row['user_moderador_comentarios'], 1);
 show_radio_row($lang['field_moderador_usuarios'], "user_moderador_usuarios", $user_row['user_moderador_usuarios'], 1);
 }
////////// Fin nuevo tipo de usuario ///////

Suche :

Code: [Select]
show_userlevel_select_row($lang['field_userlevel']);
Ersetze mit :

Code: [Select]
//// Nuevo tipo de usuario //////
   /* ***** Antes *****
  show_userlevel_select_row($lang['field_userlevel']);
  */
  // ******** Ahora ******
  if ($user_info['user_level'] == ADMIN){
  show_userlevel_select_row($lang['field_userlevel']);
  }
  else {
  show_userlevel_select_row_moderadores($lang['field_userlevel']);
  }
   ////////// Fin nuevo tipo de usuario //////

Suche :

Code: [Select]
$sql = "SELECT COUNT(*) AS users
          FROM ".USERS_TABLE."
          WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST;

Ersetze mit :

Code: [Select]
//// Nuevo tipo de usuario /////////////
/* ***** Antes *********
 $sql = "SELECT COUNT(*) AS users
          FROM ".USERS_TABLE."
          WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST;
*/
// ***** Ahora ********
if (($user_info['user_level'] == ADMIN) && ($usuario <> "moderadores")) {
 $sql = "SELECT COUNT(*) AS users
          FROM ".USERS_TABLE."
          WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST;
}
else {
if (($user_info['user_level'] == ADMIN) && ($usuario == "moderadores")) {
 $sql = "SELECT COUNT(*) AS users
          FROM ".USERS_TABLE."
          WHERE user_level = 5";
 }
 }
if ($user_info['user_level'] == MODERADOR) {
 $sql = "SELECT COUNT(*) AS users
          FROM ".USERS_TABLE."
          WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST;
 }
////////// Fin nuevo tipo de usuario //////

Suche :

Code: [Select]
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
            FROM ".USERS_TABLE."
            WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST."
            ORDER BY $orderby $direction
            LIMIT $limitstart, $limitnumber";

Ersetze mit :

Code: [Select]
//// Nuevo tipo de usuario /////////////
  /* ***** Antes *********
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
            FROM ".USERS_TABLE."
            WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST."
            ORDER BY $orderby $direction
            LIMIT $limitstart, $limitnumber";
*/
// ***** Ahora *******
if (($user_info['user_level'] == ADMIN) && ($usuario <> "moderadores")) {
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
            FROM ".USERS_TABLE."
            WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST."
            ORDER BY $orderby $direction
            LIMIT $limitstart, $limitnumber";
}
else {
if (($user_info['user_level'] == ADMIN) && ($usuario == "moderadores")) {
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
            FROM ".USERS_TABLE."
            WHERE user_level = 5";
}
}
if ($user_info['user_level'] == MODERADOR) {
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
            FROM ".USERS_TABLE."
            WHERE $condition AND user_level = 1 OR user_level = 2
            ORDER BY $orderby $direction
            LIMIT $limitstart, $limitnumber";
}
////////// Fin nuevo tipo de usuario //////

Suche :

Code: [Select]
show_text_link($lang['permissions'], "usergroups.php?action=editpermissions&user_id=".$user_row[$user_table_fields['user_id']]);
   show_text_link($lang['nav_usergroups'], "usergroups.php?action=edituser&user_id=".$user_row[$user_table_fields['user_id']]);

Ersetze mit :

Code: [Select]
//// Nuevo tipo de usuario /////////////
      /* ****** Antes *********
   show_text_link($lang['permissions'], "usergroups.php?action=editpermissions&user_id=".$user_row[$user_table_fields['user_id']]);
   show_text_link($lang['nav_usergroups'], "usergroups.php?action=edituser&user_id=".$user_row[$user_table_fields['user_id']]);
   */
   // ***** Ahora ********
   if ($user_info['user_level'] == ADMIN){
   show_text_link($lang['permissions'], "usergroups.php?action=editpermissions&user_id=".$user_row[$user_table_fields['user_id']]);
   show_text_link($lang['nav_usergroups'], "usergroups.php?action=edituser&user_id=".$user_row[$user_table_fields['user_id']]);
   }
    ////////// Fin nuevo tipo de usuario //////

Suche :

Code: [Select]
$user_invisible = intval($HTTP_POST_VARS['user_invisible_'.$i]);
Füge darunter :

Code: [Select]
////// Nuevo tipo de usuario //////
  $user_moderador_categorias = intval($HTTP_POST_VARS['user_moderador_categorias_'.$i]);
  $user_moderador_imagenes = intval($HTTP_POST_VARS['user_moderador_imagenes_'.$i]);
  $user_moderador_comentarios = intval($HTTP_POST_VARS['user_moderador_comentarios_'.$i]);
  $user_moderador_usuarios = intval($HTTP_POST_VARS['user_moderador_usuarios_'.$i]);
   ////////// Fin nuevo tipo de usuario ////////

Suche :

Code: [Select]
show_userlevel_select_row($lang['field_userlevel'], "user_level_".$i);
Ersetze mit :

Code: [Select]
///// Nuevo tipo de usuario //////
     /* **** Antes *****
    show_userlevel_select_row($lang['field_userlevel'], "user_level_".$i);
    */
    // ******** Ahora ******
    if ($user_info['user_level'] == ADMIN){
    show_userlevel_select_row($lang['field_userlevel'], "user_level_".$i);
    }
    else {
    show_userlevel_select_row_moderadores($lang['field_userlevel'], "user_level_".$i);
    }
     ////////// Fin nuevo tipo de usuario ///////

Fertig

Download
Beste Grüße
Benny

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline h24

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Mod] Moderatoren für 4images - 4images 1.7.6
« Reply #2 on: March 17, 2011, 11:46:02 PM »
Hallo liebe 4homepages Forum user

Ich habe mir den oben genannten MD eingebaut
http://www.4homepages.de/forum/index.php?topic=23036.0

soweit hat ja alles gklappt doch

wenn sich ein mod einloggt bekommt er im adminbereich keine Navigation fürleicht kann mir jemand Helfen danke euch schon mal im voraus