Exemplo n.º 1
0
function create_tree($id, &$tree, $indent = false)
{
    $content = $indent ? '<div style="margin-left: 8px;">' : '';
    while ($page = array_shift($tree)) {
        if ($page['id'] == $id) {
            $content .= '<b>&#8226; ' . $page['title'] . '</b><br />';
        } else {
            $content .= '&#8226; <a href="' . URL::index('&amp;id=' . $page['id']) . '">' . $page['title'] . '</a><br />';
        }
        if (isset($page['sub'])) {
            $content .= create_tree($id, $page['sub'], true);
        }
    }
    if ($indent) {
        $content .= '</div>';
    }
    return $content;
}
Exemplo n.º 2
0
function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www)
{
    global $lang, $images, $board_config, $MAIN_CFG;
    static $ranksrow;
    if (!is_array($ranksrow)) {
        global $db;
        $ranksrow = $db->sql_ufetchrowset("SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_special, rank_min", SQL_ASSOC);
    }
    $from = !empty($row['user_from']) ? $row['user_from'] : '&nbsp;';
    $joined = formatDateTime($row['user_regdate'], _DATESTRING2);
    $posts = $row['user_posts'] ? $row['user_posts'] : 0;
    $email_img = $email = '';
    for ($j = 0; $j < count($ranksrow); $j++) {
        if ($row['user_rank'] && $row['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] || !$row['user_rank'] && $row['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special']) {
            $email = $ranksrow[$j]['rank_title'];
            $email_img = $ranksrow[$j]['rank_image'] ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $email . '" title="' . $email . '" style="border:0;" />' : '';
        }
    }
    $temp_url = URL::index("Your_Account&amp;profile=" . $row['user_id']);
    $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" /></a>';
    $profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
    if (is_user() && is_active('Private_Messages')) {
        $temp_url = URL::index("Private_Messages&amp;mode=post&amp;" . POST_USERS_URL . "=" . $row['user_id']);
        $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" style="border:0;" /></a>';
        $pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
    } else {
        $pm = $pm_img = '';
    }
    if ($row['user_website'] == 'http:///' || $row['user_website'] == 'http://') {
        $row['user_website'] = '';
    }
    if ($row['user_website'] != '' && substr($row['user_website'], 0, 7) != 'http://') {
        $row['user_website'] = 'http://' . $row['user_website'];
    }
    $www_img = $row['user_website'] ? '<a href="' . $row['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" style="border:0;" /></a>' : '';
    $www = $row['user_website'] ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
    $temp_url = URL::index("Forums&amp;file=search&amp;search_author=" . urlencode($row['user_id']) . "&amp;showresults=posts");
    $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" style="border:0;" /></a>';
    $search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
    return;
}
Exemplo n.º 3
0
function themeheader()
{
    global $slogan, $sitename, $mainindex, $adminindex, $cpgtpl, $site_logo, $userinfo, $CPG_SESS, $MAIN_CFG, $Blocks;
    if ($MAIN_CFG['global']['admingraphic'] & 4) {
        include 'includes/cssmainmenu.php';
    }
    $imgr = $imgl = '';
    // left blocks ?
    if ($Blocks->l && $Blocks->showblocks & 1) {
        $img = $Blocks->hideblock('600') ? 'plus.png' : 'minus.png';
        $imgl = '<img style="float:left; cursor:pointer;" alt="' . _TOGGLE . '" title="' . _TOGGLE . '" id="pic600" src="themes/' . $CPG_SESS['theme'] . '/images/' . $img . '" onclick="blockswitch(\'600\');" />';
    }
    // right blocks ?
    if ($Blocks->r && $Blocks->showblocks & 2) {
        $img = $Blocks->hideblock('601') ? 'plus.png' : 'minus.png';
        $imgr = '<img style="float:right; cursor:pointer;" alt="' . _TOGGLE . '" title="' . _TOGGLE . '" id="pic601" src="themes/' . $CPG_SESS['theme'] . '/images/' . $img . '" onclick="blockswitch(\'601\');" />';
    }
    $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
    $css_ie = false !== strpos($user_agent, 'MSIE 7.0') ? 'ie7' : (preg_match('#MSIE ([0-6].[0-9]{1,2})#', $user_agent) ? 'ie6' : (isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Safari' ? 'safari' : (isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Opera' ? 'opera' : '')));
    $cpgtpl->assign_vars(array('CSS_IE' => $css_ie ? '<link rel="stylesheet" type="text/css" href="themes/' . $CPG_SESS['theme'] . '/style/' . $css_ie . '.css" />' : '', 'PUBLIC_HEADER' => !defined('ADMIN_PAGES'), 'B_L_VISIBLE' => $Blocks->hideblock('600') ? 'style="display: none"' : '', 'G_LEFTIMAGE' => $imgl, 'G_RIGHTIMAGE' => $imgr, 'S_IS_ADMIN' => is_admin(), 'S_IS_USER' => is_user(), 'S_USER_INFO' => _BWEL . ' ' . (is_user() ? $userinfo['username'] : _ANONYMOUS), 'S_LOGO' => $site_logo, 'S_SITENAME' => $sitename, 'S_HOME' => _HOME, 'S_DOWNLOADS' => is_active('Downloads') ? _DownloadsLANG : false, 'S_FORUMS' => _ForumsLANG, 'S_MY_ACCOUNT' => is_user() ? _Your_AccountLANG : _BREG, 'S_ADMIN' => _ADMINISTRATION, 'U_MAININDEX' => $mainindex, 'U_DOWNLOADS' => URL::index('Downloads'), 'U_FORUMS' => URL::index('Forums'), 'U_MY_ACCOUNT' => URL::index(is_user() ? 'Your_Account' : 'Your_Account&amp;file=register'), 'U_ADMININDEX' => $adminindex, 'S_MAIN_MENU' => isset($mmcontent) ? $mmcontent : false));
    $Blocks->display('l');
}
Exemplo n.º 4
0
function footmsg()
{
    global $db, $dbal, $foot1, $foot2, $foot3, $total_time, $start_mem;
    if ($foot1 != '') {
        $foot1 .= '<br />' . "\n";
    }
    if ($foot2 != '') {
        $foot1 .= $foot2 . '<br />' . "\n";
    }
    if ($foot3 != '') {
        $foot1 .= $foot3 . '<br />' . "\n";
    }
    if (is_admin()) {
        $db_log = $dbal->getConfiguration()->getSQLLogger();
        $end_time = get_microtime();
        $total_time = $end_time - START_TIME - $db->time;
        $new_total_time = $end_time - START_TIME - $db_log->time;
        $foot1 .= sprintf(_PAGEFOOTER, round($total_time, 4) . '|' . round($new_total_time, 4), $db->num_queries . '|' . $db_log->num_queries, round($db->time, 4) . '|' . round($db_log->time, 4));
        // only works if your PHP is compiled with the --enable-memory-limit configuration option
        if (function_exists('memory_get_usage') && $start_mem > 0) {
            $total_mem = memory_get_usage() - $start_mem;
            $foot1 .= '<br />Memory Usage: ' . ($total_mem >= 1048576 ? round(round($total_mem / 1048576 * 100) / 100, 2) . ' MB' : ($total_mem >= 1024 ? round(round($total_mem / 1024 * 100) / 100, 2) . ' KB' : $total_mem . ' Bytes'));
        }
        $foot1 .= '<br />';
    }
    // MS-Analysis Entry
    //	  require( "modules/MS_Analysis/mstrack.php" );
    $foot1 = '<div style="text-align:center;">' . $foot1 . '
	Interactive software released under <a href="http://dragonflycms.org/GNUGPL.html" target="_blank" title="GNU Public License Agreement">GNU GPL</a>,
	<a href="' . URL::index('credits') . '">Code Credits</a>,
	<a href="' . URL::index('privacy_policy') . '">Privacy Policy</a></div>';
    if (is_admin() || NEXOS_DEBUG) {
        $GLOBALS['cpgtpl']->assign_var('S_DEBUG_SQL', NEXOS_DEBUG || $GLOBALS['MAIN_CFG']['debug']['database'] ? $GLOBALS['cpgdebugger']->get_report('sql') : false);
        $GLOBALS['cpgtpl']->assign_var('S_DEBUG_PHP', $GLOBALS['cpgdebugger']->get_report('php'));
    }
    return $foot1;
}
require "modules/" . $cpg_dir . "/include/load.inc";
$cpg_block = false;
$limit = $CONFIG['thumbcols'];
//number of thumbs
// $limit = 5; //number of pictures
$content = '';
// END USER DEFINEABLES
$result = $db->sql_query("SELECT pid, filepath, filename, p.aid, pic_rating, p.votes, p.title FROM " . $cpg_prefix . "pictures AS p INNER JOIN " . $cpg_prefix . "albums AS a ON (p.aid = a.aid AND " . VIS_GROUPS . ") WHERE approved=1 AND p.votes >= '{$CONFIG['min_votes_for_rating']}' GROUP BY pid ORDER BY ROUND((pic_rating+1)/2000) DESC, p.votes DESC LIMIT {$limit}");
$content .= '<br /><table width="100%" cols="' . $limit . '" border="0" cellpadding="0" cellspacing="0"><tr align="center">';
$pic = 0;
while ($row = $db->sql_fetchrow($result)) {
    if (defined('THEME_HAS_RATING_GRAPHICS')) {
        $theme_prefix = $CONFIG['theme'] . '/';
    } else {
        $theme_prefix = '';
    }
    $caption = '<img src="' . $CPG_M_DIR . '/' . $theme_prefix . 'images/rating' . round($row["pic_rating"] / 2000) . '.gif" align="center" alt="" />' . '<br />' . sprintf($lang_get_pic_data['n_votes'], $row['votes']) . '<br />';
    if ($CONFIG['seo_alts'] == 0) {
        $thumb_title = $row['filename'];
    } else {
        if ($row['title'] != '') {
            $thumb_title = $row['title'];
        } else {
            $thumb_title = substr($row['filename'], 0, -4);
        }
    }
    $content .= '<td align="center" valign="baseline"><a href="' . URL::index($cpg_dir . '&amp;file=displayimage&amp;meta=toprated&amp;cat=0&amp;pos=' . $pic) . '"><img src="' . get_pic_url($row, 'thumb') . '" alt="' . $thumb_title . '" title="' . $thumb_title . '" /><br />' . $caption . '</a></td>';
    $pic++;
}
$content .= '</tr><tr><td colspan="' . $limit . '" valign="baseline" align="center"><a href = "' . URL::index($cpg_dir) . '">' . _coppermineLANG . '</a></td></tr></table>';
Exemplo n.º 6
0
$s_characters .= '<option value="50">50</option>';
for ($i = 100; $i < 1100; $i += 100) {
    $selected = $i == 200 ? ' selected="selected"' : '';
    $s_characters .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
}
//
// Sorting
//
$s_sort_by = "";
for ($i = 0; $i < count($sort_by_types); $i++) {
    $s_sort_by .= '<option value="' . $i . '">' . $sort_by_types[$i] . '</option>';
}
//
// Search time
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);
$s_time = '';
for ($i = 0; $i < count($previous_days); $i++) {
    $selected = $topic_days == $previous_days[$i] ? ' selected="selected"' : '';
    $s_time .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
//
// Output the basic page
//
$page_title = $lang['Search'];
require_once "includes/phpBB/page_header.php";
make_jumpbox('viewforum');
$template->assign_vars(array('L_GO' => $lang['Go'], 'L_SEARCH_QUERY' => $lang['Search_query'], 'L_SEARCH_OPTIONS' => $lang['Search_options'], 'L_SEARCH_KEYWORDS' => $lang['Search_keywords'], 'L_SEARCH_KEYWORDS_EXPLAIN' => $lang['Search_keywords_explain'], 'L_SEARCH_AUTHOR' => $lang['Search_author'], 'L_SEARCH_AUTHOR_EXPLAIN' => $lang['Search_author_explain'], 'L_SEARCH_ANY_TERMS' => $lang['Search_for_any'], 'L_SEARCH_ALL_TERMS' => $lang['Search_for_all'], 'L_SEARCH_MESSAGE_ONLY' => $lang['Search_msg_only'], 'L_SEARCH_MESSAGE_TITLE' => $lang['Search_title_msg'], 'L_CATEGORY' => $lang['Category'], 'L_RETURN_FIRST' => $lang['Return_first'], 'L_CHARACTERS' => $lang['characters_posts'], 'L_SORT_BY' => $lang['Sort_by'], 'L_SORT_ASCENDING' => $lang['Sort_Ascending'], 'L_SORT_DESCENDING' => $lang['Sort_Descending'], 'L_SEARCH_PREVIOUS' => $lang['Search_previous'], 'L_DISPLAY_RESULTS' => $lang['Display_results'], 'L_FORUM' => $lang['Forum'], 'L_TOPICS' => $lang['Topics'], 'L_POSTS' => $lang['Posts'], 'S_SEARCH_ACTION' => URL::index("&amp;file=search&amp;mode=results"), 'S_CHARACTER_OPTIONS' => $s_characters, 'S_FORUM_OPTIONS' => $s_forums, 'S_CATEGORY_OPTIONS' => $s_categories, 'S_TIME_OPTIONS' => $s_time, 'S_SORT_OPTIONS' => $s_sort_by, 'S_HIDDEN_FIELDS' => ''));
$template->set_filenames(array('body' => 'forums/search_body.html'));
require_once 'includes/phpBB/page_tail.php';
Exemplo n.º 7
0
// Delete PM's
if (isset($mark_list) && !is_array($mark_list)) {
    // Set to empty array instead of '0' if nothing is selected.
    $mark_list = array();
}
if (!$confirm) {
    $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
    $s_hidden_fields .= isset($_POST['delete']) ? '<input type="hidden" name="delete" value="true" />' : '<input type="hidden" name="deleteall" value="true" />';
    for ($i = 0; $i < count($mark_list); $i++) {
        $s_hidden_fields .= '<input type="hidden" name="mark[]" value="' . intval($mark_list[$i]) . '" />';
    }
    //
    // Output confirmation page
    //
    $pagetitle = $lang['Confirm_delete_pm'];
    cpg_delete_msg(URL::index('&amp;folder=' . $folder), count($mark_list) == 1 ? $lang['Confirm_delete_pm'] : $lang['Confirm_delete_pms'], $s_hidden_fields);
} else {
    if ($delete_all) {
        switch ($folder) {
            case 'inbox':
                $delete_type = "privmsgs_to_userid = {$userinfo['user_id']} AND (\n\t\t\t\tprivmsgs_type = " . PM_READ_MAIL . " OR privmsgs_type = " . PM_NEW_MAIL . " OR privmsgs_type = " . PM_UNREAD_MAIL . " )";
                break;
            case 'outbox':
                $delete_type = "privmsgs_from_userid = {$userinfo['user_id']} AND ( privmsgs_type = " . PM_NEW_MAIL . " OR privmsgs_type = " . PM_UNREAD_MAIL . " )";
                break;
            case 'sentbox':
                $delete_type = "privmsgs_from_userid = {$userinfo['user_id']} AND privmsgs_type = " . PM_SENT_MAIL;
                break;
            case 'savebox':
                $delete_type = "( ( privmsgs_from_userid = {$userinfo['user_id']}\n\t\t\t\t\tAND privmsgs_type = " . PM_SAVED_OUT_MAIL . " )\n\t\t\t\tOR ( privmsgs_to_userid = " . $userinfo['user_id'] . "\n\t\t\t\t\tAND privmsgs_type = " . PM_SAVED_IN_MAIL . " ) )";
                break;
Exemplo n.º 8
0
function DailyStats($year, $month, $date)
{
    require_once 'header.php';
    OpenTable();
    showHourlyStats($year, $month, $date);
    echo '<br />';
    echo "<center>[ <a href=\"" . URL::index() . "\">" . _BACKTOMAIN . "</a> | <a href=\"" . URL::index("&amp;file=details") . "\">" . _BACKTODETSTATS . "</a> ]</center>";
    CloseTable();
}
Exemplo n.º 9
0
 private function loginmember($visitor_ip)
 {
     global $db, $prefix, $user_prefix, $sec_code, $CPG_SESS;
     $username = Fix_Quotes($_POST['ulogin']);
     $result = $db->sql_query('SELECT user_id, username, user_password, user_level, theme FROM ' . $user_prefix . "_users WHERE username='******' AND user_id>1");
     if ($db->sql_numrows($result) < 1) {
         URL::redirect(URL::index('Your_Account&error=1&uname=' . urlencode(base64_encode($username))), true);
     }
     $setinfo = $db->sql_fetchrow($result, SQL_ASSOC);
     if ($setinfo['user_password'] != '' && $setinfo['user_level'] > 0) {
         $pass = md5($_POST['user_password']);
         if ($setinfo['user_password'] != $pass) {
             URL::redirect(URL::index('Your_Account&error=2'), true);
         }
         if ($sec_code & 2) {
             $gfxid = isset($_POST['gfxid']) ? $_POST['gfxid'] : 0;
             $code = $CPG_SESS['gfx'][$gfxid];
             $gfx_check = isset($_POST['gfx_check']) ? $_POST['gfx_check'] : '';
             if (strlen($gfx_check) < 2 || $code != $gfx_check) {
                 URL::redirect(URL::index('Your_Account&error=2'), true);
             }
         }
         $db->sql_query('DELETE FROM ' . $prefix . "_session WHERE host_addr={$visitor_ip} AND guest=1");
         unset($CPG_SESS['session_start']);
         $CPG_SESS['theme'] = $setinfo['theme'];
         return $this->setmemcookie($setinfo['user_id'], $pass, false);
     } else {
         if ($setinfo['user_level'] == 0) {
             URL::redirect(URL::index('Your_Account&profile=' . $setinfo['user_id']));
         } else {
             if ($setinfo['user_level'] == -1) {
                 URL::redirect(URL::index('Your_Account&profile=' . $setinfo['user_id']));
             }
         }
         URL::redirect(URL::index('Your_Account&error=2'), true);
     }
 }
Exemplo n.º 10
0
 *	 it under the terms of the GNU General Public License as published by
 *	 the Free Software Foundation; either version 2 of the License, or
 *	 (at your option) any later version.
 *
 ***************************************************************************/
if (!defined('CPG_NUKE')) {
    exit;
}
require_once 'modules/' . $module_name . '/nukebb.php';
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
//
// Start of program proper
//
if (isset($_GET['mode']) || isset($_POST['mode'])) {
    $mode = isset($_GET['mode']) ? $_GET['mode'] : $_POST['mode'];
    if ($mode == 'viewprofile') {
        $username = isset($_GET[POST_USERS_URL]) ? $_GET[POST_USERS_URL] : $_POST[POST_USERS_URL];
        URL::refresh(URL::index('Your_Account&profile=' . $username), 0);
    } else {
        if ($mode == 'email') {
            require_once 'includes/phpBB/usercp_email.php';
        }
    }
} else {
    URL::refresh(URL::index(), 0);
}
exit;
Exemplo n.º 11
0
    $content .= '<img src="images/blocks/members.gif" alt="" />&nbsp;<span class="content"><b>' . _BMEM . ':</b></span><br />' . $who_where[0];
}
if ($online_num[1] > 0) {
    $content .= '<img src="images/blocks/visitors.gif" alt="" />&nbsp;<span class="content"><b>' . _BVIS . ':</b></span><br />' . $who_where[1];
}
if ($hidden > 0) {
    $content .= '<span class="content"><b>' . _BHID . ':</b></span> ' . $hidden;
}
$num = 0;
$content .= "\n<hr />\n" . '<span style="font-weight:bold; text-decoration:underline;">' . _STAFFONL . ':</span><br />';
$result = $db->sql_query("SELECT a.uname, u.user_id FROM " . $prefix . "_session AS a \n\tLEFT JOIN " . $user_prefix . "_users AS u ON u.username = a.uname \n\tWHERE guest = 2 \n\tORDER BY a.uname");
if ($db->sql_numrows($result) < 1) {
    $content .= '<br /><i>' . _STAFFNONE . '</i>';
} else {
    while ($row = $db->sql_fetchrow($result)) {
        $num++;
        if ($num < 10) {
            $content .= '0';
        }
        $content .= "{$num}: ";
        if ($row['user_id'] > 1) {
            if ($pm_active) {
                $content .= "<a href=\"" . URL::index("Private_Messages&amp;mode=post&amp;u={$row['user_id']}") . "\"><img src=\"images/blocks/email.gif\" style=\"border:0;\" alt=\"PM\" title=\"Send a private message to {$row['uname']}\" /></a>";
            }
            $content .= " <a href=\"" . URL::index("Your_Account&amp;profile={$row['user_id']}") . "\">{$row['uname']}</a><br />\n";
        } else {
            $content .= "{$row['uname']}<br />\n";
        }
    }
}
$db->sql_freeresult($result);
//number of thumbs
$title_length = 15;
//length of title below thumb
// marquee info at http://www.faqs.org/docs/htmltut/_MARQUEE.html
$body_length = 50;
//length of body of comment to show
$auth_length = 10;
//length of author name to show
$content = '<a name="scroller"></a><marquee loop="1" behavior="scroll" direction="up" height="150" scrollamount="1" scrolldelay="1" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'><p style="text-align:center;">';
// END USER DEFINEABLES
$result = $db->sql_query("SELECT p.pid, p.title, filepath, filename, msg_author, msg_date, msg_body FROM (" . $cpg_prefix . "comments as c, " . $cpg_prefix . "pictures AS p) INNER JOIN " . $cpg_prefix . "albums AS a ON (p.aid = a.aid AND " . VIS_GROUPS . ") WHERE c.pid=p.pid AND approved=1 ORDER BY msg_date DESC LIMIT {$length}");
$pic = 0;
$thumb_title = $date = $author = $messagebody = '';
while ($row = $db->sql_fetchrow($result)) {
    if ($CONFIG['seo_alts'] == 0) {
        $thumb_title = $row['filename'];
    } else {
        if ($row['title'] != '') {
            $thumb_title = $row['title'];
        } else {
            $thumb_title = substr($row['filename'], 0, -4);
        }
    }
    $date = formatDateTime($row['msg_date'], LASTCOM_DATE_FMT);
    $author = $row["msg_author"];
    $messagebody = $row["msg_body"];
    $content .= '<a href="' . URL::index($cpg_dir . '&amp;file=displayimage&amp;meta=lastcom&amp;cat=0&amp;pos=' . $pic) . '"><img src="' . get_pic_url($row, 'thumb') . '" style="border:0;" alt="' . $thumb_title . '" title="' . $thumb_title . '" /><br />' . truncate_stringblocks($author, $auth_length) . '</a> <br />' . truncate_stringblocks($messagebody, $body_length) . '<br />(' . $date . ')<br /><br />';
    $pic++;
}
$content .= '</p></marquee><p style="text-align:center;"><a href="' . URL::index($cpg_dir) . '">' . _coppermineLANG . '</a></p>';
Exemplo n.º 13
0
function smilies_table($mode, $field = 'message', $form = 'post')
{
    global $bb_codes, $db, $prefix, $smilies_path, $MAIN_CFG, $CPG_SESS;
    global $smilies_more, $smilies_desc;
    $url = $MAIN_CFG['server']['path'] . URL::index("smilies&amp;field={$field}&amp;form={$form}");
    $inline_cols = 4;
    $inline_rows = 5;
    $window_cols = 8;
    $content = '';
    if ($mode == 'window') {
        $content = $bb_codes['win_start'];
    } else {
        if (!defined('BBCODE_JS_ACTIVE')) {
            $content .= '<script src="includes/javascript/bbcode.js" type="text/javascript"></script>';
            define('BBCODE_JS_ACTIVE', 1);
        }
    }
    if ($mode == 'onerow') {
        $content .= '
<table width="450" border="0" cellspacing="0" cellpadding="0" class="forumline">';
    } else {
        $content .= '
<table width="100" border="0" cellspacing="0" cellpadding="5" class="forumline">';
    }
    $smilies = get_smilies();
    if (is_array($smilies)) {
        $num_smilies = 0;
        $rowset = array();
        #while ($row = $db->sql_fetchrow($result)) {
        for ($i = 0; $i < count($smilies); ++$i) {
            if (empty($rowset[$smilies[$i]['smile_url']])) {
                $rowset[$smilies[$i]['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $smilies[$i]['code']));
                # process the smiley description
                $rowset[$smilies[$i]['smile_url']]['emoticon'] = get_code_lang($smilies[$i]['emoticon'], $smilies_desc);
                $num_smilies++;
            }
        }
        if ($num_smilies) {
            $smilies_count = $mode == 'inline' ? min(19, $num_smilies) : $num_smilies;
            $smilies_split_row = $mode == 'inline' ? $inline_cols - 1 : $window_cols - 1;
            $s_colspan = $row = $col = 0;
            while (list($smile_url, $data) = each($rowset)) {
                if (!$col) {
                    $content .= '<tr align="center" valign="middle">';
                }
                $content .= "<td><a href=\"javascript:emoticon('" . $form . "', '" . $field . "', '" . $data['code'] . "')\"><img src=\"" . $smilies_path . $smile_url . "\" style=\"border:0;\" alt=\"" . $data['emoticon'] . "\" title=\"" . $data['emoticon'] . "\" /></a></td>";
                $s_colspan = max($s_colspan, $col + 1);
                if ($mode == 'onerow') {
                    if ($col >= 15) {
                        if ($num_smilies > 15) {
                            $content .= "<td colspan=\"{$s_colspan}\" class=\"nav\"><a href=\"{$url}\" onclick=\"window.open('{$url}', '_smilies', 'height=200,resizable=yes,scrollbars=yes,width=230');return false;\" target=\"_smilies\" class=\"nav\">{$smilies_more}</a></td>";
                        }
                        break;
                    }
                    $col++;
                } else {
                    if ($col == $smilies_split_row) {
                        $content .= '</tr>';
                        $col = 0;
                        if ($mode == 'inline' && $row == $inline_rows - 1) {
                            break;
                        }
                        $row++;
                    } else {
                        $col++;
                    }
                }
            }
            if ($col > 0) {
                $content .= '</tr>';
            }
            if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_cols) {
                $content .= "<tr align=\"center\">\n\t\t\t\t\t<td colspan=\"{$s_colspan}\" class=\"nav\"><a href=\"{$url}\" onclick=\"window.open('{$url}', '_smilies', 'height=200,resizable=yes,scrollbars=yes,width=230');return false;\" target=\"_smilies\" class=\"nav\">{$smilies_more}</a></td>\n\t\t\t\t</tr>";
            }
        }
    }
    $content .= "\n</table>\n";
    if ($mode == 'window') {
        $content .= $bb_codes['win_end'];
    }
    return $content;
}
Exemplo n.º 14
0
        $db->sql_freeresult($result);
        pageheader(DEL_USER);
        starttable("100%", DEL_USER . ' - ' . $user_data['username'], 6);
        // First delete the albums
        $result = $db->sql_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = '" . (FIRST_USER_CAT + $user_id) . "'", false, __FILE__, __LINE__);
        while ($album = $db->sql_fetchrow($result)) {
            delete_album($album['aid']);
        }
        // while
        $db->sql_freeresult($result);
        if ($need_caption) {
            output_caption();
        }
        // Then anonymize comments posted by the user
        $db->sql_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET  author_id = '0' WHERE  author_id = '{$user_id}'", false, __FILE__, __LINE__);
        // Do the same for pictures uploaded in public albums
        $db->sql_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET  owner_id = '0' WHERE  owner_id = '{$user_id}'", false, __FILE__, __LINE__);
        // Finally delete the user
        //$db->sql_query("DELETE FROM {$CONFIG['TABLE_USERS']} WHERE user_id = '$user_id'", false, __FILE__, __LINE__);
        //suspend user instead
        $db->sql_query("UPDATE {$CONFIG['TABLE_USERS']} SET user_level=0, susdel_reason='" . PHOTOGALLERY . "' WHERE user_id = '{$user_id}'", false, __FILE__, __LINE__);
        echo "<tr><td colspan=\"6\" class=\"tablef\" align=\"center\">\n";
        echo "<div class=\"admin_menu_thumb\"><a href=\"" . URL::index("&amp;file=usermgr") . "\"  class=\"adm_menu\">" . CONTINU . "</a></div>\n";
        echo "</td></tr>";
        endtable();
        pagefooter();
        break;
    default:
        cpg_die(_ERROR, "{$what} command not found", __FILE__, __LINE__);
        break;
}
Exemplo n.º 15
0
    $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="gid" value="' . $group_id . '" />';
    echo '</th>
	</tr>
	<tr>
	  <td class="row1" width="38%"><span class="gen">Group name:</span></td>
	  <td class="row2" width="62%">
		<input type="text" name="group_name" size="35" maxlength="40" value="' . htmlprepare($group_info['group_name']) . '" />
	  </td>
	</tr><tr>
	  <td class="row1" width="38%"><span class="gen">Group description:</span></td>
	  <td class="row2" width="62%">
		<textarea name="group_description" rows="10" cols="63">' . $group_info['group_description'] . '</textarea>
	  </td>
	</tr><tr>
	  <td class="row1" width="38%"><span class="gen">Group moderator:</span></td>
	  <td class="row2" width="62%"><input type="text" class="post" name="username" maxlength="50" size="20" value="' . $group_info['username'] . '" /> &nbsp; <input type="submit" name="usersubmit" value="Find a username" class="liteoption" onclick="window.open(\'' . URL::index('Forums&amp;file=search&amp;mode=searchuser&amp;popup=1&amp;menu=1') . '\', \'_phpbbsearch\', \'HEIGHT=250,resizable=yes,WIDTH=400\');return false;" /></td>
	</tr><tr>
	  <td class="row1" width="38%"><span class="gen">Group status:</span></td>
	  <td class="row2" width="62%">
		<input type="radio" name="group_type" value="0" ' . ($group_info['group_type'] == 0 ? ' checked="checked"' : '') . ' /> Open group &nbsp;
		<input type="radio" name="group_type" value="1" ' . ($group_info['group_type'] == 1 ? ' checked="checked"' : '') . ' /> Closed group &nbsp;
		<input type="radio" name="group_type" value="2" ' . ($group_info['group_type'] == 2 ? ' checked="checked"' : '') . ' /> Hidden group</td>
	</tr>';
    if (isset($_GET['edit'])) {
        echo '<tr>
	  <td class="row1" width="38%"><span class="gen">Delete the old group moderator?</span>
	  <br />
	  <span class="gensmall">If you\'re changing the group moderator, check this box to remove the old moderator from the group. Otherwise, do not check it, and the user will become a regular member of the group.</span></td>
	  <td class="row2" width="62%"><input type="checkbox" name="delete_old_moderator" value="1" />' . _YES . '</td>
	</tr><tr>
	  <td class="row1" width="38%"><span class="gen">Delete this group:</span></td>
}
$cpg_block = true;
require "modules/" . $cpg_dir . "/include/load.inc";
$cpg_block = false;
// $length=$CONFIG['thumbcols']; //number of thumbs
$length = 8;
//number of thumbs
$maxlength = 20;
// maximum length of name in block
// marquee info at http://www.faqs.org/docs/htmltut/_MARQUEE.html
$content = '<p style="text-align:center;"><a name="scroller"></a><marquee loop="1" behavior="scroll" direction="left" height="135" width="80%" scrollamount="1" scrolldelay="1" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>';
//END USER DEFINABLES
$result = $db->sql_query("SELECT pid, filepath, filename, p.aid, p.title FROM " . $cpg_prefix . "pictures AS p INNER JOIN " . $cpg_prefix . "albums AS a ON (p.aid = a.aid AND " . VIS_GROUPS . ") WHERE approved=1 GROUP BY pid ORDER BY pid DESC LIMIT {$length}");
$content .= '<table width="100%" cols="' . $length . '" border="0" cellpadding="0" cellspacing="7"><tr align="center">';
$pic = 0;
$thumb_title = '';
while ($row = $db->sql_fetchrow($result)) {
    if ($CONFIG['seo_alts'] == 0) {
        $thumb_title = $row['filename'];
    } else {
        if ($row['title'] != '') {
            $thumb_title = $row['title'];
        } else {
            $thumb_title = substr($row['filename'], 0, -4);
        }
    }
    $content .= '<td align="center" valign="baseline"><a href="' . URL::index($cpg_dir . '&amp;file=displayimage&amp;meta=lastup&amp;cat=0&amp;pos=' . $pic) . '"><img src="' . get_pic_url($row, 'thumb') . '" alt="' . $thumb_title . '" title="' . $thumb_title . '" /><br />' . truncate_stringblocks($thumb_title, $maxlength) . '</a>&nbsp;&nbsp;</td>';
    $pic++;
}
$content .= '</tr></table></marquee></p><p style="text-align:center;"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr align="center"><td valign="baseline"><a href="' . URL::index($cpg_dir) . '">' . _coppermineLANG . '</a><br /></td></tr></table></p>';
Exemplo n.º 17
0
	<option selected="selected" label="none" value="none">select a category</option>';
    foreach ($cats as $cat) {
        if ($cat['level'] == 1) {
            if ($selects != '') {
                $selects .= '</optgroup>';
            }
            $selects .= '<optgroup label="' . $cat['crumb'] . '">';
        } else {
            $selects .= '<option value="' . $cat['cid'] . '"' . (isset($_GET['c']) && $cat['cid'] == intval($_GET['c']) || $cat['cid'] == $in['cat'] ? ' selected="selected"' : '') . '>' . $cat['crumb'] . '</option>';
        }
    }
    $selects .= '</optgroup></select>';
}
require_once 'header.php';
$images = DL_Image::output_list($mng_id, $in['screen']);
$cpgtpl->assign_vars(array('DL_MENU' => dl_menu(), 'DL_ERRORS' => !empty($errors), 'DL_WARNINGS' => !empty($warnings), 'DL_MIRRORS' => DL_Mirror::output_list($mng_id), 'DL_IMAGES' => $images, 'IS_NEW_DL' => !can_admin($module_name), 'CAN_ADMIN' => can_admin($module_name), 'B_SCREENSHOT' => $dl_config['screen_active'] || can_admin($module_name), 'B_ADD_IMAGE' => $dl_config['screen_active'] && $images < $dl_config['screen_max'], 'B_NOTES' => false, 'B_REASON' => false, 'B_UPL_FILE' => $dl_config['upl_file'] || can_admin($module_name), 'B_UPL_IMAGE' => $dl_config['upl_image'] || can_admin($module_name), 'B_PENDING' => false, 'B_FETCH_PAD' => $fetch_pad, 'B_REM_MD5' => $dl_config['md5_remote'], 'L_YES' => _YES, 'L_NO' => _NO, 'L_DELETE' => _DELETE, 'L_UPDATE' => 'Update', 'L_CATEGORY' => _CATEGORY, 'L_SHORT_DESC' => 'Short Description', 'L_MAX_CHARS' => sprintf(_M_CHARS, 255), 'L_DESCRIPTION' => _DESCRIPTION, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_MD5' => 'MD5', 'S_BBCODE' => bbcode_table('in[desc_long]', 'add_download', true), 'DL_TITLE' => htmlprepare($in['title']), 'DL_ACCESS' => group_selectbox('in[access]', $in['access']), 'DL_CATSEL' => $selects, 'DL_DESC_SHORT' => htmlprepare($in['desc_short']), 'DL_DESC_LONG' => htmlprepare($in['desc_long']), 'DL_NOTES' => '', 'DL_REASON' => '', 'DL_NAME' => htmlprepare($in['name']), 'DL_EMAIL' => $in['email'], 'U_DL_FORM' => URL::index('&amp;file=add')));
foreach ($errors as $error) {
    $cpgtpl->assign_block_vars('dl_errors', array('S_ENTRY' => $error));
}
foreach ($warnings as $warning) {
    $cpgtpl->assign_block_vars('dl_warnings', array('S_ENTRY' => $warning));
}
$result = $db->sql_uquery("SELECT * FROM " . $dl_prefix . "_fields \n\tWHERE visible > 0" . (!can_admin($module_name) ? ' AND visible < 3' : '') . " \n\tORDER BY title");
while ($field = $db->sql_fetchrow($result)) {
    $f_title = defined($field['title']) ? constant($field['title']) : $field['title'];
    $f_title = $field['visible'] == 2 ? '* ' . $f_title : $f_title;
    if ($field['type'] == 1 || $field['type'] == 3) {
        $f_value = isset($in[$field['field']]) ? intval($in[$field['field']]) : $field['size'];
        $f_value = $f_value > 0 ? array(' checked="checked"', '') : array('', ' checked="checked"');
        $cpgtpl->assign_block_vars('fields', array('TITLE' => $f_title, 'TYPE' => $field['type'], 'NAME' => $field['field'], 'S_YES' => $f_value[0], 'S_NO' => $f_value[1]));
    } else {
Exemplo n.º 18
0
if ($story['ratings'] > 0) {
    $rate = substr($story['score'] / $story['ratings'], 0, 4);
    $r_image = round($rate);
    $the_image = '<br /><br /><img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-' . $r_image . '.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-' . $r_image . '.gif' : 'images/news/stars-' . $r_image . '.gif') . '" alt="" /><br />';
} else {
    $rate = 0;
    $the_image = '<br />';
}
$content = "<div style=\"text-align:center;\">" . _AVERAGESCORE . ": <b>{$rate}</b><br />" . _VOTES . ": <b>{$story['ratings']}</b>{$the_image}" . _RATETHISARTICLE . "</div><br />";
$content .= '<form action="' . URL::index() . '" method="post"><div>';
$content .= '<input type="hidden" name="sid" value="' . $sid . '" />';
$content .= '<input type="radio" name="score" value="5" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-5.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-5.gif' : 'images/news/stars-5.gif') . '" alt="' . _EXCELLENT . '" title="' . _EXCELLENT . '" /><br />';
$content .= '<input type="radio" name="score" value="4" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-4.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-4.gif' : 'images/news/stars-4.gif') . '" alt="' . _VERYGOOD . '" title="' . _VERYGOOD . '" /><br />';
$content .= '<input type="radio" name="score" value="3" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-3.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-3.gif' : 'images/news/stars-3.gif') . '" alt="' . _GOOD . '" title="' . _GOOD . '" /><br />';
$content .= '<input type="radio" name="score" value="2" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-2.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-2.gif' : 'images/news/stars-2.gif') . '" alt="' . _REGULAR . '" title="' . _REGULAR . '" /><br />';
$content .= '<input type="radio" name="score" value="1" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-1.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-1.gif' : 'images/news/stars-1.gif') . '" alt="' . _BAD . '" title="' . _BAD . '" /><br /><br /></div>';
$content .= '<div style="text-align:center;"><input type="submit" value="' . _CASTMYVOTE . '" /></div></form>';
$block = array('bid' => 10003, 'view' => 0, 'side' => 'r', 'title' => _RATEARTICLE, 'content' => $content);
$Blocks->custom($block);
$content = '<br />&nbsp;<img src="images/news/print.gif" style="width:16px; height:11px;" alt="' . _PRINTER . '" title="' . _PRINTER . '" />&nbsp;&nbsp;<a href="' . URL::index('&amp;file=print&amp;sid=' . $sid) . '">' . _PRINTER . '</a><br /><br />';
if (can_admin('news')) {
    $content .= '<div style="text-align:center;"><b>' . _ADMIN . '</b><br />[ <a href="' . URL::admin('&amp;mode=add') . '">' . _ADD . '</a> | <a href="' . URL::admin('&amp;edit=' . $sid) . '">' . _EDIT . '</a> | <a href="' . URL::admin('&amp;del=' . $sid) . '">' . _DELETE . '</a> ]</div>';
}
$block = array('bid' => 10004, 'view' => 0, 'side' => 'r', 'title' => _OPTIONS, 'content' => $content);
$Blocks->custom($block);
require_once 'header.php';
$cpgtpl->display('body');
if ($story['acomm'] && $MAIN_CFG['global']['articlecomm'] && $userinfo['umode'] != 'nocomments') {
    require_once "modules/{$module_name}/comments.php";
    DisplayComments($sid, $story['title']);
}
Exemplo n.º 19
0
                                        message_die(GENERAL_ERROR, 'Couldn\'t query topic', '', __LINE__, __FILE__, $sql);
                                    }
                                    $row = $db->sql_fetchrow($result);
                                    $post_title = $row['topic_title'];
                                    if (strlen($post_title) > 32) {
                                        $post_title = substr($post_title, 0, 30) . '...';
                                    }
                                    $view_topic = URL::index('&amp;file=viewtopic&amp;' . POST_POST_URL . '=' . $ids[$j]['post_id']) . '#' . $ids[$j]['post_id'];
                                    $post_titles[] = '<a href="' . $view_topic . '" class="gen" target="_blank">' . $post_title . '</a>';
                                } else {
                                    $post_titles[] = $lang['Private_Message'];
                                }
                            }
                            $post_titles = implode('<br />', $post_titles);
                            $hidden_field = '<input type="hidden" name="attach_id_list[]" value="' . $attachments[$i]['attach_id'] . '">';
                            $template->assign_block_vars('attachrow', array('ROW_NUMBER' => $i + ($_GET['start'] + 1), 'ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'FILENAME' => $attachments[$i]['real_filename'], 'COMMENT' => $attachments[$i]['comment'], 'EXTENSION' => $attachments[$i]['extension'], 'SIZE' => round($attachments[$i]['filesize'] / MEGABYTE, 2), 'DOWNLOAD_COUNT' => $attachments[$i]['download_count'], 'POST_TIME' => create_date($board_config['default_dateformat'], $attachments[$i]['filetime']), 'POST_TITLE' => $post_titles, 'S_DELETE_BOX' => $delete_box, 'S_HIDDEN' => $hidden_field, 'U_VIEW_ATTACHMENT' => URL::index('&amp;file=download&amp;id=' . $attachments[$i]['attach_id'])));
                        }
                    }
                    if (!$search_based && !$user_based) {
                        if ($total_attachments == 0) {
                            $result = $db->sql_query("SELECT attach_id FROM " . ATTACHMENTS_DESC_TABLE);
                            $total_rows = $db->sql_numrows($result);
                        }
                    }
                }
            }
        }
    }
}
//
// Generate Pagination
Exemplo n.º 20
0
                    if ($comments == 0) {
                        $commentlink = $story_link . _COMMENTSQ . '</a> | ';
                    } elseif ($comments == 1) {
                        $commentlink = $story_link . $comments . ' ' . _COMMENT . '</a> | ';
                    } elseif ($comments > 1) {
                        $commentlink = $story_link . $comments . ' ' . _COMMENTS . '</a> | ';
                    }
                }
                $printlink = '<a href="' . URL::index('News&amp;file=print&amp;sid=' . $row['sid']) . '"><img src="images/news/print.gif" alt="' . _PRINTER . '" title="' . _PRINTER . '" /></a>';
                if ($row['catid'] != 0) {
                    $title = '<a href="' . URL::index('News&amp;catid=' . $row['catid']) . '">' . $row['cattitle'] . '</a> : ' . $title;
                    $catlink = '<a href="' . URL::index('News&amp;catid=' . $row['catid']) . '">' . $row['cattitle'] . '</a> | ';
                }
                $rated = 0;
                if ($row['score'] != 0) {
                    $rated = substr($row['score'] / $row['ratings'], 0, 4);
                }
                $scorelink = _SCORE . ' ' . $rated;
                $row['topicimage'] = $row['topicimage'] != '' ? $row['topicimage'] : 'AllTopics.gif';
                $row['topictext'] = htmlprepare($row['topictext']);
                $row['informant'] = $row['informant'] != '' ? '<a href="' . URL::index("Your_Account&amp;profile={$row['informant']}") . "\">{$row['informant']}</a>" : _ANONYMOUS;
                $cpgtpl->assign_block_vars('newstopic', array('IMG_TOPIC' => (file_exists("themes/{$CPG_SESS['theme']}/images/topics/{$row['topicimage']}") ? "themes/{$CPG_SESS['theme']}/" : '') . "images/topics/{$row['topicimage']}", 'S_AUTHOR' => $row['aid'], 'S_INFORMANT' => $row['informant'], 'S_MORELINK' => $morelink, 'S_COMMLINK' => $commentlink, 'S_PRNTLINK' => $printlink, 'S_CATLINK' => $catlink, 'S_SCORLINK' => $scorelink, 'S_NOTE' => _NOTE, 'S_NOTES' => $row['notes'], 'S_POSTEDBY' => _POSTEDBY, 'S_STORY' => $row['hometext'], 'S_ON' => _ON, 'S_TEXTCOLOR1' => $textcolor1, 'S_TEXTCOLOR2' => $textcolor2, 'S_TIME' => " {$datetime} ", 'S_READS' => "({$row['counter']} " . _READS . ")", 'S_TITLE' => $title, 'S_TOPIC' => $row['topictext'], 'S_WRITES' => _WRITES, 'S_SID' => $row['sid'], 'U_NEWTOPIC' => URL::index("News&amp;topic={$row['topic']}")));
            }
            $db->sql_freeresult($result);
            $tmp = 0 < $topic ? '&amp;topic=' . $topic : (0 < $catid ? '&amp;catid=' . $catid : '');
            pagination('News' . $tmp . '&amp;page=', $pages, 1, $page);
            $cpgtpl->set_filenames(array('body' => 'news/index.html'));
            $cpgtpl->display('body');
        }
    }
}
Exemplo n.º 21
0
</script>
';
starttable('100%');
echo '
	<tr>
		<td class="tableh1" colspan="2"><b><span class="statlink">' . GROUP_NAME . '</span></b></td>
		<td class="tableh1"><b><span class="statlink">' . DISK_QUOTA . '</span></b></td>
		<td class="tableh1" align="center"><b><span class="statlink">' . CAN_RATE . '</span></b></td>
		<td class="tableh1" align="center"><b><span class="statlink">' . CAN_SEND_ECARDS . '</span></b></td>
		<td class="tableh1" align="center"><b><span class="statlink">' . CAN_POST_COM . '</span></b></td>
		<td class="tableh1" align="center"><b><span class="statlink">' . CAN_UPLOAD . '</span></b></td>
		<td class="tableh1" align="center"><b><span class="statlink">' . APPROVAL_1 . '</span></b></td>
		<td class="tableh1" align="center"><b><span class="statlink">' . CAN_HAVE_GALLERY . '</span></b></td>
		<td class="tableh1" align="center"><b><span class="statlink">' . APPROVAL_2 . '</span></b></td>
	</tr>
	<form method="post" action="' . URL::index("&amp;file=groupmgr") . '" enctype="multipart/form-data" accept-charset="utf-8">
';
display_group_list();
echo '
	<tr>
		<td colspan="10" class="tableh2"><b>' . NOTES . '</b></td>
	</tr><tr>
		<td colspan="10" class="tableb">' . NOTE1 . '</td>
	</tr><tr>
		<td colspan="10" class="tableb">' . NOTE2 . '</td>
	</tr><tr>
		<td colspan="10" align="center" class="tablef">
			<input type="submit" name="apply_modifs" value="' . APPLY . '" class="button" />&nbsp;&nbsp;&nbsp;
			<input type="submit" name="new_group" value="' . CREATE_NEW_GROUP . '" class="button" />&nbsp;&nbsp;&nbsp;
			<input type="submit" name="del_sel" value="' . DEL_GROUPS . '" onclick="return confirmDel()" class="button" />
		</td>
Exemplo n.º 22
0
 function add_result($row)
 {
     global $db, $dl_prefix, $cpgtpl, $module_name;
     $this->result[$this->result_count++] = $row;
     $rating_info = get_rating($row['score'], $row['votes']);
     if ($row['date'] >= $row['updated']) {
         $row['date'] = _DLP_PUBLISHED . ': ' . generate_date($row['date']) . mark_date($row['date'], 3, 1, '', 2);
     } else {
         $row['date'] = _DLP_UPDATED . ': ' . generate_date($row['updated']) . mark_date($row['updated'], 3, 2, '', 2);
     }
     if (can_download($row['active'], $row['access'])) {
         $img = dl_image($row['access'] > 0 ? 'download_small_yes.png' : 'download_small.png');
         $img_title = _DLP_DLNOW;
     } else {
         $img = dl_image('download_small_no.png');
         $img_title = _DLP_DLFORBIDDEN;
     }
     if ($row['img_url']) {
         if (ereg('://', $row['img_url'])) {
             $row['img_url'] .= '" width="100';
         } else {
             $row['img_url'] = dl_thumbimage($row['img_url']) . '" width="100';
         }
     }
     $cpgtpl->assign_block_vars('dl_item', array('TITLE' => $row['title'], 'U_INFO' => URL::index('&amp;file=details&amp;id=' . $row['lid']), 'U_GET' => URL::index('&amp;get=' . $row['lid']), 'U_IMG' => $row['screen'] ? URL::index('&amp;screen=' . $row['screen']) : '', 'U_HOME' => $row['homepage'], 'U_WRITE' => URL::index('&amp;review=' . $row['lid']), 'U_REVIEWS' => URL::index('&amp;file=details&amp;id=' . $row['lid'] . '#reviews'), 'NO_REVIEWS' => $row['votes'] == 0 && is_user(), 'REVIEWS' => sprintf($row['votes'] == 1 ? '%s review' : '%s reviews', $row['votes']), 'VERSION' => !empty($row['version']) ? _VERSION . ' ' . $row['version'] : '', 'NOT_ACTIVE' => $row['active'] == 0 && can_admin($module_name) ? _DLP_INACTIVE : '', 'E_PICK' => $row['pick'] ? _DLP_EDPICK : '', 'SECURE' => isset($row['cpgcs']) && $row['cpgcs'] ? 'Certified Secure' : '', 'SUBMITTER' => is_numeric($row['submitter']) ? '<a href="' . URL::index('&amp;file=search&amp;sa=' . $row['submitter']) . '">' . $row['username'] . '</a>' : $row['submitter'], 'DL_IMG' => $img, 'DL_IMG_TITLE' => $img_title, 'RATING_IMG' => $rating_info['image'], 'POP_IMG' => popularity($row['lid']), 'DATE' => $row['date'], 'DESC' => nl2br($row['desc_short']), 'U_SCREEN' => URL::index('&amp;screen=' . $row['screen']), 'IMG_SCREEN' => $row['img_url'], 'IMG_MISSING' => dl_image('missing.png'), 'L_VIEWALLSCREENS' => _DLP_VIEWALLSCREENS, 'L_NOSCREENS' => _DLP_NOSCREENSHOTS, 'L_SUBMITTEDBY' => _DLP_SUBMITTEDBY));
 }
Exemplo n.º 23
0
    cpg_die(_ERROR, ACCESS_DENIED);
}
//, __FILE__, __LINE__
$sql = "SELECT username, user_email, user_regdate as user_regdate_cp, group_name, " . "user_from, user_interests, user_website, user_occ, " . "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota " . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group_cp = group_id " . "LEFT JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = " . FIRST_USER_CAT . " + user_id " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = a.aid " . "WHERE user_id ='" . USER_ID . "' " . "GROUP BY user_id, username, user_email, user_regdate, group_name, user_from, user_interests, user_website, user_occ, group_quota";
$result = $db->sql_query($sql);
if (!$db->sql_numrows($result)) {
    cpg_die(_ERROR, $lang_register_php['err_unk_user'], __FILE__, __LINE__);
}
$user_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$form_data = array('username' => $user_data['username'], 'reg_date' => localised_date($user_data['user_regdate_cp'], REGISTER_DATE_FMT), 'group' => $user_data['group_name'], 'email' => $user_data['user_email'], 'disk_usage' => $user_data['disk_usage'] ? $user_data['disk_usage'] : 0 . ($user_data['group_quota'] ? '/' . $user_data['group_quota'] : '') . ' ' . $lang_byte_units[1], 'location' => $user_data['user_from'], 'interests' => $user_data['user_interests'], 'website' => $user_data['user_website'], 'occupation' => $user_data['user_occ']);
$title = sprintf(X_S_PROFILE, CPG_USERNAME);
pageheader($title);
starttable(-1, $title, 2);
$chset = _CHARSET;
echo '<form method="post" action="' . URL::index("") . '" enctype="multipart/form-data" accept-charset="$chset">';
make_form($edit_profile_form_param, $form_data);
echo <<<EOT
        
        </form>

EOT;
endtable();
if (defined('CPG_NUKE')) {
    get_lang("Your_Account");
    require_once 'modules/Your_Account/functions.php';
    require "modules/Your_Account/userinfo.php";
    userinfo(USER_ID);
} else {
    pagefooter();
}
Exemplo n.º 24
0
function html_comments($pid)
{
    global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $username, $FAVPICS, $CURRENT_PIC_DATA, $THEME_DIR;
    global $template_image_comments, $template_add_your_comment, $db;
    $html = '';
    if (!$CONFIG['enable_smilies']) {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_no_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_smilies');
        template_extract_block($template_add_your_comment, 'input_box_smilies');
    } else {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_no_smilies');
        template_extract_block($template_add_your_comment, 'input_box_no_smilies');
    }
    $tmpl_comments_buttons = template_extract_block($template_image_comments, 'buttons', '{BUTTONS}');
    $tmpl_comments_ipinfo = template_extract_block($template_image_comments, 'ipinfo', '{IPINFO}');
    $result = $db->sql_query("SELECT msg_id, msg_author, msg_body, msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$pid}' ORDER BY msg_id ASC", false, __FILE__, __LINE__);
    while ($row = $db->sql_fetchrow($result)) {
        $user_can_edit = GALLERY_ADMIN_MODE || USER_ID > 1 && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS || USER_ID < 2 && USER_CAN_POST_COMMENTS && $USER['ID'] == $row['author_md5_id'];
        $comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
        $comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
        $comment_ipinfo = $row['msg_raw_ip'] && GALLERY_ADMIN_MODE ? $tmpl_comments_ipinfo : '';
        if ($CONFIG['enable_smilies']) {
            $comment_body = set_smilies(make_clickable($row['msg_body']));
            $smilies = smilies_table('onerow', 'msg_body', "f{$row['msg_id']}");
        } else {
            $comment_body = make_clickable($row['msg_body']);
            $smilies = '';
        }
        $params = array('{EDIT}' => &$comment_edit_box, '{BUTTONS}' => &$comment_buttons, '{IPINFO}' => &$comment_ipinfo);
        $template = template_eval($template_image_comments, $params);
        $info = '';
        if (!in_array($pid, $FAVPICS)) {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . ADDFAV . '</a>';
        } else {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . REMFAV . '</a>';
        }
        $params = array('{MSG_AUTHOR}' => $row['msg_author'], '{MSG_ID}' => $row['msg_id'], '{MSG_TYPE}' => GALLERY_ADMIN_MODE ? 'text' : 'hidden', '{EDIT_TITLE}' => COM_EDIT_TITLE, '{CONFIRM_DELETE}' => CONFIRM_DELETE_COM, '{DELETE_LINK}' => URL::index("&amp;file=delete"), '{DELETE_TEXT}' => DELETE . ' ' . COMMENT, '{MSG_DATE}' => localised_date($row['msg_date'], COMMENT_DATE_FMT), '{MSG_BODY}' => &$comment_body, '{MSG_BODY_RAW}' => $row['msg_body'], '{OK}' => OK, '{SMILIES}' => $smilies, '{HDR_IP}' => NET::decode_ip($row['msg_hdr_ip']), '{RAW_IP}' => NET::decode_ip($row['msg_raw_ip']), '{ACTION}' => 'action="' . URL::index('&amp;file=db_input') . '" enctype="multipart/form-data" accept-charset="utf-8"', '{ADDFAVLINK}' => URL::index("&amp;file=addfav&amp;pid={$pid}"), '{ADDFAVTEXT}' => $info, '{THEMEDIR}' => $THEME_DIR);
        $html .= template_eval($template, $params);
    }
    if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments']) {
        if (USER_ID > 1) {
            $username_input = '<input type="hidden" name="msg_author" value="' . CPG_USERNAME . '" />';
            template_extract_block($template_add_your_comment, 'username_input', $username_input);
            // $username = '';
        } else {
            $username = isset($USER['name']) ? '"' . htmlprepare($USER['name']) . '"' : '"' . YOUR_NAME . '" onclick="javascript:this.value=\'\';"';
        }
        if (!in_array($pid, $FAVPICS)) {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . ADDFAV . '</a>';
        } else {
            $info = '<a href="' . URL::index('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . REMFAV . '</a>';
        }
        $params = array('{ADD_YOUR_COMMENT}' => ADD_YOUR_COMMENT, '{NAME}' => COM_NAME, '{COMMENT}' => COMMENT, '{PIC_ID}' => $pid, '{username}' => $username, '{MAX_COM_LENGTH}' => $CONFIG['max_com_size'], '{OK}' => OK, '{SMILIES}' => '', '{ACTION}' => 'action="' . URL::index("&amp;file=db_input") . '" enctype="multipart/form-data" accept-charset="utf-8"', '{ADDFAVLINK}' => URL::index("&amp;file=addfav&amp;pid={$pid}"), '{ADDFAVTEXT}' => $info);
        if ($CONFIG['enable_smilies']) {
            $params['{SMILIES}'] = smilies_table('onerow', 'message', 'post');
        }
        //		if ($CONFIG['enable_smilies']) $params['{SMILIES}'] = generate_smilies();
        $html .= template_eval($template_add_your_comment, $params);
    }
    if (USER_ID > 1 or $CONFIG['allow_anon_fullsize'] or USER_IS_ADMIN) {
        return $html;
    }
}
Exemplo n.º 25
0
EOT;
//<select onChange="if(this.options[this.selectedIndex].value) window.location.href='$CPG_URL&file=reviewcom&start=$start&count='+this.options[this.selectedIndex].value;"  name="count" class="listbox">
echo '                                <option value="25">25</option>
                                <option value="50" ' . $s50 . '>50</option>
                                <option value="75" ' . $s75 . '>75</option>
                                <option value="100" ' . $s100 . '>100</option>
                        </select>
                </td>
        </tr>

';
$result = $db->sql_query("SELECT msg_id, msg_author, msg_body, msg_date, author_id, {$CONFIG['TABLE_COMMENTS']}.pid as pid, aid, filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_COMMENTS']}, {$CONFIG['TABLE_PICTURES']} WHERE {$CONFIG['TABLE_COMMENTS']}.pid = {$CONFIG['TABLE_PICTURES']}.pid ORDER BY msg_id DESC LIMIT {$start}, {$count}", false, __FILE__, __LINE__);
while ($row = $db->sql_fetchrow($result)) {
    $thumb_url = get_pic_url($row, 'thumb');
    $image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['alb_list_thumb_size']);
    $thumb_link = URL::index("&amp;file=displayimage&amp;pid=" . $row['pid']);
    $msg_date = localised_date($row['msg_date'], COMMENT_DATE_FMT);
    echo <<<EOT
        <tr>
        <td colspan="2" class="tableh2" valign="top">
                <table cellpadding="0" cellspacing="0" border ="0">
                        <tr>
                        <td><input name="cid_array[]" type="checkbox" value="{$row['msg_id']}" />
                        <td><img src="{$CPG_M_DIR}/images/spacer.gif" alt="" width="5" height="1" /><br /></td>
                        <td><b>{$row['msg_author']}</b> - {$msg_date}</td>
                        </tr>
                </table>
                </td>
        </tr>
        <tr>
        <td class="tableb" valign="top" width="100%">
Exemplo n.º 26
0
$limit = 5;
//number of pictures
// END USER DEFINABLES
$content = '';
$result = $db->sql_query("SELECT pid, filepath, filename, p.aid, pic_rating, p.votes, p.title  FROM " . $cpg_prefix . "pictures AS p INNER JOIN " . $cpg_prefix . "albums AS a ON (p.aid = a.aid AND " . VIS_GROUPS . ") WHERE approved=1 AND p.votes >= '{$CONFIG['min_votes_for_rating']}' GROUP BY pid ORDER BY ROUND((pic_rating+1)/2000) DESC, p.votes DESC LIMIT {$limit}");
$pic = 0;
$theme_prefix = $caption = $thumb_title = '';
while ($row = $db->sql_fetchrow($result)) {
    if (defined('THEME_HAS_RATING_GRAPHICS')) {
        $theme_prefix = $CONFIG['theme'] . '/';
    } else {
        $theme_prefix = '';
    }
    // $caption = '<img src="' . $CPG_M_DIR . '/' . $theme_prefix . 'images/rating' . round($row["pic_rating"] / 2000) . '.gif" style=\"text-align:center;" alt=\"\" />' . '<br />' . sprintf(N_VOTES, $row[\'votes\']).'<br />';
    $caption = "<img src=\"" . $CPG_M_DIR . "/" . $theme_prefix . "images/rating" . round($row['pic_rating'] / 2000) . ".gif\" style=\"text-align:center;\" alt=\"\" />" . "<br />" . round($row['pic_rating'] / 2000, 2) . "/5 ";
    $caption .= sprintf(N_VOTES, $row['votes']);
    $caption .= "<br />";
    if ($CONFIG['seo_alts'] == 0) {
        $thumb_title = $row['filename'];
    } else {
        if ($row['title'] != '') {
            $thumb_title = $row['title'];
        } else {
            $thumb_title = substr($row['filename'], 0, -4);
        }
    }
    $content .= '<p style="text-align:center;"><a href="' . URL::index($cpg_dir . '&amp;file=displayimage&amp;meta=toprated&amp;cat=0&amp;pos=' . $pic) . '"><img src="' . get_pic_url($row, 'thumb') . '" alt="' . $thumb_title . '" title="' . $thumb_title . '" /><br />' . $caption . '</a></p>';
    $pic++;
}
$content .= '<p style="text-align:center;"><a href = "' . URL::index($cpg_dir) . '"> Go to gallery </a> </p>';
Exemplo n.º 27
0
    $CPG_SESS['tell_friend'] = true;
    $sender_name = $sender_email = '';
    if (is_user()) {
        $sender_name = !empty($userinfo['name']) ? $userinfo['name'] : $userinfo['username'];
        $sender_email = $userinfo['user_email'];
    }
    $message_insert = _HEY . " {recipient},\n\n" . _OURSITE . "\n\n" . _ITSCALLED . " {sitename} " . _SOMESTATS . "\n\n" . _SLOGAN . " {slogan}\n" . _FOUNDEDON . " {founded}\n" . _REGISTEREDUSERS . " {users}\n" . _TOTALSITEHITS . " {hits}\n\n" . _VISITTHEM . ($html ? ' [url={url}]{url}[/url]' : ' {url}') . "\n\n" . _KINDREGARDS . ",\n\n{sender}";
    if ($html) {
        require_once 'includes/nbbcode.php';
        $bbcode = bbcode_table('personal_message', 'tell_friend', 0);
    } else {
        $bbcode = '<div style="color: #ff0000"><strong>.: ' . _BBCODEDISABLED . ' :.</strong></div><br />';
    }
    require_once 'header.php';
    OpenTable();
    echo '<form id="tell_friend" action="' . URL::index() . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">
	<div style="text-align:center;">
	<span class="content">
	  <strong>' . _INFORMATION . '</strong>
	</span>
	<br /><br /><br />
	<strong>' . _SENDERNAME . '</strong>
	<br />
	<input type="text" name="sender_name" size="25" maxlength="255" value="' . $sender_name . '" />
	<br /><br />
	<strong>' . _SENDEREMAIL . '</strong>
	<br />
	<input type="text" name="sender_email" size="25" maxlength="255" value="' . $sender_email . '" />
	<br /><br /><br />
	<strong>' . _RECIPIENTNAME . '</strong>
	<br />
Exemplo n.º 28
0
// application/rss+xml
//  <ttl>60</ttl> a number of minutes that indicates how long a channel can be cached before refresh.
echo '<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
  <title>' . htmlprepare($sitename) . '</title>
  <link>' . $BASEHREF . '</link>
  <description>' . htmlprepare($backend_title) . '</description>
  <language>' . $backend_language . '</language>
  <pubDate>' . $date . '</pubDate>
  <ttl>' . 60 * 24 . '</ttl>
  <generator>CPG-Nuke Dragonfly</generator>
  <copyright>' . htmlprepare($sitename) . '</copyright>
  <category>Downloads</category>
  <docs>http://backend.userland.com/rss</docs>
  <image>
    <url>' . $BASEHREF . 'images/' . $MAIN_CFG['global']['site_logo'] . '</url>
    <title>' . htmlprepare($sitename) . '</title>
    <link>' . $BASEHREF . "</link>\n  </image>\n\n";
if ($row) {
    do {
        echo '<item>
  <title>' . htmlprepare($row['title']) . '</title>
  <link>' . URL::index('Downloads&amp;file=details&amp;id=' . $row['lid'], true, true) . '</link>
  <description>' . htmlprepare($row['desc_short'], false, ENT_QUOTES, true) . '</description>
  <pubDate>' . date('D, d M Y H:i:s \\G\\M\\T', $row['date']) . "</pubDate>\n</item>\n\n";
    } while ($row = $db->sql_fetchrow($result));
}
?>
</channel>
</rss>
Exemplo n.º 29
0
define('_DLP_RQR', '%s is required');
define('_DLP_INACTIVEDL', 'The download is not active');
define('_DLP_UNKNOWNDL', 'The download could not be found');
define('_DLP_DLFORBIDDEN', 'You are not allowed to download this file');
define('_DLP_FILEINLIST', 'The URL/screenshot you tried to add is already in your list');
define('_DLP_FILEEXISTS', 'The URL/screenshot you tried to add already exists in another download');
define('_DLP_FILEASSOC', 'The URL/screenshot you tried to add already exists and is associated with <a href="%s">this</a> download');
define('_DLP_FAIL2GETINFO', 'Failed to obtain file information for %s');
define('_DLP_INVALIDFNAME', '%s is not a valid filename');
define('_DLP_ISWEBSITE', '%s is a website and not a valid file');
define('_DLP_FILETOOBIG', 'File size is larger than the maximum: %s');
define('_DLP_FILETOOSMALL', 'File size is too small');
define('_DLP_EXTFORBIDDEN', 'The extension is not allowed');
define('_DLP_FILEERROR', 'An error occurred while processing the file');
define('_DLP_INVALIDFILE', 'Invalid file/image');
define('_DLP_REGISTER2DL', 'You must be a <a href="' . URL::index('Your_Account') . '">registered</a> member to download this file');
define('_DLP_ADMINDL', 'This download is available only to administrators');
define('_DLP_GROUPDL', 'This download is available only to members of the %s group');
// Menu
define('_DLP_RANDOM', 'Random');
define('_DLP_HISTORY', 'History');
define('_DLP_PROMOTE', 'Promote');
define('_DLP_WRITEREVIEW', 'Write a Review');
define('_DLP_MYDL', 'My Downloads');
// Admin menu
define('_DLP_CONFIG', 'Configuration');
define('_DLP_CFIELDS', 'Custom fields');
define('_DLP_PENDDL', 'Pending downloads');
define('_DLP_PENDMIR', 'Pending mirrors');
define('_DLP_BRMIR', 'Broken mirrors');
// broken mirrors
Exemplo n.º 30
0
  Please see the included LICENSE.txt for the terms and
  conditions that govern your use of this module

  $Source: /cvs/modules/Downloads_Pro/blocks/block-Top10_Downloads.php,v $
  $Revision: 1.6 $
  $Author: phoenix $
  $Date: 2010/11/03 23:13:17 $
******************************************************/
if (!defined('CPG_NUKE')) {
    exit;
}
global $db, $prefix;
$dl_mod = 'Downloads';
$dl_mod_prefix = $prefix . '_' . strtolower($dl_mod);
$content = '';
if (!is_active($dl_mod)) {
    $content = 'ERROR';
    return trigger_error($dl_mod . ' module is inactive', E_USER_WARNING);
}
$a = 1;
$result = $db->sql_query("SELECT d.lid, d.title, SUM(s.hits) AS hits FROM " . $dl_mod_prefix . "_downloads d\nLEFT JOIN " . $dl_mod_prefix . "_stats s ON (s.id = d.lid) WHERE d.active=1 GROUP BY s.id ORDER BY hits DESC LIMIT 0,10");
if ($db->sql_numrows($result) < 1) {
    $content = 'ERROR';
    return trigger_error('There are no downloads in ' . $dl_mod, E_USER_WARNING);
}
while (list($lid, $dtitle) = $db->sql_fetchrow($result)) {
    $content .= '<b>&#8226;</b>&nbsp; ' . $a . ': <a href="' . URL::index($dl_mod . '&amp;file=details&amp;id=' . $lid) . '">' . $dtitle . '</a><br />';
    $a++;
}
$db->sql_freeresult($result);