• [MOD] - MCP (Moderator Control Panel) 5 0 5 1
Currently:  

Author Topic: [MOD] - MCP (Moderator Control Panel)  (Read 71086 times)

0 Members and 2 Guests are viewing this topic.

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #30 on: August 31, 2007, 12:09:59 AM »
Well, its easy to transleted to english

also there is english but its translated by google ! which is not good to copy and past !

its better to copy the spanish and copy it to ur folders

u only have to know these words:


Añade debajo  -> Add after

Añade arriba -> Add before

Cambia a: -> Replace to:

this help i got from user "ccsakuweb"


with this only this help i did the mod also u migh need to add something later

but first install the mod then will see what is missing :)
« Last Edit: August 31, 2007, 12:22:13 AM by Mr_LovaLove »
English Please :@

Offline m.a

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #31 on: November 17, 2007, 12:18:40 AM »
Hi trez,
danke für den Mod.

ich glaube, wenn man den Moderator validateimages.php frei gibt, dann muss man bei der Datei moderator/validateimages.php kleine änderung auch machen:
Es korregiert die falsche adressierung bei der freigeschaltete Bilder, dass als link bei der E-Mail (Image Validation Results) gesendet wird.


Code: [Select]
<?php

//          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('DREAMBOARD');

//          show_nav_option('Board Manager', "board_admin.php");

//          show_nav_option('Config Board', "board_config.php");



          
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_ann_settings'], "ann_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=modifybackup");

//          show_nav_option($lang['nav_general_stats'], "stats.php?action=resetstats");



/*          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);

              }

            }

            @closedir($handle);

          }
*/
          
?>





In Datei moderator/validateimages.php Finde Code:
Code: [Select]
USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
$recipient_email = ($row['user_email']);
$recipient_name = ($row['user_name']);
$cut_url = str_replace("admin", "", $script_url);
$image_url = $cut_url."details.php?".URL_IMAGE_ID."=".$image_id."";

replace it with:
Code: [Select]
USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);
$recipient_email = ($row['user_email']);
$recipient_name = ($row['user_name']);
$cut_url = str_replace("moderator", "", $script_url);
$image_url = $cut_url."details.php?".URL_IMAGE_ID."=".$image_id."";

Damit wird dann die E-Mails mit richtige Adresse gesendet.

Danke noch mal für den Mod.
m.a
« Last Edit: November 17, 2007, 12:51:10 AM by m.a »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #32 on: November 17, 2007, 12:24:26 AM »
After change - please replace 3 line:

Code: [Select]
$user_allowemails = $row[$user_table_fields['user_allowemails']];
$recipient_email = (stripslashes(trim($row[$user_table_fields['user_email']])));
$recipient_name = format_text(trim($row['user_name']), 2);
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline baghdad4ever

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #33 on: December 28, 2007, 02:46:54 PM »
thanks

you say

Quote
In the above code replace XXX again with the userid of your user who would be the moderator

if i have more than one moderator

how can i do??


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #34 on: December 28, 2007, 03:17:22 PM »
Quote
if i have more than one moderator

Use $user_info['user_level'] or each $user_info['user_id'] . No usergroups exist for moderator in 4images. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline inLIMITit

  • Pre-Newbie
  • Posts: 4
    • View Profile
    • Heide-Park-Pictures
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #35 on: April 03, 2008, 09:20:14 PM »
Hallo,

kann man diesen Mod auch so einstellen, dass der Moderator dann nur in einer Kategorie moderieren kann? Heißt in Kategorie X kann er Bilder bearbeiten oder löschen, aber in den Kategorien y und z nicht.

Offline drame

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #36 on: April 07, 2008, 02:30:06 PM »
i made a little change of the mod and a few files, so i can make users to mods in the acp...

i added a column to USERS_TABLE
named:
user_mod tinyint(1)     standard:   0     

HOW TO:

STEP 1

open include/sessions.php

find:
Code: [Select]
$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
  "user_icq" => "user_icq"
);

Change to:
Code: [Select]
$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
  "user_icq" => "user_icq",
  "user_mod" => "user_mod"
);

save and close sessions.php

STEP 2


open admin_global.php

don't change
Code: [Select]
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;
    }
  }
}

to

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

BUT change to:
Code: [Select]
if (!isset($HTTP_COOKIE_VARS['moderatoron']) || $HTTP_COOKIE_VARS['moderatoron'] == 0) {
    $user_info['user_level'] = GUEST;
  }
  else {
    if ($user_info['user_mod'] != 1 && $user_info['user_level'] == USER && isset($HTTP_POST_VARS['loginusername'])) {
      setcookie("moderatoron", 1, 0, '/');
      $HTTP_COOKIE_VARS['moderatoron'] = 1;
    }
  }
}

Same With

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

don't change to:

Code: [Select]
if ($user_info['user_id'] != XXX) {
  show_admin_header();

but:
Code: [Select]
if ($user_info['user_mod'] != 1) {
  show_admin_header();

save and close admin_global.php

STEP 3

open admin/users.php

find:
Code: [Select]
show_radio_row($lang['field_invisible'], "user_invisible", $user_row['user_invisible']);
addbelow:
Code: [Select]
show_radio_row($lang['field_moderator'], "user_mod", $user_row['user_mod']);
find:
Code: [Select]
$user_invisible = intval($HTTP_POST_VARS['user_invisible']);
addbelow:
Code: [Select]
$user_mod = intval($HTTP_POST_VARS['user_mod']);
find:
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";

change to:
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', ".get_user_table_field("", "user_mod")." = $user_mod ".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = $user_id";

save and close users.php

STEP 4:

open lang/yourlanguage/admin.php

find:
Code: [Select]
$lang['field_invisible']
addbelow:
Code: [Select]
$lang['field_moderator'] = "Moderator";
save and close as usual

Thats it

hope i haven't forgotten anything...
it works fine with my 4images installation (1.7.6)
in the admin controlpanel u've got a new option if u edit a user
if u select the checkbox the user will be an moderator and can use the moderator control panel....
if u have made the:
ADDITONAL OPTION (added 25/02/2007)
Allow your moderator directly to delete/edit comments from your details.php

then u have to change it like admin_global.php was changed --> means
Code: [Select]
$user_info['user_id'] != XXX)must be changed to
Code: [Select]
$user_info['user_mod'] != 1
would be glad to receive comments

EDIT:
trez

Is there away to add a moderator control panel on the index page like the admins have? How would I go about adding that for easier access?

Thanks again, this has made my job much easier, in modding.



its quite easy

just open:
includes/page_header.php
find:
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",addbelow:
Code: [Select]
"m_cp_link" => ($user_info['user_mod'] != 1) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."moderator/index.php")."\">Moderator Control Panel</a>]</p>\n",IMPORTANT:
if u don't use my modification with the extra table field user_mod, but the original u have to change
Code: [Select]
"m_cp_link" => ($user_info['user_mod'] != 1) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."moderator/index.php")."\">Moderator Control Panel</a>]</p>\n",to
Code: [Select]
"m_cp_link" => ($user_info['user_id'] == XXX) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."moderator/index.php")."\">Moderator Control Panel</a>]</p>\n",XXX replace with user id

save&close

open:
templates/yourtemplate/footer.html
find:
Code: [Select]
{cp_link}add:
Code: [Select]
{m_cp_link}
save&close
« Last Edit: April 07, 2008, 02:52:46 PM by drame »

Offline the0bone

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • yourhp
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #37 on: April 15, 2008, 12:20:13 PM »
With some minor changes you don't need to change the template files



ADDITONAL OPTION (added 25/02/2007)

Allow your moderator directly to delete/edit comments from your details.php

Well, deleting and editing comments for your moderator can be very sad, if he always have to login first to his MCP (Moderator Control Panel), search the comment by ID and so on.
SO this little addition to my MOD allows your moderator to directly delete and edit comments at the details.php (picture)

Have pHun :)

STEP ONE

open yoursite.com/4images/moderator/index.php

Make sure those lines...

Code: [Select]
         
show_nav_header($lang['nav_comments_main']);

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

... are uncommented (without a "//" on the left)
Be also sure that you haven't deleted the "comments.php" in your moderator folder.

Everything fine? Good, let's proceed....


STEP TWO

open
yoursite.com/4images/details.php

find:

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>";
      }

insert below
this code has changed
Code: [Select]
      elseif ($user_info['user_id'] == XXX) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."moderator/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."moderator/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }

In the above code replace XXX again with the userid of your user who would be the moderator

Okay, now lets find:
this is all not needed


replace it with:


save and close details.php


STEP THREE
this is all not needed

Thats it.
Now you moderator can delete and edit comments directly from your site.



Tobi.L

  • Guest
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #38 on: June 10, 2008, 10:58:13 PM »
Was hat diese Mod für einen Sinn, also was macht diese Mod?
Ist das einsetzbar mit dieser: [MOD] Moderators for 4images gallery : http://www.4homepages.de/forum/index.php?topic=17408.0

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #39 on: October 01, 2008, 03:30:24 PM »
Hallo,

ich habe diese Modifikation eingebaut:
http://www.4homepages.de/forum/index.php?topic=17408.0

Macht es Sinn diese hier auch einzubauen?

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #40 on: October 01, 2008, 07:27:50 PM »
Alles klar,
ich dank dir ivan!

Offline mato72

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Brick-Cinema
Re: [MOD] - MCP (Moderator Control Panel)
« Reply #41 on: October 30, 2008, 07:54:24 AM »
Es tut mir leid, ich hab´s immer noch nicht gerafft wie man den Link in den Footer bekommt. Also dem "Admin Control Panel"-Link wenn man sich eben als Admin anmeldet.
Ich würde s gerne auch für meine Moderatoren anbieten, dass sie ihren "Moderator Controll Panel"-Link im Footer finden...
Wo muss ich denn da die if/else einsetzen?
Nutze die 1.7.4-Version

I´m sorry, I don´t understand how to put an "Moderator Controll Panel"-Link into the footer, if a moderator logging in...
Hope you can help me...

Using 1.7.4