[BETA] Ignore Suite 1.1.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Post by IPB_Refugee »

Hello nfs,

in my board people don´t see the real email adresses of other users. They can only send mails through the board. There is no need to hide the "email"-buttons. The magic trick could be done in includes/usercp_email.php But unfortunately I am not so good in php and mySQL. :(

Imagine a simple query done in usercp_email.php: If recipient of the email has the sender of the mail in his ignore list, then message_die. Else send email.

As I said I am not able to code that by myself. But I am sure that it could be done in includes/usercp_email.php. I know that because I have installed the following mod:
## MOD Title: Minimum Posts Before PM and Email Allowed
## MOD Author: Merlin Sythove < N/A > (Merlin Sythove) n/a
## MOD Author: azw < N/A > (Art Zoller Wagner) http://www.DigitalDesign.us
## MOD Description: Sets a minimum of posts required before
## users can send PM or emails to other members.
## Admins and mods are excluded; they can send PM and emails immediately.
## Also replying to a PM is allowed even if user has not yet posted.
## Settings can be changed in Admin Control Panel
## MOD Version: 1.0.2


You can find this short mod here: http://www.phpbb.com/phpBB/viewtopic.php?t=397453

Greetings from Austria
Wolfgang
Hekate
Registered User
Posts: 178
Joined: Sun Jun 11, 2006 12:50 am
Location: Finland

Heeeeeeeeeeeeeeeelp!

Post by Hekate »

Tried it but clicking at the user profile causes this error:
Error getting ignore listing

DEBUG MODE

SQL Error : 1146 Table 'astro3_phpbb1.IGNORE_TABLE' doesn't exist

SELECT i.ignored_id, u.username, u.user_id FROM phpbb_users u, IGNORE_TABLE i WHERE i.user_id = 2 AND i.ignored_id = 5

Line : 66
File : usercp_viewprofile.php


The mod, requires the creation of the following table. It was created without errors:
CREATE TABLE phpbb_ignore_user (
user_id mediumint(8) NOT NULL default '0',
ignored_id mediumint(8) NOT NULL default '0'
) TYPE=MyISAM;


I opened phpmyadmin and the table is there. However it is called phpbb_ignore_user. I don't know if it should be called phpbb1_ignore_user, but I think not. All the tables in the left side listing have the prefix phpbb_ and not the phpbb1_

When I select from the left side listing the table phpbb_ignore_user, it appears normally, with the 2 fields user_id and ignored_id. There is a notice message in INDEXES saying "No index defined!".

The mod code added in the "includes/usercp_viewprofile.php" file is:
//
// Retrieve list of ignored ids
//
$sql = "SELECT i.ignored_id, u.username, u.user_id
FROM " . USERS_TABLE . " u, " . IGNORE_TABLE . " i
WHERE i.user_id = " . $userdata['user_id'] . "
AND i.ignored_id = " . $profiledata['user_id'];

if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error getting ignore listing', '', __LINE__, __FILE__, $sql);
}

$num_row = $db->sql_numrows($result);
if ($num_row > 0 )
{
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$is_ignored = sprintf($profiledata['username'] . $lang['Is_ignored'], "<a href=\"ignore.$phpEx\">", "</a>");

$template->assign_block_vars('user_ignored', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'IGNORED' => $is_ignored)
);
}


Any ideas how to fix that? It is kind of urgent...
Hekate
Registered User
Posts: 178
Joined: Sun Jun 11, 2006 12:50 am
Location: Finland

Post by Hekate »

Fortunately, yellashaker's post helped. Had missed a line, in constants.php.

Let's see now how to fine-tune this for another template. :?
Hekate
Registered User
Posts: 178
Joined: Sun Jun 11, 2006 12:50 am
Location: Finland

Post by Hekate »

Some feedback for the users who, like me, are not experienced in phpbb.

To install the Ignore User mod for templates other than subSilver, you have to edit the following 4 files:

overall_header.tpl
subSilver.cfg
viewtopic_body.tpl
profile_view_body.tpl

of your installed template(s), found in the folder templates/yourtemplatename/

Those files may differ in code from the subSilver files and there may be some difficulty in locating the right part of the code to edit. Also the edit might require a slightly different syntax from the one recommended for the subSilver in the mod file. Here you have to locate the right parts and immitate the special syntax your template uses. It takes some time to figure it out, if you are a novice like me, but it can be done.

The Ignore User mod, although Beta, works fine so far (though I haven't checked the PM's yet) and is installed in the latest phpbb version (.21), without conflicts from other installed mods (and they are quite a few).

One feature I would like to see added, is the ability for the Admin to see the most ignored users.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Post by IPB_Refugee »

Hekate wrote: One feature I would like to see added, is the ability for the Admin to see the most ignored users.


Nice idea for bigger boards to detect "bad" users faster. :P

Back to my idea that user A shouldn´t be able to send emails to user B when A is on the ignore list of B. I recently found the code in privmsg.php which *EVENTUALLY* could be integrated into usercp_email.php to actualize my idea:

Code: Select all

	//Get user ignore settings IGNORE MOD
	$sql = "SELECT user_id FROM " . IGNORE_TABLE . " WHERE ignored_id = " . $userdata[user_id];
	if ( !($result = $db->sql_query($sql)) )
	{
   	   message_die(GENERAL_ERROR, 'Error retrieving ignore user data', '', __LINE__, __FILE__, $sql);
	}
	$ignored_ids = array();
	while( $row = $db->sql_fetchrow($result) )
	{
	   $ignored_ids[$row['user_id']] = true;
	}
	// ENDE IGNORE MOD

	if ( $submit )
	{
		if ( !empty($HTTP_POST_VARS['username']) )
		{
			$to_username = phpbb_clean_username($HTTP_POST_VARS['username']);

			$sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active
				FROM " . USERS_TABLE . "
				WHERE username = '" . str_replace("\'", "''", $to_username) . "'
					AND user_id <> " . ANONYMOUS;
			if ( !($result = $db->sql_query($sql)) )
			{
				$error = TRUE;
				$error_msg = $lang['No_such_user'];
			}

			if (!($to_userdata = $db->sql_fetchrow($result)))
			{
				$error = TRUE;
				$error_msg = $lang['No_such_user'];
			}

			// Ignore Mod
			if ( $userdata['user_level'] == USER && isset($ignored_ids[$to_userdata['user_id']]) && $ignored_ids[$to_userdata['user_id']] )
			{
				$error = TRUE;
				$error_msg = $to_username . $lang['Has_ignored'];
			}
			// Ignore Mod
I don´t know how to transform the code to work in usercp_email.php but it´s a first trace. :P

Greetings from Austria!
Wolfgang
Hekate
Registered User
Posts: 178
Joined: Sun Jun 11, 2006 12:50 am
Location: Finland

Post by Hekate »

You mean emails through the board right?

Well, I would suggest to try to make this an optional feature. First, most people have anti-spam programs and/or they can block addresses. So if they receive annoying emails they can simply block them. While in PM's there is no such feature.

Second, it would be a good idea to leave a communication "door" open. Sometimes people quarrel, and sometimes they quarrel a lot, but also after a while they may work things out between them and well...even become friends. :wink:
IPB_Refugee wrote: Nice idea for bigger boards to detect "bad" users faster. :P


And for free boards (no moderators, post/user deletion etc.) to use this as a humorous way to guide some people to behave better. I run a totally free board, where users are supposed to work things out for themselves. They can write whatever they like and can swear at each other if they think they should.

Of course to make the game interesting, I have two user groups and two kinds of categories. Advanced users (that's, the mature ones) can write to every category and moderate their own topics, where the simple ones can use only half the forum and that nice ignore button.

If I could see the most ignored users, I' d make this the monthly "worst users cup", or something. We'd all have a good laugh.
And some egos would feel a little bruised... :lol: :lol: :lol: :lol: :lol:
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Post by IPB_Refugee »

Hekate wrote: You mean emails through the board right?


Yes, of course. In my board I don´t show the real email addresses of my users due to legal reasons. All mails are sent through the board.
Hekate wrote: First, most people have anti-spam programs and/or they can block addresses. So if they receive annoying emails they can simply block them. While in PM's there is no such feature.


They can´t block the mails because that would mean to block all emails from my board (e.g. notifications when there are replys in a watched topic, too).
Hekate wrote: Second, it would be a good idea to leave a communication "door" open. Sometimes people quarrel, and sometimes they quarrel a lot, but also after a while they may work things out between them and well...even become friends.


Nice idea, but you are a dreamer. :wink: This is not what this mod is for. When user A decides to ignore user B there should be no way that user A gets harassed from user B anymore. Just my 2 cents. :wink:

It´s late in my country. Good night!
Wolfgang
Hekate
Registered User
Posts: 178
Joined: Sun Jun 11, 2006 12:50 am
Location: Finland

Post by Hekate »

IPB_Refugee wrote: They can´t block the mails because that would mean to block all emails from my board (e.g. notifications when there are replys in a watched topic, too).


Oops, I forgot that. :oops:
IPB_Refugee wrote:
Hekate wrote:Second, it would be a good idea to leave a communication "door" open. Sometimes people quarrel, and sometimes they quarrel a lot, but also after a while they may work things out between them and well...even become friends.


Nice idea, but you are a dreamer. :wink: This is not what this mod is for. When user A decides to ignore user B there should be no way that user A gets harassed from user B anymore. Just my 2 cents. :wink:


Of course. In dreams begin all the great things. :wink:
Actually it works, not in theory of course, but in real life and I've seen it happen many times. Some really good friendships begun with the fiercest quarrels - in forums. For all the other cases, there is this mod. :lol:

Goodnight.
Sweet`NeSs
Registered User
Posts: 52
Joined: Fri May 05, 2006 9:49 am
Location: Paris, France

Post by Sweet`NeSs »

Hello,

I'm using CH 2.14 and I'm having trouble finding the requested lines in admin_users.php

I don't have

Code: Select all

$sql = "DELETE FROM " . BANLIST_TABLE . "
				WHERE ban_userid = $user_id";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
			}
(Nothing about the banlist whithin the file actually)

Where it is requested to add

Code: Select all

$sql = "DELETE FROM " . IGNORE_TABLE . "
				WHERE user_id = $user_id
				OR ignored_id = $user_id";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete user from ignore table', '', __LINE__, __FILE__, $sql);
			}
Would greatly appreciate if someone could help me on this.

Thanks a lot
bbnewbie
Registered User
Posts: 36
Joined: Sun Aug 20, 2006 5:02 pm

Post by bbnewbie »

great mod!

here (homemade) icons for subred style: http://www.megaupload.com/it/?d=3GGOB4BA
Sweet`NeSs
Registered User
Posts: 52
Joined: Fri May 05, 2006 9:49 am
Location: Paris, France

Post by Sweet`NeSs »

Bump!

Any idea?

Thanks
Sweet`NeSs wrote: Hello,

I'm using CH 2.14 and I'm having trouble finding the requested lines in admin_users.php

I don't have

Code: Select all

$sql = "DELETE FROM " . BANLIST_TABLE . "
				WHERE ban_userid = $user_id";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
			}
(Nothing about the banlist whithin the file actually)

Where it is requested to add

Code: Select all

$sql = "DELETE FROM " . IGNORE_TABLE . "
				WHERE user_id = $user_id
				OR ignored_id = $user_id";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete user from ignore table', '', __LINE__, __FILE__, $sql);
			}
Would greatly appreciate if someone could help me on this.

Thanks a lot
BobbleHead
Registered User
Posts: 38
Joined: Sat Feb 18, 2006 9:10 pm

Post by BobbleHead »

I'm stumped...trying to install this to my forum and was about to begin this. First thing it requires me to do is:

Code: Select all

# 
#-----[ SQL ]------------------------------------------ 
#
CREATE TABLE phpbb_ignore_user (
  user_id mediumint(8) NOT NULL default '0',
  ignored_id mediumint(8) NOT NULL default '0'
) TYPE=MyISAM;
Now, what do I do? I'm lost? Create a table?? Where? How? On What file?
Thank you in advance~! I am not an expert in this :oops:
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Post by IPB_Refugee »

Hello,

you should create the table in your data base and can use tools like phpMyAdmin for this. (That depends on your hosting provider.)

But you can also use a little mod/online tool:

http://www.phpbbhacks.com/download/1581

Just put in the required SQL query and then execute the file db_update.php.

Greetings
Wolfgang
Austin Powers II
Registered User
Posts: 9
Joined: Fri Oct 27, 2006 11:54 pm
Location: New Jersey
Contact:

Post by Austin Powers II »

Is there a way to put the ignore button in a users profile instead of having it when a user is veing a topic? (viewtopic.php)

Thanks
Austin
Slamtrak
Registered User
Posts: 1
Joined: Sun Sep 03, 2006 9:46 pm

Post by Slamtrak »

I am getting this error when using easy mod. Newbie on moding.


Critical Error

FIND FAILED: In file [viewtopic.php] could not find:

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid

MOD script line #378 :: FAQ :: Report
Post Reply

Return to “[2.0.x] MODs in Development”