Beispiel #1
0
function newdownloadgraphic($datetime)
{
    global $module_name, $userinfo;
    echo ' ';
    $count = 0;
    while ($count <= 7) {
        $daysold = L10NTime::date('d-M-Y', gmtime() - 86400 * $count, $userinfo['user_dst'], $userinfo['user_timezone']);
        if ($daysold == $datetime) {
            if ($count <= 1) {
                echo "<img src=\"modules/{$module_name}/images/new_1.gif\" alt=\"" . _NEWTODAY . "\" />";
            }
            if ($count <= 3 && $count > 1) {
                echo "<img src=\"modules/{$module_name}/images/new_3.gif\" alt=\"" . _NEWLAST3DAYS . "\" />";
            }
            if ($count <= 7 && $count > 3) {
                echo "<img src=\"modules/{$module_name}/images/new_7.gif\" alt=\"" . _NEWTHISWEEK . "\" />";
            }
        }
        $count++;
    }
}
Beispiel #2
0
    public function upgrade($prev_version)
    {
        global $db, $prefix, $installer, $userinfo;
        if (version_compare($prev_version, '3', '<')) {
            $this->new_tables();
            $installer->add_query('DROP', $this->prefix . '_modrequest');
            $installer->add_query('DROP', $this->prefix . '_newdownload');
            $installer->add_query('DROP', $this->prefix . '_editorials');
            $installer->add_query('DROP', $this->prefix . '_votedata');
            $installer->add_query('DEL', $this->prefix . '_categories', 'ldescription');
            //			$installer->add_query('DEL', $this->prefix.'_downloads', 'FOREIGN KEY sid');
            $installer->add_query('DEL', $this->prefix . '_downloads', 'INDEX sid');
            $installer->add_query('DEL', $this->prefix . '_downloads', 'INDEX title');
            $installer->add_query('DEL', $this->prefix . '_downloads', 'COLUMN sid, DROP COLUMN downloadratingsummary, DROP COLUMN totalvotes, DROP COLUMN totalcomments');
            $installer->add_query('CHANGE', $this->prefix . '_downloads', 'description desc_long TEXT');
            $installer->add_query('CHANGE', $this->prefix . '_downloads', 'date date int UNSIGNED NOT NULL default ' . time());
            $installer->add_query('ADD', $this->prefix . '_downloads', 'screen INT NOT NULL DEFAULT 0 AFTER url');
            $installer->add_query('ADD', $this->prefix . '_downloads', 'desc_short varchar(255) NOT NULL AFTER screen');
            $installer->add_query('ADD', $this->prefix . '_downloads', 'notes text NOT NULL AFTER desc_long');
            $installer->add_query('ADD', $this->prefix . '_downloads', 'active TINYINT NOT NULL DEFAULT 1 AFTER cid');
            $installer->add_query('ADD', $this->prefix . '_downloads', 'updated int UNSIGNED NOT NULL DEFAULT 0 AFTER date');
            $installer->add_query('ADD', $this->prefix . '_downloads', 'compat varchar(255) NOT NULL AFTER homepage');
            $installer->add_query('ADD', $this->prefix . '_downloads', 'pick TINYINT NOT NULL DEFAULT 0');
            $installer->add_query('ADD', $this->prefix . '_downloads', 'access TINYINT NOT NULL DEFAULT 0 AFTER active');
            $time = time();
            $time_year = intval(L10NTime::date('Y', $time, $userinfo['user_dst'], $userinfo['user_timezone']));
            $time_month = intval(L10NTime::date('m', $time, $userinfo['user_dst'], $userinfo['user_timezone'])) - 1;
            if ($time_month < 1) {
                $time_month = 12;
                $time_year -= 1;
            }
            $result = $db->sql_uquery("SELECT lid, UNIX_TIMESTAMP(date), hits FROM " . $prefix . '_' . $this->prefix . "_downloads");
            while ($row = $db->sql_fetchrow($result)) {
                $installer->add_query('UPDATE', $this->prefix . '_downloads', "date='" . Fix_Quotes($row[1]) . "' WHERE lid='" . $row[0] . "'");
                $installer->add_query('INSERT', $this->prefix . '_stats', "'" . $row[0] . "', '{$time_year}', '{$time_month}', '" . $row[3] . "', 0");
            }
            $installer->add_query('DEL', $this->prefix . '_downloads', 'hits');
            $this->new_config();
            $result = $db->sql_uquery("SELECT lid, url, filesize FROM " . $prefix . '_' . $this->prefix . "_downloads");
            while ($row = $db->sql_fetchrow($result, SQL_NUM)) {
                if (ereg('://', $row[1])) {
                    $row[2] = intval($row[2]);
                    $row[3] = 'N/A';
                } else {
                    $row[2] = intval(filesize($row[2]));
                    $row[3] = md5_file($row[2]);
                    clearstatcache();
                }
                $installer->add_query('INSERT', $this->prefix . '_mirrors', "'NULL', '" . $row[0] . "', '" . Fix_Quotes($row[1]) . "', '', " . $row[2] . ", '" . $row[3] . "', 0");
            }
            $installer->add_query('DEL', $this->prefix . '_downloads', 'url');
        }
        // end upgrade < 3.0.0.0
        // 3.0.0.0 upgrade SPECIAL for multi-screenshot system
        if (version_compare($prev_version, '3.0.0.1', '<')) {
            $installer->add_query('CHANGE', $this->prefix . '_downloads', 'screen screen INT NOT NULL DEFAULT 0');
            $db->sql_query('CREATE TABLE ' . $prefix . '_' . $this->prefix . '_screenshots (
				id int(11) NOT NULL auto_increment,
				did int(11) DEFAULT 0 NOT NULL,
				url varchar(255) NOT NULL,
				uploaded tinyint(4) DEFAULT 0 NOT NULL,
				PRIMARY KEY (id))');
            $result = $db->sql_query("SELECT lid, screen FROM " . $prefix . '_' . $this->prefix . "_downloads");
            while ($row = $db->sql_fetchrow($result, SQL_NUM)) {
                if (!empty($row[1])) {
                    $db->sql_query('INSERT INTO ' . $prefix . '_' . $this->prefix . "_screenshots VALUES (NULL, '" . $row[0] . "', '" . $row[1] . "', 0)");
                    $installer->add_query('UPDATE', $this->prefix . '_downloads', "screen='" . $db->sql_nextid('id') . "' WHERE lid='" . $row[0] . "'");
                }
            }
        }
        if (version_compare($prev_version, '3.0.0.2', '<')) {
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "anon_dl_remote", 1');
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "use_fetch_remote", 1');
        }
        if (version_compare($prev_version, '3.0.0.3', '<')) {
            $installer->add_query('ADD', $this->prefix . '_ratings', 'active TINYINT NOT NULL DEFAULT 1 AFTER uid');
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "r_active", 1');
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "r_queue", 0');
        }
        if (version_compare($prev_version, '3.0.0.4', '<')) {
            $installer->add_query('ADD', $this->prefix . '_broken', 'mid INT NOT NULL DEFAULT 0 AFTER lid');
        }
        if (version_compare($prev_version, '3.0.0.5', '<')) {
            $installer->add_query('INDEX', $this->prefix . '_downloads', 'active', 'active');
            $installer->add_query('INDEX', $this->prefix . '_stats', 'id', 'id');
        }
        if (version_compare($prev_version, '3.0.0.6', '<')) {
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "md5_local", 1');
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "md5_remote", 1');
        }
        if (version_compare($prev_version, '3.0.0.7', '<')) {
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "screen_max", 10');
        }
        if (version_compare($prev_version, '3.0.0.8', '<')) {
            $installer->add_query('INSERT', 'config_custom', '"' . $this->prefix . '", "pub_mirror", 1');
            $installer->add_query('ADD', $this->prefix . '_mirrors', 'uid mediumint(8) UNSIGNED NOT NULL DEFAULT 0 AFTER did');
            $installer->add_query('ADD', $this->prefix . '_mirrors', 'active TINYINT NOT NULL DEFAULT 1');
            $result = $db->sql_query("SELECT lid, submitter FROM " . $prefix . '_' . $this->prefix . "_downloads");
            while ($row = $db->sql_fetchrow($result, SQL_NUM)) {
                $installer->add_query('UPDATE', $this->prefix . '_mirrors', "uid='" . $row[1] . "' WHERE did='" . $row[0] . "'");
            }
        }
        if (version_compare($prev_version, '3.0.0.9', '<')) {
            $installer->add_query('DELETE', 'config_custom', 'cfg_name="' . $this->prefix . '" AND cfg_field="outside"');
        }
        return true;
    }
Beispiel #3
0
	<span style="float:left; height:25px;">' . _NICKNAME . '</span><span style="float:right; height:25px;"><input type="text" name="ulogin" size="10" maxlength="25" /></span><br />
	<span style="float:left; height:25px;">' . _PASSWORD . '</span><span style="float:right; height:25px;"><input type="password" name="user_password" size="10" maxlength="20" /></span><br />
	';
    if ($MAIN_CFG['debug']['sec_code'] & 2) {
        $content .= '<span style="float:left; height:25px;">' . _SECURITYCODE . '</span><span style="float:right; height:25px;">' . generate_secimg() . '</span><br style="clear:left;" />
		<span style="float:left; height:25px;">' . _TYPESECCODE . '</span><span style="float:right; height:25px;"><input type="text" name="gfx_check" size="8" maxlength="8" /></span><br />';
    }
    // don't show register link unless allowuserreg is yes
    $content .= '<span style="float:left; height:25px;">' . ($MAIN_CFG['member']['allowuserreg'] ? '<input type="button" value="' . _BREG . '" onclick="window.location=\'' . URL::index('Your_Account&amp;file=register', 1, 1) . '\'" />' : '') . '</span>
	<span style="float:right; height:25px;"><input type="submit" value="' . _LOGIN . '" />
	</span></div></form>';
}
if (is_admin()) {
    $content .= '<br style="clear:left;"/><a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '"><img src="images/blocks/login.gif" alt="" /></a>&nbsp;<a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '">' . _ADMIN . ' ' . _LOGOUT . "</a><br />\n";
}
$day = L10NTime::tolocal(mktime(0, 0, 0, date('n'), date('j'), date('Y')) - date('Z'), $userinfo['user_dst'], $userinfo['user_timezone']);
list($last[0]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate>='" . $day . "'", SQL_NUM);
list($last[1]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate<'" . $day . "' AND user_regdate>='" . ($day - 86400) . "'", SQL_NUM);
list($lastuser) = $db->sql_ufetchrow("SELECT username FROM " . $user_prefix . "_users \n\tWHERE user_active = 1 AND user_level > 0 \n\tORDER BY user_id DESC", SQL_NUM);
list($numusers) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \nWHERE user_id > 1 AND user_level > 0", SQL_NUM);
$content .= '<hr /><span style="font-weight:bold; text-decoration:underline;">' . _BMEMP . ":</span><br />\n";
$content .= '<img src="images/blocks/ur-moderator.gif" alt="" /> ' . _BLATEST . ': <a href="' . URL::index("Your_Account&amp;profile={$lastuser}") . '"><b>' . $lastuser . '</b></a><br />
<img src="images/blocks/ur-author.gif" alt="" /> ' . _BTD . ': <b>' . $last[0] . '</b><br />
<img src="images/blocks/ur-admin.gif" alt="" /> ' . _BYD . ': <b>' . $last[1] . '</b><br />
<img src="images/blocks/ur-guest.gif" alt="" /> ' . _BOVER . ': <b>' . $numusers . '</b><br />
<hr />
<img src="images/blocks/group-1.gif" alt="" /> <span style="font-weight:bold; text-decoration:underline;">' . _BVISIT . ':</span><br />
<img src="images/blocks/ur-member.gif" alt="" /> ' . _BMEM . ': <b>' . $online_num[0] . '</b><br />
<img src="images/blocks/ur-anony.gif" alt="" /> ' . _BVIS . ': <b>' . $online_num[1] . '</b><br />
<img src="images/blocks/ur-registered.gif" alt="" /> ' . _BTT . ': <b>' . $online_num[2] . '</b>
<hr />
Beispiel #4
0
     unlink($tmpfile);
     cpg_die(_ERROR, GD_FILE_TYPE_ERR, __FILE__, __LINE__, true);
 }
 // Check image type is among those allowed for ImageMagick
 if ($CONFIG['thumb_method'] == 'im' && !stristr($CONFIG['allowed_img_types'], $IMG_TYPES[$imginfo[2]])) {
     unlink($tmpfile);
     cpg_die(_ERROR, sprintf(ALLOWED_IMG_TYPES, $CONFIG['allowed_img_types']), __FILE__, __LINE__);
 }
 // Check that picture size (in pixels) is lower than the maximum allowed
 $max = max($imginfo[0], $imginfo[1]);
 if ($max > $CONFIG['max_upl_width_height']) {
     $max = $CONFIG['max_upl_width_height'];
 }
 // Setup a textual watermark ?
 if ($CONFIG['watermark']) {
     $tolocal = L10NTime::tolocal(time(), $userinfo['user_dst'], $userinfo['user_timezone']);
     $watermark = '(c)' . date('Y', $tolocal) . ' ' . CPG_USERNAME . ' & ' . (!empty($MAIN_CFG['server']['domain']) ? $MAIN_CFG['server']['domain'] : $MAIN_CFG['global']['sitename']);
 } else {
     $watermark = false;
 }
 // Create the "big" image
 if (!resize_image($tmpfile, $imginfo, $uploaded_pic, $max, $CONFIG['thumb_method'], '', $watermark)) {
     unlink($tmpfile);
     cpg_die(_ERROR, $ERROR, __FILE__, __LINE__);
 }
 // Create thumbnail and intermediate image and add the image into the DB
 if (!add_picture($album, $dest_dir, basename($uploaded_pic), $title, $caption, $keywords, $user1, $user2, $user3, $user4, $category, $watermark, $tmpfile)) {
     unlink($uploaded_pic);
     unlink($tmpfile);
     cpg_die(_CRITICAL_ERROR, sprintf(ERR_INSERT_PIC, $uploaded_pic) . '<br /><br />' . $ERROR, __FILE__, __LINE__, true);
 }
Beispiel #5
0
function create_date($format, $gmepoch)
{
    global $board_config, $userinfo;
    if (is_user()) {
        return L10NTime::date($format, $gmepoch, $userinfo['user_dst'], $userinfo['user_timezone']);
    } else {
        return L10NTime::date($format, $gmepoch, 0, $board_config['board_timezone']);
    }
}
Beispiel #6
0
            $l_box_size_status = sprintf($lang['Sentbox_size'], $inbox_limit_pct);
            break;
        case 'savebox':
            $l_box_size_status = sprintf($lang['Savebox_size'], $inbox_limit_pct);
            break;
    }
}
//
// Dump vars to template
//
$template->assign_vars(array('FORM_ACTION' => URL::index('&amp;folder=' . $folder), 'BOX_NAME' => $l_box_name, 'INBOX_LIMIT_IMG_WIDTH' => $inbox_limit_img_length, 'INBOX_LIMIT_PERCENT' => $inbox_limit_pct, 'BOX_SIZE_STATUS' => $l_box_size_status, 'T_TD_COLOR2' => $bgcolor4, 'S_FOLDER' => $folder, 'S_HIDDEN_FIELDS' => '', 'S_POST_NEW_MSG' => $post_new_mesg_url, 'S_SELECT_MSG_DAYS' => $select_msg_days));
//
// Okay, let's build the correct folder
//
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) {
    $i = 0;
    do {
        $row_color = !($i % 2) ? $bgcolor2 : $bgcolor1;
        $row_class = !($i % 2) ? 'row1' : 'row2';
        ++$i;
        $template->assign_block_vars('listrow', array('ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'FROM' => $row['username'], 'SUBJECT' => $row['privmsgs_subject'], 'DATE' => L10NTime::date($MAIN_CFG['global']['dateformat'], $row['privmsgs_date'], $userinfo['user_dst'], $userinfo['user_timezone']), 'PM_NEW_MAIL' => $row['privmsgs_type'] == PM_UNREAD_MAIL, 'MSG_ID' => $row['privmsgs_id'], 'U_READ' => URL::index('&amp;folder=' . $folder . '&amp;mode=read&amp;p=' . $row['privmsgs_id']), 'U_FROM_USER_PROFILE' => URL::index('Your_Account&amp;profile=' . $row['user_id'])));
    } while ($row = $db->sql_fetchrow($result));
    pagination("Private_Messages&amp;folder={$folder}&amp;start=", $pm_total, $MAIN_CFG['private_messages']['per_page'], $start);
} else {
    $template->assign_block_vars('switch_no_messages', array());
}
if ($mode == '') {
    $template->set_handle('body', 'private_msgs/index_body.html');
    $template->display('body');
}
Beispiel #7
0
 public static function is_dst($localtime, $start, $end)
 {
     $dst_start = L10NTime::get_dst_switch($localtime, $start);
     $dst_end = L10NTime::get_dst_switch($localtime, $end);
     if ($dst_start < $dst_end) {
         # Northern Hemisphere
         return $localtime > $dst_start && $localtime < $dst_end;
     } else {
         # Southern Hemisphere
         return $localtime > $dst_start || $localtime < $dst_end;
     }
 }
Beispiel #8
0
function monthlist()
{
    global $db, $prefix, $userinfo;
    list($time) = $db->sql_ufetchrow('SELECT time FROM ' . $prefix . '_stories ORDER BY time ASC', SQL_NUM);
    if ($time < 1) {
        return '';
    }
    $time = L10NTime::tolocal($time, $userinfo['user_dst'], $userinfo['user_timezone']);
    $firstyear = L10NTime::date('Y', $time);
    $firstmonth = intval(L10NTime::date('m', $time));
    $time = L10NTime::tolocal(time(), $userinfo['user_dst'], $userinfo['user_timezone']);
    $year = L10NTime::date('Y', $time);
    $month = intval(L10NTime::date('m', $time));
    $months = array(_JANUARY, _FEBRUARY, _MARCH, _APRIL, _MAY, _JUNE, _JULY, _AUGUST, _SEPTEMBER, _OCTOBER, _NOVEMBER, _DECEMBER);
    $return = '<ul>';
    while ($year >= $firstyear) {
        if ($year <= $firstyear && $month < $firstmonth) {
            break;
        }
        $return .= '<li><a href="' . URL::index("&amp;sa=show_month&amp;year={$year}&amp;month={$month}") . '">' . $months[$month - 1] . " {$year}</a></li>";
        $month--;
        if ($month < 1) {
            $month = 12;
            $year--;
        }
    }
    return $return . '</ul>';
}
Beispiel #9
0
    }
}
if ($user_sig != '' && $privmsg['privmsgs_attach_sig']) {
    require_once 'includes/nbbcode.php';
    $user_sig = $MAIN_CFG['private_messages']['allow_bbcode'] ? decode_bbcode($user_sig, 1, false) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $user_sig);
}
$private_message = $MAIN_CFG['private_messages']['allow_bbcode'] ? decode_bbcode($private_message, 1, false) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $private_message);
$private_message = make_clickable($private_message);
if ($privmsg['privmsgs_attach_sig'] && $user_sig != '') {
    $private_message .= '<br /><br />_________________<br />' . make_clickable($user_sig);
}
if ($MAIN_CFG['private_messages']['allow_smilies'] && $privmsg['privmsgs_enable_smilies']) {
    $private_message = set_smilies($private_message);
}
//	  $private_message = str_replace("\n", '<br />', $private_message);
$template->assign_vars(array('MESSAGE_FROM' => $privmsg['username_1'], 'MESSAGE_TO' => $privmsg['username_2'], 'POST_SUBJECT' => $post_subject, 'POST_DATE' => L10NTime::date($MAIN_CFG['global']['dateformat'], $privmsg['privmsgs_date'], $userinfo['user_dst'], $userinfo['user_timezone']), 'MESSAGE' => $private_message, 'U_MESSAGE_FROM' => URL::index('Your_Account&amp;profile=' . $privmsg['username_1']), 'U_MESSAGE_TO' => URL::index('Your_Account&amp;profile=' . $privmsg['username_2'])));
// PM QUICK REPLY
//if ( $MAIN_CFG['private_messages']['ropm_quick_reply'] && $privmsg['privmsgs_from_userid'] != $userinfo['user_id'] )
if ($folder == 'inbox' && $MAIN_CFG['private_messages']['quick_reply']) {
    require_once 'includes/nbbcode.php';
    $last_msg = $privmsg['privmsgs_text'];
    $last_msg = '[quote="' . $privmsg['username_1'] . '"]' . $last_msg . '[/quote]';
    $last_msg = str_replace('\\', '\\\\', $last_msg);
    //'
    $last_msg = str_replace('"', '&quot;', $last_msg);
    $last_msg = str_replace(chr(13), '', $last_msg);
    $s_hidden_fields = '
<input type="hidden" name="folder" value="' . $folder . '" />
<input type="hidden" name="mode" value="post" />
<input type="hidden" name="username" value="' . $privmsg['username_1'] . '" />';
    $template->assign_block_vars('quickreply', array('POST_ACTION' => URL::index(), 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'SUBJECT' => (!preg_match('/^Re:/', $privmsg['privmsgs_subject']) ? 'Re: ' : '') . $privmsg['privmsgs_subject'], 'HTML_ON' => $MAIN_CFG['private_messages']['allow_html'], 'SMILIES_ON' => $MAIN_CFG['private_messages']['allow_smilies'] ? smilies_table('onerow', 'message', 'qreply') : '', 'BBCODE_ON' => $MAIN_CFG['private_messages']['allow_bbcode'] ? bbcode_table('message', 'qreply', 1) : '', 'SIG_ON' => $MAIN_CFG['private_messages']['allow_sig'] && $user_sig != '', 'S_HTML_CHECKED' => !$userinfo['user_allowhtml'] ? ' checked="checked"' : '', 'S_BBCODE_CHECKED' => !$userinfo['user_allowbbcode'] ? ' checked="checked"' : '', 'S_SMILIES_CHECKED' => !$userinfo['user_allowsmile'] ? ' checked="checked"' : '', 'S_QREPLY_MSG' => $last_msg, 'S_SIG_CHECKED' => $userinfo['user_sig'] != '' && $MAIN_CFG['private_messages']['allow_sig'] ? $userinfo['user_sig'] : ''));
Beispiel #10
0
function viewdownloaddetails()
{
    global $downloadsprefix, $db, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $module_name;
    global $useoutsidevoting, $detailvotedecimal, $outsideweight, $anonymous, $userinfo;
    $lid = intval($_GET['lid']);
    include "header.php";
    downl_menu_tpl(1);
    $voteresult = $db->sql_query("SELECT rating, ratinguser, ratingcomments FROM " . $downloadsprefix . "_votedata WHERE ratinglid = {$lid}");
    $totalvotesDB = $db->sql_numrows($voteresult);
    $anonvotes = 0;
    $anonvoteval = 0;
    $outsidevotes = 0;
    $outsidevoteeval = 0;
    $regvoteval = 0;
    $topanon = 0;
    $bottomanon = 11;
    $topreg = 0;
    $bottomreg = 11;
    $topoutside = 0;
    $bottomoutside = 11;
    $avv = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvv = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovv = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $truecomments = $totalvotesDB;
    while (list($ratingDB, $ratinguserDB, $ratingcommentsDB) = $db->sql_fetchrow($voteresult)) {
        if ($ratingcommentsDB == "") {
            $truecomments--;
        }
        if ($ratinguserDB == $anonymous) {
            $anonvotes++;
            $anonvoteval += $ratingDB;
        }
        if ($useoutsidevoting == 1) {
            if ($ratinguserDB == 'outside') {
                $outsidevotes++;
                $outsidevoteval += $ratingDB;
            }
        } else {
            $outsidevotes = 0;
        }
        if ($ratinguserDB != $anonymous && $ratinguserDB != "outside") {
            $regvoteval += $ratingDB;
        }
        if ($ratinguserDB != $anonymous && $ratinguserDB != "outside") {
            if ($ratingDB > $topreg) {
                $topreg = $ratingDB;
            }
            if ($ratingDB < $bottomreg) {
                $bottomreg = $ratingDB;
            }
            for ($rcounter = 1; $rcounter < 11; $rcounter++) {
                if ($ratingDB == $rcounter) {
                    $rvv[$rcounter]++;
                }
            }
        }
        if ($ratinguserDB == $anonymous) {
            if ($ratingDB > $topanon) {
                $topanon = $ratingDB;
            }
            if ($ratingDB < $bottomanon) {
                $bottomanon = $ratingDB;
            }
            for ($rcounter = 1; $rcounter < 11; $rcounter++) {
                if ($ratingDB == $rcounter) {
                    $avv[$rcounter]++;
                }
            }
        }
        if ($ratinguserDB == "outside") {
            if ($ratingDB > $topoutside) {
                $topoutside = $ratingDB;
            }
            if ($ratingDB < $bottomoutside) {
                $bottomoutside = $ratingDB;
            }
            for ($rcounter = 1; $rcounter < 11; $rcounter++) {
                if ($ratingDB == $rcounter) {
                    $ovv[$rcounter]++;
                }
            }
        }
    }
    $regvotes = $totalvotesDB - $anonvotes - $outsidevotes;
    if ($totalvotesDB == 0) {
        $finalrating = 0;
    } else {
        if ($anonvotes == 0 && $regvotes == 0) {
            /* Figure Outside Only Vote */
            $finalrating = $outsidevoteval / $outsidevotes;
            $finalrating = number_format($finalrating, $detailvotedecimal);
            $avgOU = $outsidevoteval / $totalvotesDB;
            $avgOU = number_format($avgOU, $detailvotedecimal);
        } else {
            if ($outsidevotes == 0 && $regvotes == 0) {
                /* Figure Anon Only Vote */
                $finalrating = $anonvoteval / $anonvotes;
                $finalrating = number_format($finalrating, $detailvotedecimal);
                $avgAU = $anonvoteval / $totalvotesDB;
                $avgAU = number_format($avgAU, $detailvotedecimal);
            } else {
                if ($outsidevotes == 0 && $anonvotes == 0) {
                    /* Figure Reg Only Vote */
                    $finalrating = $regvoteval / $regvotes;
                    $finalrating = number_format($finalrating, $detailvotedecimal);
                    $avgRU = $regvoteval / $totalvotesDB;
                    $avgRU = number_format($avgRU, $detailvotedecimal);
                } else {
                    if ($regvotes == 0 && $useoutsidevoting == 1 && $outsidevotes != 0 && $anonvotes != 0) {
                        /* Figure Reg and Anon Mix */
                        $avgAU = $anonvoteval / $anonvotes;
                        $avgOU = $outsidevoteval / $outsidevotes;
                        if ($anonweight > $outsideweight) {
                            /* Anon is 'standard weight' */
                            $newimpact = $anonweight / $outsideweight;
                            $impactAU = $anonvotes;
                            $impactOU = $outsidevotes / $newimpact;
                        } else {
                            /* Outside is 'standard weight' */
                            $newimpact = $outsideweight / $anonweight;
                            $impactOU = $outsidevotes;
                            $impactAU = $anonvotes / $newimpact;
                        }
                        $finalrating = ($avgOU * $impactOU + $avgAU * $impactAU) / ($impactAU + $impactOU);
                        $finalrating = number_format($finalrating, $detailvotedecimal);
                    } else {
                        /* REG User vs. Anonymous vs. Outside User Weight Calutions */
                        $impact = $anonweight;
                        $outsideimpact = $outsideweight;
                        if ($regvotes == 0) {
                            $avgRU = 0;
                        } else {
                            $avgRU = $regvoteval / $regvotes;
                        }
                        if ($anonvotes == 0) {
                            $avgAU = 0;
                        } else {
                            $avgAU = $anonvoteval / $anonvotes;
                        }
                        if ($outsidevotes == 0) {
                            $avgOU = 0;
                        } else {
                            $avgOU = $outsidevoteval / $outsidevotes;
                        }
                        $impactRU = $regvotes;
                        $impactAU = $anonvotes / $impact;
                        $impactOU = $outsidevotes / $outsideimpact;
                        $finalrating = ($avgRU * $impactRU + $avgAU * $impactAU + $avgOU * $impactOU) / ($impactRU + $impactAU + $impactOU);
                        $finalrating = number_format($finalrating, $detailvotedecimal);
                    }
                }
            }
        }
    }
    if (!isset($avgO)) {
        $avgOU = "";
    } else {
        $avgOU = number_format($avgOU, $detailvotedecimal);
    }
    if (!isset($avgRU)) {
        $avgRU = "";
    } else {
        $avgRU = number_format($avgRU, $detailvotedecimal);
    }
    if (!isset($avgAU)) {
        $avgAU = "";
    } else {
        $avgAU = number_format($avgAU, $detailvotedecimal);
    }
    if ($topanon == 0) {
        $topanon = "";
    }
    if ($bottomanon == 11) {
        $bottomanon = "";
    }
    if ($topreg == 0) {
        $topreg = "";
    }
    if ($bottomreg == 11) {
        $bottomreg = "";
    }
    if ($topoutside == 0) {
        $topoutside = "";
    }
    if ($bottomoutside == 11) {
        $bottomoutside = "";
    }
    $totalchartheight = 70;
    $chartunits = $totalchartheight / 10;
    $avvper = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvvper = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovvper = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $avvpercent = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvvpercent = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovvpercent = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $avvchartheight = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvvchartheight = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovvchartheight = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $avvmultiplier = 0;
    $rvvmultiplier = 0;
    $ovvmultiplier = 0;
    for ($rcounter = 1; $rcounter < 11; $rcounter++) {
        if ($anonvotes != 0) {
            $avvper[$rcounter] = $avv[$rcounter] / $anonvotes;
        }
        if ($regvotes != 0) {
            $rvvper[$rcounter] = $rvv[$rcounter] / $regvotes;
        }
        if ($outsidevotes != 0) {
            $ovvper[$rcounter] = $ovv[$rcounter] / $outsidevotes;
        }
        $avvpercent[$rcounter] = number_format($avvper[$rcounter] * 100, 1);
        $rvvpercent[$rcounter] = number_format($rvvper[$rcounter] * 100, 1);
        $ovvpercent[$rcounter] = number_format($ovvper[$rcounter] * 100, 1);
        if ($avv[$rcounter] > $avvmultiplier) {
            $avvmultiplier = $avv[$rcounter];
        }
        if ($rvv[$rcounter] > $rvvmultiplier) {
            $rvvmultiplier = $rvv[$rcounter];
        }
        if ($ovv[$rcounter] > $ovvmultiplier) {
            $ovvmultiplier = $ovv[$rcounter];
        }
    }
    if ($avvmultiplier != 0) {
        $avvmultiplier = 10 / $avvmultiplier;
    }
    if ($rvvmultiplier != 0) {
        $rvvmultiplier = 10 / $rvvmultiplier;
    }
    if ($ovvmultiplier != 0) {
        $ovvmultiplier = 10 / $ovvmultiplier;
    }
    for ($rcounter = 1; $rcounter < 11; $rcounter++) {
        $avvchartheight[$rcounter] = $avv[$rcounter] * $avvmultiplier * $chartunits;
        $rvvchartheight[$rcounter] = $rvv[$rcounter] * $rvvmultiplier * $chartunits;
        $ovvchartheight[$rcounter] = $ovv[$rcounter] * $ovvmultiplier * $chartunits;
        if ($avvchartheight[$rcounter] == 0) {
            $avvchartheight[$rcounter] = 1;
        }
        if ($rvvchartheight[$rcounter] == 0) {
            $rvvchartheight[$rcounter] = 1;
        }
        if ($ovvchartheight[$rcounter] == 0) {
            $ovvchartheight[$rcounter] = 1;
        }
    }
    $res = $db->sql_query("SELECT cid, date, hits, name, email, description, filesize, version, homepage, title FROM " . $downloadsprefix . "_downloads WHERE lid='{$lid}'");
    list($cid, $time, $hits, $auth_name, $email, $description, $filesize, $version, $homepage, $ttitle) = $db->sql_fetchrow($res);
    $displaytitle = $ttitle;
    echo '<br />';
    OpenTable();
    echo "<center><font class=\"title\">" . _DOWNLOADPROFILE . ": <A HREF=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\">{$displaytitle}</A>";
    newdownloadgraphic(L10NTime::date('d-M-Y', $time . ' 00:00:00', $userinfo['user_dst'], $userinfo['user_timezone']));
    popgraphic($hits);
    detecteditorial($lid, 1);
    $catResult = $db->sql_query("select title,cdescription,ldescription,parentid from " . $downloadsprefix . "_categories where cid='{$cid}'");
    list($catTitle, $cdescription, $ldescription, $parentid) = $db->sql_fetchrow($catResult);
    $catTitle = getparent($parentid, $catTitle);
    $catTitle = _MAIN . "/{$catTitle}";
    echo "</FONT><br /><br /><B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\">{$catTitle}</A></B><br />";
    $ttitle = ereg_replace(" ", "_", $ttitle);
    downl_infomenu_tpl($lid, $ttitle);
    echo "<br /><br /><b><u>" . _DOWNLOADRATINGDET . "</u></b><br />" . "<b>" . _TOTALVOTES . "</B> {$totalvotesDB}<br />" . "<b>" . _OVERALLRATING . ":</B> {$finalrating}<br /><br />" . "<div align=\"justify\" class=\"content\">{$description}</div>";
    if ($auth_name == "") {
        $auth_name = "<i>" . _UNKNOWN . "</i>";
    } else {
        if ($email == "") {
            $auth_name = "{$auth_name}";
        } else {
            $email = ereg_replace("@", " <i>at</i> ", $email);
            $email = ereg_replace("\\.", " <i>dot</i> ", $email);
            $auth_name = "{$auth_name} ({$email})";
        }
    }
    echo "<br /><b>" . _CREDITS_AUTHORS . ":</b> {$auth_name}<br />" . "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "</font><br /><br />" . "[ <b><a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\">" . _DOWNLOADNOW . "</a></b> ";
    if ($homepage == "" or $homepage == "http://") {
        echo "]<br /><br />";
    } else {
        echo "| <a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> ]<br /><br />";
    }
    echo "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"455\">" . "<tr><td colspan=\"2\" bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b>" . _REGISTEREDUSERS . "</b></font>" . "</td></tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\">" . "<font class=\"content\">" . _NUMBEROFRATINGS . ": {$regvotes}</font>" . "</td>" . "<td rowspan=\"5\">";
    if ($regvotes == 0) {
        echo "<center><font class=\"content\">" . _NOREGUSERSVOTES . "</font></center>";
    } else {
        echo "<CENTER><table border=\"1\" WIDTH=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['1']} " . _LVOTES . " ({$rvvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['1']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['2']} " . _LVOTES . " ({$rvvpercent['2']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['2']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['3']} " . _LVOTES . " ({$rvvpercent['3']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['3']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['4']} " . _LVOTES . " ({$rvvpercent['4']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['4']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['5']} " . _LVOTES . " ({$rvvpercent['5']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['5']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['6']} " . _LVOTES . " ({$rvvpercent['6']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['6']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['7']} " . _LVOTES . " ({$rvvpercent['7']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['7']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['8']} " . _LVOTES . " ({$rvvpercent['8']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['8']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['9']} " . _LVOTES . " ({$rvvpercent['9']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['9']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['10']} " . _LVOTES . " ({$rvvpercent['10']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['10']}\"></td>" . "</tr>" . "<tr><td colspan=\"10\" bgcolor=\"{$bgcolor2}\" ALIGN=CENTER>" . "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"200\"><tr>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">1</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">2</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">3</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">4</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">5</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">6</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">7</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">8</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">9</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">10</font></td>" . "</tr></table></CENTER>" . "</td></tr></table>";
    }
    echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgRU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topreg}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomreg}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _NUMOFCOMMENTS . ": {$truecomments}</font></td></tr>" . "<tr><td></td></tr>";
    if (isset($anonweight)) {
        echo "<tr><td valign=\"top\" colspan=\"2\"><font class=\"tiny\"><br /><br />" . $anonweight . ' ' . _TO . ' 1.</font></td></tr>';
    }
    echo "<tr><td colspan=\"2\" bgcolor=\"{$bgcolor2}\"><font class=\"content\"><b>" . _UNREGISTEREDUSERS . "</b></font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _NUMBEROFRATINGS . ": {$anonvotes}</font></td>" . "<td rowspan=\"5\">";
    if ($anonvotes == 0) {
        echo "<center><font class=\"content\">" . _NOUNREGUSERSVOTES . "</font></center>";
    } else {
        echo "<CENTER><table border=\"1\" width=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['1']} " . _LVOTES . " ({$avvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['1']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['2']} " . _LVOTES . " ({$avvpercent['2']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['2']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['3']} " . _LVOTES . " ({$avvpercent['3']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['3']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['4']} " . _LVOTES . " ({$avvpercent['4']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['4']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['5']} " . _LVOTES . " ({$avvpercent['5']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['5']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['6']} " . _LVOTES . " ({$avvpercent['6']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['6']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['7']} " . _LVOTES . " ({$avvpercent['7']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['7']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['8']} " . _LVOTES . " ({$avvpercent['8']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['8']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['9']} " . _LVOTES . " ({$avvpercent['9']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['9']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['10']} " . _LVOTES . " ({$avvpercent['10']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['10']}\"></td>" . "</tr>" . "<tr><td colspan=\"10\" bgcolor=\"{$bgcolor2}\">" . "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"200\"><tr>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">1</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">2</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">3</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">4</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">5</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">6</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">7</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">8</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">9</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">10</font></td>" . "</tr></table>" . "</td></tr></table></CENTER>";
    }
    echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgAU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topanon}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomanon}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">&nbsp;</font></td></tr>";
    if (isset($useoutsidevoting) && $useoutsidevoting == 1) {
        echo "<tr><td valign=top colspan=\"2\"><font class=\"tiny\"><br /><br />" . _WEIGHOUTNOTE . " {$outsideweight} " . _TO . " 1.</font></td></tr>" . "<tr><td colspan=\"2\" bgcolor=\"{$bgcolor2}\"><font class=\"content\"><b>" . _OUTSIDEVOTERS . "</b></font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _NUMBEROFRATINGS . ": {$outsidevotes}</font></td>" . "<td rowspan=\"5\">";
        if ($outsidevotes == 0) {
            echo "<center><font class=\"content\">" . _NOOUTSIDEVOTES . "</font></center>";
        } else {
            echo "<CENTER><table border=\"1\" width=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['1']} " . _LVOTES . " ({$ovvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['1']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['2']} " . _LVOTES . " ({$ovvpercent['2']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['2']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['3']} " . _LVOTES . " ({$ovvpercent['3']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['3']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['4']} " . _LVOTES . " ({$ovvpercent['4']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['4']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['5']} " . _LVOTES . " ({$ovvpercent['5']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['5']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['6']} " . _LVOTES . " ({$ovvpercent['6']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['6']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['7']} " . _LVOTES . " ({$ovvpercent['7']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['7']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['8']} " . _LVOTES . " ({$ovvpercent['8']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['8']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['9']} " . _LVOTES . " ({$ovvpercent['9']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['9']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['10']} " . _LVOTES . " ({$ovvpercent['10']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['10']}\"></td>" . "</tr>" . "<tr><td colspan=\"10\" bgcolor=\"{$bgcolor2}\">" . "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"200\"><tr>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">1</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">2</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">3</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">4</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">5</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">6</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">7</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">8</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">9</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">10</font></td>" . "</tr></table>" . "</td></tr></table></CENTER>";
        }
        echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgOU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topoutside}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomoutside}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">&nbsp;</font></td></tr>";
    }
    echo "</table><br /><br /><center>";
    downloadfooter($lid);
    echo "</center>";
    CloseTable();
    include "footer.php";
}