[ADDON] Visitor Goal (Who was here?)

Download and support for PhpBB3 Forum Goal MOD
User avatar
Stoker
Site Admin
Site Admin
Posts: 3560
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

[ADDON] Visitor Goal (Who was here?)

Post 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.
Board rules! No PM support
User avatar
doktornotor
BBCoder IV
BBCoder IV
Posts: 167
Joined: 14 Sep 2011, 23:20
BBCodes: 30
Favourite MOD: Thanks for Posts
Contact:

[ADDON] Visitor Goal (Who was here?)

Post 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)
Support requests via PM go straight to /dev/null!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3560
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

[ADDON] Visitor Goal (Who was here?)

Post by Stoker »

Thanks doc ;)
Board rules! No PM support
User avatar
themission
BBCoder III
BBCoder III
Posts: 123
Joined: 10 Aug 2011, 22:32
BBCodes: 3
Location: Devon UK
Contact:

[ADDON] Visitor Goal (Who was here?)

Post by themission »

How do you stop the Visitor goal reseting to 0 after 24 hours ? is it posible
User avatar
Stoker
Site Admin
Site Admin
Posts: 3560
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

[ADDON] Visitor Goal (Who was here?)

Post by Stoker »

If you set the who was here mod to reset the Visitor goal mod also resets.
Board rules! No PM support
User avatar
themission
BBCoder III
BBCoder III
Posts: 123
Joined: 10 Aug 2011, 22:32
BBCodes: 3
Location: Devon UK
Contact:

[ADDON] Visitor Goal (Who was here?)

Post by themission »

Ahh cool, thank you ;)
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

[ADDON] Visitor Goal (Who was here?)

Post by martin123456 »

Stoker is this an addon for the NV who was here mod?

http://www.phpbb.com/community/viewtopic.php?t=545983
User avatar
Stoker
Site Admin
Site Admin
Posts: 3560
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

[ADDON] Visitor Goal (Who was here?)

Post 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
Board rules! No PM support
User avatar
themission
BBCoder III
BBCoder III
Posts: 123
Joined: 10 Aug 2011, 22:32
BBCodes: 3
Location: Devon UK
Contact:

[ADDON] Visitor Goal (Who was here?)

Post by themission »

My stats are still resetting - lol
Who was here looks like this
Image is that wrong ?
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

[ADDON] Visitor Goal (Who was here?)

Post by martin123456 »

How did you install the visitor addon ?

from stoker's edits

or

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