[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.
SuperFedya
Registered User
Posts: 253
Joined: Sun Jul 14, 2002 9:14 pm
Contact:

Post by SuperFedya »

Hi
How i can show Ignore List on profile?
Thanks.
User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3542
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Post by bonelifer »

nvm
William Jacoby - Community Team
Knowledge Base | phpBB Board Rules | Search Customisation Database
Please don't contact me via PM or email for phpBB support .
nfs
Registered User
Posts: 49
Joined: Mon May 16, 2005 10:04 pm

Post by nfs »

Sorry about not responding - I've been away. Really away. As in "often no computer access" away.

I've looked at the email code and it's a rats nest. I'm afraid I will break something if I try to put ignore code in there.

Re adding the ability to ignore users in places other than viewtopic (profile and ignore have been suggested), I'll see what I can do. Profile seems a bad bet to me: How often do you decide to ignore someone on the basis of what's in their profile rather than what they've written on the forum? On the ignore list seems better but then there's always that "spelling the user's name right" issue.

Re the most ignored list for admins, I'll think about it. If you have phpMyAdmin or command line sql, you can get the list with

Code: Select all

SELECT ignored_id , username, COUNT(username) FROM `phppb_ignore_user` i, `phpbb_users` u WHERE i.ignored_id = u.user_id GROUP BY ignored_id  ORDER BY `COUNT( username )` DESC
SuperFedya
Registered User
Posts: 253
Joined: Sun Jul 14, 2002 9:14 pm
Contact:

Post by SuperFedya »

Hi
I have 2 mods:
- Birthdays by TerraFrost + user age in viewtopic add-on (\birthdays\contrib\mod\user_age.txt)
http://www.phpbbhacks.com/download/6698
- Custom Profile Fields
http://www.phpbbhacks.com/download/6664

I wish hide this fields if user ignored.

I try like this:

in viewtopic_body.tpl i find {postrow.POSTER_AGE}.

and add $poster_age = ""; line in this code:

Code: Select all

	//Apply User Ignore Settings 
	if ( isset($ignored_ids[$postrow[$i]['user_id']]) && $ignored_ids[$postrow[$i]['user_id']] ) 
	{
		$temp_url = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&mode=unignore&ignoree_id=" . $postrow[$i]['user_id'] . "&sid=" . $userdata['session_id'];
		$ignore_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_unignore'] . '" alt="' . $lang['Unignore_user'] . '" title="' . $lang['Unignore_user'] . '" border="0" /></a>';
		$rank_image = "";
		$poster_joined = "";
		$poster_posts = "";
		$poster_from = "";
		$poster_avatar = "";
		$post_subject = "";
		$poster_age = "";

		$message = sprintf($postrow[$i]['username'] . $lang['Is_ignored'], "<a href=\"ignore.$phpEx\">", "</a>");

		$user_sig = "";
		$l_edited_by = "";
		$quote_img = "";
		$quote = "";
		$profile_img = "";
		$profile = "";
		$pm_img = "";
		$pm = "";
		$email_img = "";
		$email = "";
		$www_img = "";
		$www = "";
		$icq_status_img = "";
		$icq_img = "";
		$icq = "";
		$aim_img = "";
		$aim = "";
		$msn_img = "";
		$msn = "";
		$yim_img = "";
		$yim = "";
	}
And nothing happed :(
Whit Custom Profile Fields same :(

Someone can help me?
nfs
Registered User
Posts: 49
Joined: Mon May 16, 2005 10:04 pm

Post by nfs »

Beats me. Never seen these MODs before.

I took a quick look at the birthday mod and it looks to me like you'll need something significantly different if you want to scrub the birthday. The MOD includes these lines

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
		'EDITED_MESSAGE' => $l_edited_by,
#
#-----[ AFTER, ADD ]------------------------------------------
#
		'POSTER_AGE' => $lang_bd . $age,
when setting the template in viewtopic. If you don't want that code to run, you'll have to test for ignored users in there somewhere.

I won't change the MOD for this because MODs have to run against stock code. I can only wish you good luck in making it work.
Dodgeboy
Registered User
Posts: 26
Joined: Thu Mar 13, 2003 1:17 am

Post by Dodgeboy »

This is a fantastic mod! Does anyone know how to include searching for ignored users in the recent topics marquee? I'd like ignored posters to not show up in the list of recent topics (for that particular user) on the index page. I've tried several SQL manipulations without success.

This is (close to) the standard SQL statement for the recent topics page:

$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_type, t.topic_status, p.post_id, p.poster_id,
p.post_time, u.user_id, u.username, u.user_level, u.user_lastvisit
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
WHERE t.forum_id IN " . $auth_view_forum_sql . " AND t.topic_id = p.topic_id
AND f.forum_id = t.forum_id
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY t.topic_last_post_id DESC";


Any help would be greatly appreciated.

Thanks,
Dave

PS. I should also add that this mod works great as delivered in the zip. I'm trying to add this additional functionality.
Kay_Davis
Registered User
Posts: 12
Joined: Sat Jan 06, 2007 1:29 pm

Modifing for Anonymous in viewtopic.php

Post by Kay_Davis »

I am having a problem where the Mod calls for Modifying one section in viewtopic.php. I do not have a section preceded by if ( $poster_id != ANONYMOUS . I assume that a Mod applied before I took over Maintenance of the board modified this section. There are 2 possible areas in Viewtopic that start with if ( $poster_id != ANONYMOUS. I am Just not sure how to integrate the change into them.

Board is running phpBB 2.0.21
Any Suggestions
Kay

Code: Select all


----------------------- As specified in the MOD ----------------------

#-----[ FIND ]------------------------------------------ 
#
	if ( $poster_id != ANONYMOUS )
	{

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
		if ($userdata['session_logged_in'] && $poster_id != $userdata['user_id'] && $postrow[$i]['user_level'] == USER)
		{
			$temp_url = append_sid("viewtopic.$phpEx?mode=ignore&t=" . $postrow[$i]['topic_id'] . "&ignoree_id=" . $postrow[$i]['user_id']);
			$ignore_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ignore'] . '" alt="' . $lang['Ignore_user'] . '" title="' . $lang['Ignore_user'] . '" border="0" /></a>';
			$ignore = '<a href="' . $temp_url . '">' . $lang['Ignore_user'] . '</a>';
		}

# 

----------------end of Mod ------------------------------------------

------------- Beginning of the code from our Board ------------------
       //
        // Handle anon users posting with usernames
        //
        if ( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
        {
                $poster = $postrow[$i]['post_username'];
                $poster_rank = $lang['Guest'];
        }

        $temp_url = '';

        if ( $poster_id != ANONYMOUS && $userdata['session_logged_in'] )
        {
        $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");
                $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>';
                $profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';

                $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$poster_id");
                $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
                $pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';

                if ( !empty($postrow[$i]['user_viewemail']) || $is_auth['auth_mod'] )
                {
                        $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $poster_id) : 'mailto:' . $postrow[$i]['user_email'];

                        $email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
                        $email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
                }
                else
                {
                        $email_img = '';
                        $email = '';
                }

                $www_img = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
                $www = ( $postrow[$i]['user_website'] ) ? '<a href="' . $postrow[$i]['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';

                if ( !empty($postrow[$i]['user_icq']) )
                {
                        $icq_status_img = '<a href="http://wwp.icq.com/' . $postrow[$i]['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $postrow[$i]['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
                        $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $postrow[$i]['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
                        $icq =  '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $postrow[$i]['user_icq'] . '">' . $lang['ICQ'] . '</a>';
                }
                else
                {
                        $icq_status_img = '';
                        $icq_img = '';
                        $icq = '';
                }

                $aim_img = ( $postrow[$i]['user_aim'] ) ? '<a href="aim:goim?screenname=' . $postrow[$i]['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '';
                $aim = ( $postrow[$i]['user_aim'] ) ? '<a href="aim:goim?screenname=' . $postrow[$i]['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : '';

                $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");
                $msn_img = ( $postrow[$i]['user_msnm'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : '';
                $msn = ( $postrow[$i]['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : '';

                $yim_img = ( $postrow[$i]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $postrow[$i]['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
                $yim = ( $postrow[$i]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $postrow[$i]['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : '';
        }
        else
        {
                $profile_img = '';
                $profile = '';
                $pm_img = '';
                $pm = '';
                $email_img = '';
                $email = '';
                $www_img = '';
                $www = '';
                $icq_status_img = '';
                $icq_img = '';
                $icq = '';
                $aim_img = '';
                $aim = '';
                $msn_img = '';
                $msn = '';
                $yim_img = '';
                $yim = '';
        }

        $temp_url = append_sid("posting.$phpEx?mode=quote&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
        $quote_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quote'] . '" alt="' . $lang['Reply_with_quote'] . '" title="' . $lang['Reply_with_quote'] . '" border="0" /></a>';
        $quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';

        $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($postrow[$i]['username']) . "&showresults=posts");
        $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '" title="' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '" border="0" /></a>';
        $search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '</a>';

----------------- end of the code -----------------------
Last edited by Kay_Davis on Wed Feb 07, 2007 1:11 pm, edited 2 times in total.
Kay_Davis
Registered User
Posts: 12
Joined: Sat Jan 06, 2007 1:29 pm

Post by Kay_Davis »

Duplicate post
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Post by RMcGirr83 »

SuperFedya wrote: Hi
I have 2 mods:
- Birthdays by TerraFrost + user age in viewtopic add-on (\birthdays\contrib\mod\user_age.txt)
http://www.phpbbhacks.com/download/6698

Code: Select all

	//Apply User Ignore Settings 
	if ( isset($ignored_ids[$postrow[$i]['user_id']]) && $ignored_ids[$postrow[$i]['user_id']] ) 
	{
		$temp_url = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&mode=unignore&ignoree_id=" . $postrow[$i]['user_id'] . "&sid=" . $userdata['session_id'];
		$ignore_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_unignore'] . '" alt="' . $lang['Unignore_user'] . '" title="' . $lang['Unignore_user'] . '" border="0" /></a>';
		$rank_image = "";
		$poster_joined = "";
		$poster_posts = "";
		$poster_from = "";
		$poster_avatar = "";
		$post_subject = "";
		$poster_age = "";

		$message = sprintf($postrow[$i]['username'] . $lang['Is_ignored'], "<a href=\"ignore.$phpEx\">", "</a>");

		$user_sig = "";
		$l_edited_by = "";
		$quote_img = "";
		$quote = "";
		$profile_img = "";
		$profile = "";
		$pm_img = "";
		$pm = "";
		$email_img = "";
		$email = "";
		$www_img = "";
		$www = "";
		$icq_status_img = "";
		$icq_img = "";
		$icq = "";
		$aim_img = "";
		$aim = "";
		$msn_img = "";
		$msn = "";
		$yim_img = "";
		$yim = "";
	}


Just put this AFTER $www= ";

Code: Select all

$age = "";
$lang_bd = "";
nfs
Registered User
Posts: 49
Joined: Mon May 16, 2005 10:04 pm

Re: Modifing for Anonymous in viewtopic.php

Post by nfs »

Kay_Davis wrote: I am having a problem where the Mod calls for Modifying one section in viewtopic.php. I do not have a section preceded by if ( $poster_id != ANONYMOUS . I assume that a Mod applied before I took over Maintenance of the board modified this section. There are 2 possible areas in Viewtopic that start with if ( $poster_id != ANONYMOUS. I am Just not sure how to integrate the change into them.

Board is running phpBB 2.0.21
Any Suggestions
Kay

That little piece of code in the MOD generates the button to ignore a user and adds it to all the other buttons at the bottom of each post, like PM and email and profile.

In your MODded code, it looks to me like it will slot in an obvious place. There is a redundant check for being logged in that should not cause a problem - leave it in or remove it as you like.

Code: Select all

        $temp_url = '';

        if ( $poster_id != ANONYMOUS && $userdata['session_logged_in'] )
        {

//MOD STARTS HERE
		if ($userdata['session_logged_in'] && $poster_id != $userdata['user_id'] && $postrow[$i]['user_level'] == USER)
		{
			$temp_url = append_sid("viewtopic.$phpEx?mode=ignore&t=" . $postrow[$i]['topic_id'] . "&ignoree_id=" . $postrow[$i]['user_id']);
			$ignore_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ignore'] . '" alt="' . $lang['Ignore_user'] . '" title="' . $lang['Ignore_user'] . '" border="0" /></a>';
			$ignore = '<a href="' . $temp_url . '">' . $lang['Ignore_user'] . '</a>';
		}
//MOD ENDS HERE

        $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");
                $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>';
                $profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
...
Kay_Davis
Registered User
Posts: 12
Joined: Sat Jan 06, 2007 1:29 pm

Post by Kay_Davis »

Thank you very much for ythe quick reply
Kay_Davis
Registered User
Posts: 12
Joined: Sat Jan 06, 2007 1:29 pm

Non logged in users seeing user is on your ignore list

Post by Kay_Davis »

Good Afternoon,

Finally got all 33 templates modified and installed the mod. For logged in users all seems to be working fine.

The problem is users that are not logged in and are only browsing the forum.

Any person who has been ignored by a logged on user, shows up as ignored when the guest is browsing complete with an unignore button. Of course pressing the button does nothing. If they click to goto the ignore list they are taken to a login screen.

Any Ideas please
Kay

PS :twisted: we are of 2 minds on this truth be told, <grin> it's a good way to 'encourage' posters to be civil if they want visitors to see them, but on the other hand it can put too much power in someone who wants to play games... now if it was possible to say if the person has 15 ignores total then block the user... but that is way beyond the scope of my question. just daydreaming
Kay_Davis
Registered User
Posts: 12
Joined: Sat Jan 06, 2007 1:29 pm

Post by Kay_Davis »

Additionial information

Looking in the database's table i find several ignores set for the user -1 (Anonymous) not sure how they got there. I have deleted them directly from the table.

Additional info. Sunday Morning at 10:30

Found 4 new entries in the ignore table for -1. Removed them. Still not sure how it is happening.

Kay
Additional info. Tuesday Morning at 8:15
Found new entries both Monday and today, so it is definatly still happening, and I am no closer to finding the cause
kay
Kay_Davis
Registered User
Posts: 12
Joined: Sat Jan 06, 2007 1:29 pm

Post by Kay_Davis »

Good Day,

Update one week later, it is still occuring. What is strange is say user id 23 goes to ignore user 933 2 records are being created
-1,933 and
23,933

If nothing else, wonder if I could add to the code snippet at the end some code to delete any entries that have -1?

Kay
Edit to add I am no php expert....

Code: Select all



if ( $mode == 'ignore' )
{
	$sql = "INSERT INTO " . IGNORE_TABLE . " (user_id, ignored_id) VALUES (" . $userdata[user_id] . ", " . $ignoree_id . ")" ;
	if ( !($db->sql_query($sql)) ) 
	{ 
		message_die(GENERAL_ERROR, 'Error setting ignore user', '', __LINE__, __FILE__, $sql); 
	}
}
else if ( $mode == 'unignore' )
{
	$sql = "DELETE FROM " . IGNORE_TABLE . " WHERE user_id = " . $userdata[user_id] . " && ignored_id = " . $ignoree_id;
	if ( !($db->sql_query($sql)) ) 
	{ 
		message_die(GENERAL_ERROR, 'Error unsetting ignore user', '', __LINE__, __FILE__, $sql); 
	}	
}

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

Post by bbnewbie »

superb mod!
Post Reply

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