[ADDON] Visitor Goal (Who was here?)
Posted: 03 Dec 2011, 10:47
Visitor Goal
Written by Stoker
open includes/mods/who_was_here.php
Find:
After add:
Open includes/acp/acp_board.php
Find:
Before add:
Open language/en/acp/board.php
Find:
Before add:
Open styles/prosilver/template/forum_goal_body.html
Find:
Before add:
Upload files, purge cache and refresh templates.
Written by Stoker
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']),
));
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,
));
}
Find:
Code: Select all
// END Forum Goals
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),
Find:
Code: Select all
// END Forum Goals
Code: Select all
'FVG_ENABLE' => 'Enable or disable Forum Visitor Goal',
'FVG_NUMBER' => 'Set the goal for Forum Visitors (Who was here? ADDON)',
Find:
Code: Select all
</tbody>
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 -->