Page 1 of 2

[ADDON] Visitor Goal (Who was here?)

Posted: 03 Dec 2011, 10:47
by Stoker
Visitor Goal
Written by Stoker
visitor_goal.png
open includes/mods/who_was_here.php
Find:

Code: Select all

$template->assign_vars(array(
			'WHO_WAS_HERE_LIST'		=> $user->lang['REGISTERED_USERS'] . ' ' . $users_list,
			'WHO_WAS_HERE_TOTAL'	=> self::get_total_users_string($config['wwh_disp_hidden'], $config['wwh_disp_bots'], $config['wwh_disp_guests']),
			'WHO_WAS_HERE_EXP'		=> self::get_explanation_string($config['wwh_version']),
			'WHO_WAS_HERE_RECORD'	=> self::get_record_string($config['wwh_record'], $config['wwh_version']),
		));
After add:

Code: Select all

if (!empty($config['forum_goals_visitor_enable']) &&  $config['forum_goals_visitor'] > 0)
	{
		$forum_goals_visitor_percent = (self::$count_total * 100) / $config['forum_goals_visitor'];
		$forum_goals_visitor_rest = $config['forum_goals_visitor'] - self::$count_total;
		$template->assign_vars(array(
		   'FVG_ENABLE'		            	=> $config['forum_goals_visitor_enable'],
		   'VISITOR_TOTAL'					=> self::$count_total,
		   'FORUM_VISITOR_GOAL'            	=> $config['forum_goals_visitor'],
		   'FORUM_VISITOR_PERCENT'          => number_format($forum_goals_visitor_percent),
		   'FORUM_VISITOR_REST'            	=> $forum_goals_visitor_rest,
		));
	}
Open includes/acp/acp_board.php
Find:

Code: Select all

// END Forum Goals
Before add:

Code: Select all

'forum_goals_visitor_enable'	=> array('lang' => 'FVG_ENABLE',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
						'forum_goals_visitor'			=> array('lang' => 'FVG_NUMBER',	'validate' => 'int',   	'type' => 'text:15:8', 'explain' => false),
Open language/en/acp/board.php
Find:

Code: Select all

// END Forum Goals
Before add:

Code: Select all

	'FVG_ENABLE' 				=> 'Enable or disable Forum Visitor Goal',
	'FVG_NUMBER'				=> 'Set the goal for Forum Visitors (Who was here? ADDON)',
Open styles/prosilver/template/forum_goal_body.html
Find:

Code: Select all

</tbody>
Before add:

Code: Select all

<!-- IF FVG_ENABLE and WHO_WAS_HERE_TOTAL -->
			<tr>
				<td style="width: 160px; font-size:12px;">{L_TOTAL_FORUM_VISITOR_GOAL} <strong>{FORUM_VISITOR_GOAL}</strong></td>
				<td style="width: 160px; font-size:12px;">{L_TOTAL_FORUM_VISITOR} <strong>{VISITOR_TOTAL}</strong></td>
				<td style="width: 160px; font-size:12px;"><!-- IF FORUM_VISITOR_PERCENT < 100 -->{L_GOAL_REMAINING} <strong>{FORUM_VISITOR_REST}</strong><!-- ELSE --><em>{L_GOAL_REMAINING_ZERO} <img src="{ROOT_PATH}images/forum_goal_ok.png" width="12" height="12" alt="" /></em><!-- ENDIF --></td>
				<td><div style="background:url('{ROOT_PATH}images/forum_goal_grey.png') repeat-x; background-color: #cccccc; border: 1px solid black; width:100%;"><div style="background:url('{ROOT_PATH}images/forum_goal_<!-- IF FORUM_VISITOR_PERCENT < 34 -->red<!-- ELSEIF FORUM_VISITOR_PERCENT < 67 -->yellow<!-- ELSE -->green<!-- ENDIF -->.png') repeat-x;background-color: #008040; color: white; font-weight:bold;<!-- IF FORUM_VISITOR_PERCENT < 100 --> border-right: 1px solid black;<!-- ENDIF --> max-width:100%;  width:{FORUM_VISITOR_PERCENT}%; height:12px;"><span style="padding-left:25px; font-size:10px; line-height:12px;">{FORUM_VISITOR_PERCENT}%</span></div></div></td>
			</tr>
			<!-- ENDIF -->
Upload files, purge cache and refresh templates.

[ADDON] Visitor Goal (Who was here?)

Posted: 04 Dec 2011, 19:51
by doktornotor
This is missing the language strings ;)

Open: language/en/common.php

Find:

Code: Select all

));
// END Forum Goal
Before add:

Code: Select all

	'TOTAL_FORUM_VISITOR_GOAL'		=> 'Visitor goal',
	'TOTAL_FORUM_VISITOR'			=> 'Total visitors',
BTW, this including the CSS3 version packed in automod format here: [ADDON] CSS3 Progress Bars (with eyecandy)

[ADDON] Visitor Goal (Who was here?)

Posted: 04 Dec 2011, 19:57
by Stoker
Thanks doc ;)

[ADDON] Visitor Goal (Who was here?)

Posted: 09 Dec 2011, 10:33
by themission
How do you stop the Visitor goal reseting to 0 after 24 hours ? is it posible

[ADDON] Visitor Goal (Who was here?)

Posted: 09 Dec 2011, 13:02
by Stoker
If you set the who was here mod to reset the Visitor goal mod also resets.

[ADDON] Visitor Goal (Who was here?)

Posted: 09 Dec 2011, 13:13
by themission
Ahh cool, thank you ;)

[ADDON] Visitor Goal (Who was here?)

Posted: 09 Dec 2011, 14:16
by martin123456
Stoker is this an addon for the NV who was here mod?

http://www.phpbb.com/community/viewtopic.php?t=545983

[ADDON] Visitor Goal (Who was here?)

Posted: 09 Dec 2011, 15:53
by Stoker
Yes, but you are linking to a pretty outdated version.
This is the new topic with the newest version: http://www.phpbb.com/community/viewtopi ... &t=1576245

[ADDON] Visitor Goal (Who was here?)

Posted: 12 Dec 2011, 23:02
by themission
My stats are still resetting - lol
Who was here looks like this
Image is that wrong ?

[ADDON] Visitor Goal (Who was here?)

Posted: 12 Dec 2011, 23:19
by martin123456
How did you install the visitor addon ?

from stoker's edits

or

from here viewtopic.php?f=50&t=1639