Author Topic: طريقة عمل مشرف  (Read 13318 times)

0 Members and 1 Guest are viewing this topic.

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
طريقة عمل مشرف
« on: October 28, 2008, 08:25:15 PM »
الطريقة با
 Español
http://www.4homepages.de/forum/index.php?topic=17155.0
---------------------------------------
الملفات الجديدة
install_moderador.php
---------------------------------------
الملفات التي سيتم التعديل علية
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
--------------------------------------
افتح صفحة
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>";
      }
استبدلة با
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 /////
ابحث مرة اخري
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>";
}
استبدلة با
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 /////
افتح صفحة
 lang/ملف اللغة العربية/main.php
ابحث عن
Code: [Select]
$lang['userlevel_admin'] = "مدير";اضف بعدة
Code: [Select]
////// Nuevo tipo usuario /////
$lang['userlevel_moderador'] = "مشرف";
///// Fin nuevo tipo usuario ///////
افتح صفحة
lang/ملف اللغة العربية/admin.php
ابحث عن
Code: [Select]
$lang['userlevel_admin'] = "مدير";اضف بعدة
Code: [Select]
///// Nuevo tipo de usuario /////
$lang['userlevel_moderador'] = "Moderadores";
/////// Fin nuevo tipo de usuario /////
ابحث مرة اخري
Code: [Select]
$lang['field_usergroup_name'] = "عنوان المجموعة";اضف بعدة
Code: [Select]
/////// Nuevo tipo de usuario //////////
$lang['field_moderador_categorias'] = "التحكم با الاقسام ? :";
$lang['field_moderador_imagenes'] = "التحكم با الصور  ? :";
$lang['field_moderador_comentarios'] = "التحكم با التعليقات ? :";
$lang['field_moderador_usuarios'] = "التحكم با الاعضاء ? :";
/////// Fin nuevo tipo de usuario ////////
ابحث مرة اخري
Code: [Select]
$lang['nav_users_email'] = "أرسل بريد";اضف بعدة
Code: [Select]
////// Nuevo tipo de usuario //////
$lang['nav_users_moderadores_main'] = "مشرف";
$lang['nav_users_moderadores_edit'] = "تعديل المشرف";
///// Fin nuevo tipo de usuario //////
افتح صفحة
Code: [Select]
include/constans.php
// User levels
define('GUEST', -1);
define('USER_AWAITING', 1);
define('USER', 2);
define('ADMIN', 9);
اضف بعدة
Code: [Select]
///// Nuevo tipo de usuario //////
define('MODERADOR', 5);
////// Fin nuevo tipo de usuario ///////
ابحث عن
Code: [Select]
// Permission levels
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);
اضف بعدة
Code: [Select]
///// Nuevo tipo de usuario //////
define('AUTH_MODERADOR', 5);
////// Fin nuevo tipo de usuario ///////
ابحث عن
Code: [Select]
define('ADMIN_SAFE_LOGIN', 0);اضف بعدة
Code: [Select]
///// Nuevo tipo de usuario //////
define('MODERADOR_SAFE_LOGIN', 0);
////// Fin nuevo tipo de usuario ///////
افتح صفحة
 include/page_header.php
ابحث عن
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",اضف بعدة
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 ///////
افتح صفحة
templates/الثيم المستخدم/footer.html
ابحث عن
Code: [Select]
{cp_link}استبدلة با
Code: [Select]
{cp_link}{cp_moderador}افتح صفحة
 admin/admin_functions.php
ابحث عن
Code: [Select]
  echo ">".$lang['userlevel_admin']."</option>\n";اضف بعدة
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 ///////
ابحث مرة اخري
Code: [Select]
echo ">".$lang['userlevel_registered_awaiting']."</option>\n";
  echo "</select>\n</td>\n</tr>\n";
}
اضف بعدة
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 //////
افتح صفحة
admin/email.php
Code: [Select]
$select .= "<option value=\"0\" class=\"dropdownmarker\">".$lang['userlevel_admin']."</option>\n";
    }
اضف بعدة
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 //////
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;
    }
  }
}
استبدلة با
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 ///////
ابحث مرة اخري
Code: [Select]
if ($user_info['user_level'] != ADMIN) {استبدلة با
Code: [Select]
if ($user_info['user_level'] != ADMIN) {
افتح
 admin/index.php
ابحث عن
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);
              }
            }
استبدلة با
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 //////
افتح
admin/users.php
ابحث عن
Code: [Select]
$user_invisible = intval($HTTP_POST_VARS['user_invisible']);استبدلة با
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 ////
ابحث مرة اخري
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);
استبدلة با
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 //////
ابحث عن
Code: [Select]
show_userlevel_select_row($lang['field_userlevel'], "user_level", $user_row['user_level']);استبدلة با
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 //////
ابحث عن
Code: [Select]
show_date_input_row($lang['field_lastaction'].$lang['date_desc'], "user_lastaction", $user_row['user_lastaction'], $textinput_size);
اضف بعدة
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 ///////
ابحث عن
Code: [Select]
show_userlevel_select_row($lang['field_userlevel']);اضف بعدة
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 //////
ابحث عن
Code: [Select]
$sql = "SELECT COUNT(*) AS users
          FROM ".USERS_TABLE."
          WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST;
استبدل با
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 //////
ابحث عن
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";
استبدل با
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 //////
استبدلة با
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']]);
ابحث عن
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 //////
ابحث عن
Code: [Select]
$user_invisible = intval($HTTP_POST_VARS['user_invisible_'.$i]);اضف بعدة
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 ////////
ابحث عن
Code: [Select]
show_userlevel_select_row($lang['field_userlevel'], "user_level_".$i);استبدل با
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 ///////
ارسل الصفحة
install_moderador.php
الي الملف الرئيسي
install_moderador.php
للتحميل صفحة install_moderador.php
http://swalfbnat.com/up/download.php?filename=e7927667f3.rar

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: طريقة عمل مشرف
« Reply #1 on: October 29, 2008, 05:56:26 AM »
سباق للخير

^_*

عندي اضافه

راح اضيفها من ارجع الى البيت

شكرا لك
English Please :@

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: طريقة عمل مشرف
« Reply #2 on: October 29, 2008, 01:42:46 PM »
لاظهار عبارة مشرف في التعليقات

افتح

details.php

وابحث عن

Code: [Select]
      elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          $comment_user_info = $lang['userlevel_admin'];

واضف بداله

Code: [Select]
      elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          $comment_user_info = $lang['userlevel_admin'];

        }elseif ($comment_row[$i][$user_table_fields['user_level']] == MODERADOR){
          $comment_user_info = $lang['userlevel_moderador'];
        }

مثال :

http://www.143.ae/image/details.php?image_id=435

المشرف في التعليقات اسمه

بوخليفه

Moderator

اللي حاب يلون يروح الـ

main.php

والموجوف في مجلد

lang


وهنا مثال

Code: [Select]
////// Nuevo tipo usuario /////
$lang['userlevel_moderador'] = "مشرف";
///// Fin nuevo tipo usuario ///////

نفيره الى

Code: [Select]
$lang['userlevel_moderador'] = "<font color='Gray'>مشرف</font>";

وهذا بيغير فقط المشرف

واذا تريد تغير اللون الى لون آخر غير

Gray

الى اللون المطلوب

واللي يريد يعتمد الالوان عندي

هذا هو الكود كامل

Code: [Select]
//-----------------------------------------------------
//--- Userlevel ---------------------------------------
//-----------------------------------------------------
$lang['userlevel_admin'] = "<font color='red'>مدير</font>";
$lang['userlevel_moderador'] = "<font color='Gray'>مشرف</font>";
$lang['userlevel_user'] = "<font color='Silver'>عضو</font>";
//$lang['userlevel_guest'] = "Guest";
English Please :@

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: طريقة عمل مشرف
« Reply #3 on: October 29, 2008, 08:44:10 PM »
مشكور اخوي وماقصرت
ومشكور علي الرد
(^o^)

Offline baseel

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: طريقة عمل مشرف
« Reply #4 on: May 01, 2009, 02:37:35 PM »
السلام عليكم

اخي الكريم

طبقت كل حرف من اللي شرحته

و عند التعديل من قبل المشرف و الادمن اصبح يظهر هذا الخطأ فوق في اعلى الصفحة

DB Error: Bad SQL Query: UPDATE 4images_users SET user_level = 9, user_name = 'ßÊÇÆÈí ãÛÊÑÈ', user_email = '******@hotmail.com', user_showemail = 0, user_allowemails = 1, user_invisible = , user_joindate = UNIX_TIMESTAMP('2009-04-30 18:52'), user_lastaction = UNIX_TIMESTAMP('2009-05-01 00:33'), user_homepage = '', user_icq = '', user_moderador_categorias = '0', user_moderador_imagenes = '0', user_moderador_comentarios = '0', user_moderador_usuarios = '0' WHERE user_id = 13
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' user_joindate = UNIX_TIMESTAMP('2009-04-30 18:52'), user_lastaction = UNIX_TIME' at line 2
حدث خطأ أثناء تحرير العضو


ما هو الحل للخطا

مع الشكر

Offline softxgame

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: طريقة عمل مشرف
« Reply #5 on: May 04, 2009, 02:54:50 PM »
جاري تجربة ياخوي مشكور بارك الله فيك
Links from my profile were removed and I'm about to get banned for spam.
One more stupid post and I'm gone. Ops, I did it again..."thank you for the subject" - what kind of reply is this? now I'm banned for sure.

Offline e3lan

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: طريقة عمل مشرف
« Reply #6 on: November 04, 2009, 12:19:28 PM »
شكرا اخي الكريم لكن ياريت عند النقل يكون هناك مراجعه لما نقلته لان اخطاء كثيرة جدا جدا بالموضوع واتمنى من الاخوان ان يراجعوا الموضوع الاصلي لانه هو الاصح وهو باللغه الاسبانيه واستخدم جوجل للترجمه

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: طريقة عمل مشرف
« Reply #7 on: November 11, 2009, 02:27:24 PM »
مشكور اخوي وسوف
اتاكد من الموضوع مرة اخراء
لكي لتحصل اخطاء

 

Post your comments here