4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on April 13, 2005, 01:21:45 AM
-
This mod was created by chlee but was lost after the hack. I'm just recovering it.
I did a quick hack to list group members from usergroups.php. It is simple and need only 3 files to be modified.
Open your admin/usergroups.php and find
echo "<tr class=\"".get_row_bg()."\"><td><p><b>".$row['group_name']."</b></p></td><td><p>";
show_text_link($lang['edit'], "usergroups.php?action=editgroup&group_id=".$row['group_id']);
show_text_link($lang['delete'], "usergroups.php?action=removegroup&group_id=".$row['group_id']);
Add after it with this:
show_text_link($lang['list_members'], "users.php?action=findusers&user_level=-1&group_id=".$row['group_id']);
Open your lang/yourlang/admin.php and add this line to the bottom of usergroups block (or anywhere you like)
$lang['list_members'] = "list members";
Open your admin/users.php and find these:
$user_level = intval($HTTP_POST_VARS['user_level']);
and replace those with:
$array = array("user_level", "user_name", "user_email", "dateafter", "datebefore", "lastactionafter", "lastactionbefore", "orderby");
foreach($array as $val)
{
if (!isset($HTTP_POST_VARS[$val]))
{
$HTTP_POST_VARS[$val] = (isset($HTTP_GET_VARS[$val])) ? $HTTP_GET_VARS[$val] : "";
}
}
$group_id = trim($HTTP_GET_VARS['group_id']);
$group_sql = "";
if ($group_id !="") {
$now_timestamp = time();
$condition .= " AND group_id = $group_id AND groupmatch_startdate < $now_timestamp".
" AND (groupmatch_enddate > $now_timestamp OR groupmatch_enddate = 0)";
$group_sql = " INNER JOIN ".GROUP_MATCH_TABLE." ON ".USERS_TABLE.".user_id=".GROUP_MATCH_TABLE.".user_id ";
}
$user_level = intval($HTTP_POST_VARS['user_level']);
if ($user_level == 0) {
$user_level = intval($HTTP_GET_VARS['user_level']);
}
Find next:
$sql = "SELECT COUNT(*) AS users
FROM ".USERS_TABLE."
WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST;
Replace it with:
$sql = "SELECT COUNT(*) AS users
FROM ".USERS_TABLE.$group_sql."
WHERE $condition AND ".USERS_TABLE.".".get_user_table_field("", "user_id")." <> ".GUEST;
Find next:
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
FROM ".USERS_TABLE."
WHERE $condition AND ".get_user_table_field("", "user_id")." <> ".GUEST."
Replace it with:
$sql = "SELECT ".USERS_TABLE.".".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
FROM ".USERS_TABLE.$group_sql."
WHERE $condition AND ".USERS_TABLE.".".get_user_table_field("", "user_id")." <> ".GUEST."
Done!
-
Another reply by chlee:
Further enhancement to this quick mod allows you to send emails based on group, or any search criteria users.php allows (Though very ugly code, it works)
in admin/users.php find
if ($action == "findusers") {
add these lines before it
if ($action == "sendemails") {
$error = array();
$subject = stripslashes(trim($HTTP_POST_VARS['subject']));
$message = stripslashes(trim($HTTP_POST_VARS['message']));
if ($subject == "") {
$error['subject'] = 1;
}
if ($message == "") {
$error['message'] = 1;
}
if (!isset($HTTP_POST_VARS['emails']) || empty($HTTP_POST_VARS['emails'])) {
$error['emails'] = 1;
} else {
$emails = $HTTP_POST_VARS['emails'];
}
if (empty($error)) {
@set_time_limit(1200);
include_once(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($config['site_email']);
$site_email->set_subject($subject);
$site_email->register_vars(array(
"message" => $message,
"site_email" => $config['site_email'],
"site_name" => $config['site_name']
));
$site_email->set_body("admin_email", $config['language_dir']);
$site_email->set_bcc($emails);
echo ($site_email->send_email()) ? $lang['send_emails_success'] : $lang['send_emails_error'];
echo "<p>";
show_text_link($lang['back'], "javascript:history.back(1)");
}
else {
$msg = sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
$action = "mass_email";
}
}
if ($action == "mass_email") {
if ($msg != "") {
printf("<b>%s</b>n", $msg);
}
if (!isset($HTTP_POST_VARS['emails']) || empty($HTTP_POST_VARS['emails'])) {
if (isset($HTTP_POST_VARS['deleteusers']) && !empty($HTTP_POST_VARS['deleteusers'])) {
$emails = array();
$user_ids = $HTTP_POST_VARS['deleteusers'];
foreach ($user_ids as $id_val) {
$ids_tosend .= ",".$id_val;
}
$ids_tosend = substr($ids_tosend, 1);
$sql = "SELECT user_email FROM ".USERS_TABLE." WHERE user_id IN (".$ids_tosend.")";
$result = $site_db->query($sql);
while ($email_row = $site_db->fetch_array($result)) {
$emails[] = $email_row['user_email'];
}
}
} else {
$emails = $HTTP_POST_VARS['emails'];
}
show_form_header("users.php", "sendemails");
show_table_header($lang['send_emails'], 2);
show_input_row($lang['send_emails_subject'], "subject", "", 45);
show_textarea_row($lang['send_emails_message'], "message", "", 60, 20);
foreach ($emails as $key => $hidden_val) {
show_hidden_input("emails[".$key."]", $hidden_val);
}
$title = $lang['mass_email'];
if (isset($error['emails'])) {
$title = sprintf("<span class=\"marktext\">%s *</span>", $title);
}
show_form_footer($lang['send_emails'], "", 2);
}
Find
show_text_link($lang['delete'],"users.php?action=removeuser&user_id=".$user_row[$user_table_fields['user_id']]);
echo " ";
show_text_link($lang['permissions'], "usergroups.php?action=editpermissions&user_id=".$user_row[$user_table_fields['user_id']]);
show_text_link($lang['nav_usergroups'], "usergroups.php?action=edituser&user_id=".$user_row[$user_table_fields['user_id']]);
echo "</p></td>n";
echo "</tr>n";
}
echo "<tr class=\"tablefooter\">n<td colspan=\"6\" align=\"left\">n ";
Add this line after it
echo "<input type=\"button\" value=\" ".$lang['mass_email']." \" onclick=\"action.value='mass_email';submit();\" class=\"button\">n";
Add a line in lang/yourlang/admin.php at the bottom of the user block (or anywhere you like)
$lang['mass_email'] = "Mass message";
Done!
-
Great MODs, I was waiting for something like this :):)
-
Good job, thanks!
Mod 1 is a link "list members" under usergroup.
Mod 2 is a "Mass message" button and email formular under "list members".
-
Hi.. Bekomme da nen DB Error beim Aufruf der Liste:
DB Error: Bad SQL Query: SELECT COUNT(*) AS users FROM bb1_users INNER JOIN 4images_groupmatch ON bb1_users.user_id=4images_groupmatch.user_id WHERE 1=1 AND group_id = 3 AND groupmatch_startdate < 1113745570 AND (groupmatch_enddate > 1113745570 OR groupmatch_enddate = 0) AND bb1_users.userid <> -1
Unknown column 'bb1_users.user_id' in 'on clause'
Gefunden: . Angezeigt: 0-.
Hängt das vielleicht damit zusammen das ich die WBB-Lite Integration von Jens21 drin habe und Version 1.7.1 nutze ?
Hat einer ne Lösung für mich ?
-
great mod but this doesnot work if we are using integration with IPB
-
hi i got this mod working when i installed it but now i get this error :S
DB Error: Bad SQL Query: SELECT COUNT(*) AS users FROM girls_users u WHERE 1=1 AND group_id = 87 AND groupmatch_startdate < 1115072841 AND (groupmatch_enddate > 1115072841 OR groupmatch_enddate = 0) AND u.user_id <> -1
Unknown column 'group_id' in 'where clause'
Encontrados: . Mostrados: 0-.
-
hi i got this mod working when i installed it but now i get this error
it worked just fine before and now all of the sudden it doesnt???
/me doubt it :roll:
-
yep, it was working perfectly and yesterday i check the listing member thing and that error appear :S
-
please what can i do about that
-
there is nothing happens by itself...really...
perhaps reinstall the mod?
-
i did :(
-
Wow, danke vielmals!
Nach solch einem Mod habe ich schon lange gesucht! Danke vielmals!
Liebe Grüße!
-
Hi everybody
When I klick on the memberlist, members are shown for several times. Some of them are displayed three, some eight times?
Why that?
Serge
-
Ich habe drei Usergruppen:
Kunde
Fotograf
Aussteller
Wenn ich mir die Liste Usergruppe anschaue, erscheinen gewisse User mehrfach.
Ich sehe aber kein Muster. Einige User erscheinen nur 1 Mal, andere mehrere Male.
Gruss
TIMT
-
the problem was the tabel " 4images_groupmatch".
I had to save all usergroup definitions in the ACP for all users again.
Then the table "4images_groupmatch" was fine and the list group members were displayed correctly.
I have no idea why the table "4images_groupmatch" was wrong.
TIMT
-
Just for blockheads :wink:
What is the ACP?
-
Admin Control Panel
-
when listing members, is there a way so the 1st member is most recent added and the last is most nearest to expiring from usergroup
Cheers
James
-
... this modification should be standard in the ACP by a 4images installation ...
... thanks chlee and v@no ...
-
This is mod is not working with v1.7.4 (At least for me)
When i click on Mass Msgs, all i see is a blank page.
However with one other installation of 4images v 1.7.1, its working just fine.
-
Hi
I have three groups:
photographer
customer
exhibitor
When I click on member-list (e.g. photographer) some users are shown several times.
As i mentioned in a previouse post, the problem ist the file 4images_groupmatch.
the problem was the tabel " 4images_groupmatch".
I had to save all usergroup definitions in the ACP for all users again.
Then the table "4images_groupmatch" was fine and the list group members were displayed correctly.
It is not possible to do this task again and again (klick on Member List, Klick on Usergroup, Klick Save --> now the user is only shown once in the list)
Why are the Users shown several times in the list (up to 20 times)?
Thanks for helping me.
TIMT
-
Any chance this can be ported to 1.7.6?
-
Is it possible to modify mass-mailing-mod for usage with version 1.7.6?
This tool is great - but it doesn't work.
-
Hi,
Have a litlle problem. :?
The code in my (1.7.6) user.php is different.
How I can solve this problem. :?
Thanks,
-
I've updated instructions.
-
Is there perhaps something to do different in 4images 1.7.9 ? I've installed it without any problems but it doesn't list any members when I click "list members", it only shows "keine Einträge gefunden".
I've tried the hint above (save all usergroups definitions for all members again) but there is still no list.
Any hint for me? This MOD would be very useful for me.
-
Ich habe die MOD inzwischen schon zweimal neu installiert, es werden einfach keine Gruppenmitglieder bei mir gelistet (4 Usergruppen sind angelegt und mit Mitgliedern gefüllt).
Muss der Code bei 4i 1.7.9 evtl. irgendwo geändert werden?
Dann ist mir aufgefallen, dass im groupmatch table jeder User zweimal aufgeführt ist; einmal mit irgendeiner ID-Zahl und einmal mit der korrekten Usergruppen-ID.
Ist das normales 4i-Verhalten oder ein Fehler in meiner Datenbank bzw. in der Tabelle ?
-
...Ist das normales 4i-Verhalten oder ein Fehler in meiner Datenbank bzw. in der Tabelle ?
ohne den mod funktioniert das ja einwandfrei, also wird es entweder am mod oder am mod einbau liegen.
mfg Andi
-
Deiner Antwort entnehme ich, dass in der groupmatch table jeder user 2x aufgeführt sein muss, also scheidet die Datentabelle als
Fehlerursache dann sicher aus.
Beim Einbau kann man ja kaum was verkehrt machen, so simpel wie der ist.
Naja, vielleicht hat noch jemand eine Idee, was die Ursache sein kann. Im ACP ist die Mod korrekt zu sehen, sie wird halt nur nicht ausgeführt.
Vielen Dank für Deine Antwort, Andi und schönen Restfeiertag!