本文整理汇总了PHP中CPGPluginAPI类的典型用法代码示例。如果您正苦于以下问题:PHP CPGPluginAPI类的具体用法?PHP CPGPluginAPI怎么用?PHP CPGPluginAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CPGPluginAPI类的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;
}
示例2: mirror_configure
function mirror_configure()
{
global $CONFIG, $CPG_PLUGINS;
$icon_array['ok'] = cpg_fetch_icon('ok', 1);
$icon_array['cancel'] = cpg_fetch_icon('cancel', 1);
$allow_continue = 1;
echo <<<EOT
<form action="" method="post" name="mirror_config" id="mirror_config">
<ul>
EOT;
if ($CONFIG['transparent_overlay'] != '0') {
echo <<<EOT
<li>The mirror plugin doesn't work with the config option '<em>Insert a transparent overlay to minimize image theft</em>'. If you decide to continue, that option will be disabled for you. Don't turn it back on while using this plugin.</li>
EOT;
}
if (($plugin_id = CPGPluginAPI::installed('image_manipulation')) !== false) {
echo <<<EOT
<li>You have installed the plugin '<em>Image Manipulation (image_manipulation)</em>' that can't be run at the same time with the Mirror plugin. Return to the plugin manager and uninstall that other plugin first before installing this plugin.</li>
EOT;
$allow_continue = 0;
}
echo <<<EOT
</ul>
EOT;
if ($allow_continue == 1) {
echo <<<EOT
<input type="hidden" name="mirror_continue_anyway" id="mirror_continue_anyway" value="1" />
<button type="submit" class="button" name="submit" value="Continue anyway">{$icon_array['ok']}Continue anyway</button>
EOT;
}
echo <<<EOT
<a href="pluginmgr.php" class="admin_menu">{$icon_array['cancel']}Cancel</a>
EOT;
echo <<<EOT
</form>
EOT;
}
示例3: display_plugin_list
//.........这里部分代码省略.........
if ($installed_count == 0) {
echo '<tr><td colspan="4" class="tableb" align="center">' . $lang_pluginmgr_php['none_installed'] . '</td></tr>';
}
endtable();
echo '<p> </p>';
echo '<form name="cpgform" id="cpgform" action="pluginmgr.php?op=upload" method="post" enctype="multipart/form-data">';
$help_upload = ' ' . cpg_display_help('f=plugins.htm&as=plugin_manager_upload&ae=plugin_manager_upload_end&top=1', '640', '480');
$help_install = ' ' . cpg_display_help('f=plugins.htm&as=plugin_manager_install&ae=plugin_manager_install_end&top=1', '640', '480');
starttable('100%');
echo <<<EOT
<tr>
<td class="tableh1" width="90%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<strong><span class="statlink">{$lang_pluginmgr_php['n_plugins']}</span></strong>{$help_install}
</td>
<td align="right">
<input type="file" size="40" name="plugin" class="textinput" />
<input type="hidden" name="form_token" value="{$form_token}" />
<input type="hidden" name="timestamp" value="{$timestamp}" />
<input type="submit" class="button" value="{$lang_pluginmgr_php['upload']}" />
{$help_upload}
</td>
</tr>
</table>
</td>
<td colspan="3" class="tableh1" align="center" width="10%"><strong><span class="statlink">{$lang_pluginmgr_php['operation']}</span></strong></td>
</tr>
EOT;
$loop_counter = 0;
// Note: CPGPluginAPI::installed() works even if Plugin API is disabled.
foreach ($available_plugins as $path) {
if (($plugin_id = CPGPluginAPI::installed($path)) === false) {
// If codebase.php and configuration.php don't exist, skip this folder
if (!(file_exists('./plugins/' . $path . '/codebase.php') && file_exists('./plugins/' . $path . '/configuration.php'))) {
continue;
}
unset($extra_info);
unset($install_info);
include './plugins/' . $path . '/configuration.php';
$pluginPath = $path;
$safename = addslashes(str_replace(' ', '', $name));
if (isset($install_info) == TRUE) {
$extra = $install_info;
} else {
$extra = '';
}
if ($loop_counter == 0) {
$row_style_class = 'tableb';
} else {
$row_style_class = 'tableb tableb_alternate';
}
$loop_counter++;
if ($loop_counter > 1) {
$loop_counter = 0;
}
echo <<<EOT
<tr>
<td width="90%" class="{$row_style_class}">
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="maintable">
<tr>
<td colspan="2" class="tableh1">{$name} ({$pluginPath}): {$lang_pluginmgr_php['vers']}{$version}</td>
</tr>
<tr>
<td class="tableb tableb_alternate" width="20%" valign="top">{$lang_pluginmgr_php['author']}:</td>
示例4: list_users
/**
* list_users()
*
* Get a list of users galleries
*/
function list_users()
{
global $CONFIG, $PAGE;
global $lang_list_users, $template_user_list_info_box, $cpg_udb;
$user_count = 0;
$rowset = $cpg_udb->list_users_query($user_count);
if (!$rowset) {
msg_box($lang_list_users['user_list'], $lang_list_users['no_user_gal'], '', '', 'info');
return;
}
$user_per_page = $CONFIG['thumbcols'] * $CONFIG['thumbrows'];
$totalPages = ceil($user_count / $user_per_page);
$user_list = array();
foreach ($rowset as $user) {
$cpg_nopic_data = cpg_get_system_thumb('nopic.jpg', $user['user_id']);
$user_thumb = '<img src="' . $cpg_nopic_data['thumb'] . '" ' . $cpg_nopic_data['whole'] . ' class="image thumbnail" border="0" alt="" />';
$user_pic_count = $user['pic_count'];
$user_thumb_pid = $user['gallery_pid'] ? $user['gallery_pid'] : $user['thumb_pid'];
$user_album_count = $user['alb_count'];
if ($user_pic_count) {
$sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$user_thumb_pid}' AND approved='YES'";
$result = cpg_db_query($sql);
if ($result->numRows()) {
$picture = $result->fetchAssoc(true);
$pic_url = get_pic_url($picture, 'thumb');
if (!is_image($picture['filename'])) {
$image_info = cpg_getimagesize(urldecode($pic_url));
$picture['pwidth'] = $image_info[0];
$picture['pheight'] = $image_info[1];
}
//thumb cropping
//$image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
if (array_key_exists('system_icon', $picture) && $picture['system_icon'] == true) {
$image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size'], true, 'cat_thumb');
} else {
$image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size'], false, 'cat_thumb');
}
$user_thumb = "<img src=\"" . $pic_url . "\" class=\"image thumbnail\" {$image_size['geom']} border=\"0\" alt=\"\" />";
}
}
$albums_txt = sprintf($lang_list_users['n_albums'], $user_album_count);
$pictures_txt = sprintf($lang_list_users['n_pics'], $user_pic_count);
$params = CPGPluginAPI::filter('user_caption_params', array('{USER_NAME}' => $user['user_name'], '{USER_ID}' => $user['user_id'], '{ALBUMS}' => $albums_txt, '{PICTURES}' => $pictures_txt));
$caption = template_eval($template_user_list_info_box, $params);
$user_list[] = array('cat' => FIRST_USER_CAT + $user['user_id'], 'image' => $user_thumb, 'caption' => $caption);
}
theme_display_thumbnails($user_list, $user_count, '', '', 1, $PAGE, $totalPages, false, true, 'user');
}
示例5: display_plugin_list
//.........这里部分代码省略.........
</tr>
EOT;
}
if ($installed_count == 0) {
echo '<tr><td colspan="4" class="tableb" align="center">' . $lang_pluginmgr_php['none_installed'] . '</td></tr>';
}
endtable();
echo '<p> </p>';
echo '<form name="cpgform" id="cpgform" action="pluginmgr.php?op=upload" method="post" enctype="multipart/form-data">';
$help_upload = ' ' . cpg_display_help('f=plugins.htm&as=plugin_manager_upload&ae=plugin_manager_upload_end&top=1', '640', '480');
$help_install = ' ' . cpg_display_help('f=plugins.htm&as=plugin_manager_install&ae=plugin_manager_install_end&top=1', '640', '480');
starttable('100%');
echo <<<EOT
<tr>
<td class="tableh1" width="90%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">
<strong><span class="statlink">{$lang_pluginmgr_php['n_plugins']}</span></strong>{$help_install}
</td>
<td align="right">
<input type="file" size="40" name="plugin" class="textinput" />
<input type="submit" class="button" value="{$lang_pluginmgr_php['upload']}" />
{$help_upload}
</td>
</tr>
</table>
</td>
<td colspan="3" class="tableh1" align="center" width="10%"><strong><span class="statlink">{$lang_pluginmgr_php['operation']}</span></strong></td>
</tr>
EOT;
$loop_counter = 0;
foreach ($available_plugins as $path) {
if (($plugin_id = CPGPluginAPI::installed($path)) === false) {
// If codebase.php and configuration.php don't exist, skip this folder
if (!(file_exists('./plugins/' . $path . '/codebase.php') && file_exists('./plugins/' . $path . '/configuration.php'))) {
continue;
}
unset($extra_info);
unset($install_info);
include './plugins/' . $path . '/configuration.php';
$pluginPath = $path;
$safename = addslashes(str_replace(' ', '', $name));
if (isset($install_info) == TRUE) {
$extra = $install_info;
} else {
$extra = '';
}
if ($loop_counter == 0) {
$row_style_class = 'tableb';
} else {
$row_style_class = 'tableb tableb_alternate';
}
$loop_counter++;
if ($loop_counter > 1) {
$loop_counter = 0;
}
echo <<<EOT
<tr>
<td width="90%" class="{$row_style_class}">
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="maintable">
<tr>
<td colspan="2" class="tableh1">{$name} ({$pluginPath}): {$lang_pluginmgr_php['vers']}{$version}</td>
</tr>
<tr>
<td class="tableb tableb_alternate" width="20%" valign="top">{$lang_pluginmgr_php['author']}:</td>
示例6: uninstall
/**
* CPGPluginAPI::uninstall()
*
* Uninstalls a plugin and executes 'plugin_uninstall' action
*
* @param integer $plugin_id
* @return N/A
**/
function uninstall($plugin_id)
{
global $CONFIG, $USER_DATA, $CPG_PLUGINS, $thisplugin, $lang_plugin_api;
if (!isset($CPG_PLUGINS[$plugin_id])) {
return true;
}
// Grab the plugin from the global scope
$thisplugin =& $CPG_PLUGINS[$plugin_id];
// Grab the priority level, so you can shift the ones in the database
$priority = $thisplugin->priority;
// If plugin has an uninstall action, execute it
$uninstalled = CPGPluginAPI::action('plugin_uninstall', true, $plugin_id);
if (is_bool($uninstalled) && $uninstalled) {
$sql = 'delete from ' . $CONFIG['TABLE_PLUGINS'] . ' ' . 'where plugin_id=' . $plugin_id . ';';
$result = cpg_db_query($sql);
// Shift the plugins up
$sql = 'update ' . $CONFIG['TABLE_PLUGINS'] . ' set priority=priority-1 where priority>' . $priority . ';';
$result = cpg_db_query($sql);
unset($CPG_PLUGINS[$plugin_id]);
if ($CONFIG['log_mode']) {
log_write("Plugin '" . $name . "' uninstalled at " . date("F j, Y, g:i a"), CPG_GLOBAL_LOG);
}
return true;
// If $uninstalled is an integer then the plugin needs to be cleaned up; Return the value
} elseif (is_numeric($uninstalled)) {
return $uninstalled;
} else {
// The plugin's uninstall action failed
cpg_die(CRITICAL_ERROR, sprintf($lang_plugin_api['error_uninstall'], $thisplugin->name), __FILE__, __LINE__);
}
}
示例7: image_manipulation_configure
function image_manipulation_configure()
{
global $CONFIG, $CPG_PLUGINS, $lang_plugin_image_manipulation;
require './plugins/image_manipulation/init.inc.php';
$icon_array['ok'] = cpg_fetch_icon('ok', 1);
$icon_array['cancel'] = cpg_fetch_icon('cancel', 1);
$allow_continue = 1;
echo <<<EOT
<form action="" method="post" name="image_manipulation_config" id="image_manipulation_config">
<ul>
EOT;
if ($CONFIG['transparent_overlay'] != '0') {
echo <<<EOT
<li>{$lang_plugin_image_manipulation['transparent_overlay_warning']}
{$lang_plugin_image_manipulation['continue_will_disable_warning']}
{$lang_plugin_image_manipulation['do_not_turn_on_again']}</li>
EOT;
}
if (($plugin_id = CPGPluginAPI::installed('mirror')) !== false) {
$warning_coexist = sprintf($lang_plugin_image_manipulation['plugins_cant_coexist'], '<em>Mirror</em>');
echo <<<EOT
<li>{$warning_coexist}</li>
EOT;
$allow_continue = 0;
}
echo <<<EOT
</ul>
EOT;
if ($allow_continue == 1) {
echo <<<EOT
<input type="hidden" name="image_manipulation_continue_anyway" id="image_manipulation_continue_anyway" value="1" />
<button type="submit" class="button" name="submit" value="{$lang_plugin_image_manipulation['continue_anyway']}">{$icon_array['ok']}{$lang_plugin_image_manipulation['continue_anyway']}</button>
EOT;
}
echo <<<EOT
<a href="pluginmgr.php" class="admin_menu">{$icon_array['cancel']}{$lang_plugin_image_manipulation['cancel']}</a>
EOT;
echo <<<EOT
</form>
EOT;
}
示例8: set_js_var
// define some vars that need to exist in JS
set_js_var('lang_warning_dont_submit', $lang_admin_php['warning_dont_submit']);
set_js_var('lang_reset_to_default', $lang_admin_php['reset_to_default']);
set_js_var('lang_no_change_needed', $lang_admin_php['no_change_needed']);
set_js_var('display_reset_boxes', $CONFIG['display_reset_boxes_in_config']);
// Include the JS for admin.php
js_include('js/jquery.spinbutton.js');
js_include('js/admin.js');
$admin_data_array = $CONFIG;
$optionLoopCounter = 0;
$submit_icon = cpg_fetch_icon('ok', 1);
$factory_icon = cpg_fetch_icon('delete', 1);
require_once 'include/admin.inc.php';
// populate the array for the admin data (could later be done using an XML file)
// Filter upload choices to allow plugins to add upload methods
$config_data['user_settings']['upload_mechanism']['options'] = CPGPluginAPI::filter('upload_options', $config_data['user_settings']['upload_mechanism']['options']);
// loop through the config sections and populate the array that determines what sections to expand/collapse
$collapseSections_array = array();
// By default, all sections should be hidden. Let's populate the array first with all existing sections and then later remove the ones that are supposed to be expanded by default
foreach ($config_data as $key => $value) {
$collapseSections_array[] = $key;
}
$userMessage = '';
//The message that the will be displayed if something went wrong or to tell the user that we had success
$problemFields_array = array();
// we'll add field-wrapper-IDs to this array to visualize that something went wrong. Onload we'll assign the class "important" to the boxes that correspond to the array data
if ($superCage->post->keyExists('restore_config')) {
// user has chosen to factory-reset the config --- start
// first we check if the form token is valid
if (!checkFormToken()) {
cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__);
示例9: sprintf
} else {
$user_status = '';
}
if ($user_thumb != '') {
$user_thumb = '<td width="50%" valign="top" align="center">' . '<a href="thumbnails.php?album=lastupby&uid=' . $uid . '">' . '<span class="thumb_title">' . $lang_register_php['last_uploads'] . '<br />' . sprintf($lang_register_php['last_uploads_detail'], $user_data['user_name']) . '<br /></span>' . $user_thumb . '</a></td>';
}
$lastComArray = cpgUserLastComment($uid);
if ($lastComArray['count'] != 0) {
$lastcom = '<td width="50%" valign="top" align="center">' . '<a href="thumbnails.php?album=lastcomby&uid=' . $uid . '">' . '<span class="thumb_title">' . $lang_register_php['last_comments'] . '<br />' . sprintf($lang_register_php['last_comments_detail'], $user_data['user_name']) . '<br /></span>' . $lastComArray['thumb'] . '</a><br />';
$lastcom .= "<span class=\"thumb_caption\">" . localised_date($lastComArray['msg_date'], $lang_date['lastcom']) . '</span>' . "<span class=\"thumb_caption\">" . bb_decode(process_smilies($lastComArray['comment'])) . '</span></td>';
}
$quick_jump = $user_thumb . $lastcom ? '<table width="100%" border="0" cellspacing="5"><tr>' . $user_thumb . $lastcom . '</tr></table>' : '';
list($timestamp, $form_token) = getFormToken();
if ($uid == USER_ID) {
$adminLink = '<a href="profile.php?op=edit_profile" class="admin_menu">' . $lang_register_php['edit_my_profile'] . '</a>';
} elseif (GALLERY_ADMIN_MODE) {
$adminLink = '<a href="usermgr.php?op=edit&user_id=' . $uid . '&form_token=' . $form_token . '×tamp=' . $timestamp . '" class="admin_menu">' . $icon_array['edit'] . sprintf($lang_register_php['edit_xs_profile'], $user_data['user_name']) . '</a>';
} else {
$adminLink = '';
}
$form_data = array('username' => $user_data['user_name'], 'status' => $user_status, 'reg_date' => localised_date($user_data['user_regdate'], $lang_date['register']), 'group' => $user_data['group_name'], 'user_profile1' => $user_data['user_profile1'], 'user_profile2' => $user_data['user_profile2'], 'user_profile3' => $user_data['user_profile3'], 'user_profile4' => $user_data['user_profile4'], 'user_profile5' => $user_data['user_profile5'], 'user_profile6' => bb_decode($user_data['user_profile6']), 'user_thumb' => $quick_jump, 'pic_count' => cpgUserPicCount($uid), 'admin_link' => $adminLink);
$title = sprintf($lang_register_php['x_s_profile'], $user_data['user_name']);
pageheader($title);
// Displays the profile of any user
starttable(-1, cpg_fetch_icon('my_profile', 2) . $title, 2);
$profile_data = CPGPluginAPI::filter('profile_add_data', array(0 => $display_profile_form_param, 1 => $form_data));
make_form($display_profile_form_param, $form_data);
endtable();
pagefooter();
break;
}
示例10: getFormToken
<tr>
<td class="tableb" valign="top" align="right">
{$lang_contact_php['confirmation']} {$captcha_help}
</td>
<td class="tableb" valign="top">
<span id="captcha_wrapper" class="{$highlightFieldCSS}">
<input type="text" class="textinput" name="captcha" size="5" maxlength="5" value="" />
</span>
<img src="captcha.php" align="middle" border="0" alt="" />
</td>
<td class="tableb">
<span id="captcha_remark" style="display:{$captcha_remark_visibility}">{$captcha_remark}</span>
</td>
</tr>
EOT;
$captcha_print = CPGPluginAPI::filter('captcha_contact_print', $captcha_print);
print $captcha_print;
}
list($timestamp, $form_token) = getFormToken();
// submit button
print <<<EOT
<tr>
<td class="tableb" valign="top" align="right">
<input type="hidden" name="form_token" value="{$form_token}" />
<input type="hidden" name="timestamp" value="{$timestamp}" />
</td>
<td class="tableb" valign="top" colspan="2">
<button type="submit" class="button" name="submit" id="submit" value="{$lang_common['go']}">{$icon_array['ok']}{$lang_common['go']}</button>
</td>
</tr>
EOT;
示例11: list_users
//.........这里部分代码省略.........
-->
</script>
EOT;
starttable('100%');
if (isset($_POST['username'])) {
$search_filter = '<td class="tableh1" align="center">' . $lang_usermgr_php['search_result'] . '«' . $_POST['username'] . '»</td>';
} else {
$search_filter = '';
}
$help = ' ' . cpg_display_help('f=users.htm&as=user_cp&ae=user_cp_end&top=1', '650', '500');
echo <<<EOT
<tr>
<td colspan="{$number_of_columns}" class="tableh1">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="tableh1">
EOT;
if (!$lim_user) {
echo '<h2>' . $lang_usermgr_php['user_manager'] . $help . '</h2>';
} else {
echo '<h2>' . $lang_usermgr_php['memberlist'] . '</h2>';
}
echo <<<EOT
</td>
{$search_filter}
<td class="tableh1" align="right"><b>{$lang_usermgr_php['sort_by']}</b>:
{$lb}</td>
</tr>
</table>
</td>
</tr>
EOT;
// Accept header addons
echo CPGPluginAPI::filter('usermgr_header', '');
print '<form method="get" action="delete.php" name="editForm" id="cpgform">' . "\n";
print '<input type="hidden" name="id" value="" />';
if (!$lim_user) {
echo <<<EOT
<tr>
<td class="tableh1" align="center"><input type="checkbox" {$makereadonly}name="checkAll" onClick="selectAll(this,'u');" class="checkbox" title="{$lang_common['check_uncheck_all']}" /></td>
<td class="tableh1" colspan="2"><b><span class="statlink">{$lang_usermgr_php['name']}</span></b>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=name_a"><img src="images/ascending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['name_a']}" /></a>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=name_d"><img src="images/descending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['name_d']}" /></a>
</td>
<td class="tableh1"><b><a href="groupmgr.php" class="statlink">{$lang_usermgr_php['group']}</a></b>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=group_a"><img src="images/ascending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['group_a']}" /></a>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=group_d"><img src="images/descending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['group_d']}" /></a>
</td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['registered_on']}</span></b>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=reg_a"><img src="images/ascending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['reg_a']}" /></a>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=reg_d"><img src="images/descending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['reg_d']}" /></a>
</td>
<td class="tableh1"><b><span class="statlink">{$lang_usermgr_php['last_visit']}</span></b>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=lv_a"><img src="images/ascending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['lv_a']}" /></a>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=lv_d"><img src="images/descending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['lv_d']}" /></a>
</td>
<td class="tableh1" align="center"><b><span class="statlink">{$lang_usermgr_php['pictures']}</span></b>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=pic_a"><img src="images/ascending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['pic_a']}" /></a>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=pic_d"><img src="images/descending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['pic_d']}" /></a>
</td>
<td class="tableh1" align="center"><b><span class="statlink">{$lang_usermgr_php['disk_space_used']}</span></b>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=disku_a"><img src="images/ascending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['disku_a']}" /></a>
<a href="{$_SERVER['PHP_SELF']}?page={$page}&sort=disku_d"><img src="images/descending.gif" width="9" height="9" border="0" alt="" title="{$lang_usermgr_php['disku_d']}" /></a>
</td>
<td class="tableh1" align="center"><b><span class="statlink">{$lang_usermgr_php['disk_space_quota']}</span></b>
示例12: cpg_die
// Check that the file uploaded has a valid extension
if (!preg_match("/(.+)\\.(.*?)\\Z/", $picture_name, $matches)) {
$matches[1] = 'invalid_fname';
$matches[2] = 'xxx';
}
if ($matches[2] == '' || !is_known_filetype($matches)) {
cpg_die(ERROR, $lang_db_input_php['err_invalid_fext'] . ' ' . $CONFIG['allowed_file_extensions'], __FILE__, __LINE__);
}
// Create a unique name for the uploaded file
$nr = 0;
$picture_name = $matches[1] . '.' . $matches[2];
while (file_exists($dest_dir . $picture_name)) {
$picture_name = $matches[1] . '~' . $nr++ . '.' . $matches[2];
}
$uploaded_pic = $dest_dir . $picture_name;
CPGPluginAPI::action('upload_html_pre_move', $superCage->files->getRaw("/userpicture/tmp_name"));
// Move the picture into its final location
// getRaw is safe here since this filename is generated by the server
if (!move_uploaded_file($superCage->files->getRaw("/userpicture/tmp_name"), $uploaded_pic)) {
cpg_die(CRITICAL_ERROR, sprintf($lang_db_input_php['err_move'], $picture_name, $dest_dir), __FILE__, __LINE__, true);
}
// Change file permission
chmod($uploaded_pic, octdec($CONFIG['default_file_mode']));
// Get picture information
// Check that picture file size is lower than the maximum allowed
if (filesize($uploaded_pic) > $CONFIG['max_upl_size'] * 1024) {
@unlink($uploaded_pic);
cpg_die(ERROR, sprintf($lang_db_input_php['err_imgsize_too_large'], $CONFIG['max_upl_size']), __FILE__, __LINE__);
} elseif (is_image($picture_name)) {
$imginfo = cpg_getimagesize($uploaded_pic);
if ($imginfo == null) {
示例13: cpg_mail
function cpg_mail($to, $subject, $msg_body = '', $type = 'text/plain', $sender_name = '', $sender_email = '', $msg_body_plaintext = '')
{
global $CONFIG, $lang_charset, $HTML_SUBST;
// makeshift plaintext if not set
if (!$msg_body_plaintext) {
$msg_body_plaintext = strip_tags($msg_body);
}
// convert possible special HTML entities to characters
$subject = htmlspecialchars_decode($subject, ENT_QUOTES);
// send mails to ALL admins - not bridged only
if ($to == 'admin') {
if (UDB_INTEGRATION == 'coppermine') {
$to = array($CONFIG['gallery_admin_email']);
$result = cpg_db_query("SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_group = 1");
while ($row = mysql_fetch_assoc($result)) {
if (!empty($row['user_email'])) {
$to[] = $row['user_email'];
}
}
$to = array_unique($to);
} else {
$to = array($CONFIG['gallery_admin_email']);
}
} else {
$to = array($to);
}
$to = CPGPluginAPI::filter('cpg_mail_to_email', $to);
if ($sender_name == '') {
$sender_name = $CONFIG['gallery_name'];
}
if ($sender_email == '') {
$sender_email = $CONFIG['gallery_admin_email'];
}
$sender_email = CPGPluginAPI::filter('cpg_mail_sender_email', $sender_email);
$sender_name = strtr($sender_name, array_flip($HTML_SUBST));
$charset = $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'];
$mail = new cpg_PHPmailer();
if ($CONFIG['smtp_host']) {
$mail->IsSMTP();
$mail->Host = $CONFIG['smtp_host'];
if ($CONFIG['smtp_username']) {
$mail->SMTPAuth = true;
$mail->Username = $CONFIG['smtp_username'];
$mail->Password = $CONFIG['smtp_password'];
} else {
$mail->SMTPAuth = false;
}
} else {
$mail->IsMail();
}
$mail->IsHTML(true);
foreach ($to as $email) {
$mail->AddAddress($email);
}
$mail->From = $sender_email;
$mail->FromName = $sender_name;
$mail->Subject = $subject;
$mail->Body = $msg_body;
$mail->AltBody = $msg_body_plaintext;
$mail->CharSet = $charset;
$mail->Sender = $CONFIG['gallery_admin_email'];
if ($CONFIG['smtp_host'] && $CONFIG['log_mode'] == CPG_LOG_ALL) {
$mail->SMTPDebug = 2;
ob_start();
}
$result = $mail->Send();
if ($CONFIG['smtp_host'] && $CONFIG['log_mode'] == CPG_LOG_ALL) {
$log = ob_get_clean();
log_write($log, CPG_MAIL_LOG);
}
return $result;
}
示例14: theme_display_thumbnails
//.........这里部分代码省略.........
}
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$date_link = $date == '' ? '' : '&date=' . $date;
if ($superCage->get->getInt('uid')) {
$uid_link = '&uid=' . $superCage->get->getInt('uid');
} else {
$uid_link = '';
}
$theme_thumb_tab_tmpl = $template_tab_display;
if ($mode == 'thumb') {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $date_link . $uid_link . '&page=%d'));
} else {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
$theme_thumb_tab_tmpl['page_link'] = strtr($theme_thumb_tab_tmpl['page_link'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
}
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';
$tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
if (!GALLERY_ADMIN_MODE && stripos($template_thumb_view_title_row, 'admin_buttons') !== false) {
template_extract_block($template_thumb_view_title_row, 'admin_buttons');
}
// The sort order options are not available for meta albums
if ($sort_options) {
if (GALLERY_ADMIN_MODE) {
$param = array('{ALBUM_ID}' => $aid, '{CAT_ID}' => $cat > 0 ? $cat : $CURRENT_ALBUM_DATA['category'], '{MODIFY}' => cpg_fetch_icon('modifyalb', 1) . $lang_common['album_properties'], '{PARENT_CAT}' => cpg_fetch_icon('category', 1) . $lang_common['parent_category'], '{EDIT_PICS}' => cpg_fetch_icon('edit', 1) . $lang_common['edit_files'], '{ALBUM_MGR}' => cpg_fetch_icon('alb_mgr', 1) . $lang_common['album_manager']);
} else {
$param = array();
}
$param['{ALBUM_NAME}'] = $album_name;
$title = template_eval($template_thumb_view_title_row, $param);
} elseif ($aid == 'favpics' && $CONFIG['enable_zipdownload'] > 0) {
//Lots of stuff can be added here later
$param = array('{ALBUM_NAME}' => $album_name, '{DOWNLOAD_ZIP}' => cpg_fetch_icon('zip', 2) . $lang_thumb_view['download_zip']);
$title = template_eval($template_fav_thumb_view_title_row, $param);
} else {
$title = $album_name;
}
if ($mode == 'thumb') {
starttable('100%', $title, $thumbcols);
} else {
starttable('100%');
}
echo $header;
$i = 0;
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}' => str_replace('.gif', '.png', $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']) . '\');';
}
} elseif ($aid == 'random') {
$target = "displayimage.php?pid={$thumb['pid']}{$uid_link}#top_display_media";
} elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
$page = cpg_get_comment_page_number($thumb['msg_id']);
$page = is_numeric($page) ? "&page={$page}" : '';
$target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&pid={$thumb['pid']}{$uid_link}&msg_id={$thumb['msg_id']}{$page}#comment{$thumb['msg_id']}";
} else {
$target = "displayimage.php?album={$aid}{$cat_link}{$date_link}&pid={$thumb['pid']}{$uid_link}#top_display_media";
}
$params = array('{CELL_WIDTH}' => $cell_width, '{LINK_TGT}' => $target, '{THUMB}' => $thumb['image'], '{CAPTION}' => str_replace('.gif', '.png', $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}' => str_replace('.gif', '.png', $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;
if ($display_tabs) {
$params = array('{THUMB_COLS}' => $thumbcols, '{TABS}' => $tabs_html);
echo template_eval($tabs, $params);
}
endtable();
echo $spacer;
}
示例15: array
//.........这里部分代码省略.........
$mime_content = cpg_get_type($pic_row['filename']);
$pic_row = array_merge($pic_row, $mime_content);
$filepathname = null;
// Code to handle custom thumbnails
// If fullsize or normal mode use regular file
if ($mime_content['content'] != 'image' && $mode == 'normal') {
$mode = 'fullsize';
} elseif ($mime_content['content'] != 'image' && $mode == 'thumb' || $system_pic) {
$thumb_extensions = array('.gif', '.png', '.jpg');
// Check for user-level custom thumbnails
// Create custom thumb path and erase extension using filename; Erase filename's extension
$custom_thumb_path = $url_prefix[$pic_row['url_prefix']] . $pic_row['filepath'] . $pic_prefix[$mode];
$file_base_name = str_replace('.' . $mime_content['extension'], '', basename($pic_row['filename']));
// Check for file-specific thumbs
foreach ($thumb_extensions as $extension) {
if (file_exists($custom_thumb_path . $file_base_name . $extension)) {
$filepathname = $custom_thumb_path . $file_base_name . $extension;
break;
}
}
if (!$system_pic) {
// Check for extension-specific thumbs
if (is_null($filepathname)) {
foreach ($thumb_extensions as $extension) {
if (file_exists($custom_thumb_path . $mime_content['extension'] . $extension)) {
$filepathname = $custom_thumb_path . $mime_content['extension'] . $extension;
break;
}
}
}
// Check for content-specific thumbs
if (is_null($filepathname)) {
foreach ($thumb_extensions as $extension) {
if (file_exists($custom_thumb_path . $mime_content['content'] . $extension)) {
$filepathname = $custom_thumb_path . $mime_content['content'] . $extension;
break;
}
}
}
}
// Use default thumbs
if (is_null($filepathname)) {
// Check for default theme- and global-level thumbs
$thumb_paths[] = $THEME_DIR . 'images/';
// Used for custom theme thumbs
$thumb_paths[] = 'images/';
// Default Coppermine thumbs
foreach ($thumb_paths as $default_thumb_path) {
if (is_dir($default_thumb_path)) {
if (!$system_pic) {
foreach ($thumb_extensions as $extension) {
// Check for extension-specific thumbs
if (file_exists($default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['extension'] . $extension)) {
$filepathname = $default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['extension'] . $extension;
//thumb cropping - if we display a system thumb we calculate the dimension by any and not ex
$pic_row['system_icon'] = true;
break 2;
}
}
foreach ($thumb_extensions as $extension) {
// Check for media-specific thumbs (movie,document,audio)
if (file_exists($default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['content'] . $extension)) {
$filepathname = $default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['content'] . $extension;
//thumb cropping
$pic_row['system_icon'] = true;
break 2;
}
}
} else {
// Check for file-specific thumbs for system files
foreach ($thumb_extensions as $extension) {
if (file_exists($default_thumb_path . $CONFIG['thumb_pfx'] . $file_base_name . $extension)) {
$filepathname = $default_thumb_path . $CONFIG['thumb_pfx'] . $file_base_name . $extension;
//thumb cropping
$pic_row['system_icon'] = true;
break 2;
}
}
}
}
}
}
$filepathname = path2url($filepathname);
}
if (is_null($filepathname)) {
$filepathname = $url_prefix[$pic_row['url_prefix']] . path2url($pic_row['filepath'] . $pic_prefix[$mode] . $pic_row['filename']);
}
// Added hack: "&& !isset($pic_row['mode'])" thumb_data filter isn't executed for the fullsize image
if ($mode == 'thumb' && !isset($pic_row['mode'])) {
$pic_row['url'] = $filepathname;
$pic_row['mode'] = $mode;
$pic_row = CPGPluginAPI::filter('thumb_data', $pic_row);
} elseif ($mode != 'thumb') {
$pic_row['url'] = $filepathname;
$pic_row['mode'] = $mode;
} else {
$pic_row['url'] = $filepathname;
}
return $pic_row['url'];
}