4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on April 18, 2003, 10:28:09 AM
-
THIS MOD NOT IS SUPPORTED BY THE AUTHOR ANYMORE, BECAUSE THE WAY ITS DONE, IT HAS NO POTENTIAL FUTURE TO EXPAND.
IF U HAVEN'T INSTALL THIS MOD, PLEASE DON'T. IF VERSION 2 EVER COMES OUT, AND U INSTALLED THIS VERSION, U'LL HAVE TO REMOVE THIS VERSION PRIOR INSTALLING NEXT VERSION.
SAVE YOURSELF FROM TROUBLE AND WAIT TILL NEXT VERSION.
SORRY.
NOTE: MPC = Members Personal Category
--- Overview --------
With this MOD members will be able have their own one personal (private) category, with almost full admin control.
As usual, u can see it in action here (http://come.no-ip.com)
--- Features ---------
- Members can make their category for: public, only members or private.
When category set to private, the owner can chose wich members will have access to the category.
- Control from AdminControlPanel:
Anable/disable this mod
Anable/disable activating new categories. This means that for members who previously activated their MPC, it wont affect, but who hasnt - they wont be able have MPC. (this works same as "disable new account signup").
Chose "parent" category where new MPC will be created
Chose what permissions owners of MPC will be able to change.
Disable single member MPC (u can use this to panish abusing member)[/list:u]
--- Warning ------------
If u have to use this: http://4homepages.de/forum/viewtopic.php?t=3383
This MOD probably not for u, your members wont be very hapy :(
--- Changed Files -----
/member.php
/details.php
/admin/settings.php
/admin/users.php
/includes/db_field_definitions.php
/lang/<yourlanguage>/main.php
/lang/<yourlanguage>/admin.php
/templates/<yourtemplate>/member_editprofile.html
New templates:
member_cat_edit.html
member_cat_edit_bit.html
member_cat_terms.html
--- Installation ---------
Step 1.
Open /member.php
Findif ($action == "deletecomment") {
if (!$comment_id || ($config['user_delete_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
show_error_page($lang['no_permission']);
exit;
}
$sql = "SELECT c.comment_id, c.user_id AS comment_user_id, i.image_id, i.cat_id, i.user_id, i.image_name
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "deletecomment") {
if (!$comment_id) {
show_error_page($lang['no_permission']);
exit;
}
$sql = "SELECT c.comment_id, c.user_id AS comment_user_id, i.image_id, i.cat_id, i.user_id, i.image_name
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
// if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_delete_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $comment_row['cat_id']&& $user_info['user_id'] != $comment_row['comment_user_id'])) {
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_delete_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $comment_row['cat_id'])) {
Step 1.2.
Find:if ($action == "removecomment") {
if (!$comment_id || ($config['user_delete_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "removecomment") {
if (!$comment_id) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
// if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_delete_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $comment_row['cat_id']&& $user_info['user_id'] != $comment_row['comment_user_id'])) {
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_delete_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_id'] != $comment_row['comment_user_id'])) {
Step 1.3.
Find:if ($action == "updatecomment") {
if (!$comment_id || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
show_error_page($lang['no_permission']);
exit;
}
$sql = "SELECT c.comment_id, c.image_id, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "updatecomment") {
if (!$comment_id) {
show_error_page($lang['no_permission']);
exit;
}
$sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
// if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $comment_row['cat_id']&& $user_info['user_id'] != $comment_row['comment_user_id'])) {
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $comment_row['cat_id'])) {
Step 1.4.
Find:if ($action == "editcomment") {
if (!$comment_id || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "editcomment") {
if (!$comment_id) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
FROM ".COMMENTS_TABLE." c, ".IMAGES_TABLE." i
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
$comment_row = $site_db->query_firstrow($sql);
// if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $comment_row['cat_id']&& $user_info['user_id'] != $comment_row['comment_user_id'])) {
if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $comment_row['cat_id'])) {
Step 1.5.
Find:if ($action == "deleteimage") {
if (!$image_id || ($config['user_delete_image'] != 1 && $user_info['user_level'] != ADMIN)) {
show_error_page($lang['no_permission']);
exit;
}
$sql = "SELECT image_id, cat_id, user_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "deleteimage") {
if (!$image_id) {
show_error_page($lang['no_permission']);
exit;
}
$sql = "SELECT image_id, cat_id, user_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($config['user_edit_image'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id'])) {
Step 1.6.
Find:if ($action == "removeimage") {
if (!$image_id || ($config['user_delete_image'] != 1 && $user_info['user_level'] != ADMIN)) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$sql = "SELECT image_id, cat_id, user_id, image_name
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "removeimage") {
if (!$image_id) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$sql = "SELECT image_id, cat_id, user_id, image_name
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_id || ($config['user_delete_image'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id'])) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id'])) {
Step 1.7.
Find:if ($action == "updateimage") {
if (!$image_id || ($config['user_edit_image'] != 1 && $user_info['user_level'] != ADMIN)) {
show_error_page($lang['no_permission']);
}
$sql = "SELECT image_id, cat_id, user_id, image_name
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "updateimage") {
if (!$image_id) {
show_error_page($lang['no_permission']);
} $sql = "SELECT image_id, cat_id, user_id, image_name
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($config['user_edit_image'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id'])) {
Step 1.8.
Find:if ($action == "editimage") {
if (!$image_id || ($config['user_edit_image'] != 1 && $user_info['user_level'] != ADMIN)) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", ".$key;
}
}
$sql = "SELECT image_id, cat_id, user_id, image_name, image_description, image_keywords, image_allow_comments".$additional_sql."
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
Replace with:if ($action == "editimage") {
if (!$image_id) {
header("Location: ".$site_sess->url($url, "&"));
exit;
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", ".$key;
}
}
$sql = "SELECT image_id, cat_id, user_id, image_name, image_description, image_keywords, image_allow_comments".$additional_sql."
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($config['user_edit_image'] != 1 && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id']) || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN && $user_info['user_cat'] != $image_row['cat_id'])) {
Step 1.9.
Find: if (!$error) {
$additional_sql = "";
if (!empty($additional_user_fields)) {
$table_fields = $site_db->get_table_fields(USERS_TABLE);
foreach ($additional_user_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
$additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
}
}
}
$sql = "UPDATE ".USERS_TABLE."
Replace with: if (!$error) {
$additional_sql = "";
if (!empty($additional_user_fields)) {
$table_fields = $site_db->get_table_fields(USERS_TABLE);
foreach ($additional_user_fields as $key => $val) {
if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
$additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
}
}
if (isset($HTTP_POST_VARS['user_cat_active']) && isset($table_fields['user_cat_active'])) {
user_cat_create();
}else{
$additional_sql .= ", user_cat_active = 0";
}
}
$sql = "UPDATE ".USERS_TABLE."
Step 1.10.
Find: "user_name" => htmlspecialchars(stripslashes($user_name)),
Add before (obove it): "lang_activate" => ($config['user_cat'] && $user_info['user_cat_active_admin'] && ($config['user_cat_new'] || $user_info['user_cat'])) ? $lang['user_cat_activate'] : "",
"user_cat_edit" => ($user_info['user_cat_active']) ? $site_sess->url(ROOT_PATH."member.php?action=usercatpermedit") : "",
"lang_edit" => $lang['edit'],
Step 1.11.
Find://-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$txt_clickstream."</span>";
Add before (above it)://-------------------------
//---- User Create Cat ----
//-------------------------
function user_cat_create(){
global $user_info, $cat_cache, $config;
if ($user_info['user_cat'] == 0 || !$cat_cache[$user_info['user_cat']]) {
if (!$cat_id = create_user_cat($user_info['user_id'], $user_info['user_name'])) {
$msg .= "Error creating category";
}
}
}
//-----------------------------
//---- User Cat Permissions----
//-----------------------------
if ($action == "usercatpermedit") {
if ((!user_cat_check() || !$user_info['user_cat_active']) && $user_info['user_level'] != ADMIN) {
show_error_page($lang['no_permission']);
exit;
}
$error = 0;
$user_cat_terms = 0;
if ($user_info['user_level'] != ADMIN && !$user_info['user_cat_active_admin']) {
$msg = $lang['user_cat_deactive_admin'];
$error = 1;
}
if ($user_info['user_level'] != ADMIN && !$user_info['user_cat_terms']) {
if (isset($HTTP_POST_VARS['user_cat_accept']) && $HTTP_POST_VARS['user_cat_accept']) {
$sql = "UPDATE ".USERS_TABLE."
SET user_cat_terms = 1
WHERE user_id = ".$user_info['user_id'];
$site_db->query($sql);
}else{
$user_cat_terms = 1;
}
}
if (!$error) {
if ($user_cat_terms) {
$site_template->register_vars(array(
"lang_user_cat_terms" => $lang['user_cat_terms'],
"lang_agreement_terms" => $lang['user_cat_terms_text'],
"lang_agree" => $lang['agree'],
"lang_agree_not" => $lang['agree_not']
));
$content .= $site_template->parse_template("member_cat_terms");
}else{
$auth_show = "";
$user_list_added = "";
$user_list_rmvd = "";
$user_list_added_count = 0;
$user_list_rmvd_count = 0;
$auth_array = get_auth_array(($user_info['user_level'] == ADMIN) ? "1,1,1,1,1,1,1,1,1" : "");
if (isset($HTTP_POST_VARS['auth']) || isset($HTTP_GET_VARS['auth'])) {
$auth_check = ($HTTP_POST_VARS['auth'] ) ? $HTTP_POST_VARS['auth'] : $HTTP_GET_VARS['auth'];
if (in_array("auth_".$auth_check, $auth_array)){
$auth_show = "auth_".$auth_check;
if (isset($HTTP_POST_VARS[$auth_check.'_1']) || isset($HTTP_GET_VARS[$auth_check.'_1'])) {
$auth_list_no = ($HTTP_POST_VARS[$auth_check.'_1'] ) ? $HTTP_POST_VARS[$auth_check.'_1'] : $HTTP_GET_VARS[$auth_check.'_1'];
foreach ($auth_list_no as $key){
if ($key != 0) {
$user_list = get_user_info($key);
$user_list_added .= $user_list['user_name']."<br />";
$user_list_added_count++;
$user_perm = user_cat_perm_cur($key);
$user_perm_cur = array();
foreach ($auth_array as $val) {
$user_perm_cur[$val] = (($val == $auth_show) ? 1 : (($user_perm[$val]) ? $user_perm[$val] : 0));
}
update_user_group($key, $admin_cat_id, $user_perm_cur);
}
}
}
if (isset($HTTP_POST_VARS[$auth_check.'_2']) || isset($HTTP_GET_VARS[$auth_check.'_2'])) {
$auth_list_yes = ($HTTP_POST_VARS[$auth_check.'_2'] ) ? $HTTP_POST_VARS[$auth_check.'_2'] : $HTTP_GET_VARS[$auth_check.'_2'];
foreach ($auth_list_yes as $key){
if ($key != 0) {
$user_list = get_user_info($key);
$user_list_rmvd .= $user_list['user_name']."<br />";
$user_list_rmvd_count++;
$user_perm = user_cat_perm_cur($key);
$user_perm_cur = array();
foreach ($auth_array as $val) {
$user_perm_cur[$val] = (($val == $auth_show) ? 0 : (($user_perm[$val]) ? $user_perm[$val] : 0));
}
update_user_group($key, $admin_cat_id, $user_perm_cur);
}
}
}
if (isset($HTTP_POST_VARS['auth_type']) || isset($HTTP_GET_VARS['auth_type'])) {
$auth_type = ($HTTP_POST_VARS['auth_type'] ) ? $HTTP_POST_VARS['auth_type'] : $HTTP_GET_VARS['auth_type'];
$auth_type = ($auth_type) ? $auth_type : 0;
if ($cat_cache[$admin_cat_id][$auth_show] != $auth_type) {
$sql = "UPDATE ".CATEGORIES_TABLE."
SET ".$auth_show." = ".$auth_type."
WHERE cat_id = ".$admin_cat_id;
$site_db->query($sql);
$cat_cache[$admin_cat_id][$auth_show] = $auth_type;
}
}
}
}
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_level").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email")."
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_level")." > ".USER_AWAITING." AND ".get_user_table_field("", "user_id")." <> ".$user_info['user_id']." AND ".get_user_table_field("", "user_level")." != ".ADMIN."
ORDER BY ".get_user_table_field("", "user_name")." ASC";
$result = $site_db->query($sql);
$user_list = "";
while ($user_cache = $site_db->fetch_array($result)) {
$user_list .= $user_cache['user_id'].",".addslashes($user_cache['user_name']).",";
}
$auth_list = "";
$auth_edit_js = "";
foreach ($auth_array as $auth_item) {
$auth_type = "";
$auth_edit = 0;
$auth_edit_prv = 0;
$user_cat_note_warning = "";
$user_cat_help = "";
if ($auth_show == $auth_item) {
if ($cat_cache[$admin_cat_id][$auth_item] == AUTH_ACL){
$users = user_cat_perm($auth_show);
foreach ($users as $key => $val) {
$auth_list .= $key.",";
}
$auth_edit_js = 1;
$auth_edit = 1;
$user_cat_help = $lang['user_cat_help'];
}
$auth_type = "<select name=\"auth_type\">\n";
foreach ($user_cat_auth_type as $key => $val) {
$auth_type .= "<option value=\"".$key."\"";
if ($cat_cache[$admin_cat_id][$auth_item] == $key){
$auth_type .= " style=\"color: #FF5353\" selected=\"selected\"";
$auth_cur = $key;
}
$auth_type .= ">".$val."</option>\n";
}
$auth_type .= "</select> **\n";
$auth_edit_prv = 1;
if ($auth_show != "auth_viewcat" && $cat_cache[$admin_cat_id]['auth_viewcat'] == AUTH_ACL) {
$user_cat_note_warning = "<br /><br />".$lang['auth_warning'];
}
}
$site_template->register_vars(array(
"user_list_added" => $user_list_added,
"user_list_rmvd" => $user_list_rmvd,
"lang_added" => $lang['added']." (".$user_list_added_count.")",
"lang_rmvd" => $lang['removed']." (".$user_list_rmvd_count.")",
"auth_type" => $auth_type,
"auth_cur" => $user_cat_auth_type[$cat_cache[$admin_cat_id][$auth_item]],
"admin_cat" => ($user_info['user_level'] == ADMIN) ? "<input type=\"hidden\" name=\"user_id\" value=\"".$admin_cat_owner['user_id']."\" />" : "",
"usercat_auth" => $auth_check,
"usercat_auth_show" => $lang[$auth_item],
"auth_edit" => $auth_edit,
"user_cat_note" => $lang['user_cat_note'].$user_cat_note_warning,
"auth_edit_prv" => $auth_edit_prv,
"auth_edit_link" => ($auth_edit_prv) ? "" : $site_sess->url(ROOT_PATH."member.php?action=usercatpermedit&auth=".str_replace("auth_", "", $auth_item).(($user_info['user_level'] == ADMIN) ? "&user_id=".$admin_cat_owner['user_id'] : "")),
"lang_save" => $lang['save'],
"lang_edit" => $lang['edit'],
"lang_cancel" => $lang['cancel'],
"lang_not_in_list" => $lang['not_in_list'],
"lang_in_list" => $lang['in_list'],
"user_cat_help" => $user_cat_help
));
$auth_bit .= $site_template->parse_template("member_cat_edit_bit");
}
$site_template->register_vars(array(
"auth_edit_js" => $auth_edit_js,
"admin_cat_owner" => $admin_cat_owner['user_id'],
"user_cat_owner" => $admin_cat_owner['user_name'],
"user_list" => trim($user_list, ","),
"usercat_auth" => $auth_check,
"auth_list" => trim($auth_list, ","),
"auth_bit" => $auth_bit,
"lang_auth" => $lang['user_cat_for']." <a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$admin_cat_id)."\">".$admin_cat_owner['user_name']."</a>"
));
$content .= $site_template->parse_template("member_cat_edit");
}
}
$txt_clickstream = $lang['user_cat'];
}
function user_cat_perm_cur($user_id){
global $site_db, $user_info, $admin_cat_id;
$auth_array = get_auth_array();
$sql = "SELECT g.group_id, g.group_name
FROM ".GROUPS_TABLE." g, ".GROUP_MATCH_TABLE." gm
WHERE gm.user_id = $user_id AND g.group_id = gm.group_id";
$row = $site_db->query_firstrow($sql);
if (!$row) {
$row = update_single_usergroup($user_id);
}
$group_id = $row['group_id'];
$group_name = $row['group_name'];
$sql = "SELECT *
FROM ".GROUP_ACCESS_TABLE."
WHERE group_id = $group_id AND cat_id = ".$admin_cat_id;
$result = $site_db->query_firstrow($sql);
return $result;
}
function user_cat_perm($field = ""){
global $site_db, $user_info, $admin_cat_id;
$sql = "SELECT group_id
FROM ".GROUP_ACCESS_TABLE."
WHERE cat_id = ".$admin_cat_id.(($field) ? " AND $field = 1" : "");
$result = $site_db->query($sql);
$group_ids = array();
while ($row = $site_db->fetch_array($result)) {
$group_ids[] = $row['group_id'];
}
if ($group_ids){
$sql = "SELECT u.*
FROM ".GROUP_MATCH_TABLE." gm, ".USERS_TABLE." u
WHERE u.user_id = gm.user_id AND gm.group_id IN (".implode(",", $group_ids).") AND u.user_id <> ".$user_info['user_id'];
$result = $site_db->query($sql);
$users = array();
while ($row = $site_db->fetch_array($result)) {
$users[$row['user_id']] = $row;
}
return $users;
}
return array();
}
function user_cat_check(){
global $config, $user_info, $cat_cache, $HTTP_POST_VARS, $HTTP_GET_VARS, $admin_cat_id, $site_db, $admin_cat_owner;
if (!$config['user_cat'] && $user_info['user_level'] != ADMIN && $user_info['user_level'] == GUEST) {
return false;
}
if ($user_info['user_level'] == ADMIN) {
if (isset($HTTP_POST_VARS['user_id']) || isset($HTTP_GET_VARS['user_id'])) {
$admin_user_id = (intval($HTTP_POST_VARS['user_id'])) ? intval($HTTP_POST_VARS['user_id']) : intval($HTTP_GET_VARS['user_id']);
}
if (empty($admin_user_id)) {
return false;
}
}
$admin_user_id = (isset($admin_user_id)) ? $admin_user_id : $user_info['user_id'];
$sql = "SELECT user_id, user_name, user_cat
FROM ".USERS_TABLE."
WHERE user_id = ".$admin_user_id;
$result = $site_db->query_firstrow($sql);
$admin_cat_owner = array();
$admin_cat_owner['user_id'] = $result['user_id'];
$admin_cat_owner['user_name'] = $result['user_name'];
$admin_cat_id = $result['user_cat'];
if ($admin_cat_id == 0 || !$cat_cache[$admin_cat_id]) {
return false;
}
return true;
}
function create_user_cat($user_id, $cat_name){
global $site_db, $user_info, $config, $admin_cat_id, $cat_cache;
$sql = "SELECT cat_order
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = 0
ORDER BY cat_order DESC
LIMIT 1";
$catorder = $site_db->query_firstrow($sql);
$cat_order = $catorder['cat_order'] + 10;
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '', ".$config['user_cat_parent'].", $cat_order, 3, 3, 3, 3, 0, 3, 3, 3, 3)";
$result = $site_db->query($sql);
$cat_id = $site_db->get_insert_id();
$sql = "UPDATE ".USERS_TABLE."
SET user_cat = ".$cat_id.", user_cat_active = 1
WHERE user_id = ".$user_id;
$site_db->query($sql);
$user_info['user_cat'] = $cat_id;
$admin_cat_id = $cat_id;
$cat_cache[$cat_id] = 1;
$auth = array(
"auth_viewcat" => 1,
"auth_viewimage" => 1,
"auth_download" => 1,
"auth_upload" => 1,
"auth_vote" => 1,
"auth_sendpostcard" => 1,
"auth_readcomment" => 1,
"auth_postcomment" => 1
);
if ($result && $cat_id) {
update_user_group($user_id, $cat_id, $auth);
if (create_cat_folder(MEDIA_PATH."/".$cat_id, CHMOD_DIRS) && create_cat_folder(THUMB_PATH."/".$cat_id, CHMOD_DIRS)){
return true;
}else{
return false;
}
}else{
return false;
}
}
function update_user_group($user_id, $cat_id, $auth) {
global $site_db;
$auth_field = "";
$auth_value = "";
foreach($auth as $key => $val){
$auth_field .= $key.", ";
$auth_value .= $val.", ";
}
$auth_field = trim($auth_field, ", ");
$auth_value = trim($auth_value, ", ");
$sql = "SELECT g.group_id, g.group_name
FROM ".GROUPS_TABLE." g, ".GROUP_MATCH_TABLE." gm
WHERE gm.user_id = $user_id AND g.group_id = gm.group_id";
$row = $site_db->query_firstrow($sql);
if (!$row) {
$row = update_single_usergroup($user_id);
}
$group_id = $row['group_id'];
$group_name = $row['group_name'];
$sql = "DELETE FROM ".GROUP_ACCESS_TABLE."
WHERE cat_id = $cat_id AND group_id = $group_id";
$site_db->query($sql);
$sql = "INSERT INTO ".GROUP_ACCESS_TABLE."
(group_id, cat_id, $auth_field)
VALUES
($group_id, $cat_id, $auth_value)";
$site_db->query($sql);
}
function update_single_usergroup($user_id) {
global $site_db, $user_table_fields;
$sql = "SELECT ".get_user_table_field("", "user_name")."
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
$row = $site_db->query_firstrow($sql);
if (!$row) {
return false;
}
else {
$group_name = $row[$user_table_fields['user_name']];
unset($row);
}
$sql = "SELECT group_id
FROM ".GROUPS_TABLE."
WHERE group_name = '".addslashes($group_name)."' AND group_type = ".GROUPTYPE_SINGLE;
$row = $site_db->query_firstrow($sql);
if (!$row) {
$sql = "INSERT INTO ".GROUPS_TABLE."
(group_name, group_type)
VALUES
('".addslashes($group_name)."', ".GROUPTYPE_SINGLE.")";
$site_db->query($sql);
$group_id = $site_db->get_insert_id();
}
else {
$group_id = $row['group_id'];
}
$sql = "SELECT group_id
FROM ".GROUP_MATCH_TABLE."
WHERE group_id = $group_id AND user_id = $user_id";
if ($site_db->is_empty($sql)) {
$sql = "INSERT INTO ".GROUP_MATCH_TABLE."
(group_id, user_id, groupmatch_startdate, groupmatch_enddate)
VALUES
($group_id, $user_id, 0, 0)";
$site_db->query($sql);
}
return array("group_id" => $group_id, "group_name" => $group_name);
}
function create_cat_folder($path, $mode) {
if (@is_dir($path)) {
@chmod($path, $mode);
return true;
}
else {
$oldumask = umask(0);
$result = mkdir($path, $mode);
umask($oldumask);
if (!@is_dir($path) || !$result) {
$result = mkdir($path, 0755);
@chmod($path, $mode);
}
return $result;
}
}
function get_auth_array($admin = ""){
global $config;
$auth_conf = explode(",", ($admin) ? $admin : $config['user_cat_auth_array']);
$auth_array = array(
"auth_viewcat",
"auth_viewimage",
"auth_download",
"auth_upload",
"auth_directupload",
"auth_vote",
"auth_sendpostcard",
"auth_readcomment",
"auth_postcomment"
);
$auth = array();
for ($i = 0; $i < count($auth_array); $i++) {
if ($auth_conf[$i]){
$auth[] = $auth_array[$i];
}
}
return $auth;
}
//---- End User Cat -----------
Done with /member.php :D
Step 2.
Open /details.php
Find: $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";
Replace with: $comment_user_ip = ($user_info['user_level'] == ADMIN || $user_info['user_cat'] == $cat_id) ? $comment_row[$i]['comment_ip'] : "";
Step 2.2.
Find: elseif ($is_image_owner) {
$admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
Replace with:// elseif ($is_image_owner || $comment_user_id == $user_info['user_id'] && $user_info['user_level'] != GUEST || $user_info['user_cat'] == $cat_id) {
elseif ($is_image_owner || $user_info['user_cat'] == $cat_id) {
$admin_links .= ($config['user_edit_comments'] != 1 && $user_info['user_cat'] != $cat_id) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_comments'] != 1 && $user_info['user_cat'] != $cat_id) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
Step 2.3.
Find:elseif ($is_image_owner) {
$admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
Replace with: elseif ($is_image_owner || $user_info['user_cat'] == $cat_id) {
$admin_links .= ($config['user_edit_image'] != 1 && $user_info['user_cat'] != $cat_id) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_image'] != 1 && $user_info['user_cat'] != $cat_id) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
Done with /details.php
Step 3.
Open /admin/settings.php
Find:// end of functions
show_admin_header();
if ($action == "updatesettings") {
$setting_item = $HTTP_POST_VARS['setting_item'];
Replace with:function show_categories_list($setting_name, $value_option = ""){
global $cat_parent_cache, $drop_down_cat_cache, $lang, $config;
$category = "\n<select name=\"setting_item[".$setting_name."]\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['main_category']."</option>\n";
$category .= "<option value=\"0\">--------------</option>\n";
$drop_down_cat_cache = array();
$drop_down_cat_cache = $cat_parent_cache;
$category .= get_category_dropdown_bits($value_option);
$category .= "</select>\n";
echo $category;
}
function show_user_cat_perm_array($setting_name, $setting_value) {
global $config, $lang, $auth_array;
$auth_conf = explode(",", $config['user_cat_auth_array']);
$auth = array();
for ($i = 0; $i < count($auth_array); $i++) {
echo "<input type=\"checkbox\" name=\"user_cat_".$auth_array[$i]."\" value=\"1\"".(($auth_conf[$i]) ? " checked=\"checked\"" : "").">".$lang[$auth_array[$i]]."<br>\n";
}
return $auth;
}
// end of functions
show_admin_header();
if ($action == "updatesettings") {
$setting_item = $HTTP_POST_VARS['setting_item'];
$setting_item['user_cat_auth_array'] = "";
foreach ($auth_array as $key) {
$setting_item['user_cat_auth_array'] .= (($HTTP_POST_VARS['user_cat_'.$key]) ? 1 : 0).",";
}
$setting_item['user_cat_auth_array'] = trim($setting_item['user_cat_auth_array'], ",");
Step 3.2.
Find: show_form_footer($lang['save_changes'], "", 2);
Add before (above it): show_table_separator($setting_group[10], 2, "#setting_group_10");
show_setting_row("user_cat", "radio");
show_setting_row("user_cat_new", "radio");
show_setting_row("user_cat_parent", "show_categories_list");
show_setting_row("user_cat_auth_array", "show_user_cat_perm_array");
NOTE: change $setting_group[10], 2, "#setting_group_10" to whatever number is goin next, just scroll little bit up to find it out. REMEMBER THE NUMBER YOU ADDED, YOU WILL NEED IT IN Step 7.
Done with /admin/settings.php
Step 4.
Open /admin/users.php
Find: show_additional_fields("user", $user_row, USERS_TABLE);
Add before (above it): $additional_user_fields['user_cat'][0] = "<a href=\"".ROOT_PATH."categories.php?cat_id=".$user_row['user_cat']."\" target=\"_blank\" />".$lang['user_cat']."</a>";
Done with /admin/users.php
Step 5.
Open /includes/db_field_definitions.php
At the end of the file, just before closing ?> add this:$additional_user_fields['user_cat'] = array($lang['user_cat'], "text", 0);
$additional_user_fields['user_cat_active'] = array($lang['user_cat_active'], "radio", 0);
$additional_user_fields['user_cat_active_admin'] = array($lang['user_cat_active_admin'], "radio", 0);
$additional_user_fields['user_cat_terms'] = array($lang['user_cat_terms'], "radio", 0);
Done with /includes/db_field_definitions.php
Step 6.
Open /lang/<yourlanguage>/main.php
At the end of the file, just before closing ?> add this://----- User Cat -----
$lang['cancel'] = "Cancel";
$lang['not_in_list'] = "Dont have access";
$lang['in_list'] = "Have access";
$lang['auth_viewcat'] = "View Category";
$lang['auth_viewimage'] = "View Image";
$lang['auth_download'] = "Download";
$lang['auth_upload'] = "Upload";
$lang['auth_directupload'] = "Direct Upload";
$lang['auth_vote'] = "Vote";
$lang['auth_sendpostcard'] = "Send eCard";
$lang['auth_readcomment'] = "Read Comments";
$lang['auth_postcomment'] = "Post Comment";
$lang['added'] = "Added";
$lang['removed'] = "Removed";
$lang['user_cat'] = "Personal Category";
$lang['user_cat_for'] = "Personal Category Permissions for";
$lang['user_cat_active'] = "Activate Personal Category";
$lang['user_cat_active_admin'] = "Permit Personal Category";
$lang['user_cat_terms'] = "Members Personal Category Terms and Conditions";
$lang['permis'] = "Permissions";
$lang['user_cat_note'] = "** <b>All</b> - Everyone including guests (public).<br /><b> Registered Users</b> - guests not allowed.<br /><b> Private</b> - only selected members will have access.";
$lang['auth_warning'] = "NOTE: This will affect only selected in "".$lang['auth_viewcat']."" members.";
$lang['user_cat_help'] = "* Select from <b>left</b> side members who you want <b>add</b> to access list<br /> and from <b>right</b> side to <b>delete</b> members from access list.";
$lang['user_cat_terms_text'] = "Blah Blah Blah<br />Just accept it.";
$lang['user_cat_terms_must'] = "You must accept terms and conditions";
$lang['user_cat_activate_not'] = "Your ".$lang['user_cat']." is not activated";
$lang['user_cat_activate'] = "Activate";
$lang['user_cat_deactive_admin'] = "Your ".$lang['user_cat']." was terminated by administrator";
$user_cat_auth_type = array(
AUTH_ALL => "All",
AUTH_USER => "Registered Users",
AUTH_ACL => "Private"
);
//--- End User Cat ---
Done with /lang/<yourlanguage>/main.php
Step 7.
Open /lang/<yourlanguage>/admin.php
At the end of the file, just before closing ?> add this:/*-- Setting-Group 10 --*/
$setting_group[10]="Member Personal Category";
$setting['user_cat'] = "Activate Member Personal Category";
$setting['user_cat_new'] = "Allow Create New Member Personal Categories";
$setting['user_cat_parent'] = "Parent Category";
$setting['user_cat_auth_array'] = "Allowed Change Permissions";
$auth_array = array(
"auth_viewcat",
"auth_viewimage",
"auth_download",
"auth_upload",
"auth_directupload",
"auth_vote",
"auth_sendpostcard",
"auth_readcomment",
"auth_postcomment"
);
NOTE: change $setting_group[10] to whatever u changed in Step 3.2.
Done with /lang/<yourlanguage>/admin.php
Step 8.
Open /templates/<yourtemplate>/member_editprofile.html
Add this: {if lang_activate}
<tr>
<td colspan="2" valign="top" class="head1">{lang_user_cat} <sup class="new">{lang_new}</sup></td>
</tr>
<tr>
<td class="row1" colspan="2">
<input type="checkbox" name="user_cat_active" value="1"{user_cat_active_yes} /><b> {lang_activate}</b>
</td>
</tr>
{if user_cat_edit}
<tr>
<td class="row1" colspan="2">
<a href="{user_cat_edit}">{lang_edit}</a>
</td>
</tr>
{endif user_cat_edit}
{endif lang_activate}
Done with /templates/<yourtemplate>/member_editprofile.html
Next 3 steps u will need create new templates and then upload them to /templates/<yourtemplate>/ dir.
Step 9.
Create member_cat_edit.html with this code:{if auth_edit_js}
<script language="JavaScript">
var user_list="{user_list}";
var list=user_list.split(",");
var user_list = new Array();
var user_list_id = new Array();
var ii=0;
for (var i=0; i < (list.length/2); i++){
user_list[i] = list[ii+1];
user_list_id[i] = list[ii];
ii=ii+2;
}
var list = "{auth_list}";
var name = "{usercat_auth}";
var list = list.split(",");
var owner = {admin_cat_owner};
var owner_mark = "";
function print_list(type){
result="<select name='"+name+"_"+type+"[]' size='15' style='width:200;' multiple='multiple'>\n";
result +="<option value='0' selected='selected'></option>\n";
for (var i=0; i<user_list_id.length; i++){
if (owner == user_list_id[i]) {
owner_mark = " style='background-color: #FFCECE;'";
}else{
owner_mark = "";
}
if (type == 1){
if (!searchArray(user_list_id[i], list)) {
result +="<option value='"+user_list_id[i]+"'"+owner_mark+">» "+user_list[i]+"</option>\n";
}
}else{
if (searchArray(user_list_id[i], list)) {
result +="<option value='"+user_list_id[i]+"'"+owner_mark+"'>» "+user_list[i]+"</option>\n";
}
}
}
result +="</select>\n";
return result;
}
function searchArray(key, arr){
for (var i=0;i<arr.length;i++){
if (key==arr[i]) return true;
}
return false;
}
</script>
{endif auth_edit_js}
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="bordercolor">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top" class="head1" colspan="4">{lang_auth}</td>
</tr>
{auth_bit}
</table>
</td>
</tr>
</table>
-
Step 10.
Create member_cat_edit_bit.html with this code:<tr class="row2" valign="top">
<td width="120" align="left">
{usercat_auth_show}
</td>
{if auth_edit_link}
<td colspan="3" align="left" width="90%">
<a href="{auth_edit_link}">{lang_edit}</a> ({auth_cur})
</td>
{endif auth_edit_link}
{if auth_edit_prv}
<td>
<table width="300" border="0" cellpadding="3" cellspacing="0" align="left">
<form name="usercatpermform" action="{self}" method="post">
{if auth_edit}
<tr>
<td align="center"><b>{lang_not_in_list}</b> *</td>
<td>
</td>
<td align="center"><b>{lang_in_list}</b> *</td>
</tr>
<tr>
<td align="center">
<script language="JavaScript">
document.writeln(print_list(1));
</script>
</td>
<td valign="middle" align="center">
<=== <br><br>
===>
</td>
<td align="center">
<script language="JavaScript">
document.writeln(print_list(2));
</script>
</td>
</tr>
{endif auth_edit}
<tr>
<td align="center" nowrap colspan="3">
<input type="hidden" name="action" value="usercatpermedit" />
<input type="hidden" name="auth" value="{usercat_auth}" />
{admin_cat}
{auth_type}<br /><br />
<input type="submit" name="postbutton" value="{lang_save}" class="button" />
</td>
</tr>
<tr>
<td align="left" colspan="4">
{user_cat_help}
</td>
</tr>
<tr>
<td align="left" colspan="3">
{user_cat_note}
</td>
</tr>
</form>
</table>
</td>
{if user_list_added}
<td width="200" align="left" valign="top">
<br /><b>{lang_added}:</b><br /><br />
<div style="overflow-y: auto; width: 200px; height: 270px;">
{user_list_added}
</div>
</td>
{endif user_list_added}
{if user_list_rmvd}
<td width="200" align="left" valign="top">
<br /><b>{lang_rmvd}:</b><br /><br />
<div style="overflow-y: auto; width: 200px; height: 270px;">
{user_list_rmvd}
</div>
</td>
{endif user_list_rmvd}
{endif auth_edit_prv}
</tr>
Step 11.
Create member_cat_terms.html with this code:<table border="0" cellpadding="0" cellspacing="0" width="100%" class="bordercolor" align="center">
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top" class="head1">{lang_user_cat_terms}</td>
</tr>
<tr>
<td class="row2">{lang_agreement_terms}</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellspacing="1" cellpadding="1" width="100%" align="center">
<tr>
<td align="right">
<form method="post" action="{self}">
<input type="hidden" name="action" value="usercatpermedit" />
<input type="hidden" name="user_cat_accept" value="1" />
<input type="submit" value="{lang_agree}" class="button" />
</form>
</td>
<td align="left">
<form method="post" action="{url_home}">
<input type="submit" value="{lang_agree_not}" class="button" />
</form>
</td>
</tr>
</table>
<br />
Step 12. (Final)
Download "Install MPC (http://gallery.vano.org/file9dl)" installer. Unpack it and upload to your 4images root dir. Then start it by something like (http://youdomain.com/4images/install_mpc.php)
---- How To Use --------
By default this MOD is disabled.
To activate it, go to ACP -> settings and at the very bottom u should see new options.
Members: go to "Control Panel", u should see new option. First they must activate it, then there should be showed new link to edit permissions for their category.
NOTE:
1. The layout doesnt looks too good with default template and screen resolution less then 1024x768 :roll:
2. direct_upload by default is set to ALL, that means, no admin aproval requered when new images uploaded in members category, MPC owner can not change permissions for direct_upload, can change permissions for "upload". I would not recomend let MPC owners set permission for direct_upload.
3. In steps: 1. ; 1.2. ; 1.3. ; 1.4. and 2.2. I add commented lines. If u want owners of comments to be able edit or delete their comments, uncoment those lines, and comment lines below.
I think thats not fair when I cant edit or delete comment I posted... :roll:
-
control panel:
Parse error: parse error, unexpected ':', expecting ')' in e:\www\main2\member.php on line 1114
-
have not tried it out yet, but ohhh yeah I've been waiting for this much needed MOD! :wink:
-
very good mod thk veno
-
When I run the installer, I receive this error:
DB Error: Bad SQL Query: ALTER TABLE 4images_users ADD `user_cat` MEDIUMINT( 8 ) NOT NULL , ADD `user_cat_active` TINYINT( 2 ) NOT NULL , ADD `user_cat_active_admin` TINYINT( 2 ) DEFAULT '1' NOT NULL , ADD `user_cat_terms` TINYINT( 2 ) NOT NULL ;
You have an error in your SQL syntax near '; ' at line 1
Where is the syntax error in the installer? I tried running it through phpmyadmin and got the same error. I don't know enough about php to know what the error is
-
When I run the installer, I receive this error:
DB Error: Bad SQL Query: ALTER TABLE 4images_users ADD `user_cat` MEDIUMINT( 8 ) NOT NULL , ADD `user_cat_active` TINYINT( 2 ) NOT NULL , ADD `user_cat_active_admin` TINYINT( 2 ) DEFAULT '1' NOT NULL , ADD `user_cat_terms` TINYINT( 2 ) NOT NULL ;
You have an error in your SQL syntax near '; ' at line 1
Where is the syntax error in the installer? I tried running it through phpmyadmin and got the same error. I don't know enough about php to know what the error is
Sorry, the installation mysql query was created by my phpmyadmin, so, probably my version of mysql support that kind format...but try to delete " ; ": "ALTER TABLE ".USERS_TABLE." ADD `user_cat` MEDIUMINT( 8 ) NOT NULL , ADD `user_cat_active` TINYINT( 2 ) NOT NULL , ADD `user_cat_active_admin` TINYINT( 2 ) DEFAULT '1' NOT NULL , ADD `user_cat_terms` TINYINT( 2 ) NOT NULL ; "
P.S. Just in case I reuploaded installer without ;
-
Thank you for posting that fix :D i'm sure that this mod will be useful for many people.
-
hello,
I installed this MOD, it seems that there was no error and the Admin Control Panel was OK, however, I did not see and new feature when I logged on as a normal member . .
I cant find where & how to create my own Cartegory . . . .
Could you please give me some suggestion to solve this??
thanks in advance!
-
as I mentioned by default the mod is not activated. u must activated in 4images settings. (first option)
-
I did activate it from the Admin Control panel already . . .
So now, how?
-
Will this mod conflict with the user upload limits mod?
-
Will this mod conflict with the user upload limits mod?
so how can we solve this problem???
I also installed the member upload limit MOD
-
I havnt actually installed this mod yet, Im *asking* if it will conflict before I install it, as the user upload limits mod is of the utmost importance to my site.
-
I havnt actually installed this mod yet, Im *asking* if it will conflict before I install it, as the user upload limits mod is of the utmost importance to my site.
I can not be sure, but I think it shouldnt.
P.S.
also, I forgot mention in the original post, that incase user's category was deleted by admin, next time user upadate hes profile it will create new category...
let me know if this is a bad idea, it's easy to fix.
-
I did activate it from the Admin Control panel already . . .
So now, how?
same here, ACTIVATED and
I dont see any new options when logged in as REGULAR member or even as ADMINISTRATOR
by the way, my 4images is intergrated with vBulletin 2.2.8
whats the solution ?
-
I did activate it from the Admin Control panel already . . .
So now, how?
same here, ACTIVATED and
I dont see any new options when logged in as REULAR member or as ADMINISTRATOR
by the way, my 4images is intergrated with vBulletin 2.2.8
whats the solution ?
Your problem may be same to mine, as my 4images is integrated in phpBB2.0.2
Any one help us out with this?
Thanks
-
Can you send me 3 new template and 1 existing template via e-mail.
I have a problems to create and mod those files.
member_cat_edit.html
member_cat_edit_bit.html
member_cat_terms.html
member_editprofile.html
Thanks.
Jackie
jackie911@so-net.com.hk
-
P.S.
also, I forgot mention in the original post, that incase user's category was deleted by admin, next time user upadate hes profile it will create new category...
let me know if this is a bad idea, it's easy to fix.
Hi V@no, probably the problem is with the integration of 4images into phpBB (as my case).
As you know, after integration, the user database is from phpBB and when I click on "control panel" in 4images page (logged in as normal member) it comes the "edit_profile" of the phpBB NOT what was from 4images before integration.
I would appreciate if you could help us solving this problem . .
Thanks in advance.
-
As you know, after integration, the user database is from phpBB and when I click on "control panel" in 4images page (logged in as normal member) it comes the "edit_profile" of the phpBB NOT what was from 4images before integration.
Alteast now we know where is the problem...
unfortunetly, to solve this I'll need code compleately separate mod, that integrated into PHPBB, not 4images...
-
As you know, after integration, the user database is from phpBB and when I click on "control panel" in 4images page (logged in as normal member) it comes the "edit_profile" of the phpBB NOT what was from 4images before integration.
Alteast now we know where is the problem...
unfortunetly, to solve this I'll need code compleately separate mod, that integrated into PHPBB, not 4images...
Ok I created another 4Images page
stand alone, NO intergration with any BB at all
I install the HACK/mod, as the ADMIN I logged in, create a category ( MEMBERS PRIVATE ) and apply these settings ( Bottom Right of Pic )
( (http://host.deluxnetwork.com/~webx/a1.jpg) )
Next I logged in as a REGULAR user and click on Control Panel and all I saw was ( see Personal Category circled in pic below )
( (http://host.deluxnetwork.com/~webx/a.jpg) )
I checked the BOX and apply my settings change, but it just brings me back to that SAME screen with the box UNchecked.
unlike at YOUR forum ( as a member ) when I click on Control Panel, what I see is ( pic attached below )
(http://host.deluxnetwork.com/~webx/a2.jpg)
ACTIVATE had YES and NO option,
below that was EDIT
when I clicked EDIT I was able to do features
so whats my NEXT step/where did I go wrong ? ?
Thanks in advance
-
I had some problems to mod the template html.
Please send me the changed template html to me via e-mail.
Thanks.
Jackie
jackie911@so-net.com.hk
-
I had some problems to mod the template html.
Please send me the changed template html to me via e-mail.
Thanks.
Jackie
jackie911@so-net.com.hk
Hello Jackie
was this directed to ME ? did you want ME to send you MY templates ?
Thanks in advance
-
ah, ok, guys, I dont know whats wrong with this forum, but I cant open first page of this thread. can someone post part from the mod for member_editprofile.html ?
-
RIght............
Thanks...........a LOT.
I had some problems to mod the template html.
Please send me the changed template html to me via e-mail.
Thanks.
Jackie
jackie911@so-net.com.hk
Hello Jackie
was this directed to ME ? did you want ME to send you MY templates ?
Thanks in advance
-
To v@no, here you are
Step 8.
Open /templates/<yourtemplate>/member_editprofile.html
Add this:Code:
{if lang_activate}
<tr>
<td colspan="2" valign="top" class="head1">{lang_user_cat} <sup class="new">{lang_new}</sup></td>
</tr>
<tr>
<td class="row1" colspan="2">
<input type="checkbox" name="user_cat_active" value="1"{user_cat_active_yes} /><b> {lang_activate}</b>
</td>
</tr>
{if user_cat_edit}
<tr>
<td class="row1" colspan="2">
<a href="{user_cat_edit}">{lang_edit}</a>
</td>
</tr>
{endif user_cat_edit}
{endif lang_activate}
Done with /templates/<yourtemplate>/member_editprofile.html
-
ah, ok, then try this instead:
{if lang_activate}
<tr>
<td colspan="2" valign="top" class="head1">{lang_user_cat} <sup class="new">{lang_new}</sup></td>
</tr>
<tr>
<td class="row2"><b>{lang_activate}</b></td>
<td class="row2">
<input type="radio" name="user_cat_active" value="1"{user_cat_active_yes} />{lang_yes}
<input type="radio" name="user_cat_active" value="0"{user_cat_active_no} />{lang_no}
</td>
</tr>
{if user_cat_edit}
<tr>
<td class="row1" colspan="2">
<a href="{user_cat_edit}">{lang_edit}</a>
</td>
</tr>
{endif user_cat_edit}
{endif lang_activate}
-
ah, ok, then try this instead:
{if lang_activate}
<tr>
<td colspan="2" valign="top" class="head1">{lang_user_cat} <sup class="new">{lang_new}</sup></td>
</tr>
<tr>
<td class="row2"><b>{lang_activate}</b></td>
<td class="row2">
<input type="radio" name="user_cat_active" value="1"{user_cat_active_yes} />{lang_yes}
<input type="radio" name="user_cat_active" value="0"{user_cat_active_no} />{lang_no}
</td>
</tr>
{if user_cat_edit}
<tr>
<td class="row1" colspan="2">
<a href="{user_cat_edit}">{lang_edit}</a>
</td>
</tr>
{endif user_cat_edit}
{endif lang_activate}
should that code be added at the TOP ? Bottom ? anywhere specific ?
T I A
-
should that code be added at the TOP ? Bottom ? anywhere specific ?
no. just make sure it's inside the <form...>...</form>
-
As you know, after integration, the user database is from phpBB and when I click on "control panel" in 4images page (logged in as normal member) it comes the "edit_profile" of the phpBB NOT what was from 4images before integration.
Alteast now we know where is the problem...
unfortunetly, to solve this I'll need code compleately separate mod, that integrated into PHPBB, not 4images...
Please refer to this problem:
I made a link to http://www.1XYZZhd.net/4images/member.php?action=editprofile then it called up the original "control panel" of 4images, and I found the "personal Cartegory" in it (logged as normal member).
But the problem is when I selected to activate the Personal Cartegory, this error came.
DB Error: Bad SQL Query: UPDATE phpBB123xyz_users SET user_email = 'xxxx@yahoo.com', user_viewemail = 0, = 0, user_allow_viewonline = 0, user_website = '', user_icq = '', user_cat_active = '1' WHERE user_id = 22
You have an error in your SQL syntax near '= 0, user_allow_viewonline = 0, user_website = '', user_icq = '', user_cat_activ' at line 4
Could you please explain me how to solve this problem.
Thanks
-
Please refer to this problem:
I made a link to http://www.1XYZZhd.net/4images/member.php?action=editprofile then it called up the original "control panel" of 4images, and I found the "personal Cartegory" in it (logged as normal member).
dead link.
But the problem is when I selected to activate the Personal Cartegory, this error came.
DB Error: Bad SQL Query: UPDATE phpBB123xyz_users SET user_email = 'xxxx@yahoo.com', user_viewemail = 0, = 0, user_allow_viewonline = 0, user_website = '', user_icq = '', user_cat_active = '1' WHERE user_id = 22
You have an error in your SQL syntax near '= 0, user_allow_viewonline = 0, user_website = '', user_icq = '', user_cat_activ' at line 4
what goes after user_viewemail in your code?
why its missing?
-
Well the link was alterred, I meant when I pointed browser directly to the control panel page of 4images, then I found it worked.
but when a normal member activate the personal cartegory, it came that error . . .
I couldn't get your meaning for this:
what goes after user_viewemail in your code?
though, there is error, the cartegory was activated anyway, I guess the problem maybe at the field names definition were not the same in 4images and phpBB . . .
-
Great idea for a mod, I wish it would work with the phpbb intergration because this mod is just what my site needs.
-
hello,
I have a problem below:
(http://www.krvn-online.net/files/Capture.jpg)
When I edit permission to "private", there should be a list of usernames in the left hand side (no access) to be added to the right side (allow access) . .
However, the list on the left handside was empty, even I have hundres of members at my site (see picture), could you please help me to solve this.
Thanks
-
not sure, maybe some of your users has "special" caracters in their name, such as single/doble quotes? (' or ")
-
Hi V@no,
thanks for ur suggestion, but the usernames at my site do not have special characters . . .
I think there must be somethings wrong in the command or function to call the username to the table on the left handside . . . If possible, please let me know the code for this function, I will look into it to see any likely errors.
When I logged on my account at ur site, and edited the permission, the table on the left handside is full of username, while at my site it was empty . . . .
Thanks for early reply
-
as I can see, it's all because of phbb board integration...
and u get bunch of error messages when creating/activating/accessing that category...
to solve all that, u must litterely rewrite almost entire mod, to fix the different fields names in the database...
for example, for the user list:
in member.php find:ORDER BY ".get_user_table_field("", "user_name")." ASC";
try to replace it with:ORDER BY ".get_user_table_field("", "username")." ASC";
if this wont work, then try this:ORDER BY username ASC";
-
to solve all that, u must litterely rewrite almost entire mod, to fix the different fields names in the database...
for example, for the user list:
in member.php find:ORDER BY ".get_user_table_field("", "user_name")." ASC";
try to replace it with:ORDER BY ".get_user_table_field("", "username")." ASC";
if this wont work, then try this:ORDER BY username ASC";
I think that is because of integration also. I did two suggestions also. With the first suggestion, it came nothing (no username). With the second suggestion, there was a list of username BUT we can not view exactly the username (u can check by urself, I still keep the second option on the page), when I select 1 or 2 member to add, there come lots of things to be solved:
DB Error: Bad SQL Query: SELECT FROM phpbb202_users WHERE user_id = 246
You have an error in your SQL syntax near 'FROM phpbb202_users WHERE user_id = 246' at line 2
DB Error: Bad SQL Query: SELECT * FROM 4images_groupaccess WHERE group_id = AND cat_id = 76
You have an error in your SQL syntax near 'AND cat_id = 76' at line 3
DB Error: Bad SQL Query: SELECT FROM phpbb202_users WHERE user_id = 246
You have an error in your SQL syntax near 'FROM phpbb202_users WHERE user_id = 246' at line 2
DB Error: Bad SQL Query: DELETE FROM 4images_groupaccess WHERE cat_id = 76 AND group_id =
You have an error in your SQL syntax near '' at line 2
DB Error: Bad SQL Query: INSERT INTO 4images_groupaccess (group_id, cat_id, auth_viewcat, auth_viewimage, auth_download, auth_upload) VALUES (, 76, 1, 0, 0, 0)
You have an error in your SQL syntax near ' 76, 1, 0, 0, 0)' at line 4
DB Error: Bad SQL Query: SELECT FROM phpbb202_users WHERE user_id = 122
You have an error in your SQL syntax near 'FROM phpbb202_users WHERE user_id = 122' at line 2
DB Error: Bad SQL Query: SELECT * FROM 4images_groupaccess WHERE group_id = AND cat_id = 76
You have an error in your SQL syntax near 'AND cat_id = 76' at line 3
DB Error: Bad SQL Query: SELECT FROM phpbb202_users WHERE user_id = 122
You have an error in your SQL syntax near 'FROM phpbb202_users WHERE user_id = 122' at line 2
DB Error: Bad SQL Query: DELETE FROM 4images_groupaccess WHERE cat_id = 76 AND group_id =
You have an error in your SQL syntax near '' at line 2
DB Error: Bad SQL Query: INSERT INTO 4images_groupaccess (group_id, cat_id, auth_viewcat, auth_viewimage, auth_download, auth_upload) VALUES (, 76, 1, 0, 0, 0)
You have an error in your SQL syntax near ' 76, 1, 0, 0, 0)' at line 4
What should I do now?
-
well, this was just an idea of what's goin on...
for the user list change:$user_list .= $user_cache['user_id'].",".addslashes($user_cache['user_name']).",";
to:$user_list .= $user_cache['user_id'].",".addslashes($user_cache['username']).",";
so u'll have to do with most of the mod...I cant provide u with compleate fix because as I said, it will be new mod afterward...and I dont have integration to check it out myself.
-
thanks for ur idea,
by the way, all "user_name" in member.php had already been changed to "username" a couple of weeks ago.
Do you think that, I have to look into the include file(s), if so pliz suggest me which file(s) I should spend time on it.
Thanks again
-
sure, u know what? maybe u should again follow integration steps, if did changes in any files that this MOD has changed... for example if u said that user_name had to be changed to username by the integration tutorial, then u probably must do same thing for the MOD. try it, let us know what happend ;)
-
Hi V@no,
Done and successfull.
I go into include folder of 4images, rename all "user_name" to "username" in the files functions.php, session.php; and it works
You can check by urself!
Thanks for ur advice and courage!
-
greate, so, basicaly for others, who has integration, they has to do again changes in the files MOD does changes?
another thing, at your site, when u update profile it still give u an error message.
-
I got that but did not know how to fix it!! Any suggestion for that?
thanks
-
... another thing, at your site, when u update profile it still give u an error message.
After jumping around, this error is now fixed, but I did not remember exactly how it was fix . . :? . . trying to change all user_name to username in any php files of 4images.
But now come this problem. . .
before changing user_name to username in these files, the userbox worked properly, but now I did not.
Before it was: logged in as: ai-gu (Ex)
now, it is: logged in as: (empty here)
I need ur suggestion again
thanks
-
u probably changed too many user_name .... ;)
now u need do same changes in the templates.
-
I need to have the image management of using the MOD Members Personal Category and MOD Auto IMage resize on upload.
Probably only a small percentage of users know how to reduce or modify images well enough for resizing, and with the ability to manage their own images...I can see a lot of problems with users storing too many large images.
I was thinking of usiing the resize MOD to max of 400.
Any idea if the two will work together, or maybe which one should be installed first?
:?: :)
-
I need to have the image management of using the MOD Members Personal Category and MOD Auto IMage resize on upload.
Probably only a small percentage of users know how to reduce or modify images well enough for resizing, and with the ability to manage their own images...I can see a lot of problems with users storing too many large images.
I was thinking of usiing the resize MOD to max of 400.
Any idea if the two will work together, or maybe which one should be installed first?
:?: :)
-
those two mods are 100% independent from each other, there shouldnt be any complications installing both. (each of my mods are installed on my site, so far, no problems ;))
-
is there a way to let users organize their private gallery?
i mean, can they separate their images by category, and when another user went see his gallery, he would see different folders with a little thumbnail like this:
- {thumbnail} General (46 pics in gallery)
- {thumbnail} Nature (8 pics in gallery)
- {thumbnail} Portrait (32 pics in gallery)
- {thumbnail} Landscape (6 pics in gallery)
then when clicked it would point to those private gallerys
is this possible?
thanks
-
maybe in version 3 (?) ;)
-
:) ok
i think it's a good ideia if users could create all categorys that they want, and not just the categorys choosen by admin.
this way, every user would have a more personal gallery.
just a thought. :wink:
-
Has anyone figured out what to do for 4images integrated with vBulletin?
The guy who had all the phpbb errors had different problems.
For example, I made it so the members update profile form is only the "activate/deactivate personal gallery" but when the user activates it, nothing happens.
Is this the whole.. "user_name" to "username" thing???
-
Hi V@no,
As I did last time (changing so many user_name into username in *.php files) to the 4images, now I got this problems:
1- When logged in the salutation is not proper (no user name after the word logged in as: . .)
2- The author of the image is not shown . .
(you can see at the site)
I tried around with the detail.php but then it came the author as Guest for all images . . .
Could you please suggest me what I should look into . .
Thanks and nice weekend!
-
I think u'll need do same thing with {user_name} tags in templates ;)
-
I did with home.html and found no tag {user_name}, did with details.html and found only one {user_name_link} when I changed to {username_link} all the uploaders' usernames were "GUEST"
can you show me the code which calls the user name of the uploaders in details.php and the logged in username of the Userbox??
Thank you
-
oh, also got into some trouble with the mod:
i'm running a standalone installation and it works fine until i try to change the default permissions from the users' control panel. once i try to switch between all, registered users, and private i get this kind of messages:
if i try to switch from all to registered users:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 2 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
from all to private:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_download = 1
You have an error in your SQL syntax near 'AND auth_download = 1' at line 3
and something else, the category is not displaying for guests, even though now 'all' should be able to see it. Please help :)
-
The only thing I would like to adjust is which user groups the member can add to their category. The only two options I want to give them is the "Private" or "Registered Users" groups.
Also, how do my current users activate their category? When I tried with a few of them, it did not create the group.
Thanks!
-
oh, also got into some trouble with the mod:
i'm running a standalone installation and it works fine until i try to change the default permissions from the users' control panel. once i try to switch between all, registered users, and private i get this kind of messages:
if i try to switch from all to registered users:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 2 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
from all to private:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_download = 1
You have an error in your SQL syntax near 'AND auth_download = 1' at line 3
and something else, the category is not displaying for guests, even though now 'all' should be able to see it. Please help :)
I have the SAME problem as this also
my setup is a STAND ALONE 4iMages
please give solution
-
is this error shows only when u are logged in as administrator?
-
is this error shows only when u are logged in as administrator?
It shows up BOTH as a REGULAR user and also as ADMINISTRATOR
sn: I installed the Bypass SAFE MODE hack found here >>> http://www.4homepages.de/forum/viewtopic.php?t=3958 and I'm still getting that error above the page ( even tho the image IS uploaded and viewable )
-
i have the mod installed and activated.
now i make a login as a registered member. i can not see any possibility to make me a new category. i can not find the page where its possible.
(sorry for my english)
-
i can not find the page where its possible.
go to "Control Panel" (not the admin control panel), u should see new option "Activate MPC"
-
checkbox is activ. i click to edit and come error: i have no rights...
(in admin control panel are the rights for registered members checked)
-
Thanks for this great Mod :)
I've installed in on a new ver1.7 install for testing. I've enabled it and it appears to work but have a few questions that I am not fully understanding and have read all the posts on this topic.
- Installed on XP, added the English Language Pack
1) Appears I have to enable it per user from the admin->edit users
Is this the only way?
2) In admin->edit users: What is the Field "Personal Category" for. I can only really edit my personal category permissions if I enter a "1" in this field. Even if "Activate Personal Category" is activated in edit user screen. I don't understand the interplay between the 2 fields. Activate is clear.
3) How do I automatically have a new category created for a user - is this possible? It appears your site works this way.
4) How do I assign the category to the user and how do I see this as a user ? - I don't see anyway to tell what real category "personal category" I am editing permissions as a user.
5) Logged in as user and accessing the control Panel. I see the "Personal Category *New" in the left col - under the random image. I have a Check box that is enabled by the "Activate" label - so far so good.
5.1 -> Am I supposed to be able to de-activate and activate this as a user? (if not why is it a checkbox that I apparently have control over)
5.2 -> Not touching the checkbox - if I then hit "Save" above the Change Password field - the Personal Category flag will de-activate. Everytime. I have to logon as admin and re-enable that user again.
That should do and will help me with this mod - maybe others had similar questions ;)
Thanks,
Blaine
-
a great mod! I would like to try it for my pic galley, but I can not download the "Install MPC installer" file, would V@no send me the file by email ?
my email: popo@bbs.shunde.net
thanks.
-
sorry, was kind of too busy lately.
1) Appears I have to enable it per user from the admin->edit users
Is this the only way?
u must first anable MPC from 4images settings.
2) In admin->edit users: What is the Field "Personal Category" for. I can only really edit my personal category permissions if I enter a "1" in this field. Even if "Activate Personal Category" is activated in edit user screen. I don't understand the interplay between the 2 fields. Activate is clear.
That field is show u the category ID asigned to the user, u can change it to another category ID.
3) How do I automatically have a new category created for a user - is this possible? It appears your site works this way.
yes, each member must first activate MPC from their profile, when they activated, and accepted terms and conditions, they can set settings and stuff. (remmber, u must first activate "global" MPC from 4images settings.
4) How do I assign the category to the user and how do I see this as a user ? - I don't see anyway to tell what real category "personal category" I am editing permissions as a user.
sorry, didnt quet understand this one :? I might answered it already in second question.
5) Logged in as user and accessing the control Panel. I see the "Personal Category *New" in the left col - under the random image. I have a Check box that is enabled by the "Activate" label - so far so good.
5.1 -> Am I supposed to be able to de-activate and activate this as a user? (if not why is it a checkbox that I apparently have control over)
5.2 -> Not touching the checkbox - if I then hit "Save" above the Change Password field - the Personal Category flag will de-activate. Everytime. I have to logon as admin and re-enable that user again.
yes, members can deactivate their MPC (it's actualy pretty much useless :?)
Not sure about 5.1, it shouldnt be that way.
-
......... any fix yet ?
-
V@no, thanks for that reply. I always had the feature enabled and your other replies helped. I wanted to outline my understanding on how to setup and administrate the personal category feature. If you could review and maybe this will also help others.
1) Enable feature in main settings
2) Create categories or sub-categories that you want users to use for their personal images. Likely one per user that you want to enable this feature for.
3) For each user: Edit user record and enable the MPC feature then enter the category ID that you created above in the "Personal Category" field
4) Now edit permissions for user to grant access for the category to view category, images, upload etc ....
Note: If this is a sub-category then you need view category rights for all directories in the tree.
Note: I can still view and access the images even without the parent directory access, I just can't see the categories and navigation from the home view. I may see the new image and thus the link as expected
5) Login as user and edit the permissions for the personal category if you want to grant other users access or make public
I assume that is the intended behaviour and admin steps.
The only problem I still see is that when logged in as a user and I access the control panel. Hitting Save will clear the "Activate" Personal Category checkbox - everytime using IE 6. Making no changes on the form.
Also, I can de-activate the MPC as the user but I can not re-activate it.
Are you aware or going to release fixes for the above noted issue - just curious as I may have to dig into the code but would prefer to not if I don't need.
Thanks,
Blaine
-
1) Enable feature in main settings
2) Create categories or sub-categories that you want users to use for their personal images. Likely one per user that you want to enable this feature for.
This is correct. Make sure that permissions of that category for view category and view images set to all.
3) For each user: Edit user record and enable the MPC feature then enter the category ID that you created above in the "Personal Category" field
4) Now edit permissions for user to grant access for the category to view category, images, upload etc ....
U might need do those steps, if u didnt do step 2 (your tutorial) and members already activated their MPC.
Note: I can still view and access the images even without the parent directory access, I just can't see the categories and navigation from the home view. I may see the new image and thus the link as expected
this is quet alright, that's why u must set MPC root category (the one u chose in settings) "view category" and "view images" to ALL.
5) Login as user and edit the permissions for the personal category if you want to grant other users access or make public
Correct.
The only problem I still see is that when logged in as a user and I access the control panel. Hitting Save will clear the "Activate" Personal Category checkbox - everytime using IE 6. Making no changes on the form.
Also, I can de-activate the MPC as the user but I can not re-activate it.
this is not right, I've checked my installation steps on fresh 4images and it was working perfectly (I think :?).
Are you aware or going to release fixes for the above noted issue - just curious as I may have to dig into the code but would prefer to not if I don't need.
I'd like see it in action if u dont mind, would u post a link to your site?
-
oh, also got into some trouble with the mod:
i'm running a standalone installation and it works fine until i try to change the default permissions from the users' control panel. once i try to switch between all, registered users, and private i get this kind of messages:
if i try to switch from all to registered users:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 2 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
from all to private:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_download = 1
You have an error in your SQL syntax near 'AND auth_download = 1' at line 3
and something else, the category is not displaying for guests, even though now 'all' should be able to see it. Please help :)
solutions ?
-
oh, also got into some trouble with the mod:
i'm running a standalone installation and it works fine until i try to change the default permissions from the users' control panel. once i try to switch between all, registered users, and private i get this kind of messages:
if i try to switch from all to registered users:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 2 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
from all to private:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_download = 1
You have an error in your SQL syntax near 'AND auth_download = 1' at line 3
and something else, the category is not displaying for guests, even though now 'all' should be able to see it. Please help :)
solutions ?
u have to edit user profile in Control Panel
give the member a member Category number...
But Admin still have DB error message...
-
okay..so say a user has created/activated their album already.....and you have 1150 users. How do they change their permissions?
Do I have to edit user and change permissions for ALL 1150 users so that everyone can see everyone else's albums?!?!?!?
I keep getting this error anyways whenever I try to edit the permissions from member_editprofile...I get this error:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_upload = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_upload = 1
You have an error in your SQL syntax near 'AND auth_upload = 1' at line 3
please help....I think i might cry.
-
okay..so say a user has created/activated their album already.....and you have 1150 users. How do they change their permissions?
each of your members must go to control panel, activate MPC, click save. after that they should see a link "Edit" in their control panel. After first time clicking on "Edit" link, they must accept whatever agreement u set, then new category folder should be automaticaly created and they should see the permissions page.
-
okay..so say a user has created/activated their album already.....and you have 1150 users. How do they change their permissions?
each of your members must go to control panel, activate MPC, click save. after that they should see a link "Edit" in their control panel. After first time clicking on "Edit" link, they must accept whatever agreement u set, then new category folder should be automaticaly created and they should see the permissions page.
okay...right.
so they get DB errors everytime they try to set permissions. What must I do so that they dont get errors?
-
This is another mod I would love to have for my gallery; but the website is still down and I cannot download the files I need :(
peace
WaywardTraveller
-
okay..so say a user has created/activated their album already.....and you have 1150 users. How do they change their permissions?
Do I have to edit user and change permissions for ALL 1150 users so that everyone can see everyone else's albums?!?!?!?
I keep getting this error anyways whenever I try to edit the permissions from member_editprofile...I get this error:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_upload = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_upload = 1
You have an error in your SQL syntax near 'AND auth_upload = 1' at line 3
please help....I think i might cry.
I get the same error. I have run this mod for a long time and have about 11K users. Yestrday I get feedback from user who get this error. Anyone know?
-
i ve installed 4images 1.71. before the hack, i ask "is this MOD for 1.71?" someone said. NO. had any body installed this mod on a running 1.71 system? if yes, how to do this??
thanx b.o.fan
-
hey . i instaleed MPC and it seems to work. just in user control panel i see this instead of "language"
{if user_cat_edit} [Edit]
{endif user_cat_edit}
.... {if auth_edit_js}
it doesn't show text from language file i guess. how can i fix it? :?
-
okay..so say a user has created/activated their album already.....and you have 1150 users. How do they change their permissions?
Do I have to edit user and change permissions for ALL 1150 users so that everyone can see everyone else's albums?!?!?!?
I keep getting this error anyways whenever I try to edit the permissions from member_editprofile...I get this error:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_upload = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_upload = 1
You have an error in your SQL syntax near 'AND auth_upload = 1' at line 3
please help....I think i might cry.
I get the same error. I have run this mod for a long time and have about 11K users. Yestrday I get feedback from user who get this error. Anyone know?
I fix this problem. I deleted all cat with no pics in and run "Repair table" and "Optimize table" in phpmyadmin. All the error is gone. :)
-
I can't seem to download the installation file...both the site and mirror is down. Could someone email it to theresa@tgq.us.
Thanks,
Theresa
-
Wait.... can it be that code in step 9 is incomplete? I don't know javascript... but I know that a scriipt should start and end with the <script></script> tags... and the closing tag is missing.... if this is the cause, can someone lease post the complete code?
-
Juhu.... just found it myself.... so, here is the correct code for step 9! :)
{if auth_edit_js}
<script language="JavaScript">
var user_list="{user_list}";
var list=user_list.split(",");
var user_list = new Array();
var user_list_id = new Array();
var ii=0;
for (var i=0; i < (list.length/2); i++){
user_list[i] = list[ii+1];
user_list_id[i] = list[ii];
ii=ii+2;
}
var list = "{auth_list}";
var name = "{usercat_auth}";
var list = list.split(",");
var owner = {admin_cat_owner};
var owner_mark = "";
function print_list(type){
result="<select name='"+name+"_"+type+"[]' size='15' style='width:200;' multiple='multiple'>\n";
result +="<option value='0' selected='selected'></option>\n";
for (var i=0; i<user_list_id.length; i++){
if (owner == user_list_id[i]) {
owner_mark = " style='background-color: #FFCECE;'";
}else{
owner_mark = "";
}
if (type == 1){
if (!searchArray(user_list_id[i], list)) {
result +="<option value='"+user_list_id[i]+"'"+owner_mark+">» "+user_list[i]+"</option>\n";
}
}else{
if (searchArray(user_list_id[i], list)) {
result +="<option value='"+user_list_id[i]+"'"+owner_mark+"'>» "+user_list[i]+"</option>\n";
}
}
}
result +="</select>\n";
return result;
}
function searchArray(key, arr){
for (var i=0;i<arr.length;i++){
if (key==arr[i]) return true;
}
return false;
}
</script>
{endif auth_edit_js}
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="bordercolor">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top" class="head1" colspan="4">{lang_auth}</td>
</tr>
{auth_bit}
</table>
</td>
</tr>
</table>
-
to V@no
Do you think you will ever do a version 2 of the MPC? If yes, is there a timeframe for that?
Thanx.
-
I still need to find a way to make the members private category accessible via a direct link....
Tried it by adding this (second line "user_cat_id") to member.php:
$site_template->register_vars(array(
"user_cat_id" => $user_row['user_cat'],
"auth_edit_js" => $auth_edit_js,
"admin_cat_owner" => $admin_cat_owner['user_id'],
"user_cat_owner" => $admin_cat_owner['user_name'],
And that to the user_logininfo.html:
<a href="{root_path}categories.php?cat_id={user_cat_id}">My folder</a><br />
But that does not work.... What do I have to do? Please help....
-
Hi I was thinking in install the MOD member personal category but I read that it is not recomendable to install because
THIS MOD NOT IS SUPPORTED BY THE AUTHOR ANYMORE, BECAUSE THE WAY ITS DONE, IT HAS NO POTENTIAL FUTURE TO EXPAND.
IF U HAVEN'T INSTALL THIS MOD, PLEASE DON'T. IF VERSION 2 EVER COMES OUT, AND U INSTALLED THIS VERSION, U'LL HAVE TO REMOVE THIS VERSION PRIOR INSTALLING NEXT VERSION.
SAVE YOURSELF FROM TROUBLE AND WAIT TILL NEXT VERSION.
SORRY.
So I think that would be very cool for the second version or for a new mod to have a Member personal Album. It would be like the light box ... when a user register would see Album and if he click on there it would say you don't have pictures on your album so the user can upload pictures to his or her album and then in his profile there would be a link to his Personal Album so it is not really a category just a member personal space.
If some one has any idea or if this can be done easyly please post it :):):)
-
should that code be added at the TOP ? Bottom ? anywhere specific ?
no. just make sure it's inside the <form...>...</form>
when i go to control panel (user control panel) and i activate personal gallery, then i go to the control panel and the option is off ... but if i go to the categories, my personal category was created ...
-
hi, how can i change the permissions for user personal gallery, if i create a member personal category when other user enter into the gallery he cant view other personal galleries ... and when i edit this categories, the options was all in PRIVATE ...
-
u can edit permissions as any other category - through ACP.
-
u can edit permissions as any other category - through ACP.
but, the permissions set automatically with PRIVATE, how i can change for the default is ALL ...
-
these are set through this part in member.php:
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '', ".$config['user_cat_parent'].", $cat_order, 3, 3, 3, 3, 0, 3, 3, 3, 3)";
the numbers on the last line are represent the access level:
0 - everyone
1 - members only
3 - private
9 - admin
their siquence is matching to auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment (top line)
so, if u count, the number 0 on last line is belong to auth_directupload on top line.
-
thanksssssssss
-
i have a big problem...
I installed MPC coorectly, but after i activated it in control center and in the user center, there is no button to edit the user center...there is only {if user_cat_edit} {endif user_cat_edit} ...Can somebody help me ?
:wink:
-
Is ther a solution to add a direct link in the users box to the usres personal category?
-
i solved my problem
but now....I couldnt find the edit button.....I activatd it corrctly, but there is no edit button to create a new personal category
i need help
-
Hi V@no,
this is a very interesting mod but,
1. why this is an obsolete not supported mod?
2. Is it dangerous for last version of 4images?
3. Can I install it on 1.7.1?
4. Is it incompatible with any mod?
I'd like to install it... what do you think about?
Tnx.
-
hey guys,
is'it possible to add a link in the user box to the users personal category??? :?:
thx for your help!!!
jkn
-
Hi!
When I save general settings in admin panel, I have this massage:
Notice: Undefined index: user_cat_auth_directupload in z:\home\gallery\www\admin\settings.php on line 196
And when I click link "edit" for change Permissions for personal members category, i have this message:
Notice: Undefined variable: auth_check in z:\home\gallery\www\member.php on line 1475
Notice: Undefined variable: auth_bit in z:\home\gallery\www\member.php on line 1488
Help me please.
Evgeny, Russia Fed.
-
Hi!
When I save general settings in admin panel, I have this massage:
Notice: Undefined index: user_cat_auth_directupload in z:\home\gallery\www\admin\settings.php on line 196
And when I click link "edit" for change Permissions for personal members category, i have this message:
Notice: Undefined variable: auth_check in z:\home\gallery\www\member.php on line 1475
Notice: Undefined variable: auth_bit in z:\home\gallery\www\member.php on line 1488
Help me please.
Evgeny, Russia Fed.
=> [MOD] Members Personal Category (obsolete, not supported)
:(
-
:( I´m interesting in this mod... but if it isn´t suported... -.- when will you publish the next version?
-
is anyone going to try to take on the next version for this mod?
-
hi,
has anyone the language parts for this mod in german for me? My english is very bad so i can´t translate it by myself :(
sabba
-
Вот такая ошибка:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 3 WHERE cat_id =
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 '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_download = 1
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 'AND auth_download = 1' at line 3
Как и что можно исправить? :( :( :(
-
http://www.4homepages.de/forum/index.php?topic=13316.0
-
Well i have a little Problem with this mod!
I installed everything with no errors.
I go to the Controle Center and Activate the Mod, than i go to the Member Profile and i check Activate Personal Category... but than i can't see any changes and i can't see how to create a own Category??
What did i wrong?
-
In 4images Version 1.7.2 i cab't find member.php "user_name" => htmlspecialchars(stripslashes($user_name)), ???
-
Well guy's i finally managed it to get the Private Gallery Mod to work only problem is this:
oh, also got into some trouble with the mod:
i'm running a standalone installation and it works fine until i try to change the default permissions from the users' control panel. once i try to switch between all, registered users, and private i get this kind of messages:
if i try to switch from all to registered users:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 2 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
from all to private:
DB Error: Bad SQL Query: UPDATE 4images_categories SET auth_download = 3 WHERE cat_id =
You have an error in your SQL syntax near '' at line 3
DB Error: Bad SQL Query: SELECT group_id FROM 4images_groupaccess WHERE cat_id = AND auth_download = 1
You have an error in your SQL syntax near 'AND auth_download = 1' at line 3
and something else, the category is not displaying for guests, even though now 'all' should be able to see it. Please help :)
solutions ?
Someone know's how to correct it?
Well i tested it as registred user and it look's like it only happends to the Admin.
-
VANO dear, i can setup this mode on new version of 4 images? can or can`not? thank you
-
I have no clue, and I wouldnt recomend installing it on any versions...
-
In 4images Version 1.7.2 i cab't find member.php "user_name" => htmlspecialchars(stripslashes($user_name)), ???
Find in member.php
"user_name" => format_text(stripslashes($user_name), 2),
Insert above it:
"lang_activate" => ($config['user_cat'] && $user_info['user_cat_active_admin'] && ($config['user_cat_new'] || $user_info['user_cat'])) ? $lang['user_cat_activate'] : "",
"user_cat_edit" => ($user_info['user_cat_active']) ? $site_sess->url(ROOT_PATH."member.php?action=usercatpermedit") : "",
"lang_edit" => $lang['edit'],
It works!
And yes... this MOD works with the latest version 1.7.3
THX @ V@no
-
I have still problems with the permission before the user set it self!
I adjust the permissions in member.php to 0, 0, 1, 3, 0, 0, 1, 0, 0 and it does already work, but the user and the administrator can`t read out this permission of the database.
The database entries are correct, but the administrator has this view in the category view.
And the user has a look on this picture.
What's the cause? Does anyone have an idea?
Is this the cause "user_name" => htmlspecialchars(stripslashes($user_name)), at the post above?
Thx
-
In 4images Version 1.7.2 i cab't find member.php "user_name" => htmlspecialchars(stripslashes($user_name)), ???
Find in member.php
"user_name" => format_text(stripslashes($user_name), 2),
Insert above it:
"lang_activate" => ($config['user_cat'] && $user_info['user_cat_active_admin'] && ($config['user_cat_new'] || $user_info['user_cat'])) ? $lang['user_cat_activate'] : "",
"user_cat_edit" => ($user_info['user_cat_active']) ? $site_sess->url(ROOT_PATH."member.php?action=usercatpermedit") : "",
"lang_edit" => $lang['edit'],
It works!
And yes... this MOD works with the latest version 1.7.3
THX @ V@no
it works??
i will test it ;)
-
Yes, it works in version 1.7.2 and 1.7.3, but i have currently a little problem with this Mod. Read and look the post above.
It could be, that this problem is in line "user_name" => format_text(stripslashes($user_name), 2), because I also cant find the right line!
I´m not a developer and I can also only test, whether it works.
Best regards...
-
Yes, it works in version 1.7.2 and 1.7.3, but i have currently a little problem with this Mod. Read and look the post above.
It could be, that this problem is in line "user_name" => format_text(stripslashes($user_name), 2), because I also cant find the right line!
I´m not a developer and I can also only test, whether it works.
Best regards...
what is your problem there?
-
Please look at the post above. In the file "member.php" you can define the authorisations.
This autorisations are taken over in the database, too. But when the user or the admin selcts the authorisations, there is nothing deposited.
See the picture above
-
Part of the instructions for this mod says:
Download "Install MPC" installer. Unpack it and upload to your 4images root dir. Then start it by something like (http://youdomain.com/4images/install_mpc.php)
I guess because V@no site is down, the link doesn't work. How to get this MPC installer?
Thanks
Steve
-
see the attach...
-
thanks cappuccino
-
First off, I must state, V@no, you always got great MODs! Most of the best offered for 4images :D
I just had a simple question and I doubt it would be too hard to do.
I was wondering how I could change the code to allow the user to select the category they want to create the new category in. Basically show the dropdown that the admin has when he/she enables the feature.
I think this would be a great addon feature for this mod. If anyone knows how to do it, can you please post.
Thanks loads!
Chris
-
Any idea how to add the category list to allow the member to select which category they want to create their folder?
-
is this working with 1.7.4 if it is can someone share he files or codes for it
-
I installed th MPC-Mod on 1.7.4 without an error, but I could not find the setting under 'settings' to enable the mod.
Any tips???
-
Hello my friend's
I am add this mode on 4images 1.7.4 but i think ,it doesn't work correctly.you can test it, www.fotoz.ir
how can i correct it?
-
Hallo erstmal,
hat noch irgend jemand den installer? nach der ganzen arbeit habe ich erst festgestellt das der download nicht geht :?
grüße aus dem norden