当前位置: 首页>>代码示例>>PHP>>正文


PHP alt_trow函数代码示例

本文整理汇总了PHP中alt_trow函数的典型用法代码示例。如果您正苦于以下问题:PHP alt_trow函数的具体用法?PHP alt_trow怎么用?PHP alt_trow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了alt_trow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetch_forum_announcements

function fetch_forum_announcements($pid = 0, $depth = 1)
{
    global $mybb, $db, $lang, $announcements, $templates, $announcements_forum, $moderated_forums;
    static $forums_by_parent, $forum_cache, $parent_forums;
    if (!is_array($forum_cache)) {
        $forum_cache = cache_forums();
    }
    if (!is_array($parent_forums) && $mybb->user['issupermod'] != 1) {
        // Get a list of parentforums to show for normal moderators
        $parent_forums = array();
        foreach ($moderated_forums as $mfid) {
            $parent_forums = array_merge($parent_forums, explode(',', $forum_cache[$mfid]['parentlist']));
        }
    }
    if (!is_array($forums_by_parent)) {
        foreach ($forum_cache as $forum) {
            $forums_by_parent[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
        }
    }
    if (!is_array($forums_by_parent[$pid])) {
        return;
    }
    foreach ($forums_by_parent[$pid] as $children) {
        foreach ($children as $forum) {
            if ($forum['active'] == 0 || !is_moderator($forum['fid'])) {
                // Check if this forum is a parent of a moderated forum
                if (in_array($forum['fid'], $parent_forums)) {
                    // A child is moderated, so print out this forum's title.  RECURSE!
                    $trow = alt_trow();
                    eval("\$announcements_forum .= \"" . $templates->get("modcp_announcements_forum_nomod") . "\";");
                } else {
                    // No subforum is moderated by this mod, so safely continue
                    continue;
                }
            } else {
                // This forum is moderated by the user, so print out the forum's title, and its announcements
                $trow = alt_trow();
                $padding = 40 * ($depth - 1);
                eval("\$announcements_forum .= \"" . $templates->get("modcp_announcements_forum") . "\";");
                if ($announcements[$forum['fid']]) {
                    foreach ($announcements[$forum['fid']] as $aid => $announcement) {
                        $trow = alt_trow();
                        if ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0) {
                            $icon = "<img src=\"images/minioff.gif\" alt=\"({$lang->expired})\" title=\"{$lang->expired_announcement}\"  style=\"vertical-align: middle;\" /> ";
                        } else {
                            $icon = "<img src=\"images/minion.gif\" alt=\"({$lang->active})\" title=\"{$lang->active_announcement}\"  style=\"vertical-align: middle;\" /> ";
                        }
                        $subject = htmlspecialchars_uni($announcement['subject']);
                        eval("\$announcements_forum .= \"" . $templates->get("modcp_announcements_announcement") . "\";");
                    }
                }
            }
            // Build the list for any sub forums of this forum
            if ($forums_by_parent[$forum['fid']]) {
                fetch_forum_announcements($forum['fid'], $depth + 1);
            }
        }
    }
}
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:59,代码来源:functions_modcp.php

示例2: trader_view_rep

function trader_view_rep($uid = 1)
{
    global $mybb, $db, $templates, $pagination, $mypostkey, $header, $headerinclude, $footer, $theme, $posreps, $negreps, $neutreps, $totalreps, $lang;
    $lang->load("tradefeedback");
    $uid = intval($uid);
    if (!$uid) {
        $uid = $mybb->user['uid'];
    }
    if (!$uid) {
        error($lang->feedback_invalid_user);
    }
    if ($mybb->input['fid']) {
        $colspan = 5;
        $fidonly = "AND f.fid=" . intval($mybb->input['fid']) . " ";
    } else {
        $colspan = 6;
        $detailcolumn = "<th class=\"tcat\">{$lang->feedback_details}</th>";
    }
    $url = "tradefeedback.php?action=view&uid={$uid}";
    if (isset($mybb->input['value'])) {
        $value = intval($mybb->input['value']);
        $valuesql = " AND f.value={$value}";
        $url .= "&value={$value}";
    }
    if (isset($mybb->input['type'])) {
        $type = $db->escape_string($mybb->input['type']);
        $typesql = " AND f.type='{$type}'";
        $url .= "&type={$type}";
    }
    $approved = 1;
    if ($mybb->usergroup['canmodcp'] && $mybb->usergroup['issupermod']) {
        $approved = 0;
    }
    // Count the number of reps to figure out pagination
    $query = $db->simple_select("trade_feedback f", "COUNT(f.fid) as reps", "f.receiver={$uid} AND f.approved >= {$approved} {$valuesql} {$fidonly} {$typesql}");
    $total = $db->fetch_field($query, "reps");
    if (!$total) {
        $noresults = "<tr><td colspan=\"{$colspan}\">{$lang->feedback_no_results}</td></tr>";
    }
    $userquery = $db->simple_select("users", "username, posreps, neutreps, negreps", "uid={$uid}");
    $feedback = $db->fetch_array($userquery);
    $receiverusername = $feedback['username'];
    add_breadcrumb($lang->sprintf($lang->feedback_profile, $receiverusername), "member.php?action=profile&uid={$uid}");
    add_breadcrumb($lang->sprintf($lang->feedback_page_title, $receiverusername), "tradefeedback.php?action=view&uid={$uid}");
    $posreps = $feedback['posreps'];
    $neutreps = $feedback['neutreps'];
    $negreps = $feedback['negreps'];
    $totalreps = $posreps + $neutreps + $negreps;
    $perpage = 20;
    $pages = ceil($total / $perpage);
    if ($mybb->input['page']) {
        $pages = intval($mybb->input['page']);
    } else {
        $page = 1;
    }
    if ($page < 1) {
        $page = 1;
    }
    if ($page > $pages) {
        $page = $pages;
    }
    $start = $page * $perpage - $perpage;
    if ($start < 0) {
        $start = 0;
    }
    $pagination = multipage($total, $perpage, $page, $url);
    // Actually fetch the feedback
    $query = $db->query("SELECT f.*, u.username, u.usergroup, u.displaygroup\n    FROM " . TABLE_PREFIX . "trade_feedback f\n    LEFT JOIN " . TABLE_PREFIX . "users u\n    ON(f.giver=u.uid)\n    WHERE f.receiver={$uid} AND f.approved >= {$approved} {$valuesql} {$fidonly} {$typesql}\n    ORDER BY f.dateline DESC\n    LIMIT {$start} , {$perpage}");
    while ($feedback = $db->fetch_array($query)) {
        $feedback['formattedname'] = format_name($feedback['username'], $feedback['usergroup'], $feedback['displaygroup']);
        $feedback['profilelink'] = build_profile_link($feedback['formattedname'], $feedback['giver']);
        $feedback['dateline'] = my_date($mybb->settings['dateformat'], $feedback['dateline'], "", 0);
        if ($feedback['threadlink'] && $mybb->input['fid']) {
            $threadlink = "<br /><a href=\"" . htmlspecialchars_uni($feedback['threadlink']) . "\" target=\"_blank\">{$lang->feedback_threadlink}</a>";
        }
        if ($feedback['value'] == 1) {
            $feedback['smilyurl'] = $mybb->settings['bburl'] . "/images/smilies/smile.png";
        } else {
            if ($feedback['value'] == 0) {
                $feedback['smilyurl'] = $mybb->settings['bburl'] . "/images/smilies/undecided.png";
            } else {
                $feedback['smilyurl'] = $mybb->settings['bburl'] . "/images/smilies/angry.png";
            }
        }
        $feedback['type'] = ucfirst($feedback['type']);
        if ($mybb->usergroup['canmodcp'] && $mybb->usergroup['issupermod']) {
            if ($feedback['approved'] == 1) {
                $approvedtext = $lang->feedback_options_unapprove;
                $approvedlinkpart = "unapprove";
                $tdclass = alt_trow();
            } else {
                $approvedtext = $lang->feedback_options_approve;
                $approvedlinkpart = "approve";
                $tdclass = "trow_shaded";
            }
            eval("\$modbit = \"" . $templates->get("tradefeedback_mod") . "\";");
        }
        if (!$mybb->input['fid']) {
            $detaillink = "<td class=\"{$tdclass}\"><a href=\"" . $mybb->settings['bburl'] . "/tradefeedback.php?action=view&amp;uid=" . $mybb->input['uid'] . "&amp;fid=" . $feedback['fid'] . "\">{$lang->feedback_view_details}</a></td>";
            if (strlen($feedback['comments']) >= 50) {
//.........这里部分代码省略.........
开发者ID:jnschrag,项目名称:Trade-Feedback,代码行数:101,代码来源:tradefeedback.php

示例3: array

                 $parser_options = array("allow_html" => $customfield['allowhtml'], "allow_mycode" => $customfield['allowmycode'], "allow_smilies" => $customfield['allowsmilies'], "allow_imgcode" => $customfield['allowimgcode'], "allow_videocode" => $customfield['allowvideocode'], "filter_badwords" => 1);
                 if ($customfield['type'] == "textarea") {
                     $parser_options['me_username'] = $memprofile['username'];
                 } else {
                     $parser_options['nl2br'] = 0;
                 }
                 if ($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0) {
                     $parser_options['allow_imgcode'] = 0;
                 }
                 $customfieldval = $parser->parse_message($userfields[$field], $parser_options);
             }
         }
         if ($customfieldval) {
             $customfield['name'] = htmlspecialchars_uni($customfield['name']);
             eval("\$customfields .= \"" . $templates->get("member_profile_customfields_field") . "\";");
             $bgcolor = alt_trow();
         }
     }
 }
 if ($customfields) {
     eval("\$profilefields = \"" . $templates->get("member_profile_customfields") . "\";");
 }
 $memprofile['postnum'] = my_number_format($memprofile['postnum']);
 $lang->ppd_percent_total = $lang->sprintf($lang->ppd_percent_total, my_number_format($ppd), $post_percent);
 $memprofile['threadnum'] = my_number_format($memprofile['threadnum']);
 $lang->tpd_percent_total = $lang->sprintf($lang->tpd_percent_total, my_number_format($tpd), $thread_percent);
 $formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);
 $bannedbit = '';
 if ($memperms['isbannedgroup'] == 1 && $mybb->usergroup['canbanusers'] == 1) {
     // Fetch details on their ban
     $query = $db->simple_select('banned b LEFT JOIN ' . TABLE_PREFIX . 'users a ON (b.admin=a.uid)', 'b.*, a.username AS adminuser', "b.uid='{$uid}'", array('limit' => 1));
开发者ID:nicopinto,项目名称:fantasitura.com,代码行数:31,代码来源:member.php

示例4: multipage

 $numusers = $db->num_rows($query);
 $perpage = (int) $mybb->settings['membersperpage'];
 if ($perpage < 1) {
     $perpage = 20;
 }
 $page = $mybb->get_input('page', MyBB::INPUT_INT);
 if ($page && $page > 0) {
     $start = ($page - 1) * $perpage;
 } else {
     $start = 0;
     $page = 1;
 }
 $multipage = multipage($numusers, $perpage, $page, "managegroup.php?gid=" . $gid);
 $users = "";
 while ($user = $db->fetch_array($query)) {
     $altbg = alt_trow();
     $regdate = my_date('relative', $user['regdate']);
     $post = $user;
     $sendpm = $email = '';
     if ($mybb->settings['enablepms'] == 1 && $post['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos("," . $post['ignorelist'] . ",", "," . $mybb->user['uid'] . ",") === false) {
         eval("\$sendpm = \"" . $templates->get("postbit_pm") . "\";");
     }
     if ($user['hideemail'] != 1) {
         eval("\$email = \"" . $templates->get("postbit_email") . "\";");
     } else {
         $email = '';
     }
     $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
     $user['profilelink'] = build_profile_link($user['username'], $user['uid']);
     if (in_array($user['uid'], $leaders_array)) {
         $leader = $lang->leader;
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:managegroup.php

示例5: my_date

        if ($warning['expired'] != 1) {
            if ($warning['expires'] == 0) {
                $expires = $lang->never;
            } else {
                $expires = my_date($mybb->settings['dateformat'], $warning['expires']) . ", " . my_date($mybb->settings['timeformat'], $warning['expires']);
            }
        } else {
            if ($warning['daterevoked']) {
                $expires = $lang->warning_revoked;
            } else {
                if ($warning['expires']) {
                    $expires = $lang->already_expired;
                }
            }
        }
        $alt_bg = alt_trow();
        $plugins->run_hooks("warnings_warning");
        eval("\$warnings .= \"" . $templates->get("warnings_warning") . "\";");
    }
    if (!$warnings) {
        eval("\$warnings = \"" . $templates->get("warnings_no_warnings") . "\";");
    }
    $plugins->run_hooks("warnings_end");
    eval("\$warnings = \"" . $templates->get("warnings") . "\";");
    output_page($warnings);
}
function find_warnlevels_to_check(&$query, &$max_expiration_times, &$check_levels)
{
    global $db;
    // we have some warning levels we need to revoke
    $max_expiration_times = array(1 => -1, 2 => -1, 3 => -1);
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:warnings.php

示例6: build_forumbits


//.........这里部分代码省略.........
            }
            // Forum is a category, set template type
            if ($forum['type'] == 'c') {
                $forumcat = '_cat';
            } else {
                $forumcat = '_forum';
            }
            if ($forum['linkto'] == '') {
                // No posts have been made in this forum - show never text
                if (($lastpost_data['lastpost'] == 0 || $lastpost_data['lastposter'] == '') && $hideinfo != true) {
                    $lastpost = "<div style=\"text-align: center;\">{$lang->lastpost_never}</div>";
                } elseif ($hideinfo != true) {
                    // Format lastpost date and time
                    $lastpost_date = my_date($mybb->settings['dateformat'], $lastpost_data['lastpost']);
                    $lastpost_time = my_date($mybb->settings['timeformat'], $lastpost_data['lastpost']);
                    // Set up the last poster, last post thread id, last post subject and format appropriately
                    $lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);
                    $lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");
                    $lastpost_subject = $full_lastpost_subject = $parser->parse_badwords($lastpost_data['lastpostsubject']);
                    if (my_strlen($lastpost_subject) > 25) {
                        $lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";
                    }
                    $lastpost_subject = htmlspecialchars_uni($lastpost_subject);
                    $full_lastpost_subject = htmlspecialchars_uni($full_lastpost_subject);
                    // Call lastpost template
                    if ($depth != 1) {
                        eval("\$lastpost = \"" . $templates->get("forumbit_depth{$depth}_forum_lastpost") . "\";");
                    }
                }
                if ($mybb->settings['showforumviewing'] != 0 && $forum['viewers'] > 0) {
                    if ($forum['viewers'] == 1) {
                        $forum_viewers_text = $lang->viewing_one;
                    } else {
                        $forum_viewers_text = $lang->sprintf($lang->viewing_multiple, $forum['viewers']);
                    }
                    $forum_viewers_text_plain = $forum_viewers_text;
                    $forum_viewers_text = "<span class=\"smalltext\">{$forum_viewers_text}</span>";
                }
            }
            // If this forum is a link or is password protected and the user isn't authenticated, set lastpost and counters to "-"
            if ($forum['linkto'] != '' || $hideinfo == true) {
                $lastpost = "<div style=\"text-align: center;\">-</div>";
                $posts = "-";
                $threads = "-";
            } else {
                $posts = my_number_format($forum['posts']);
                $threads = my_number_format($forum['threads']);
            }
            // Moderator column is not off
            if ($mybb->settings['modlist'] != 0) {
                $done_moderators = array();
                $moderators = '';
                // Fetch list of moderators from this forum and its parents
                $parentlistexploded = explode(',', $forum['parentlist']);
                foreach ($parentlistexploded as $mfid) {
                    // This forum has moderators
                    if (is_array($moderatorcache[$mfid])) {
                        // Fetch each moderator from the cache and format it, appending it to the list
                        foreach ($moderatorcache[$mfid] as $moderator) {
                            if (in_array($moderator['uid'], $done_moderators)) {
                                continue;
                            }
                            $moderators .= "{$comma}<a href=\"" . get_profile_link($moderator['uid']) . "\">" . htmlspecialchars_uni($moderator['username']) . "</a>";
                            $comma = ', ';
                            $done_moderators[] = $moderator['uid'];
                        }
                    }
                }
                $comma = '';
                // If we have a moderators list, load the template
                if ($moderators) {
                    eval("\$modlist = \"" . $templates->get("forumbit_moderators") . "\";");
                } else {
                    $modlist = '';
                }
            }
            // Descriptions aren't being shown - blank them
            if ($mybb->settings['showdescriptions'] == 0) {
                $forum['description'] = '';
            }
            // Check if this category is either expanded or collapsed and hide it as necessary.
            $expdisplay = '';
            $collapsed_name = "cat_{$forum['fid']}_c";
            if (isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: show;") {
                $expcolimage = "collapse_collapsed.gif";
                $expdisplay = "display: none;";
                $expaltext = "[+]";
            } else {
                $expcolimage = "collapse.gif";
                $expaltext = "[-]";
            }
            // Swap over the alternate backgrounds
            $bgcolor = alt_trow();
            // Add the forum to the list
            eval("\$forum_list .= \"" . $templates->get("forumbit_depth{$depth}{$forumcat}") . "\";");
        }
    }
    // Return an array of information to the parent forum including child forums list, counters and lastpost information
    return array("forum_list" => $forum_list, "counters" => $parent_counters, "lastpost" => $parent_lastpost);
}
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:101,代码来源:functions_forumlist.php

示例7: xthreads_tpl_forumbits_tplget

 function xthreads_tpl_forumbits_tplget(&$obj, &$forum, $title, $eslashes, $htmlcomments)
 {
     if ($forum['xthreads_hideforum']) {
         // alternate the bgcolor if applicable (so we get no net change)
         if ($title == 'forumbit_depth1_cat' || $title == 'forumbit_depth2_cat' || $title == 'forumbit_depth2_forum') {
             $GLOBALS['bgcolor'] = alt_trow();
         }
         return 'return "";';
     }
     global $forum_tpl_prefixes;
     if (!empty($forum_tpl_prefixes[$forum['fid']])) {
         foreach ($forum_tpl_prefixes[$forum['fid']] as &$p) {
             if (isset($obj->cache[$p . $title]) && !isset($obj->non_existant_templates[$p . $title])) {
                 $title = $p . $title;
                 break;
             }
         }
     }
     return 'return "' . $obj->xthreads_tpl_forumbits_get($title, $eslashes, $htmlcomments) . '";';
 }
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:20,代码来源:xt_forumdhooks.php

示例8: teamonline_show

function teamonline_show()
{
    global $cache, $groupscache, $db, $mybb, $teamonline, $lang, $theme, $templates, $online;
    $lang->load('teamonline');
    if ($mybb->settings['teamonline_gid']) {
        $gid = " IN (" . $mybb->settings['teamonline_gid'] . ")";
        $timesearch = TIME_NOW - $mybb->settings['wolcutoffmins'] * 60;
        $teamonline_row = '';
        $trowbg = alt_trow();
        $query = $db->query("\n\t\t\tSELECT s.sid, s.ip, s.uid, u.username, s.time, u.avatar, u.usergroup, u.displaygroup, u.invisible\n\t\t\tFROM " . TABLE_PREFIX . "sessions s\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (s.uid=u.uid)\n\t\t\tWHERE u.usergroup {$gid} AND time>'{$timesearch}'\n\t\t\tORDER BY u.username ASC, s.time DESC\n\t\t\t");
        if (!$db->num_rows($query)) {
            eval("\$teamonline_no = \"" . $templates->get("teamonline_no") . "\";");
            $invisible = 0;
            $membercount = 0;
        } else {
            if (!is_array($groupscache)) {
                $groupscache = $cache->read("usergroups");
            }
            while ($online = $db->fetch_array($query)) {
                $invisible_mark = '';
                if ($online['invisible'] == 1) {
                    $invisible_mark = '*';
                }
                if ($online['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $online['uid'] == $mybb->user['uid']) {
                    $avatar_teamonline = format_avatar($online['avatar']);
                    $online['username'] = format_name($online['username'], $online['usergroup'], $online['displaygroup']);
                    $online['profilelink'] = build_profile_link($online['username'], $online['uid']) . $invisible_mark;
                    $online['groupname'] = $groupscache[$online['usergroup']]['title'];
                    eval("\$teamonline_row .= \"" . $templates->get("teamonline_row") . "\";");
                }
                $invisible += $online['invisible'];
                $membercount++;
            }
        }
        eval("\$teamonline = \"" . $templates->get("teamonline") . "\";");
    }
}
开发者ID:ambsalinas,项目名称:anima,代码行数:37,代码来源:teamonline.php

示例9: myalerts_view_alerts

/**
 * View all alerts.
 *
 * @param MyBB       $mybb      MyBB core object.
 * @param MyLanguage $lang      Language object.
 * @param templates  $templates Template manager.
 * @param array      $theme     Details about the current theme.
 */
function myalerts_view_alerts($mybb, $lang, $templates, $theme)
{
    if (MybbStuff_MyAlerts_AlertManager::getInstance() === false) {
        myalerts_create_instances();
    }
    $alerts = MybbStuff_MyAlerts_AlertManager::getInstance()->getAlerts(0, 10);
    if (!isset($lang->myalerts)) {
        $lang->load('myalerts');
    }
    add_breadcrumb($lang->myalerts_page_title, 'alerts.php?action=alerts');
    require_once __DIR__ . '/inc/functions_user.php';
    usercp_menu();
    $numAlerts = MybbStuff_MyAlerts_AlertManager::getInstance()->getNumAlerts();
    $page = (int) $mybb->input['page'];
    $pages = ceil($numAlerts / $mybb->settings['myalerts_perpage']);
    if ($page > $pages or $page <= 0) {
        $page = 1;
    }
    if ($page) {
        $start = ($page - 1) * $mybb->settings['myalerts_perpage'];
    } else {
        $start = 0;
        $page = 1;
    }
    $multipage = multipage($numAlerts, $mybb->settings['myalerts_perpage'], $page, "alerts.php");
    $alertsList = MybbStuff_MyAlerts_AlertManager::getInstance()->getAlerts($start);
    $readAlerts = array();
    if (is_array($alertsList) && !empty($alertsList)) {
        foreach ($alertsList as $alertObject) {
            $altbg = alt_trow();
            $alert = parse_alert($alertObject);
            if ($alert['message']) {
                eval("\$alertsListing .= \"" . $templates->get('myalerts_alert_row') . "\";");
            }
            $readAlerts[] = $alert['id'];
        }
    } else {
        $altbg = 'trow1';
        eval("\$alertsListing = \"" . $templates->get('myalerts_alert_row_no_alerts') . "\";");
    }
    MybbStuff_MyAlerts_AlertManager::getInstance()->markRead($readAlerts);
    global $headerinclude, $header, $footer, $usercpnav;
    $content = '';
    eval("\$content = \"" . $templates->get('myalerts_page') . "\";");
    output_page($content);
}
开发者ID:WhiteNeo,项目名称:MyAlerts,代码行数:54,代码来源:alerts.php

示例10: build_forumbits


//.........这里部分代码省略.........
                    // Call lastpost template
                    if ($depth != 1) {
                        eval("\$lastpost = \"" . $templates->get("forumbit_depth{$depth}_forum_lastpost") . "\";");
                    }
                }
                if ($mybb->settings['showforumviewing'] != 0 && $forum['viewers'] > 0) {
                    if ($forum['viewers'] == 1) {
                        $forum_viewers_text = $lang->viewing_one;
                    } else {
                        $forum_viewers_text = $lang->sprintf($lang->viewing_multiple, $forum['viewers']);
                    }
                    $forum_viewers_text_plain = $forum_viewers_text;
                    eval("\$forum_viewers_text = \"" . $templates->get("forumbit_depth2_forum_viewers") . "\";");
                }
            }
            // If this forum is a link or is password protected and the user isn't authenticated, set counters to "-"
            if ($forum['linkto'] != '' || $hideinfo == true || $hidecounters == true) {
                $posts = "-";
                $threads = "-";
            } else {
                $posts = my_number_format($forum['posts']);
                $threads = my_number_format($forum['threads']);
            }
            // If this forum is a link or is password protected and the user isn't authenticated, set lastpost to "-"
            if ($forum['linkto'] != '' || $hideinfo == true || $hidelastpostinfo == true) {
                eval("\$lastpost = \"" . $templates->get("forumbit_depth2_forum_lastpost_hidden") . "\";");
            }
            // Moderator column is not off
            if ($mybb->settings['modlist'] != 0) {
                $done_moderators = array("users" => array(), "groups" => array());
                $moderators = '';
                // Fetch list of moderators from this forum and its parents
                $parentlistexploded = explode(',', $forum['parentlist']);
                foreach ($parentlistexploded as $mfid) {
                    // This forum has moderators
                    if (isset($moderatorcache[$mfid]) && is_array($moderatorcache[$mfid])) {
                        // Fetch each moderator from the cache and format it, appending it to the list
                        foreach ($moderatorcache[$mfid] as $modtype) {
                            foreach ($modtype as $moderator) {
                                if ($moderator['isgroup']) {
                                    if (in_array($moderator['id'], $done_moderators['groups'])) {
                                        continue;
                                    }
                                    $moderator['title'] = htmlspecialchars_uni($moderator['title']);
                                    eval("\$moderators .= \"" . $templates->get("forumbit_moderators_group", 1, 0) . "\";");
                                    $done_moderators['groups'][] = $moderator['id'];
                                } else {
                                    if (in_array($moderator['id'], $done_moderators['users'])) {
                                        continue;
                                    }
                                    $moderator['profilelink'] = get_profile_link($moderator['id']);
                                    $moderator['username'] = htmlspecialchars_uni($moderator['username']);
                                    eval("\$moderators .= \"" . $templates->get("forumbit_moderators_user", 1, 0) . "\";");
                                    $done_moderators['users'][] = $moderator['id'];
                                }
                                $comma = $lang->comma;
                            }
                        }
                    }
                }
                $comma = '';
                // If we have a moderators list, load the template
                if ($moderators) {
                    eval("\$modlist = \"" . $templates->get("forumbit_moderators") . "\";");
                } else {
                    $modlist = '';
                }
            }
            // Descriptions aren't being shown - blank them
            if ($mybb->settings['showdescriptions'] == 0) {
                $forum['description'] = '';
            }
            // Check if this category is either expanded or collapsed and hide it as necessary.
            $expdisplay = '';
            $collapsed_name = "cat_{$forum['fid']}_c";
            if (isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: show;") {
                $expcolimage = "collapse_collapsed.png";
                $expdisplay = "display: none;";
                $expthead = " thead_collapsed";
                $expaltext = "[+]";
            } else {
                $expcolimage = "collapse.png";
                $expthead = "";
                $expaltext = "[-]";
            }
            // Swap over the alternate backgrounds
            $bgcolor = alt_trow();
            // Add the forum to the list
            eval("\$forum_list .= \"" . $templates->get("forumbit_depth{$depth}{$forumcat}") . "\";");
        }
    }
    if (!isset($parent_lastpost)) {
        $parent_lastpost = 0;
    }
    if (!isset($lightbulb)) {
        $lightbulb = '';
    }
    // Return an array of information to the parent forum including child forums list, counters and lastpost information
    return array("forum_list" => $forum_list, "counters" => $parent_counters, "lastpost" => $parent_lastpost, "lightbulb" => $lightbulb);
}
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:101,代码来源:functions_forumlist.php

示例11: mysupport_modcp_support_denial


//.........这里部分代码省略.........
            // -1 is if we're revoking and 0 is no reason, so those are exempt
            if (!array_key_exists($deniedsupportreason, $mysupport_cache['deniedreasons']) && $deniedsupportreason != -1 && $deniedsupportreason != 0) {
                mysupport_error($lang->support_denial_reason_invalid_reason);
                exit;
            } elseif ($deniedsupportreason == -1) {
                $update = array("deniedsupport" => 0, "deniedsupportreason" => 0, "deniedsupportuid" => 0);
                $db->update_query("users", $update, "uid = '" . intval($uid) . "'");
                $update = array("closed" => 0, "closedbymysupport" => 0);
                $mysupport_forums = implode(",", array_map("intval", mysupport_forums()));
                $db->update_query("threads", $update, "uid = '" . intval($uid) . "' AND fid IN (" . $db->escape_string($mysupport_forums) . ") AND closed = '1' AND closedbymysupport = '2'");
                mysupport_mod_log_action(11, $lang->sprintf($lang->deny_support_revoke_mod_log, $username));
                mysupport_redirect_message($lang->sprintf($lang->deny_support_revoke_success, htmlspecialchars_uni($username)));
            } else {
                $update = array("deniedsupport" => 1, "deniedsupportreason" => intval($deniedsupportreason), "deniedsupportuid" => intval($mybb->user['uid']));
                $db->update_query("users", $update, "uid = '" . intval($uid) . "'");
                if ($mybb->settings['mysupportclosewhendenied'] == 1) {
                    $update = array("closed" => 1, "closedbymysupport" => 2);
                    $mysupport_forums = implode(",", array_map("intval", mysupport_forums()));
                    $db->update_query("threads", $update, "uid = '" . intval($uid) . "' AND fid IN (" . $db->escape_string($mysupport_forums) . ") AND closed = '0'");
                }
                if ($deniedsupportreason != 0) {
                    $deniedsupportreason = $db->fetch_field($query, "name");
                    mysupport_mod_log_action(11, $lang->sprintf($lang->deny_support_mod_log_reason, $username, $deniedsupportreason));
                } else {
                    mysupport_mod_log_action(11, $lang->sprintf($lang->deny_support_mod_log, $username));
                }
                mysupport_redirect_message($lang->sprintf($lang->deny_support_success, htmlspecialchars_uni($username)));
            }
            if (!empty($mod_log_action)) {
                $mod_log_data = array("fid" => intval($fid), "tid" => intval($tid));
                log_moderator_action($mod_log_data, $mod_log_action);
            }
            redirect($redirect_url, $redirect);
        } elseif ($mybb->input['do'] == "denysupport") {
            if ($mybb->settings['enablemysupportsupportdenial'] != 1) {
                mysupport_error($lang->support_denial_not_enabled);
                exit;
            }
            $uid = intval($mybb->input['uid']);
            $tid = intval($mybb->input['tid']);
            $user = get_user($uid);
            $username = $user['username'];
            $user_link = build_profile_link(htmlspecialchars_uni($username), intval($uid), "blank");
            if ($mybb->input['uid']) {
                $deny_support_to = $lang->sprintf($lang->deny_support_to, htmlspecialchars_uni($username));
            } else {
                $deny_support_to = $lang->deny_support_to_user;
            }
            add_breadcrumb($deny_support_to);
            $deniedreasons = "";
            $deniedreasons .= "<label for=\"deniedsupportreason\">{$lang->reason}:</label> <select name=\"deniedsupportreason\" id=\"deniedsupportreason\">\n";
            // if they've not been denied support yet or no reason was given, show an empty option that will be selected
            if ($user['deniedsupport'] == 0 || $user['deniedsupportreason'] == 0) {
                $deniedreasons .= "<option value=\"0\"></option>\n";
            }
            $mysupport_cache = $cache->read("mysupport");
            if (!empty($mysupport_cache['deniedreasons'])) {
                // if there's one or more reasons set, show them in a dropdown
                foreach ($mysupport_cache['deniedreasons'] as $deniedreasons) {
                    $selected = "";
                    // if a reason has been given, we'd be editing it, so this would select the current one
                    if ($user['deniedsupport'] == 1 && $user['deniedsupportreason'] == $deniedreason['mid']) {
                        $selected = " selected=\"selected\"";
                    }
                    $deniedreasons .= "<option value=\"" . intval($deniedreason['mid']) . "\"{$selected}>" . htmlspecialchars_uni($deniedreason['name']) . "</option>\n";
                }
            }
            $deniedreasons .= "<option value=\"0\">{$lang->support_denial_reasons_none}</option>\n";
            // if they've been denied support, give an option to revoke it
            if ($user['deniedsupport'] == 1) {
                $deniedreasons .= "<option value=\"0\">-----</option>\n";
                $deniedreasons .= "<option value=\"-1\">{$lang->revoke}</option>\n";
            }
            $deniedreasons .= "</select>\n";
            eval("\$deny_support = \"" . $templates->get('mysupport_deny_support_deny') . "\";");
            eval("\$deny_support_page = \"" . $templates->get('mysupport_deny_support') . "\";");
            output_page($deny_support_page);
        } else {
            $query = $db->write_query("\r\n\t\t\t\tSELECT u1.username AS support_denied_username, u1.uid AS support_denied_uid, u2.username AS support_denier_username, u2.uid AS support_denier_uid, m.name AS support_denied_reason\r\n\t\t\t\tFROM " . TABLE_PREFIX . "users u\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "mysupport m ON (u.deniedsupportreason = m.mid)\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u1 ON (u1.uid = u.uid)\r\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u2 ON (u2.uid = u.deniedsupportuid)\r\n\t\t\t\tWHERE u.deniedsupport = '1'\r\n\t\t\t\tORDER BY u1.username ASC\r\n\t\t\t");
            if ($db->num_rows($query) > 0) {
                while ($denieduser = $db->fetch_array($query)) {
                    $bgcolor = alt_trow();
                    $support_denied_user = build_profile_link(htmlspecialchars_uni($denieduser['support_denied_username']), intval($denieduser['support_denied_uid']));
                    $support_denier_user = build_profile_link(htmlspecialchars_uni($denieduser['support_denier_username']), intval($denieduser['support_denier_uid']));
                    if (empty($denieduser['support_denied_reason'])) {
                        $support_denial_reason = $lang->support_denial_no_reason;
                    } else {
                        $support_denial_reason = $denieduser['support_denied_reason'];
                    }
                    eval("\$denied_users .= \"" . $templates->get('mysupport_deny_support_list_user') . "\";");
                }
            } else {
                $denied_users = "<tr><td class=\"trow1\" align=\"center\" colspan=\"5\">{$lang->support_denial_no_users}</td></tr>";
            }
            eval("\$deny_support = \"" . $templates->get('mysupport_deny_support_list') . "\";");
            eval("\$deny_support_page = \"" . $templates->get('mysupport_deny_support') . "\";");
            output_page($deny_support_page);
        }
    }
}
开发者ID:myWebDev,项目名称:MySupport,代码行数:101,代码来源:mysupport.php

示例12: tslink_modcp

function tslink_modcp()
{
    global $db, $mybb, $lang, $templates, $theme, $headerinclude, $header, $footer, $modcp_nav, $multipage;
    require __DIR__ . '/config.php';
    $tslink_modcp_access = explode(',', $tslink_modcp_groups);
    $mybb_user_groups = explode(',', $mybb->user['additionalgroups']);
    if (simple_array_intersect($tslink_modcp_access, $mybb_user_groups) || $mybb->usergroup['cancp'] == 1) {
        eval('$tslink_modcp_menu_template = "' . $templates->get('tslink_modcp_menu') . '";');
        $modcp_nav = str_replace('<!-- tslink -->', $tslink_modcp_menu_template, $modcp_nav);
    }
    if ($mybb->input['action'] == 'tslink_dochange') {
        $mybb_uid = intval($mybb->input['uid']);
        $changeto = intval($mybb->input['changeto']);
        $db->query('UPDATE ' . TABLE_PREFIX . "users SET memberstatus= '" . $changeto . "' WHERE uid='" . $mybb_uid . "'");
        $queryUser = $db->simple_select('users', 'username, lastip', "uid='{$mybb_uid}'");
        $bin_ip_in_db = $db->fetch_field($queryUser, 'lastip');
        $givenip = my_inet_ntop($db->unescape_binary($bin_ip_in_db));
        $forUser = $db->fetch_field($queryUser, 'username');
        // If there's an ip of the user in de database, update the unique id's in the database
        if (!empty($givenip)) {
            tslink_log("=============================================================\n=================== " . date('d-m-Y H:i:s') . " =====================\n=============================================================\n", $forUser);
            tslink_log('Started on ModCP by ' . $mybb->user['username'] . ' - IP address of user available (' . $givenip . ') - doing tslink_update_uids & tslink_update_groups', $forUser);
            $tslink_update_uids_results = tslink_update_uids($givenip);
            tslink_log($tslink_update_uids_results, $forUser);
            $message = $lang->tslink_status_changed;
        }
        // If there's no lastip of the user in the database - dont try to update the unique id's in the database
        if (empty($givenip)) {
            tslink_log("=============================================================\n=================== " . date('d-m-Y H:i:s') . " =====================\n=============================================================\n", $forUser);
            tslink_log('Started on ModCP ' . $mybb->user['username'] . ' - IP address of user NOT available - only doing tslink_update_groups to update previously registered TS uids', $forUser);
            $tslink_update_groups_results = tslink_update_groups($mybb_uid);
            tslink_log($tslink_update_groups_results, $forUser);
            $message = $lang->tslink_status_changed;
        }
        redirect('modcp.php?action=tslink', $message);
    }
    if ($mybb->input['action'] == 'tslink') {
        add_breadcrumb($lang->nav_modcp, 'modcp.php');
        add_breadcrumb($lang->tslink_title, 'modcp.php?action=tslink');
        global $db, $mybb, $lang, $templates, $theme, $headerinclude, $header, $footer, $modcp_nav, $multipage;
        $query = $db->simple_select('users', 'uid, username, memberstatus', '', ['order_by' => 'username', 'order_dir' => 'ASC']);
        while ($users = $db->fetch_array($query)) {
            $alt_bg = alt_trow();
            $user['username'] = build_profile_link($users['username'], $users['uid']);
            if ($users['memberstatus'] == '0') {
                $status = 'Member';
                $linktochange = '<a href="modcp.php?action=tslink_dochange&amp;uid=' . $users['uid'] . '&amp;changeto=1">' . $lang->tslink_modcp_changestatus1 . ' </a>-
                                        <a href="modcp.php?action=tslink_dochange&amp;uid=' . $users['uid'] . '&amp;changeto=2"> ' . $lang->tslink_modcp_changestatus2 . '</a>
                                        ';
            } elseif ($users['memberstatus'] == '1') {
                $status = 'Donating Member';
                $linktochange = '<a href="modcp.php?action=tslink_dochange&amp;uid=' . $users['uid'] . '&amp;changeto=0">' . $lang->tslink_modcp_changestatus0 . ' </a>-
                                        <a href="modcp.php?action=tslink_dochange&amp;uid=' . $users['uid'] . '&amp;changeto=2"> ' . $lang->tslink_modcp_changestatus2 . '</a>
                                        ';
            } elseif ($users['memberstatus'] == '2') {
                $status = 'VIP Member';
                $linktochange = '<a href="modcp.php?action=tslink_dochange&amp;uid=' . $users['uid'] . '&amp;changeto=0">' . $lang->tslink_modcp_changestatus0 . ' </a>-
                                        <a href="modcp.php?action=tslink_dochange&amp;uid=' . $users['uid'] . '&amp;changeto=1"> ' . $lang->tslink_modcp_changestatus1 . '</a>
                                        ';
            }
            eval('$tslink_rows .= "' . $templates->get('tslink_modcp_row') . '";');
        }
        eval('$content = "' . $templates->get('tslink_modcp_page_template') . '";');
        output_page($content);
    }
}
开发者ID:f0nt4,项目名称:TSLink,代码行数:66,代码来源:tslinkfunctions.php

示例13: recentthread_list_threads

function recentthread_list_threads($return = false)
{
    global $mybb, $db, $templates, $recentthreadtable, $recentthreads, $settings, $canviewrecentthreads, $cache, $theme;
    // First check permissions
    if (!recentthread_can_view()) {
        return;
    }
    require_once MYBB_ROOT . "inc/functions_search.php";
    $threadlimit = (int) $mybb->settings['recentthread_threadcount'];
    if (!$threadlimit) {
        $threadlimit = 15;
    }
    $onlyusfids = array();
    // Check group permissions if we can't view threads not started by us
    $group_permissions = forum_permissions();
    foreach ($group_permissions as $fid => $forum_permissions) {
        if ($forum_permissions['canonlyviewownthreads'] == 1) {
            $onlyusfids[] = $fid;
        }
    }
    if (!empty($onlyusfids)) {
        $where .= "AND ((t.fid IN(" . implode(',', $onlyusfids) . ") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(" . implode(',', $onlyusfids) . "))";
    }
    $approved = 0;
    // Moderators can view unapproved threads
    if ($mybb->usergroup['canmodcp'] == 1) {
        $approved = -1;
    }
    $unsearchableforums = get_unsearchable_forums();
    $unviewableforums = get_unviewable_forums();
    if ($unsearchableforums && $unviewableforums) {
        $forumarray = explode(",", $unsearchableforums . "," . $unviewableforums);
        $newarray = array_unique($forumarray);
        $unsearchableforumssql = " AND t.fid NOT IN(" . implode(",", $newarray) . ") ";
    }
    // Take into account any ignored forums
    if ($mybb->settings['recentthread_forumskip']) {
        $ignoreforums = " AND t.fid NOT IN(" . $mybb->settings['recentthread_forumskip'] . ") ";
    }
    $forums = $cache->read("forums");
    $query = $db->query("\n\t\t\tSELECT t.*, u.username AS userusername, u.usergroup, u.displaygroup, u.avatar as threadavatar, u.avatardimensions as threaddimensions, lp.usergroup AS lastusergroup, lp.avatar as lastavatar, lp.avatardimensions as lastdimensions, lp.displaygroup as lastdisplaygroup\n\t\t\tFROM " . TABLE_PREFIX . "threads t\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=t.uid)\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users lp ON (t.lastposteruid=lp.uid)\n\t\t\tWHERE 1=1 {$where} AND t.visible > {$approved} {$unsearchableforumssql} {$ignoreforums}\n\t\t\tORDER BY t.lastpost DESC\n\t\t\tLIMIT {$threadlimit}\n\t\t");
    while ($thread = $db->fetch_array($query)) {
        $trow = alt_trow();
        $thread['forum'] = $forums[$thread['fid']]['name'];
        $threadlink = get_thread_link($thread['tid'], "", "newpost");
        $lastpostlink = get_thread_link($thread['tid'], "", "lastpost");
        $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
        $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
        $lastposttimeago = my_date("relative", $thread['lastpost']);
        $lastposter = $thread['lastposter'];
        $lastposteruid = $thread['lastposteruid'];
        $thread['author'] = build_profile_link(format_name($thread['userusername'], $thread['usergroup'], $thread['displaygroup']), $thread['uid']);
        // Don't link to guest's profiles (they have no profile).
        if ($lastposteruid == 0) {
            $lastposterlink = $lastposter;
        } else {
            $lastposterlink = build_profile_link(format_name($lastposter, $thread['lastusergroup'], $thread['lastdisplaygroup']), $lastposteruid);
        }
        if ($mybb->settings['recentthread_threadavatar']) {
            $threadavatar = format_avatar($thread['threadavatar'], $thread['threaddimensions']);
            $avatarurl = $threadavatar['image'];
            $dimensions = $threadavatar['width_height'];
            eval("\$posteravatar = \"" . $templates->get("recentthread_avatar") . "\";");
        }
        if ($mybb->settings['recentthread_lastavatar']) {
            $lastposteravatar = format_avatar($thread['lastavatar'], $thread['lastdimensions']);
            $avatarurl = $lastposteravatar['image'];
            $dimensions = $lastposteravatar['width_height'];
            eval("\$lastavatar = \"" . $templates->get("recentthread_avatar") . "\";");
        }
        // Now check the length of subjects
        $length = (int) $mybb->settings['recentthread_subject_length'];
        if (strlen($thread['subject']) > $length && $length != 0) {
            // Figure out if we need to split it up.
            $title = my_substr($thread['subject'], 0, $length);
            if ($mybb->settings['recentthread_subject_breaker']) {
                $words = explode(" ", $title);
                $count = count($words) - 1;
                $currenttitle = "";
                for ($x = 0; $x < $count; $x++) {
                    $currenttitle .= $words[$x] . " ";
                }
                $thread['subject'] = $currenttitle . " ...";
            }
            if (!$mybb->settings['recentthread_subject_breaker']) {
                $thread['subject'] = $title . "...";
            }
        }
        // Moderator stuff baby!
        if (is_moderator($thread['fid'])) {
            $ismod = TRUE;
            // fetch the inline mod column
        } else {
            $ismod = FALSE;
        }
        if (is_moderator($thread['fid'], "caneditposts") || $fpermissions['caneditposts'] == 1) {
            $can_edit_titles = 1;
        } else {
            $can_edit_titles = 0;
        }
//.........这里部分代码省略.........
开发者ID:ambsalinas,项目名称:anima,代码行数:101,代码来源:recentthread.php

示例14: cookielaw_misc

function cookielaw_misc()
{
    global $mybb, $lang, $templates, $theme, $cookielaw_info, $header, $headerinclude, $footer;
    $lang->load('cookielaw');
    if ($mybb->input['action'] == 'cookielaw_change') {
        if (isset($mybb->input['more_info'])) {
            // hack to show no redirect
            $mybb->settings['redirects'] = 0;
            redirect('misc.php?action=cookielaw_info');
        } else {
            if (isset($mybb->input['disallow'])) {
                cookielaw_clear_cookies();
                my_setcookie('mybb[allow_cookies]', '0');
            } else {
                my_setcookie('mybb[allow_cookies]', '1');
                if ($mybb->input['okay']) {
                    $lang->cookielaw_redirect = '';
                }
            }
            redirect('index.php', $lang->cookielaw_redirect);
        }
    } elseif ($mybb->input['action'] == 'cookielaw_info') {
        $cookies_rows = '';
        $cookies = cookielaw_get_cookies();
        foreach ($cookies as $cookie_name => $info) {
            if (isset($info['mod']) || isset($info['admin'])) {
                $cookie_user_type = '';
                if ($info['mod']) {
                    $cookie_user_type = $lang->cookielaw_info_cookies_set_mod;
                } elseif ($info['admin']) {
                    $cookie_user_type = $lang->cookielaw_info_cookies_set_admin;
                }
                $trow = alt_trow();
                $cookie_description = 'cookielaw_cookie_' . $cookie_name . '_desc';
                $cookies_rows .= '<tr>
					<td class="' . $trow . '">' . $cookie_name . '</td>
					<td class="' . $trow . '">' . $lang->{$cookie_description} . '</td>
					<td class="' . $trow . '" align="center">' . $cookie_user_type . '</td>
					<td class="' . $trow . '" align="center">-</td>
				</tr>';
            } else {
                if (substr($mybb->version, 0, 3) == '1.6') {
                    $ext = 'gif';
                } elseif (substr($mybb->version, 0, 3) == '1.8') {
                    $ext = 'png';
                }
                $cookie_member = $cookie_guest = '';
                if ($info['member']) {
                    $cookie_member = '<img src="' . $mybb->settings['bburl'] . '/images/valid.' . $ext . '" alt="" title="" />';
                } else {
                    $cookie_member = '<img src="' . $mybb->settings['bburl'] . '/images/invalid.' . $ext . '" alt="" title="" />';
                }
                if ($info['guest']) {
                    $cookie_guest = '<img src="' . $mybb->settings['bburl'] . '/images/valid.' . $ext . '" alt="" title="" />';
                } else {
                    $cookie_guest = '<img src="' . $mybb->settings['bburl'] . '/images/invalid.' . $ext . '" alt="" title="" />';
                }
                $trow = alt_trow();
                $cookie_description = 'cookielaw_cookie_' . $cookie_name . '_desc';
                $cookies_rows .= '<tr>
					<td class="' . $trow . '">' . $cookie_name . '</td>
					<td class="' . $trow . '">' . $lang->{$cookie_description} . '</td>
					<td class="' . $trow . '" align="center">' . $cookie_member . '</td>
					<td class="' . $trow . '" align="center">' . $cookie_guest . '</td>
				</tr>';
            }
        }
        if ($mybb->settings['cookielaw_method'] == 'opt') {
            eval("\$buttons = \"" . $templates->get("cookielaw_buttons_" . $mybb->settings['cookielaw_method']) . "\";");
        }
        eval("\$cookielaw_info = \"" . $templates->get("cookielaw_info") . "\";");
        output_page($cookielaw_info);
    }
}
开发者ID:Blackbeeard,项目名称:Cookie-Law,代码行数:74,代码来源:cookielaw.php

示例15: mylikes_popup

function mylikes_popup()
{
    global $db, $mybb, $lang, $groupscache, $templates;
    if ($mybb->input['action'] == "likes_recount") {
        // Rebuild the cache for this post - the reputation/like counter may have changed
        if (!empty($mybb->input['pid'])) {
            JB_MyLikes_Like::cache($mybb->input['pid']);
        }
        exit;
    }
    if ($mybb->input['action'] != "likes") {
        return;
    }
    if (empty($mybb->input['pid']) || empty($mybb->input['uid'])) {
        error_no_permission();
    }
    $lang->load("mylikes");
    $pid = $mybb->get_input("pid");
    $uid = $mybb->get_input("uid");
    $query = $db->simple_select("reputation", "*", "uid={$uid} AND pid={$pid}");
    $users = "";
    while ($like = $db->fetch_array($query)) {
        $user = get_user($like['adduid']);
        $name = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
        $profile_link = build_profile_link($name, $user['uid'], '_blank', 'if(window.opener) { window.opener.location = this.href; return false; }');
        $send_pm = '';
        if ($mybb->user['receivepms'] != 0 && $user['receivepms'] != 0 && $groupscache[$user['usergroup']]['canusepms'] != 0) {
            eval("\$send_pm = \"" . $templates->get("misc_buddypopup_user_sendpm") . "\";");
        }
        if ($user['lastactive']) {
            $last_active = $lang->sprintf($lang->last_active, my_date('relative', $user['lastactive']));
        } else {
            $last_active = $lang->sprintf($lang->last_active, $lang->never);
        }
        $user['avatar'] = format_avatar(htmlspecialchars_uni($user['avatar']), $user['avatardimensions'], '44x44');
        $online_alt = alt_trow();
        $users .= eval($templates->render("misc_mylikes_like"));
    }
    if (empty($users)) {
        $users = eval($templates->render("misc_mylikes_nolikes"));
    }
    echo eval($templates->render("misc_mylikes", 1, 0));
    exit;
}
开发者ID:JN-Jones,项目名称:MyLikes,代码行数:44,代码来源:mylikes.php


注:本文中的alt_trow函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。