User Notes/Warnings in Viewtopic

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: User Notes/Warnings in Viewtopic

Post by RMcGirr83 » Wed Nov 25, 2009 10:32 am

davaguco wrote:Will this MOD work with a 3.0.6 board?

Thanks.
Yep.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

CMA
Registered User
Posts: 330
Joined: Mon Jun 02, 2003 4:15 pm
Location: Vancouver BC Canada
Contact:

Re: User Notes/Warnings in Viewtopic

Post by CMA » Thu Nov 26, 2009 7:33 am

oddly... no problem with automod... but i dont see any display on the profile or memberlist...

is there any option in ACP?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: User Notes/Warnings in Viewtopic

Post by RMcGirr83 » Thu Nov 26, 2009 11:15 am

The display is in viewtopic...just as the title suggests. Nothing to do with memberlist or profile.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

CMA
Registered User
Posts: 330
Joined: Mon Jun 02, 2003 4:15 pm
Location: Vancouver BC Canada
Contact:

Re: User Notes/Warnings in Viewtopic

Post by CMA » Thu Nov 26, 2009 3:25 pm

yes profiles at viewtopic... so i dont see anything... i did clean cache and whatsoever...

but why does this mod edit memberlist template?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: User Notes/Warnings in Viewtopic

Post by RMcGirr83 » Thu Nov 26, 2009 10:10 pm

CMA wrote:but why does this mod edit memberlist template?
:?:
What are you talking about? There are absolutely no edits to "memberlist template"!!

http://www.rmcgirr83.org/mods/notes_in_ ... ll_mod.xml

This is the second mod of mine that you have stated "you have problems with". You need to slow down and take your time as you are clearly making mistakes that have seem to have to do with user error and not modification error. :)
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

CMA
Registered User
Posts: 330
Joined: Mon Jun 02, 2003 4:15 pm
Location: Vancouver BC Canada
Contact:

Re: User Notes/Warnings in Viewtopic

Post by CMA » Fri Nov 27, 2009 2:03 am

oops wrong thread...
Title: user warnings / ban info in viewtopic

Description: Displays the number of user warnings (or "CURRENTLY BANNED") in viewtopic and memberlist view - similar to how the phpbb2 yellow card MOD did. This MOD is compatible with Paul's ban users by x warnings MOD.

Version: 1.0.1

Installation Level: Easy

Installation Time: ~5 minutes

Author Notes: credit goes to RMcGirr83 for his SQL queries! :)

Username: A_O_C
Email: administrator@compnetsupport.org
WWW: http://www.compnetsupport.org

i must be drunken...

*go off and re-download*


edit: again it still not display... i already clean all cache, session and refresh template... :\

maybe i will try this at other fresh installed phpbb3

iliveforyou
Registered User
Posts: 1
Joined: Wed Dec 09, 2009 12:37 am

Re: User Notes/Warnings in Viewtopic

Post by iliveforyou » Wed Dec 09, 2009 12:44 am

hi,

How i make this mod to work with melankolia style ?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: User Notes/Warnings in Viewtopic

Post by RMcGirr83 » Wed Dec 09, 2009 10:33 am

melankonia appears to be a subsilver2 based style, so do the edits to the files the mod has you do to subsilver2.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

hostel2forum
Registered User
Posts: 17
Joined: Sat Dec 12, 2009 1:38 am

Re: User Notes/Warnings in Viewtopic

Post by hostel2forum » Tue Dec 15, 2009 5:46 pm

"RMcGirr83" good to see that you are following the posts regularly.
I have little problem with your signature, not a problem but a suggestion infect.
The whole concept of open source is understood by you i guess. it doesn't look good when you say u'll install for lil monay. you can chnage the wordings to convey same meaning. neway thats just diff in opinion bwt us. :)


Note to other members : i have install thsi mod without any problem. already checked with diff browsers and with normal user login.

exintaexi
Registered User
Posts: 28
Joined: Mon Oct 12, 2009 11:47 pm

Re: User Notes/Warnings in Viewtopic

Post by exintaexi » Tue Dec 29, 2009 12:59 pm

Hi, thanks for this MOD, it really helped me a lot with my forum.

I believe this could be awesome if it was merged with A_O_C's similar MOD.
Well, notes were more important to me than the "currently banned" label, so I picked this one.
Has anybody tried to include the "currently banned" label to this MOD?

Also, I don't know if it's too much to ask, but a snippet that can bring the last note's text (content) inside viewtopic would absolutely save my life! Like displaying under the signature "Last Note: blah blah". Is it too difficult?

Thanks and happy holidays everybody. :)

larsu
Registered User
Posts: 12
Joined: Sun Dec 21, 2008 2:33 pm

Re: User Notes/Warnings in Viewtopic

Post by larsu » Thu Jan 07, 2010 4:53 pm

Hi, I'm getting this error message:
Parse error: syntax error, unexpected ',' in /users/internet/www/forum/includes/mcp/mcp_notes.php on line 175
My mcp_notes.php:

Code: Select all

<?php
/**
*
* @package mcp
* @version $Id: mcp_notes.php 10042 2009-08-22 02:56:05Z terrafrost $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* mcp_notes
* Displays notes about a user
* @package mcp
*/
class mcp_notes
{
	var $p_master;
	var $u_action;

	function mcp_notes(&$p_master)
	{
		$this->p_master = &$p_master;
	}

	function main($id, $mode)
	{
		global $auth, $db, $user, $template;
		global $config, $phpbb_root_path, $phpEx;

		$action = request_var('action', array('' => ''));

		if (is_array($action))
		{
			list($action, ) = each($action);
		}

		$this->page_title = 'MCP_NOTES';

		switch ($mode)
		{
			case 'front':
				$template->assign_vars(array(
					'U_FIND_USERNAME'	=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true'),
					'U_POST_ACTION'		=> append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes'),

					'L_TITLE'			=> $user->lang['MCP_NOTES'],
				));

				$this->tpl_name = 'mcp_notes_front';
			break;

			case 'user_notes':
				$user->add_lang('acp/common');

				$this->mcp_notes_user_view($action);
				$this->tpl_name = 'mcp_notes_user';
			break;
		}
	}

	/**
	* Display user notes
	*/
	function mcp_notes_user_view($action)
	{
		global $phpEx, $phpbb_root_path, $config;
		global $template, $db, $user, $auth;

		$user_id = request_var('u', 0);
		$username = request_var('username', '', true);
		$start = request_var('start', 0);
		$st	= request_var('st', 0);
		$sk	= request_var('sk', 'b');
		$sd	= request_var('sd', 'd');

		add_form_key('mcp_notes');

		$sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";

		$sql = 'SELECT *
			FROM ' . USERS_TABLE . "
			WHERE $sql_where";
		$result = $db->sql_query($sql);
		$userrow = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (!$userrow)
		{
			trigger_error('NO_USER');
		}

		$user_id = $userrow['user_id'];

		// Populate user id to the currently active module (this module)
		// The following method is another way of adjusting module urls. It is the easy variant if we want
		// to directly adjust the current module url based on data retrieved within the same module.
		if (strpos($this->u_action, "&u=$user_id") === false)
		{
			$this->p_master->adjust_url('&u=' . $user_id);
			$this->u_action .= "&u=$user_id";
		}

		$deletemark = ($action == 'del_marked') ? true : false;
		$deleteall	= ($action == 'del_all') ? true : false;
		$marked		= request_var('marknote', array(0));
		$usernote	= utf8_normalize_nfc(request_var('usernote', '', true));

		// Handle any actions
		if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
		{
			$where_sql = '';
			$count = 0;
			if ($deletemark && $marked)
			{
				$sql_in = array();
				foreach ($marked as $mark)
				{
					$sql_in[] = $mark;
					$count++;
				}
				$where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in);
				unset($sql_in);
			}

			if ($where_sql || $deleteall)
			{
				if (check_form_key('mcp_notes'))
				{
					$sql = 'DELETE FROM ' . LOG_TABLE . '
						WHERE log_type = ' . LOG_USERS . "
							AND reportee_id = $user_id
							$where_sql";
					$db->sql_query($sql);
					
					// begin user notes in viewtopic mod
					if (!$deleteall)
					{
						$action = 'some';
			  		}
			  		else
			  		{
						$action = 'reset';
					}
					include($phpbb_root_path . 'includes/notes_in_viewtopic.' . $phpEx);
				 	notes_in_viewtopic($action, $user_id, $count);
					// end user notes in viewtopic mod

					add_log('admin', 'LOG_CLEAR_USER', $userrow['username']);

					$msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED';
				}
				else
				{
					$msg = 'FORM_INVALID';
				}
				$redirect = $this->u_action . '&u=' . $user_id;
				meta_refresh(3, $redirect);
				trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
			}
		}

		if ($usernote && $action == 'add_feedback')
		{
			if (check_form_key('mcp_notes'))
			{
				 'LOG_USER_FEEDBACK', $userrow['username']);
				add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $userrow['username']);

				add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
				// begin user notes in viewtopic mod
				include($phpbb_root_path . 'includes/notes_in_viewtopic.' . $phpEx);
			 	notes_in_viewtopic($action, $user_id);
				// end user notes in viewtopic mod
				$msg = $user->lang['USER_FEEDBACK_ADDED'];
			}
			else
			{
				$msg = $user->lang['FORM_INVALID'];
			}
			$redirect = $this->u_action;
			meta_refresh(3, $redirect);

			trigger_error($msg .  '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
		}

		// Generate the appropriate user information for the user we are looking at
		if (!function_exists('get_user_avatar'))
		{
			include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
		}

		$rank_title = $rank_img = '';
		$avatar_img = get_user_avatar($userrow['user_avatar'], $userrow['user_avatar_type'], $userrow['user_avatar_width'], $userrow['user_avatar_height']);

		$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
		$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
		$sort_by_sql = array('a' => 'u.username_clean', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');

		$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
		gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);

		// Define where and sort sql for use in displaying logs
		$sql_where = ($st) ? (time() - ($st * 86400)) : 0;
		$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');

		$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
		$keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';

		$log_data = array();
		$log_count = 0;
		view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords);

		if ($log_count)
		{
			$template->assign_var('S_USER_NOTES', true);

			foreach ($log_data as $row)
			{
				$template->assign_block_vars('usernotes', array(
					'REPORT_BY'		=> $row['username_full'],
					'REPORT_AT'		=> $user->format_date($row['time']),
					'ACTION'		=> $row['action'],
					'IP'			=> $row['ip'],
					'ID'			=> $row['id'])
				);
			}
		}

		$template->assign_vars(array(
			'U_POST_ACTION'			=> $this->u_action,
			'S_CLEAR_ALLOWED'		=> ($auth->acl_get('a_clearlogs')) ? true : false,
			'S_SELECT_SORT_DIR'		=> $s_sort_dir,
			'S_SELECT_SORT_KEY'		=> $s_sort_key,
			'S_SELECT_SORT_DAYS'	=> $s_limit_days,
			'S_KEYWORDS'			=> $keywords,

			'L_TITLE'			=> $user->lang['MCP_NOTES_USER'],

			'PAGE_NUMBER'		=> on_page($log_count, $config['posts_per_page'], $start),
			'PAGINATION'	=> generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
			'TOTAL_REPORTS'		=> ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),

			'RANK_TITLE'		=> $rank_title,
			'JOINED'			=> $user->format_date($userrow['user_regdate']),
			'POSTS'				=> ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
			'WARNINGS'			=> ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,

			'USERNAME_FULL'		=> get_username_string('full', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
			'USERNAME_COLOUR'	=> get_username_string('colour', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
			'USERNAME'			=> get_username_string('username', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
			'U_PROFILE'			=> get_username_string('profile', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),

			'AVATAR_IMG'		=> $avatar_img,
			'RANK_IMG'			=> $rank_img,
			)
		);
	}

}

?>

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: User Notes/Warnings in Viewtopic

Post by RMcGirr83 » Thu Jan 07, 2010 5:06 pm

Find this on line 175

Code: Select all

             'LOG_USER_FEEDBACK', $userrow['username']);
and remove it.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

larsu
Registered User
Posts: 12
Joined: Sun Dec 21, 2008 2:33 pm

Re: User Notes/Warnings in Viewtopic

Post by larsu » Thu Jan 07, 2010 5:52 pm

THX, now it works :D

Raven78uk
Registered User
Posts: 7
Joined: Fri Feb 05, 2010 3:45 pm

Re: User Notes/Warnings in Viewtopic

Post by Raven78uk » Fri Feb 05, 2010 9:16 pm

Hi im using AeroBlack theme and mod installed by AutoMod perfect.
Converted to AeroBlack also without the problem.

But still only admins can see that, registered users or guest not :(

Code: Select all

	</table>

				<span class="postdetails">
   					<!-- IF postrow.POSTER_WARNINGS --><br /><b>{L_WARNINGS}:</b> {postrow.POSTER_WARNINGS}<!-- ENDIF -->
					<!-- IF postrow.U_NOTES --><br /><a href="{postrow.U_NOTES}" title="{L_VIEW_NOTES}"> {postrow.POSTER_NOTES}</a><!-- ENDIF -->
					<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
					<!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}:</b> {postrow.POSTER_POSTS}<!-- ENDIF -->
					<!-- IF postrow.POSTER_FROM --><br /><b>{L_LOCATION}:</b> {postrow.POSTER_FROM}<!-- ENDIF -->

					<!-- IF postrow.S_PROFILE_FIELD1 -->
						<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
						<br /><b>{postrow.PROFILE_FIELD1_NAME}:</b> {postrow.PROFILE_FIELD1_VALUE}
					<!-- ENDIF -->

					<!-- BEGIN custom_fields -->
						<br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
					<!-- END custom_fields -->
				</span>

			</td>
Thats the code in veiwtopic_body.html after installation.

Any Help?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: User Notes/Warnings in Viewtopic

Post by RMcGirr83 » Fri Feb 05, 2010 9:30 pm

In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Locked

Return to “[3.0.x] MOD Database Releases”