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


PHP CPGPluginAPI::filter方法代码示例

本文整理汇总了PHP中CPGPluginAPI::filter方法的典型用法代码示例。如果您正苦于以下问题:PHP CPGPluginAPI::filter方法的具体用法?PHP CPGPluginAPI::filter怎么用?PHP CPGPluginAPI::filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPGPluginAPI的用法示例。


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

示例1: get_smilies_table2

function get_smilies_table2()
{
    global $lang_smilies_inc_php;
    $smilies_display = array(array(':lol:', 'lol.gif', $lang_smilies_inc_php['Laughing']), array(':-P', 'razz.gif', $lang_smilies_inc_php['Razz']), array(':-D', 'biggrin.gif', $lang_smilies_inc_php['Very Happy']), array(':-)', 'smile.gif', $lang_smilies_inc_php['Smile']), array(':-|', 'neutral.gif', $lang_smilies_inc_php['Neutral']), array(':-(', 'sad.gif', $lang_smilies_inc_php['Sad']), array(':cry:', 'cry.gif', $lang_smilies_inc_php['Crying or Very sad']), array('8-)', 'cool.gif', $lang_smilies_inc_php['Cool']), array(':-o', 'surprised.gif', $lang_smilies_inc_php['Surprised']), array(':-?', 'confused.gif', $lang_smilies_inc_php['Confused']), array(':oops:', 'redface.gif', $lang_smilies_inc_php['Embarrassed']), array(':shock:', 'eek.gif', $lang_smilies_inc_php['Shocked']), array(':-x', 'mad.gif', $lang_smilies_inc_php['Mad']), array(':roll:', 'rolleyes.gif', $lang_smilies_inc_php['Rolling Eyes']), array(';-)', 'wink.gif', $lang_smilies_inc_php['Wink']), array(':idea:', 'idea.gif', $lang_smilies_inc_php['Idea']), array(':!:', 'exclaim.gif', $lang_smilies_inc_php['Exclamation']), array(':?:', 'question.gif', $lang_smilies_inc_php['Question']));
    $smilies_display = CPGPluginAPI::filter('smilies_display', $smilies_display);
    return $smilies_display;
}
开发者ID:stephenjschaefer,项目名称:APlusPhotography,代码行数:7,代码来源:smilies.inc.php

示例2: create_banlist

/**
 * create_banlist()
 *
 * @return
 **/
function create_banlist()
{
    global $CONFIG, $lang_banning_php, $lang_usermgr_php, $lang_common, $lang_date, $CPG_PHP_SELF, $icon_array, $sort, $limit, $header_output, $help_array;
    //$PHP_SELF,
    $result = cpg_db_query("SELECT *, UNIX_TIMESTAMP(expiry) AS expiry FROM {$CONFIG['TABLE_BANNED']} WHERE brute_force = 0 ORDER BY {$sort} {$limit}");
    $count = $result->numRows();
    echo <<<EOT
        <tr>
            <th align="center" class="tableh2">
                {$lang_banning_php['ban_id']}
                {$header_output['ban_a']}
                {$header_output['ban_d']}
            </th>
            <th align="center" class="tableh2">
                {$lang_common['delete']}
            </th>
            <th align="center" class="tableh2">
                {$lang_banning_php['user_name']}
                {$help_array['user_name']}
                {$header_output['user_name_a']}
                {$header_output['user_name_d']}
            </th>
            <th align="center" class="tableh2">
                {$lang_banning_php['email_address']}
                {$help_array['email_address']}
                {$header_output['email_a']}
                {$header_output['email_d']}
            </th>
            <th align="center" class="tableh2">
                {$lang_banning_php['ip_address']}
                {$help_array['ip_address']}
                {$header_output['ip_a']}
                {$header_output['ip_d']}
            </th>
            <th align="center" class="tableh2">
                {$lang_banning_php['expires']}
                {$help_array['expiration']}
                {$header_output['expiry_a']}
                {$header_output['expiry_d']}
            </th>
        </tr>
EOT;
    if ($count > 0) {
        $row_counter = 0;
        while ($row = $result->fetchAssoc()) {
            if ($row['user_id']) {
                $username = get_username($row['user_id']);
                $view_profile = '<a href="profile.php?uid=' . $row['user_id'] . '">' . cpg_fetch_icon('my_profile', 0, $lang_usermgr_php['view_profile']) . '</a>';
            } elseif ($row['user_name']) {
                $username = $row['user_name'];
                $view_profile = '';
            } else {
                $username = '';
                $view_profile = '';
            }
            list($row['ip_detail']) = CPGPluginAPI::filter('ip_information', array('', $row['ip_addr']));
            $expired = '';
            if ($row['expiry']) {
                $expiry = date('Y-m-d', $row['expiry']);
                if (date('Y-m-d H:i:s', $row['expiry']) < date('Y-m-d H:i:s')) {
                    $expired = $lang_banning_php['expired'];
                }
            } else {
                $expiry = '';
            }
            echo <<<EOT
                <tr>
                    <td class="{$row_style_class}" align="center" valign="top">
                        <input type="hidden" name="ban_id[]" id="ban_id_{$row['ban_id']}" value="{$row['ban_id']}" />
                        {$row['ban_id']}
                    </td>
                    <td class="{$row_style_class}" align="right" valign="top">
                        {$expired}
                        <input type="checkbox" class="checkbox" name="select_{$row['ban_id']}" id="select_{$row['ban_id']}" value="1" />
                    </td>
                    <td class="{$row_style_class}" valign="top">
                        <input type="text" class="textinput" style="width: 100%" name="user_name_{$row['ban_id']}" id="user_name_{$row['ban_id']}" value="{$username}" />
                        {$view_profile}
                        <input type="hidden" name="user_id_{$row['ban_id']}" id="user_id_{$row['ban_id']}" value="{$row['user_id']}" />
                    </td>
                    <td class="{$row_style_class}" valign="top">
                        <input type="text" class="textinput email_field" style="width: 100%" name="email_{$row['ban_id']}" id="email_{$row['ban_id']}" value="{$row['email']}" />
                        <div id="email_{$row['ban_id']}_warning" class="cpg_message_validation formFieldWarning" style="display:none;">{$lang_banning_php['email_field_invalid']}</div>
                    </td>
                    <td class="{$row_style_class}" valign="top">
                        <input type="text" class="textinput ip_field" style="width: 80%" size="15" maxlength="15" name="ip_addr_{$row['ban_id']}" id="ip_addr_{$row['ban_id']}" value="{$row['ip_addr']}" />{$row['ip_detail']}
                        <div id="ip_addr_{$row['ban_id']}_warning" class="cpg_message_validation formFieldWarning" style="display:none;">{$lang_banning_php['ip_address_field_invalid']}</div>
                    </td>
                    <td class="{$row_style_class}" valign="top">
                        <input type="text" class="textinput date-pick" style="width:80%" size="10" maxlength="10" name="expiration_{$row['ban_id']}" id="expiration_{$row['ban_id']}" value="{$expiry}"  title="{$lang_banning_php['select_date']}" />
                        <div id="expiration_{$row['ban_id']}_warning" class="cpg_message_validation formFieldWarning" style="display:none;">{$lang_banning_php['expiry_field_invalid']}</div>
                    </td>
                </tr>
EOT;
            $row_counter++;
//.........这里部分代码省略.........
开发者ID:CatBerg-TestOrg,项目名称:coppermine,代码行数:101,代码来源:banning.php

示例3: resize_image

/**
* resize_image()
*
* Create a file containing a resized image
*
* @param  $src_file the source file
* @param  $dest_file the destination file
* @param  $new_size the size of the square within which the new image must fit
* @param  $method the method used for image resizing
* @return 'true' in case of success
*/
function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use, $watermark = "false", $sharpen = 0, $media_type = "false")
{
    global $CONFIG, $ERROR;
    global $lang_errors;
    list($sharpen) = CPGPluginAPI::filter('image_sharpen', array($sharpen, $new_size));
    //Make Cage
    $superCage = Inspekt::makeSuperCage();
    $imginfo = cpg_getimagesize($src_file);
    if ($imginfo == null) {
        return false;
    }
    // GD can only handle JPG & PNG images
    if ($imginfo[2] != GIS_JPG && $imginfo[2] != GIS_PNG && $CONFIG['GIF_support'] == 0) {
        $ERROR = $lang_errors['gd_file_type_err'];
        //return false;
        return array('error' => $ERROR);
    }
    // height/width
    $srcWidth = $imginfo[0];
    $srcHeight = $imginfo[1];
    $crop = 0;
    // initialize
    // if cropping is enabled calculate cropping parameters
    if ($thumb_use == 'ex') {
        $thb_width = $CONFIG['thumb_width'];
        $thb_height = $CONFIG['thumb_height'];
        if ($new_size == $thb_width) {
            $crop = 1;
            switch ($CONFIG['thumb_method']) {
                //cropping parameters for ImageMagick
                case "im":
                    $resize_commands = "";
                    if ($srcWidth / $srcHeight > $thb_width / $thb_height) {
                        $resize_commands .= "-resize x" . $thb_height;
                        $resized_w = $thb_height / $srcHeight * $srcWidth;
                        $resize_commands .= " -crop " . $thb_width . "x" . $thb_height . "+" . round(($resized_w - $thb_width) / 2) . "+0";
                    } else {
                        $resize_commands .= "-resize " . $thb_width;
                        $resized_h = $thb_width / $srcWidth * $srcHeight;
                        $resize_commands .= " -crop " . $thb_width . "x" . $thb_height . "+0+" . round(($resized_h - $thb_height) / 2);
                    }
                    break;
                    // cropping parameters for GD2
                // cropping parameters for GD2
                default:
                    if ($srcHeight < $srcWidth) {
                        $ratio = (double) ($srcHeight / $thb_height);
                        $cpyWidth = round($thb_width * $ratio);
                        if ($cpyWidth > $srcWidth) {
                            $ratio = (double) ($srcWidth / $thb_width);
                            $cpyWidth = $srcWidth;
                            $cpyHeight = round($thb_height * $ratio);
                            $xOffset = 0;
                            $yOffset = round(($srcHeight - $cpyHeight) / 2);
                        } else {
                            $cpyHeight = $srcHeight;
                            $xOffset = round(($srcWidth - $cpyWidth) / 2);
                            $yOffset = 0;
                        }
                    } else {
                        $ratio = (double) ($srcWidth / $thb_width);
                        $cpyHeight = round($thb_height * $ratio);
                        if ($cpyHeight > $srcHeight) {
                            $ratio = (double) ($srcHeight / $thb_height);
                            $cpyHeight = $srcHeight;
                            $cpyWidth = round($thb_width * $ratio);
                            $xOffset = round(($srcWidth - $cpyWidth) / 2);
                            $yOffset = 0;
                        } else {
                            $cpyWidth = $srcWidth;
                            $xOffset = 0;
                            $yOffset = round(($srcHeight - $cpyHeight) / 2);
                        }
                    }
                    $destWidth = $thb_width;
                    $destHeight = $thb_height;
                    $srcWidth = $cpyWidth;
                    $srcHeight = $cpyHeight;
                    break;
            }
        } else {
            $ratio = max($srcWidth, $srcHeight) / $new_size;
        }
    } elseif ($thumb_use == 'wd') {
        // resize method width
        $ratio = $srcWidth / $new_size;
    } elseif ($thumb_use == 'ht') {
        // resize method height
        $ratio = $srcHeight / $new_size;
//.........这里部分代码省略.........
开发者ID:stephenjschaefer,项目名称:APlusPhotography,代码行数:101,代码来源:picmgmt.inc.php

示例4:

/**
 * cpg_filter_page_html()
 *
 * Executes page_html filter on all plugins
 *
 * @param string HTML
 * @return string HTML
 **/
function &cpg_filter_page_html(&$html)
{
    return CPGPluginAPI::filter('page_html', $html);
}
开发者ID:CatBerg-TestOrg,项目名称:coppermine_1.6.x,代码行数:12,代码来源:plugin_api.inc.php

示例5: theme_html_picture


//.........这里部分代码省略.........
    }
    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }
    $CURRENT_PIC_DATA['menu'] = html_picture_menu();
    //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';
    if ($CONFIG['make_intermediate'] && $condition) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }
    //thumb cropping
    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width'], 'normal');
    $pic_title = '';
    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);
    if ($mime_content['content'] == 'movie' || $mime_content['content'] == 'audio') {
        if ($CURRENT_PIC_DATA['pwidth'] == 0 || $CURRENT_PIC_DATA['pheight'] == 0) {
            $CURRENT_PIC_DATA['pwidth'] = 320;
            // Default width
            // Set default height; if file is a movie
            if ($mime_content['content'] == 'movie') {
                $CURRENT_PIC_DATA['pheight'] = 240;
                // Default height
            }
        }
        $ctrl_offset['mov'] = 15;
        $ctrl_offset['wmv'] = 45;
        $ctrl_offset['swf'] = 0;
        $ctrl_offset['rm'] = 0;
        $ctrl_offset_default = 45;
        $ctrl_height = isset($ctrl_offset[$mime_content['extension']]) ? $ctrl_offset[$mime_content['extension']] : $ctrl_offset_default;
        $image_size['whole'] = 'width="' . $CURRENT_PIC_DATA['pwidth'] . '" height="' . ($CURRENT_PIC_DATA['pheight'] + $ctrl_height) . '"';
    }
    if ($mime_content['content'] == 'image') {
        if (isset($image_size['reduced'])) {
            $imginfo = getimagesize($picture_url);
            $winsizeX = $CURRENT_PIC_DATA['pwidth'] + $CONFIG['fullsize_padding_x'];
            //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight'] + $CONFIG['fullsize_padding_y'];
            //the +'s are the mysterious FF and IE paddings
            if ($CONFIG['transparent_overlay'] == 1) {
                $pic_html = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td background=\"" . $picture_url . "\" width=\"{$imginfo[0]}\" height=\"{$imginfo[1]}\" class=\"image\">";
                $pic_html .= "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid={$pid}&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width={$winsizeX},height={$winsizeY}')\">";
                $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
                $pic_html .= "<img src=\"images/image.gif?id=" . floor(rand() * 1000 + rand()) . "\" width={$imginfo[0]} height={$imginfo[1]}  border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
                $pic_html .= "</a>\n </td></tr></table>";
            } else {
                $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid={$pid}&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width={$winsizeX},height={$winsizeY}')\">";
                $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
                $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
                $pic_html .= "</a>\n";
            }
        } else {
            if ($CONFIG['transparent_overlay'] == 1) {
                $pic_html = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td background=\"" . $picture_url . "\" width=\"{$CURRENT_PIC_DATA['pwidth']}\" height=\"{$CURRENT_PIC_DATA['pheight']}\" class=\"image\">";
                $pic_html .= "<img src=\"images/image.gif?id=" . floor(rand() * 1000 + rand()) . "\" width={$CURRENT_PIC_DATA['pwidth']} height={$CURRENT_PIC_DATA['pheight']} border=\"0\" alt=\"\" /><br />\n";
                $pic_html .= "</td></tr></table>";
            } else {
                $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
            }
        }
    } elseif ($mime_content['content'] == 'document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA, 'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"" . $pic_thumb_url . "\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = $CONFIG['media_autostart'] ? 'true' : 'false';
        $players['WMP'] = array('id' => 'MediaPlayer', 'clsid' => 'classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" ', 'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ', 'mime' => 'type="application/x-mplayer2" ');
        $players['RMP'] = array('id' => 'RealPlayer', 'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ', 'codebase' => '', 'mime' => 'type="audio/x-pn-realaudio-plugin" ');
        $players['QT'] = array('id' => 'QuickTime', 'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ', 'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ', 'mime' => 'type="video/x-quicktime" ');
        $players['SWF'] = array('id' => 'SWFlash', 'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ', 'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ', 'mime' => 'type="application/x-shockwave-flash" ');
        $players['UNK'] = array('id' => 'DefaultPlayer', 'clsid' => '', 'codebase' => '', 'mime' => '');
        if (isset($_COOKIE[$CONFIG['cookie_name'] . '_' . $mime_content['extension'] . 'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'] . '_' . $mime_content['extension'] . 'player'];
        } else {
            $user_player = $mime_content['player'];
        }
        // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }
        $player = $players[$user_player];
        $pic_html = '<object id="' . $player['id'] . '" ' . $player['classid'] . $player['codebase'] . $player['mime'] . $image_size['whole'] . '>';
        $pic_html .= "<param name=\"autostart\" value=\"{$autostart}\" /><param name=\"src\" value=\"" . $picture_url . "\" />";
        $pic_html .= '<embed ' . $image_size['whole'] . ' src="' . $picture_url . '" autostart="' . $autostart . '" ' . $player['mime'] . '></embed>';
        $pic_html .= "</object><br />\n";
    }
    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';
    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data', $CURRENT_PIC_DATA);
    $params = array('{CELL_HEIGHT}' => '100', '{IMAGE}' => $CURRENT_PIC_DATA['header'] . $CURRENT_PIC_DATA['html'] . $CURRENT_PIC_DATA['footer'], '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'], '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']), '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']));
    return template_eval($template_display_media, $params);
}
开发者ID:phill104,项目名称:branches,代码行数:101,代码来源:theme.php

示例6: unserialize

    if (mysql_num_rows($result)) {
        // This album has a password.
        // Check whether the cookie is set for the current albums password
        if (!empty($_COOKIE[$CONFIG['cookie_name'] . '_albpw'])) {
            $alb_pw = unserialize($_COOKIE[$CONFIG['cookie_name'] . '_albpw']);
            // Check whether the alubm id in the cookie is same as that of the album id send by get
            if (isset($alb_pw[$album]) && ctype_alnum($alb_pw[$album])) {
                $sql = "SELECT aid FROM " . $CONFIG['TABLE_ALBUMS'] . " WHERE MD5(alb_password)='{$alb_pw[$album]}' AND aid='{$album}'";
                $result = cpg_db_query($sql);
                if (mysql_num_rows($result)) {
                    $valid = true;
                    //The album password is correct. Show the album details.
                    get_private_album_set();
                }
            }
        }
    } else {
        // Album with no password. Might be a private or normal album. Just set valid as true.
        $valid = true;
    }
}
$META_ALBUM_SET = $ALBUM_SET;
//temporary assignment until we are sure we are keeping the $META_ALBUM_SET functionality.
CPGPluginAPI::filter('post_breadcrumb', null);
if (!$valid) {
    form_albpw();
} else {
    display_thumbnails($album, isset($cat) ? $cat : 0, $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
}
pagefooter();
ob_end_flush();
开发者ID:alencarmo,项目名称:OCF,代码行数:31,代码来源:thumbnails.php

示例7: endtable

                                        <tr>
                                                <td class="tableh2">{$lang_search_php['albcatfields']}:</td>
                                                <td class="tableh2">&nbsp;</td>
                                        </tr>
                                        <tr>
                                                <td><input type="checkbox" name="album_title" id="album_title" class="checkbox" /><label for="album_title" class="clickable_option">{$lang_search_php['album_title']}</label></td>
                                                <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                                <td><input type="checkbox" name="category_title" id="category_title" class="checkbox" /><label for="category_title" class="clickable_option">{$lang_search_php['category_title']}</label></td>
                                                <td>&nbsp;</td>
                                        </tr>
                                </table>
                        </td>
                </tr>
EOT;
$text .= endtable(true);
$text .= '</form>';
$text = CPGPluginAPI::filter('search_form', $text);
echo $text;
if ($CONFIG['clickable_keyword_search'] != 0) {
    include 'include/keyword.inc.php';
}
echo <<<EOT
      <script language="javascript" type="text/javascript">
      <!--
      document.searchcpg.search.focus();
      -->
      </script>
EOT;
pagefooter();
开发者ID:CatBerg-TestOrg,项目名称:coppermine,代码行数:31,代码来源:search.php

示例8: cpg_display_help

EOT;
// captcha code
if ($CONFIG['ecard_captcha'] == 1 || $CONFIG['ecard_captcha'] == 2 && !USER_ID) {
    $help = cpg_display_help('f=empty.htm&amp;h=lang_common[captcha_help_title]&amp;t=lang_common[captcha_help]', 470, 245);
    $captcha_print = <<<EOT
    <tr>
        <td class="tableb">
            {$lang_common['confirm']}&nbsp;{$help}
        </td>
        <td class="tableb" colspan="2">
            <input type="text" name="confirmCode" id="confirmCode" size="5" maxlength="5" class="textinput" />
            <img src="captcha.php" align="middle" border="0" alt="" />
        </td>
</tr>
EOT;
    $captcha_print = CPGPluginAPI::filter('captcha_ecard_print', $captcha_print);
    echo $captcha_print;
}
echo <<<EOT
    <tr>
        <td colspan="3" align="center" class="tablef">
            <button type="submit" class="button" name="preview" id="preview" value="{$lang_ecard_php['preview_button']}">{$icon_array['preview']}{$lang_ecard_php['preview_button']}</button>
            &nbsp;&nbsp;
            <button type="submit" class="button" name="submit" id="submit" value="{$lang_ecard_php['submit_button']}">{$icon_array['ok']}{$lang_ecard_php['submit_button']}</button>
        </td>
    </tr>
EOT;
endtable();
list($timestamp, $form_token) = getFormToken();
echo <<<EOT
<input type="hidden" name="form_token" value="{$form_token}" />
开发者ID:CatBerg-TestOrg,项目名称:coppermine,代码行数:31,代码来源:ecard.php

示例9: foreach

 foreach ($db_fields as $value) {
     print '    <td class="' . $row_style_class . '">' . $LINEBREAK;
     if (${$value} == 1) {
         if ($value == 'browser' && array_key_exists($row[$value], $browserArray)) {
             print '      <img src="images/browser/' . $browserArray[$row[$value]] . '" border="0" title="' . $row[$value] . '" alt="" />' . $LINEBREAK;
         } elseif ($value == 'os' && array_key_exists($row[$value], $osArray)) {
             print '      <img src="images/os/' . $osArray[$row[$value]] . '" border="0" title="' . $row[$value] . '" alt="" />' . $LINEBREAK;
         } elseif ($value == 'uid') {
             if ($row[$value] != 0) {
                 $user_data = $cpg_udb->get_user_infos($row[$value]);
                 print '      <a href="profile.php?uid=' . $row[$value] . '">' . $user_data['user_name'] . '</a>' . $LINEBREAK;
             } else {
                 print '      <span title="' . $lang_stat_details_php['guest'] . '">-</span>' . $LINEBREAK;
             }
         } elseif ($value == 'ip') {
             list($row['ip_detail']) = CPGPluginAPI::filter('ip_information', array('', $row[$value]));
             print '      ' . $row[$value] . $row['ip_detail'] . $LINEBREAK;
         } else {
             print '      ' . $row[$value] . $LINEBREAK;
         }
     }
     print '    </td>' . $LINEBREAK;
 }
 if ($pid == '') {
     print '    <td class="' . $row_style_class . '">' . $LINEBREAK;
     if ($file == 1) {
         $thumb_url = get_pic_url($row, 'thumb');
         if (!is_image($row['filename'])) {
             $image_info = cpg_getimagesize($thumb_url);
             $row['pwidth'] = $image_info[0];
             $row['pheight'] = $image_info[1];
开发者ID:CatBerg-TestOrg,项目名称:coppermine,代码行数:31,代码来源:stat_details.php

示例10: html_picinfo

function html_picinfo()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR, $FAVPICS, $REFERER;
    global $album, $lang_picinfo, $lang_display_image_php, $lang_byte_units, $lastup_date_fmt;
    if ($CURRENT_PIC_DATA['owner_id'] && $CURRENT_PIC_DATA['owner_name']) {
        $owner_link = '<a href ="profile.php?uid=' . $CURRENT_PIC_DATA['owner_id'] . '">' . $CURRENT_PIC_DATA['owner_name'] . '</a> ';
    } else {
        $owner_link = '';
    }
    if (GALLERY_ADMIN_MODE && $CURRENT_PIC_DATA['pic_raw_ip']) {
        if ($CURRENT_PIC_DATA['pic_hdr_ip']) {
            $ipinfo = ' (' . $CURRENT_PIC_DATA['pic_hdr_ip'] . '[' . $CURRENT_PIC_DATA['pic_raw_ip'] . ']) / ';
        } else {
            $ipinfo = ' (' . $CURRENT_PIC_DATA['pic_raw_ip'] . ') / ';
        }
    } else {
        if ($owner_link) {
            $ipinfo = '/ ';
        } else {
            $ipinfo = '';
        }
    }
    $info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
    $info[$lang_picinfo['Album name']] = '<span class="alblink">' . $owner_link . '/ <a href="thumbnails.php?album=' . $CURRENT_PIC_DATA['aid'] . '">' . $CURRENT_ALBUM_DATA['title'] . '</a></span>';
    if ($CURRENT_PIC_DATA['votes'] > 0) {
        if (defined('THEME_HAS_RATING_GRAPHICS')) {
            $prefix = $THEME_DIR;
        } else {
            $prefix = '';
        }
        if (GALLERY_ADMIN_MODE) {
            $width = 800;
            $height = 500;
        } else {
            $width = 400;
            $height = 250;
        }
        $detailsLink = $CONFIG['vote_details'] ? ' (<a href="#" onclick="MM_openBrWindow(\'stat_details.php?type=vote&amp;pid=' . $CURRENT_PIC_DATA['pid'] . '&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;rating=1&amp;referer=1&amp;browser=1&amp;os=1\',\'\',\'resizable=yes,width=' . $width . ',height=' . $height . ',top=50,left=50,scrollbars=yes\'); return false;">' . $lang_picinfo['details'] . '</a>)' : '';
        $info[sprintf($lang_picinfo['Rating'], $CURRENT_PIC_DATA['votes'])] = '<img width="65" height="14" src="plugins/enlargeit/rating/rating' . round($CURRENT_PIC_DATA['pic_rating'] / 2000) . '.gif" align="middle" alt="" />' . $detailsLink;
    }
    if ($CURRENT_PIC_DATA['keywords'] != "") {
        $info[$lang_picinfo['Keywords']] = '<span class="alblink">' . preg_replace("/(\\S+)/", "<a href=\"thumbnails.php?album=search&amp;search=\\1\">\\1</a>", $CURRENT_PIC_DATA['keywords']) . '</span>';
    }
    for ($i = 1; $i <= 4; $i++) {
        if ($CONFIG['user_field' . $i . '_name']) {
            if ($CURRENT_PIC_DATA['user' . $i] != "") {
                $info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);
            }
        }
    }
    $info[$lang_picinfo['File Size']] = $CURRENT_PIC_DATA['filesize'] > 10240 ? ($CURRENT_PIC_DATA['filesize'] >> 10) . '&nbsp;' . $lang_byte_units[1] : $CURRENT_PIC_DATA['filesize'] . '&nbsp;' . $lang_byte_units[0];
    $info[$lang_picinfo['File Size']] = '<span dir="ltr">' . $info[$lang_picinfo['File Size']] . '</span>';
    $info[$lang_picinfo['Date Added']] = localised_date($CURRENT_PIC_DATA['ctime'], $lastup_date_fmt);
    $info[$lang_picinfo['Dimensions']] = sprintf($lang_display_image_php['size'], $CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']);
    $detailsLink = $CURRENT_PIC_DATA['hits'] && $CONFIG['hit_details'] && GALLERY_ADMIN_MODE ? ' (<a href="#" onclick="MM_openBrWindow(\'stat_details.php?type=hits&amp;pid=' . $CURRENT_PIC_DATA['pid'] . '&amp;sort=sdate&amp;dir=&amp;sdate=1&amp;ip=1&amp;search_phrase=1&amp;referer=1&amp;browser=1&amp;os=1\',\'\',\'resizable=yes,width=800,height=500,top=50,left=50,scrollbars=yes\'); return false;">' . $lang_picinfo['details'] . '</a>)' : '';
    $info[$lang_picinfo['Displayed']] = sprintf($lang_display_image_php['views'], $CURRENT_PIC_DATA['hits']);
    $info[$lang_picinfo['Displayed']] .= $detailsLink;
    $path_to_pic = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
    if ($CONFIG['read_exif_data']) {
        $exif = exif_parse_file($path_to_pic);
    }
    if (isset($exif) && is_array($exif)) {
        array_walk($exif, 'sanitize_data');
        $info = array_merge($info, $exif);
    }
    if ($CONFIG['read_iptc_data']) {
        $iptc = get_IPTC($path_to_pic);
    }
    if (isset($iptc) && is_array($iptc)) {
        array_walk($iptc, 'sanitize_data');
        if (!empty($iptc['Title'])) {
            $info[$lang_picinfo['iptcTitle']] = $iptc['Title'];
        }
        if (!empty($iptc['Copyright'])) {
            $info[$lang_picinfo['iptcCopyright']] = $iptc['Copyright'];
        }
        if (!empty($iptc['Keywords'])) {
            $info[$lang_picinfo['iptcKeywords']] = implode(' ', $iptc['Keywords']);
        }
        if (!empty($iptc['Category'])) {
            $info[$lang_picinfo['iptcCategory']] = $iptc['Category'];
        }
        if (!empty($iptc['SubCategories'])) {
            $info[$lang_picinfo['iptcSubCategories']] = implode(' ', $iptc['SubCategories']);
        }
    }
    /**
     * Filter file information
     */
    $info = CPGPluginAPI::filter('file_info', $info);
    return theme_html_picinfo($info);
}
开发者ID:phill104,项目名称:branches,代码行数:92,代码来源:enl_info.php

示例11: add_picture

function add_picture($aid, $filepath, $filename, $position = 0, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '', $iwidth = 0, $iheight = 0)
{
    global $CONFIG, $ERROR, $USER_DATA, $PIC_NEED_APPROVAL;
    global $lang_errors;
    $image = $CONFIG['fullpath'] . $filepath . $filename;
    $normal = $CONFIG['fullpath'] . $filepath . $CONFIG['normal_pfx'] . $filename;
    $thumb = $CONFIG['fullpath'] . $filepath . $CONFIG['thumb_pfx'] . $filename;
    if (!is_known_filetype($image)) {
        return false;
    } elseif (is_image($filename)) {
        $imagesize = getimagesize($image);
        if ($CONFIG['read_iptc_data']) {
            $iptc = get_IPTC($image);
            if (is_array($iptc) && !$title && !$caption && !$keywords) {
                //if any of those 3 are filled out we don't want to override them, they may be blank on purpose.
                $title = isset($iptc['Title']) ? $iptc['Title'] : $title;
                $caption = isset($iptc['Caption']) ? $iptc['Caption'] : $caption;
                $keywords = isset($iptc['Keywords']) ? implode(' ', $iptc['Keywords']) : $keywords;
            }
        }
        if ((USER_IS_ADMIN && $CONFIG['auto_resize'] == 1 || !USER_IS_ADMIN && $CONFIG['auto_resize'] > 0) && max($imagesize[0], $imagesize[1]) > $CONFIG['max_upl_width_height']) {
            //resize_image($image, $image, $CONFIG['max_upl_width_height'], $CONFIG['thumb_method'], $imagesize[0] > $CONFIG['max_upl_width_height'] ? 'wd' : 'ht');
            resize_image($image, $image, $CONFIG['max_upl_width_height'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);
            $imagesize = getimagesize($image);
        }
        if (!file_exists($thumb)) {
            if (!resize_image($image, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) {
                return false;
            }
        }
        if (max($imagesize[0], $imagesize[1]) > $CONFIG['picture_width'] && $CONFIG['make_intermediate'] && !file_exists($normal)) {
            if (!resize_image($image, $normal, $CONFIG['picture_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) {
                return false;
            }
        }
    } else {
        $imagesize[0] = $iwidth;
        $imagesize[1] = $iheight;
    }
    $image_filesize = filesize($image);
    $total_filesize = is_image($filename) ? $image_filesize + (file_exists($normal) ? filesize($normal) : 0) + filesize($thumb) : $image_filesize;
    // Test if disk quota exceeded
    if (!GALLERY_ADMIN_MODE && $USER_DATA['group_quota'] && $category == FIRST_USER_CAT + USER_ID) {
        $result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT + USER_ID) . "'");
        $record = mysql_fetch_array($result);
        $total_space_used = $record[0];
        mysql_free_result($result);
        if ($total_space_used + $total_filesize >> 10 > $USER_DATA['group_quota']) {
            @unlink($image);
            if (is_image($image)) {
                @unlink($normal);
                @unlink($thumb);
            }
            $msg = strtr($lang_errors['quota_exceeded'], array('[quota]' => $USER_DATA['group_quota'], '[space]' => $total_space_used >> 10));
            cpg_die(ERROR, $msg, __FILE__, __LINE__);
        }
    }
    // Test if picture requires approval
    if (GALLERY_ADMIN_MODE) {
        $approved = 'YES';
    } elseif (!$USER_DATA['priv_upl_need_approval'] && $category == FIRST_USER_CAT + USER_ID) {
        $approved = 'YES';
    } elseif (!$USER_DATA['pub_upl_need_approval'] && $category < FIRST_USER_CAT) {
        $approved = 'YES';
    } else {
        $approved = 'NO';
    }
    $PIC_NEED_APPROVAL = $approved == 'NO';
    // User ID is now recorded when in admin mode (casper)
    $user_id = USER_ID;
    $username = USER_NAME;
    // Populate Array to pass to plugins, then to SQL.
    $CURRENT_PIC_DATA['aid'] = $aid;
    $CURRENT_PIC_DATA['filepath'] = $filepath;
    $CURRENT_PIC_DATA['filename'] = $filename;
    $CURRENT_PIC_DATA['filesize'] = $image_filesize;
    $CURRENT_PIC_DATA['total_filesize'] = $total_filesize;
    $CURRENT_PIC_DATA['pwidth'] = $imagesize[0];
    $CURRENT_PIC_DATA['pheight'] = $imagesize[1];
    $CURRENT_PIC_DATA['owner_id'] = $user_id;
    $CURRENT_PIC_DATA['owner_name'] = $username;
    $CURRENT_PIC_DATA['title'] = $title;
    $CURRENT_PIC_DATA['caption'] = $caption;
    $CURRENT_PIC_DATA['keywords'] = $keywords;
    $CURRENT_PIC_DATA['approved'] = $approved;
    $CURRENT_PIC_DATA['user1'] = $user1;
    $CURRENT_PIC_DATA['user2'] = $user2;
    $CURRENT_PIC_DATA['user3'] = $user3;
    $CURRENT_PIC_DATA['user4'] = $user4;
    $CURRENT_PIC_DATA['pic_raw_ip'] = $raw_ip;
    $CURRENT_PIC_DATA['pic_hdr_ip'] = $hdr_ip;
    $CURRENT_PIC_DATA['position'] = $position;
    $CURRENT_PIC_DATA = CPGPluginAPI::filter('add_file_data', $CURRENT_PIC_DATA);
    $query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
    $result = cpg_db_query($query);
    return $result;
}
开发者ID:alencarmo,项目名称:OCF,代码行数:97,代码来源:picmgmt.inc.php

示例12: check_user_info

function check_user_info(&$error)
{
    global $CONFIG;
    global $lang_register_php, $lang_common, $lang_register_approve_email;
    global $lang_register_user_login, $lang_errors;
    $superCage = Inspekt::makeSuperCage();
    $user_name = trim(get_post_var('username'));
    $password = trim(get_post_var('password'));
    $password_again = trim(get_post_var('password_verification'));
    $email = trim(get_post_var('email'));
    $profile1 = $superCage->post->getEscaped('user_profile1');
    $profile2 = $superCage->post->getEscaped('user_profile2');
    $profile3 = $superCage->post->getEscaped('user_profile3');
    $profile4 = $superCage->post->getEscaped('user_profile4');
    $profile5 = $superCage->post->getEscaped('user_profile5');
    $profile6 = $superCage->post->getEscaped('user_profile6');
    $agree_disclaimer = $superCage->post->getEscaped('agree');
    $captcha_confirmation = $superCage->post->getEscaped('confirmCode');
    $sql = "SELECT null FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '{$user_name}'";
    $result = cpg_db_query($sql);
    if (mysql_num_rows($result)) {
        $error = '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_user_exists'] . '</li>';
        return false;
    }
    mysql_free_result($result);
    if (utf_strlen($user_name) < 2) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['username_warning2'] . '</li>';
    }
    if (!empty($CONFIG['global_registration_pw'])) {
        $global_registration_pw = get_post_var('global_registration_pw');
        if ($global_registration_pw != $CONFIG['global_registration_pw']) {
            $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_global_pw'] . '</li>';
        } elseif ($password == $CONFIG['global_registration_pw']) {
            $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_global_pass_same'] . '</li>';
        }
    }
    if (utf_strlen($password) < 2) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['password_warning1'] . '</li>';
    }
    if ($password == $user_name) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['password_warning2'] . '</li>';
    }
    if ($password != $password_again) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['password_verification_warning1'] . '</li>';
    }
    if (!Inspekt::isEmail($email)) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['email_warning2'] . '</li>';
    }
    if ($CONFIG['user_registration_disclaimer'] == 2 && $agree_disclaimer != 1) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_disclaimer'] . '</li>';
    }
    // Perform the ban check against email address and username
    $result = cpg_db_query("SELECT null FROM {$CONFIG['TABLE_BANNED']} WHERE user_name = '{$user_name}' AND brute_force = 0 LIMIT 1");
    if (mysql_num_rows($result)) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['user_name_banned'] . '</li>';
    }
    mysql_free_result($result);
    $result = cpg_db_query("SELECT null FROM {$CONFIG['TABLE_BANNED']} WHERE email = '{$email}' AND brute_force = 0 LIMIT 1");
    if (mysql_num_rows($result)) {
        $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['email_address_banned'] . '</li>';
    }
    mysql_free_result($result);
    // check captcha
    if ($CONFIG['registration_captcha'] != 0) {
        if (!captcha_plugin_enabled('register')) {
            require "include/captcha.inc.php";
            if (!PhpCaptcha::Validate($captcha_confirmation)) {
                $error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_errors['captcha_error'] . '</li>';
            }
        } else {
            $error = CPGPluginAPI::filter('captcha_register_validate', $error);
        }
    }
    if (!$CONFIG['allow_duplicate_emails_addr']) {
        $sql = "SELECT null FROM {$CONFIG['TABLE_USERS']} WHERE user_email = '{$email}'";
        $result = cpg_db_query($sql);
        if (mysql_num_rows($result)) {
            $error = '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_duplicate_email'] . '</li>';
        }
        mysql_free_result($result);
    }
    $error = CPGPluginAPI::filter('register_form_validate', $error);
    if ($error != '') {
        return false;
    }
    if ($CONFIG['reg_requires_valid_email'] || $CONFIG['admin_activation']) {
        $active = 'NO';
        list($usec, $sec) = explode(' ', microtime());
        $seed = (double) $sec + (double) $usec * 100000;
        srand($seed);
        $act_key = md5(uniqid(rand(), 1));
    } else {
        $active = 'YES';
        $act_key = '';
    }
    $encpassword = md5($password);
    $user_language = $CONFIG['lang'];
    $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} (user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6, user_language) VALUES (NOW(), '{$active}', '{$act_key}', '{$user_name}', '{$encpassword}', '{$email}', '{$profile1}', '{$profile2}', '{$profile3}', '{$profile4}', '{$profile5}', '{$profile6}', '{$user_language}')";
    $result = cpg_db_query($sql);
    $user_array = array();
//.........这里部分代码省略.........
开发者ID:stephenjschaefer,项目名称:APlusPhotography,代码行数:101,代码来源:register.php

示例13: getFormToken

/**
 * Get the form token and timestamp for the current user
 * this is calculated
 *
 * @return array ($timestamp, $token)
 */
function getFormToken($timestamp = null)
{
    global $raw_ip, $CONFIG;
    $superCage = Inspekt::makeSuperCage();
    if ($timestamp == null) {
        $timestamp = time();
    }
    $token_criteria_array = array('user_id' => USER_ID, 'site_tkn' => $CONFIG['site_token'], 'timestamp' => $timestamp);
    $token_criteria_array = CPGPluginAPI::filter('token_criteria', $token_criteria_array);
    $token_string = '';
    foreach ($token_criteria_array as $value) {
        $token_string .= $value;
    }
    $token = md5($token_string);
    return array($timestamp, $token);
}
开发者ID:stephenjschaefer,项目名称:APlusPhotography,代码行数:22,代码来源:functions.inc.php

示例14: list

 } else {
     $tableclass = 'tableb tableb_alternate';
 }
 // build a link to the author's profile if applicable
 if ($row['author_id'] != 0) {
     $profile_link_start = '<a href="profile.php?uid=' . $row['author_id'] . '">';
     $profile_link_end = '</a>';
 } else {
     $profile_link_start = '';
     $profile_link_end = '';
 }
 // Create the output of the IP address
 list($row['ip_detail']) = CPGPluginAPI::filter('ip_information', array('', $row['msg_raw_ip']));
 $ip_address_output = $row['msg_raw_ip'] . $row['ip_detail'];
 if ($row['msg_raw_ip'] != $row['msg_hdr_ip']) {
     list($row['ip_detail']) = CPGPluginAPI::filter('ip_information', array('', $row['msg_hdr_ip']));
     $ip_address_output .= '<br />' . $row['msg_hdr_ip'] . $row['ip_detail'];
 }
 // output the table rows
 echo <<<EOT
 <tr>
     <td class="{$tableclass}" valign="top" align="center">
         {$loopCounter}
     </td>
     <td class="{$tableclass}" valign="top" align="center">
         <input name="cid_array[]" id="check{$row['msg_id']}" type="checkbox" value="{$row['msg_id']}" {$checkbox_status} />
     </td>
     <td class="{$tableclass}" valign="top" align="left">
         {$comment_approval_status}
     </td>
     <td class="{$tableclass}" valign="top" align="center">
开发者ID:stephenjschaefer,项目名称:APlusPhotography,代码行数:31,代码来源:reviewcom.php

示例15: theme_display_thumbnails


//.........这里部分代码省略.........
        global $thumb;
        // make $thumb accessible to plugins
        foreach ($thumb_list as $thumb) {
            $i++;
            if ($mode == 'thumb') {
                if ($aid == 'lastalb') {
                    $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
                } elseif ($aid == 'random') {
                    // determine if thumbnail link targets should open in a pop-up
                    if ($CONFIG['thumbnail_to_fullsize'] == 1) {
                        // code for full-size pop-up
                        if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                            $target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
                        } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
                            $target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
                        } else {
                            $target = 'javascript:;" onClick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
                        }
                    } else {
                        $target = "displayimage.php?pid={$thumb['pid']}{$uid_link}";
                    }
                    $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
                } else {
                    // determine if thumbnail link targets should open in a pop-up
                    if ($CONFIG['thumbnail_to_fullsize'] == 1) {
                        // code for full-size pop-up
                        if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
                            $target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['login_needed'], '', '', '', '') . '\');';
                        } elseif (USER_ID && USER_ACCESS_LEVEL <= 2) {
                            $target = 'javascript:;" onClick="alert(\'' . sprintf($lang_errors['access_intermediate_only'], '', '', '', '') . '\');';
                        } else {
                            $target = 'javascript:;" onClick="MM_openBrWindow(\'displayimage.php?pid=' . $thumb['pid'] . '&fullsize=1\',\'' . uniqid(rand()) . '\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes,width=' . ((int) $thumb['pwidth'] + (int) $CONFIG['fullsize_padding_x']) . ',height=' . ((int) $thumb['pheight'] + (int) $CONFIG['fullsize_padding_y']) . '\');';
                        }
                    } else {
                        $target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&amp;pid={$thumb['pid']}{$uid_link}";
                    }
                    $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => $thumb['admin_menu']);
                }
            } else {
                // mode != 'thumb'
                // Used for mode = 'user' from list_users() in index.php
                $params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => "index.php?cat={$thumb['cat']}", '{THUMB}' => $thumb['image'], '{CAPTION}' => $thumb['caption'], '{ADMIN_MENU}' => '');
            }
            // Plugin Filter: allow plugin to modify or add tags to process
            $params = CPGPluginAPI::filter('theme_display_thumbnails_params', $params);
            echo template_eval($thumb_cell, $params);
            if ($i % $thumbcols == 0 && $i < count($thumb_list)) {
                echo $row_separator;
            }
        }
        // foreach $thumb
        unset($thumb);
        // unset $thumb to avoid conflicting with global
        for (; $i % $thumbcols; $i++) {
            echo $empty_cell;
        }
        echo $footer;
        // plugin addition
        if ($lightbox['message'] != '') {
            echo <<<EOT
\t\t<tr>
\t\t\t<td class="tableb" colspan="{$thumbcols}">
\t\t\t\t<div class="cpg_message_info">
\t\t\t\t\t{$lightbox['message']}
\t\t\t\t</div>
\t\t\t</td>
\t\t</tr>
EOT;
        }
        if (isset($lightbox['data']['activate_favkill'])) {
            $confirm = addslashes($lightbox['lang']['Confirm']);
            echo <<<EOT
\t\t<tr>
\t\t\t<td class="tablef" align="center" colspan="{$thumbcols}">
\t\t\t\t<button type="submit" class="button" value="{$lightbox['lang']['Remove selected']}">{$lightbox['icon']['delete']}{$lightbox['lang']['Remove selected']}</button>&nbsp;&nbsp;&nbsp;
\t\t\t\t<button type="submit" class="button" name="clear_favs" value="{$lightbox['lang']['Remove all']}" onclick="return confirm('{$confirm}');">{$lightbox['icon']['delete_all']}{$lightbox['lang']['Remove all']}</button>
\t\t\t</td>
\t\t</tr>
EOT;
        } elseif (isset($lightbox['data']['activate_favsel'])) {
            echo <<<EOT
\t\t<tr>
\t\t\t<td class="tablef" align="center" colspan="{$thumbcols}">
\t\t\t\t<button type="submit" class="button" value="{$lightbox['lang']['Add selected']}" title="{$lightbox['lang']['Add selected files to favorites']}">{$lightbox['icon']['add']}{$lightbox['lang']['Add selected']}</button>&nbsp;
\t\t\t\t<a href="thumbnails.php?album=favpics" title="{$lang_main_menu['fav_title']}" class="admin_menu">{$lightbox['icon']['favorites']}{$lang_main_menu['fav_lnk']}</a>
\t\t\t</td>
\t\t</tr>
EOT;
        }
        if ($display_tabs) {
            $params = array('{THUMB_COLS}' => $thumbcols, '{TABS}' => $tabs_html);
            echo template_eval($tabs, $params);
        }
        endtable();
        // plugin addition
        if (isset($lightbox['data']['activate_favsel'])) {
            echo '</form>';
        }
        echo $spacer;
    }
开发者ID:phill104,项目名称:branches,代码行数:101,代码来源:codebase.php


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