本文整理匯總了PHP中MG_getImageFile函數的典型用法代碼示例。如果您正苦於以下問題:PHP MG_getImageFile函數的具體用法?PHP MG_getImageFile怎麽用?PHP MG_getImageFile使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MG_getImageFile函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: MG_rebuildThumbConfirm
function MG_rebuildThumbConfirm()
{
global $_CONF, $_MG_CONF, $LANG_MG00, $LANG_MG01;
$retval = '';
$B = new Template($_MG_CONF['template_path']);
$B->set_file('admin', 'thumbs.thtml');
$B->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_CONF['site_url'], 'xhtml' => XHTML, 'lang_title' => $LANG_MG01['rebuild_thumb'], 's_form_action' => $_MG_CONF['admin_url'] . 'maint.php?mode=thumbs&step=two', 'lang_next' => $LANG_MG01['next'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_help' => $LANG_MG01['rebuild_thumb_help'], 'lang_details' => $LANG_MG01['rebuild_thumb_details']));
$T = new Template($_MG_CONF['template_path']);
$T->set_file('admin', 'administration.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'xhtml' => XHTML, 'admin_body' => $B->finish($B->parse('output', 'admin')), 'title' => $LANG_MG01['rebuild_thumb'], 'lang_admin' => $LANG_MG00['admin'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"' . XHTML . '>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Rebuild_Thumbs'));
$retval .= $T->finish($T->parse('output', 'admin'));
return $retval;
}
示例2: DB_query
}
DB_query("UPDATE {$_TABLES['mg_exif_tags']} set selected=0");
// resets all to 0
for ($i = 0; $i < $numItems; $i++) {
$sql = "UPDATE {$_TABLES['mg_exif_tags']} set selected=1 WHERE name='" . DB_escapeString($exif[$i]['sel']) . "'";
DB_query($sql);
}
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php?msg=3');
exit;
}
$T = new Template($_MG_CONF['template_path'] . '/admin/');
$T->set_file(array('admin' => 'administration.thtml'));
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
/* --- Main Processing Here --- */
if (!isset($_POST['mode'])) {
$T->set_var(array('admin_body' => MG_adminEXIF(), 'title' => $LANG_MG01['exif_admin_header'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"/>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#EXIFIPTC_Administration'));
} else {
$mode = COM_applyFilter($_POST['mode']);
switch ($mode) {
case $LANG_MG01['save']:
MG_adminEXIFsave();
break;
case $LANG_MG01['cancel']:
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
break;
default:
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php?msg=3');
break;
}
}
$T->parse('output', 'admin');
示例3: MG_displayMediaImage
//.........這裏部分代碼省略.........
$searchKeyword = $keyWords[$i];
$keyWords[$i] = str_replace('_', ' ', $keyWords[$i]);
$kwText .= '<a href="' . $_MG_CONF['site_url'] . '/search.php?mode=search&swhere=1&keywords=' . $searchKeyword . '&keyType=any">' . $keyWords[$i] . '</a> ';
}
$T->set_var(array('media_keywords' => $kwText, 'lang_keywords' => $LANG_MG01['keywords']));
} else {
$T->set_var(array('media_keywords' => '', 'lang_keywords' => ''));
}
if ($media[$mediaObject]['media_user_id'] == '' || !isset($media[$mediaObject]['media_user_id'])) {
$media[$mediaObject]['media_user_id'] = 0;
}
if ($_CONF['show_fullname']) {
$displayname = 'fullname';
} else {
$displayname = 'username';
}
$owner_name = DB_getItem($_TABLES['users'], $displayname, "uid = {$media[$mediaObject]['media_user_id']}");
if (empty($owner_name) || $owner_name == '') {
$owner_name = DB_getItem($_TABLES['users'], 'username', "uid = {$media[$mediaObject]['media_user_id']}");
if (empty($owner_name) || $owner_name == '') {
$owner_name = 'unknown';
}
}
if ($owner_name != 'unknown') {
$owner_link = '<a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $media[$mediaObject]['media_user_id'] . '">' . $owner_name . '</a>';
} else {
$owner_link = $owner_name;
}
$T->set_var('owner_username', $owner_link);
if (($MG_albums[$aid]->exif_display == 2 || $MG_albums[$aid]->exif_display == 3) && $media[$mediaObject]['media_type'] == 0) {
require_once $_CONF['path'] . 'plugins/mediagallery/include/lib-exif.php';
$haveEXIF = MG_haveEXIF($media[$mediaObject]['media_id']);
if ($haveEXIF) {
$T->set_var(array('property' => $_MG_CONF['site_url'] . '/property.php?mid=' . $media[$mediaObject]['media_id'], 'lang_property' => $LANG_MG04['exif_header']));
}
}
if ($MG_albums[0]->owner_id || $_MG_CONF['enable_media_id'] == 1) {
$T->set_var(array('media_id' => $media[$mediaObject]['media_id']));
}
// Language specific vars
$T->set_var(array('lang_comments' => $MG_albums[$aid]->enable_comments ? $LANG_MG03['comments'] : '', 'lang_views' => $MG_albums[$aid]->enable_views ? $LANG_MG03['views'] : '', 'lang_title' => $LANG_MG01['title'], 'print_shutterfly' => $LANG_MG03['print_shutterfly'], 'lang_uploaded_by' => $LANG_MG01['uploaded_by'], 'album_id' => $aid, 'lang_search' => $LANG_MG01['search']));
if (($MG_albums[$aid]->exif_display == 1 || $MG_albums[$aid]->exif_display == 3) && $media[$mediaObject]['media_type'] == 0) {
require_once $_CONF['path'] . 'plugins/mediagallery/include/lib-exif.php';
$haveEXIF = MG_haveEXIF($media[$mediaObject]['media_id']);
if ($haveEXIF) {
$exifData = MG_readEXIF($media[$mediaObject]['media_id'], 2);
$T->set_var(array('exif_info' => $exifData));
}
}
if ($sortID == 0) {
if ($MG_albums[$aid]->enable_postcard == 1 && !COM_isAnonUser() || $MG_albums[$aid]->enable_postcard == 2) {
if ($media[$mediaObject]['media_type'] == 0) {
$postcard_link = '<a href="' . $_MG_CONF['site_url'] . '/postcard.php?mode=edit&mid=' . $media[$mediaObject]['media_id'] . '"><img src="' . MG_getImageFile('icon_envelopeSmall.gif') . '" alt="' . $LANG_MG03['send_postcard'] . '" style="border:none;"/></a>';
$T->set_var('postcard_link', $postcard_link);
}
}
}
PLG_templateSetVars('mediagallery', $T);
$T->parse('output', 'page');
$retval .= $T->finish($T->get_var('output'));
if ($comments) {
// glFusion Comment support
$mid = $media[$mediaObject]['media_id'];
if ($MG_albums[$aid]->enable_comments == 1) {
USES_lib_comment();
if ($MG_albums[$aid]->access == 3 || $MG_albums[0]->owner_id) {
$delete_option = true;
} else {
$delete_option = false;
}
if (DB_count($_TABLES['comments'], 'sid', $mid) > 0 || $_MG_CONF['commentbar']) {
$cid = $mid;
$page = isset($_GET['page']) ? COM_applyFilter($_GET['page'], true) : 0;
if (isset($_POST['order'])) {
$comorder = $_POST['order'] == 'ASC' ? 'ASC' : 'DESC';
} elseif (isset($_GET['order'])) {
$comorder = $_GET['order'] == 'ASC' ? 'ASC' : 'DESC';
} else {
$comorder = '';
}
if (isset($_POST['mode'])) {
$commode = COM_applyFilter($_POST['mode']);
} elseif (isset($_GET['mode'])) {
$commode = COM_applyFilter($_GET['mode']);
} else {
$commode = '';
}
$valid_cmt_modes = array('flat', 'nested', 'nocomment', 'nobar');
if (!in_array($commode, $valid_cmt_modes)) {
$commode = 'nested';
}
$commentbar = CMT_userComments($cid, $media[$mediaObject]['media_title'], 'mediagallery', $comorder, $commode, 0, $page, false, $delete_option, 0, $media[$mediaObject]['media_user_id']);
$retval .= $commentbar;
} else {
$retval .= ' <center><a href="' . $_CONF['site_url'] . '/comment.php?sid=' . $mid . '&title=' . $title . '&pid=0&type=mediagallery' . '">' . $LANG01[60] . '</a></center>';
}
}
}
return array(strip_tags($media[$mediaObject]['media_title']), $retval, '', $aid);
}
示例4: Template
* Main
*/
$display = '';
$mode = '';
if (isset($_POST['save'])) {
$mode = 'save';
}
if (isset($_POST['cancel'])) {
$mode = 'cancel';
}
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file('admin', 'administration.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
if ($mode == 'save' && SEC_checkToken()) {
$T->set_var(array('admin_body' => MG_saveConfig(), 'mg_navigation' => MG_navigation()));
} elseif ($mode == 'cancel') {
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
exit;
} elseif ($mode == $LANG_MG01['continue']) {
COM_setMessage(2);
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
exit;
} else {
$T->set_var(array('admin_body' => MG_editConfig(), 'title' => $LANG_MG01['system_options'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?" />', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#System_Options'));
}
$T->parse('output', 'admin');
$display = COM_siteHeader('menu', '');
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;
示例5: MG_updateQuotaUsage
MG_updateQuotaUsage($row['album_id']);
}
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php?msg=16');
exit;
}
$mode = '';
if (isset($_POST['mode'])) {
$mode = COM_applyFilter($_POST['mode']);
} else {
if (isset($_GET['mode'])) {
$mode = COM_applyFilter($_GET['mode']);
}
}
$T = new Template($_MG_CONF['template_path']);
$T->set_file('admin', 'administration.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'lang_admin' => $LANG_MG00['admin'], 'xhtml' => XHTML));
if ($mode == $LANG_MG01['save'] && !empty($LANG_MG01['save'])) {
MG_rebuildQuota();
} elseif ($mode == $LANG_MG01['cancel']) {
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
exit;
} else {
$T->set_var(array('admin_body' => MG_quotaConfirm(), 'title' => $LANG_MG01['rebuild_quota'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" border="0" alt="?">', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Rebuild_User_Quota'));
}
$T->parse('output', 'admin');
$display = COM_startBlock($LANG_MG00['admin'], '', COM_getBlockTemplate('_admin_block', 'header'));
$display .= MG_showAdminMenu('batch_sessions');
$display .= $T->finish($T->get_var('output'));
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display = COM_createHTMLDocument($display);
COM_output($display);
示例6: MG_index
function MG_index()
{
global $_USER, $_MG_CONF, $_CONF, $_TABLES, $MG_albums, $LANG_MG00, $LANG_MG01, $LANG_MG02, $LANG_MG03, $themeStyle;
$display = '';
$media_size = false;
$page = 0;
if (isset($_GET['page'])) {
$page = COM_applyFilter($_GET['page'], true);
}
if ($page != 0) {
$page = $page - 1;
}
$themeStyle = MG_getThemeCSS(0);
if (!isset($_MG_CONF['album_display_columns']) || $_MG_CONF['album_display_columns'] < 1) {
$_MG_CONF['album_display_columns'] = 1;
}
switch ($_MG_CONF['album_display_columns']) {
case 1:
$albumListTemplate = 'gallery_page_body_1.thtml';
$albumColumnWidth = "100%";
break;
case 2:
$albumListTemplate = 'gallery_page_body_2.thtml';
$albumColumnWidth = "50%";
break;
default:
$albumListTemplate = 'gallery_page_body_3.thtml';
$albumColumnWidth = @intval(100 / $_MG_CONF['album_display_columns']) . '%';
if ($albumColumnWidth == 0) {
$albumColumnWidth = "25%";
}
break;
}
$T = new Template(MG_getTemplatePath(0));
$T->set_file(array('page' => 'gallery_page.thtml', 'body' => $albumListTemplate, 'noitems' => 'gallery_page_noitems.thtml'));
$T->set_var(array('lang_menulabel' => $_MG_CONF['menulabel'], 'lang_search' => $LANG_MG01['search'], 'site_url' => $_MG_CONF['site_url']));
if ($_MG_CONF['rss_full_enabled']) {
$feedUrl = MG_getFeedUrl($_MG_CONF['rss_feed_name'] . '.rss');
$rsslink = '<a href="' . $feedUrl . '"' . ' type="application/rss+xml">';
$rsslink .= '<img src="' . MG_getImageFile('feed.png') . '" alt="" style="border:none;"/></a>';
$T->set_var('rsslink', $rsslink);
$T->set_var('rsslink_url', $feedUrl);
} else {
$T->set_var('rsslink', '');
}
$nFrame = new mgFrame();
$nFrame->constructor($_MG_CONF['indexskin']);
$MG_albums[0]->albumFrameTemplate = $nFrame->getTemplate();
$MG_albums[0]->afrWidth = $nFrame->frame['wHL'] + $nFrame->frame['wHR'];
$MG_albums[0]->afrHeight = $nFrame->frame['hVT'] + $nFrame->frame['hVB'];
// Let's build our admin menu options
$showAdminBox = 0;
$admin_box_item = '';
$admin_box = '<form name="adminbox" id="adminbox" action="' . $_MG_CONF['site_url'] . '/admin.php" method="get" style="margin:0;padding:0;">' . LB;
$admin_box .= '<div>';
$admin_box .= '<select onchange="javascript:forms[\'adminbox\'].submit();" name="mode">' . LB;
$admin_box_item .= '<option label="' . $LANG_MG01['options'] . '" value="">' . $LANG_MG01['options'] . '</option>' . LB;
if (($MG_albums[0]->member_uploads || $MG_albums[0]->access == 3) && !COM_isAnonUser()) {
$admin_box_item .= '<option value="upload">' . $LANG_MG01['add_media'] . '</option>' . LB;
$showAdminBox = 1;
}
if ($MG_albums[0]->owner_id) {
$admin_box_item .= '<option value="albumsort">' . $LANG_MG01['sort_albums'] . '</option>' . LB;
$admin_box_item .= '<option value="globalattr">' . $LANG_MG01['globalattr'] . '</option>' . LB;
$admin_box_item .= '<option value="globalperm">' . $LANG_MG01['globalperm'] . '</option>' . LB;
$queue_count = DB_count($_TABLES['mg_media_album_queue']);
$admin_box_item .= '<option value="moderate">' . $LANG_MG01['media_queue'] . ' (' . $queue_count . ')</option>' . LB;
$admin_box_item .= '<option value="wmmanage">' . $LANG_MG01['wm_management'] . '</option>' . LB;
$admin_box_item .= '<option value="create">' . $LANG_MG01['create_album'] . '</option>' . LB;
$showAdminBox = 1;
} elseif ($MG_albums[0]->access == 3) {
$admin_box_item .= '<option value="create">' . $LANG_MG01['create_album'] . '</option>' . LB;
$showAdminBox = 1;
} elseif ($_MG_CONF['member_albums'] == 1 && !COM_isAnonUser() && $_MG_CONF['member_album_root'] == 0 && $_MG_CONF['member_create_new']) {
$admin_box_item .= '<option value="create">' . $LANG_MG01['create_album'] . '</option>' . LB;
$showAdminBox = 1;
}
$admin_box .= $admin_box_item;
$admin_box .= '</select>' . LB;
$admin_box .= '<input type="hidden" name="album_id" value="0"/>' . LB;
$admin_box .= ' <input type="submit" value="' . $LANG_MG03['go'] . '"/>' . LB;
$admin_box .= '</div>';
$admin_box .= '</form>';
// build ul
$admin_menu = '';
$showAdminMenu = 0;
$admin_url = $_MG_CONF['site_url'] . '/admin.php?album_id=0';
if (($MG_albums[0]->member_uploads || $MG_albums[0]->access == 3) && !COM_isAnonUser()) {
$admin_menu .= '<li><a href="' . $admin_url . '&mode=upload">' . $LANG_MG01['add_media'] . '</a></li>';
$showAdminMenu = 1;
}
if ($MG_albums[0]->owner_id) {
$admin_menu .= '<li><a href="' . $admin_url . '&mode=albumsort">' . $LANG_MG01['sort_albums'] . '</a></li>';
$admin_menu .= '<li><a href="' . $admin_url . '&mode=globalattr">' . $LANG_MG01['globalattr'] . '</a></li>' . LB;
$admin_menu .= '<li><a href="' . $admin_url . '&mode=globalperm">' . $LANG_MG01['globalperm'] . '</a></li>' . LB;
$queue_count = DB_count($_TABLES['mg_media_album_queue']);
$admin_menu .= '<li><a href="' . $admin_url . '&mode=moderate">' . $LANG_MG01['media_queue'] . ' (' . $queue_count . ')</a></li>' . LB;
$admin_menu .= '<li><a href="' . $admin_url . '&mode=wmmanage">' . $LANG_MG01['wm_management'] . '</a></li>' . LB;
$admin_menu .= '<li><a href="' . $admin_url . '&mode=create">' . $LANG_MG01['create_album'] . '</a></li>' . LB;
$showAdminMenu = 1;
//.........這裏部分代碼省略.........
示例7: MG_indexAll
//.........這裏部分代碼省略.........
$sort_box .= $LANG_MG03['sort_by'] . ' <select name="sort" onchange="forms[\'sortbox\'].submit()">';
$sort_box .= '<option value="0" ' . ($sortOrder == 0 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_default'] . '</option>';
$sort_box .= '<option value="1" ' . ($sortOrder == 1 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_default_asc'] . '</option>';
$sort_box .= '<option value="2" ' . ($sortOrder == 2 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_upload'] . '</option>';
$sort_box .= '<option value="3" ' . ($sortOrder == 3 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_upload_asc'] . '</option>';
$sort_box .= '<option value="4" ' . ($sortOrder == 4 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_capture'] . '</option>';
$sort_box .= '<option value="5" ' . ($sortOrder == 5 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_capture_asc'] . '</option>';
$sort_box .= '<option value="6" ' . ($sortOrder == 6 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_rating'] . '</option>';
$sort_box .= '<option value="7" ' . ($sortOrder == 7 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_rating_asc'] . '</option>';
$sort_box .= '<option value="8" ' . ($sortOrder == 8 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_views'] . '</option>';
$sort_box .= '<option value="9" ' . ($sortOrder == 9 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_views_asc'] . '</option>';
$sort_box .= '<option value="10" ' . ($sortOrder == 10 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_alpha'] . '</option>';
$sort_box .= '<option value="11" ' . ($sortOrder == 11 ? ' selected="selected" ' : '') . '>' . $LANG_MG03['sort_alpha_asc'] . '</option>';
$sort_box .= '</select>';
$sort_box .= ' <input type="submit" value="' . $LANG_MG03['go'] . '"/>';
$sort_box .= '</div></form>';
} else {
$sort_box = '';
}
$owner_id = $MG_albums[$album_id]->owner_id;
if ($owner_id == '' || !isset($MG_albums[$album_id]->owner_id)) {
$owner_id = 0;
}
$ownername = DB_getItem($_TABLES['users'], 'username', "uid=" . (int) $owner_id);
$album_last_update = MG_getUserDateTimeFormat($MG_albums[$album_id]->last_update);
$T = new Template($_MG_CONF['template_path']);
$T->set_file(array('page' => 'index-all.thtml'));
//@TODO fix language tag
$T->set_var(array('site_url' => $_MG_CONF['site_url'], 'album_title' => "All Photos - Sorted by Post Date", 'table_columns' => $columns_per_page, 'table_column_width' => intval(100 / $columns_per_page) . '%', 'top_pagination' => COM_printPageNavigation($_MG_CONF['site_url'] . '/index.php?aid=' . $album_id, $page + 1, ceil($total_items_in_album / $media_per_page)), 'bottom_pagination' => COM_printPageNavigation($_MG_CONF['site_url'] . '/index.php?aid=' . $album_id, $page + 1, ceil($total_items_in_album / $media_per_page)), 'page_number' => sprintf("%s %d %s %d", $LANG_MG03['page'], $current_print_page, $LANG_MG03['of'], $total_print_pages), 'jumpbox' => $album_jumpbox, 'album_id' => $album_id, 'lbslideshow' => $lbSlideShow, 'album_description' => $MG_albums[$album_id]->display_album_desc ? PLG_replaceTags($MG_albums[$album_id]->description) : '', 'album_id_display' => $MG_albums[0]->owner_id || $_MG_CONF['enable_media_id'] == 1 ? $LANG_MG03['album_id_display'] . $album_id : '', 'select_adminbox' => $admin_box, 'select_sortbox' => $sort_box, 'album_last_update' => $album_last_update[0], 'album_owner' => $ownername, 'media_count' => $MG_albums[$album_id]->getMediaCount(), 'lang_search' => $LANG_MG01['search'], 'table_columns' => $displayColumns));
$T->set_var('select_adminbox', $admin_box);
if ($_MG_CONF['rss_full_enabled']) {
$feedUrl = MG_getFeedUrl($_MG_CONF['rss_feed_name'] . '.rss');
$rsslink = '<a href="' . $feedUrl . '"' . ' type="application/rss+xml">';
$rsslink .= '<img src="' . MG_getImageFile('feed.png') . '" alt="" style="border:none;"/></a>';
$T->set_var('rsslink', $rsslink);
} else {
$T->set_var('rsslink', '');
}
// completed setting header / footer vars, parse them
PLG_templateSetVars('mediagallery', $T);
if ($total_media == 0) {
$T->set_var(array('lang_no_image' => $LANG_MG03['no_media_objects']));
}
//
// main processing of the album contents.
//
$noParse = 0;
$needFinalParse = 0;
if ($total_media > 0) {
$k = 0;
$T->set_block('page', 'ImageColumn', 'IColumn');
$T->set_block('page', 'ImageRow', 'IRow');
for ($i = 0; $i < $media_per_page; $i += $columns_per_page) {
for ($j = $i; $j < $i + $columns_per_page; $j++) {
if ($j >= $total_media) {
$k = $i + $columns_per_page - $j;
$m = $k % $columns_per_page;
for ($z = $m; $z > 0; $z--) {
$T->set_var(array('CELL_DISPLAY_IMAGE' => ''));
$T->parse('IColumn', 'ImageColumn', true);
$needFinalParse = 1;
}
if ($needFinalParse == 1) {
$T->parse('IRow', 'ImageRow', true);
$T->set_var('IColumn', '');
}
示例8: COM_applyFilter
}
/**
* Main
*/
$display = '';
$mode = '';
if (isset($_POST['mode'])) {
$mode = COM_applyFilter($_POST['mode']);
} else {
if (isset($_GET['mode'])) {
$mode = COM_applyFilter($_GET['mode']);
}
}
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file(array('admin' => 'administration.thtml'));
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
if ($mode == $LANG_MG01['save'] && !empty($LANG_MG01['save'])) {
// save the config
$T->set_var(array('admin_body' => MG_saveMemberDefaults()));
} elseif ($mode == $LANG_MG01['cancel']) {
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
exit;
} else {
$T->set_var(array('admin_body' => MG_editMemberDefaults(), 'title' => $LANG_MG01['member_album_options'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"' . '/>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Member_Album_Options'));
}
$T->parse('output', 'admin');
$display = COM_siteHeader('menu', '');
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;
示例9: DB_getItem
}
$owner_id = $MG_albums[$album_id]->owner_id;
if ($owner_id == '' || !isset($MG_albums[$album_id]->owner_id)) {
$owner_id = 0;
}
$ownername = DB_getItem($_TABLES['users'], 'username', "uid=" . intval($owner_id));
$album_last_update = MG_getUserDateTimeFormat($MG_albums[$album_id]->last_update);
$T = new Template(MG_getTemplatePath($album_id));
$T->set_file(array('page' => 'album_page.thtml', 'noitems' => 'album_page_noitems.thtml'));
SESS_setVar('mediagallery.album.page', $page + 1);
$T->set_var(array('site_url' => $_MG_CONF['site_url'], 'birdseed' => $birdseed, 'birdseed_ul' => $birdseedUL, 'album_title' => PLG_replaceTags($MG_albums[$album_id]->title, 'mediagallery', 'album_title'), 'url_slideshow' => $url_slideshow, 'table_columns' => $columns_per_page, 'table_column_width' => intval(100 / $columns_per_page) . '%', 'top_pagination' => COM_printPageNavigation($_MG_CONF['site_url'] . '/album.php?aid=' . $album_id . '&sort=' . $sortOrder, $page + 1, ceil($total_items_in_album / $media_per_page)), 'bottom_pagination' => COM_printPageNavigation($_MG_CONF['site_url'] . '/album.php?aid=' . $album_id . '&sort=' . $sortOrder, $page + 1, ceil($total_items_in_album / $media_per_page)), 'page_number' => sprintf("%s %d %s %d", $LANG_MG03['page'], $current_print_page, $LANG_MG03['of'], $total_print_pages), 'jumpbox' => $album_jumpbox, 'album_jumpbox_raw' => $album_jumpbox_raw, 'album_id' => $album_id, 'lbslideshow' => $lbSlideShow, 'album_description' => $MG_albums[$album_id]->display_album_desc ? PLG_replaceTags($MG_albums[$album_id]->description, 'mediagallery', 'album_description') : '', 'album_id_display' => $MG_albums[0]->owner_id || $_MG_CONF['enable_media_id'] == 1 ? $LANG_MG03['album_id_display'] . $album_id : '', 'lang_slideshow' => $lang_slideshow, 'select_adminbox' => $admin_box, 'admin_box_items' => $admin_box_items, 'admin_menu' => $admin_menu, 'select_sortbox' => $sort_box, 'select_sortbox_raw' => $sort_box_raw, 'album_last_update' => $album_last_update[0], 'album_owner' => $ownername, 'media_count' => $MG_albums[$album_id]->getMediaCount(), 'lang_search' => $LANG_MG01['search']));
if ($MG_albums[$album_id]->enable_rss) {
$rssfeedname = sprintf($_MG_CONF['rss_feed_name'] . "%06d", $album_id);
$feedUrl = MG_getFeedUrl($rssfeedname . '.rss');
$rsslink = '<a href="' . $feedUrl . '"' . ' type="application/rss+xml">';
$rsslink .= '<img src="' . MG_getImageFile('feed.png') . '" style="border:none;" alt=""/></a>';
$T->set_var('rsslink', $rsslink);
} else {
$T->set_var('rsslink', '');
}
$subscribe = '';
if (!COM_isAnonUser()) {
if (PLG_isSubscribed('mediagallery', '', $album_id, $_USER['uid'])) {
$subscribe = '<a class="subscribelink" href="' . $_MG_CONF['site_url'] . '/subscription.php?op=unsubscribe&sid=' . $album_id . '">' . $LANG01['unsubscribe'] . '</a>';
$subscribe_url = $_MG_CONF['site_url'] . '/subscription.php?op=unsubscribe&sid=' . $album_id;
$subscribe_text = $LANG01['unsubscribe'];
} else {
$subscribe = '<a class="subscribelink" href="' . $_MG_CONF['site_url'] . '/subscription.php?op=subscribe&sid=' . $album_id . '">' . $LANG01['subscribe'] . '</a>';
$subscribe_url = $_MG_CONF['site_url'] . '/subscription.php?op=subscribe&sid=' . $album_id;
$subscribe_text = $LANG01['subscribe'];
}
示例10: MG_autotags
//.........這裏部分代碼省略.........
$playback_options['quality'] = $_MG_CONF['swf_quality'];
$playback_options['height'] = $_MG_CONF['swf_height'];
$playback_options['width'] = $_MG_CONF['swf_width'];
$playback_options['loop'] = $_MG_CONF['swf_loop'];
$playback_options['scale'] = $_MG_CONF['swf_scale'];
$playback_options['wmode'] = $_MG_CONF['swf_wmode'];
$playback_options['allowscriptaccess'] = $_MG_CONF['swf_allowscriptaccess'];
$playback_options['bgcolor'] = $_MG_CONF['swf_bgcolor'];
$playback_options['swf_version'] = $_MG_CONF['swf_version'];
$playback_options['flashvars'] = $_MG_CONF['swf_flashvars'];
$poResult = DB_query("SELECT * FROM {$_TABLES['mg_playback_options']} WHERE media_id='" . $row['media_id'] . "'");
while ($poRow = DB_fetchArray($poResult)) {
$playback_options[$poRow['option_name']] = $poRow['option_value'];
}
if ($swfjsinclude > 0) {
$link = '';
} else {
$S = COM_newTemplate(MG_getTemplatePath(0));
$S->set_file('swf', 'swfobject.thtml');
$S->set_var('site_url', $_MG_CONF['site_url']);
$link = $S->finish($S->parse('output', 'swf'));
$swfjsinclude++;
}
// now the player specific items.
if ($autoplay == 1) {
// auto start
$playButton = '';
} else {
if ($row['media_tn_attached'] == 1) {
$tfn = 'tn/' . $row['media_filename'][0] . '/tn_' . $row['media_filename'];
$ext = MG_getMediaExt($_MG_CONF['path_mediaobjects'] . $tfn);
$playImage = $_MG_CONF['mediaobjects_url'] . '/' . $tfn . $ext;
} else {
$playImage = MG_getImageFile('blank_blk.jpg');
}
$playButton = "{ url: '" . $playImage . "', overlayId: 'play' },";
}
if ($row['remote_media'] == 1) {
$urlParts = array();
$urlParts = parse_url($row['remote_url']);
$pathParts = array();
$pathParts = explode('/', $urlParts['path']);
$ppCount = count($pathParts);
$pPath = '';
for ($row = 1; $row < $ppCount - 1; $row++) {
$pPath .= '/' . $pathParts[$row];
}
$videoFile = $pathParts[$ppCount - 1];
$pos = strrpos($videoFile, '.');
if ($pos === false) {
$basefilename = $videoFile;
} else {
$basefilename = substr($videoFile, 0, $pos);
}
$videoFile = $basefilename;
$streamingServerURL = "streamingServerURL: '" . $urlParts['scheme'] . '://' . $urlParts['host'] . $pPath . "',";
$streamingServer = "streamingServer: 'fms',";
} else {
$streamingServerURL = '';
$streamingServer = '';
$videoFile = urlencode($orig_media_url);
}
$width = $videowidth;
$height = $videoheight + 22;
$resolution_x = $videowidth;
$resolution_y = $videoheight;
示例11: COM_refresh
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
exit;
}
/**
* Main
*/
$display = '';
$mode = '';
if (isset($_POST['save'])) {
$mode = 'save';
}
if (isset($_POST['cancel'])) {
$mode = 'cancel';
}
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file(array('admin' => 'administration.thtml'));
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version']));
if ($mode == 'save' && SEC_checkToken()) {
$T->set_var(array('admin_body' => MG_saveAVDefaults(), 'title' => $LANG_MG01['av_default_editor']));
} elseif ($mode == 'cancel') {
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
exit;
} else {
$T->set_var(array('admin_body' => MG_editAVDefaults(), 'title' => $LANG_MG01['av_default_editor'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"/>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Audio__Video_Defaults'));
}
$T->parse('output', 'admin');
$display = COM_siteHeader('menu', '');
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;
示例12: DB_query
// see if they have an entry in userprefs
$result3 = DB_query("SELECT uid FROM {$_TABLES['mg_userprefs']} WHERE uid=" . $U['uid']);
$pRows = DB_numRows($result3);
$member_gallery = $nRows > 0 ? 1 : 0;
if ($pRows > 0) {
DB_change($_TABLES['mg_userprefs'], 'member_gallery', $member_gallery, 'uid', $U['uid']);
DB_change($_TABLES['mg_userprefs'], 'active', 1, 'uid', $U['uid']);
} else {
$sql = "INSERT INTO {$_TABLES['mg_userprefs']} " . "(uid, active, display_rows, display_columns, mp3_player, playback_mode, tn_size, quota, member_gallery) " . "VALUES (" . $U['uid'] . ",1,0,0,-1,-1,-1," . $_MG_CONF['member_quota'] . "," . $member_gallery . ")";
DB_query($sql);
}
}
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php?msg=14');
exit;
default:
$B = new Template($_MG_CONF['template_path']);
$B->set_file('admin', 'thumbs.thtml');
$B->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_CONF['site_url'], 'xhtml' => XHTML, 'lang_title' => $LANG_MG01['reset_members'], 's_form_action' => $_MG_CONF['admin_url'] . 'resetmembers.php?step=two', 'lang_next' => $LANG_MG01['next'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_details' => $LANG_MG01['reset_members_details']));
$B->parse('output', 'admin');
$T = new Template($_MG_CONF['template_path']);
$T->set_file('admin', 'administration.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'xhtml' => XHTML, 'admin_body' => $B->finish($B->get_var('output')), 'title' => $LANG_MG01['reset_members'], 'lang_admin' => $LANG_MG00['admin'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"' . XHTML . '>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Reset_Member_Album_Create_Flag'));
$T->parse('output', 'admin');
$display = COM_startBlock($LANG_MG00['admin'], '', COM_getBlockTemplate('_admin_block', 'header'));
$display .= MG_showAdminMenu('member_albums');
$display .= $T->finish($T->get_var('output'));
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display = COM_createHTMLDocument($display);
COM_output($display);
break;
}
示例13: COM_applyFilter
if ($mode == $LANG_MG01['save'] && !empty($LANG_MG01['save'])) {
$cat_id = COM_applyFilter($_POST['cat_id'], true);
$T->set_var(array('admin_body' => MG_saveCategory($cat_id)));
} elseif ($mode == $LANG_MG01['cancel']) {
$page = 'index.php';
if ($action == 'edit_category') {
$page = 'category.php';
}
echo COM_refresh($_MG_CONF['admin_url'] . $page);
exit;
} elseif ($mode == $LANG_MG01['create'] && !empty($LANG_MG01['create'])) {
$T->set_var(array('admin_body' => MG_editCategory(0, 'create'), 'title' => $LANG_MG01['create_category']));
} elseif ($mode == 'edit') {
$cat_id = COM_applyFilter($_GET['id'], true);
$T->set_var(array('admin_body' => MG_editCategory($cat_id, 'edit'), 'title' => $LANG_MG01['edit_category']));
} elseif ($mode == $LANG_MG01['delete'] && !empty($LANG_MG01['delete'])) {
if (isset($_POST['cat_id'])) {
$cat_id = $_POST['cat_id'];
MG_batchDeleteCategory($cat_id);
} else {
MG_batchDeleteCategory(0);
}
} else {
$T->set_var(array('admin_body' => MG_displayCategories(), 'title' => $LANG_MG01['category_manage_help'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"' . XHTML . '>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Category_Maintenance'));
}
$display = COM_startBlock($LANG_MG00['admin'], '', COM_getBlockTemplate('_admin_block', 'header'));
$display .= MG_showAdminMenu();
$display .= $T->finish($T->parse('output', 'admin'));
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display = COM_createHTMLDocument($display);
COM_output($display);
示例14: DB_getItem
$retval = '';
$aid = DB_getItem($_TABLES['mg_media_albums'], 'album_id', 'media_id="' . DB_escapeString($mid) . '"');
if ($MG_albums[$aid]->access == 0) {
$display = MG_siteHeader();
$display .= COM_showMessageText($LANG_MG00['access_denied_msg'], $LANG_ACCESS['accessdenied'], true);
$display .= MG_siteFooter();
echo $display;
exit;
}
$sql = "SELECT * FROM {$_TABLES['mg_media_albums']} as ma LEFT JOIN " . $_TABLES['mg_media'] . " as m " . " ON ma.media_id=m.media_id WHERE m.media_id='" . DB_escapeString($mid) . "'";
$result = DB_query($sql);
$nRows = DB_numRows($result);
if ($nRows < 1) {
$display = MG_siteHeader();
$display .= COM_showMessageText($LANG_MG00['access_denied_msg'], $LANG_ACCESS['accessdenied'], true);
$display .= MG_siteFooter();
echo $display;
exit;
}
$M = DB_fetchArray($result);
// build the template...
$T = new Template(MG_getTemplatePath($aid));
$T->set_file('postcard', 'getcard.thtml');
$media_size = @getimagesize($_MG_CONF['path_mediaobjects'] . 'tn/' . $M['media_filename'][0] . '/' . $M['media_filename'] . '.jpg');
$T->set_var(array('s_form_action' => $_MG_CONF['site_url'] . '/postcard.php', 'mid' => $mid, 'media_title' => $M['media_title'], 'alt_media_title' => htmlspecialchars(strip_tags($M['media_title'])), 'media_description' => $M['media_description'], 'media_url' => $_MG_CONF['site_url'] . '/media.php?s=' . $mid, 'media_image' => $_MG_CONF['mediaobjects_url'] . '/disp/' . $M['media_filename'][0] . '/' . $M['media_filename'] . '.jpg', 'site_url' => $_MG_CONF['site_url'] . '/', 'postcard_subject' => $subject, 'postcard_message' => $message, 'from_email' => $fromemail, 'site_name' => $_CONF['site_name'], 'site_slogan' => $_CONF['site_slogan'], 'to_name' => $toname, 'from_name' => $fromname, 'stamp_url' => MG_getImageFile('stamp.gif'), 'lang_to' => $LANG_MG03['to'], 'lang_from' => $LANG_MG03['from'], 'lang_send_to' => $LANG_MG03['send_to'], 'lang_subject' => $LANG_MG03['subject'], 'lang_send' => $LANG_MG03['send'], 'lang_cancel' => $LANG_MG03['cancel'], 'lang_preview' => $LANG_MG03['preview'], 'lang_message' => $LANG_MG03['message_body'], 'lang_send_from' => $LANG_MG03['send_from'], 'lang_postcard_from' => $LANG_MG03['postcard_from'], 'lang_visit' => $LANG_MG03['visit']));
$T->parse('output', 'postcard');
$retval .= $T->finish($T->get_var('output'));
$display = MG_siteHeader();
$display .= $retval;
$display .= MG_siteFooter();
echo $display;
示例15: MG_displayFLV
//.........這裏部分代碼省略.........
case 1:
// download
$u_pic = $_MG_CONF['site_url'] . '/download.php?mid=' . $I['media_id'];
$raw_link_url = $u_pic;
list($u_image, $p_image, $media_size_orig) = Media::getThumbInfo($I);
break;
case 3:
// mms - not supported for flash
// mms - not supported for flash
case 2:
// inline
$u_image = '';
// Initialize the view_flv.thtml template
$V = COM_newTemplate(MG_getTemplatePath_byName($opt['skin']));
$V->set_file('video', 'view_flv.thtml');
// now the player specific items.
$F = COM_newTemplate(MG_getTemplatePath_byName($opt['skin']));
if ($_MG_CONF['use_flowplayer'] == 1) {
// FlowPlayer Setup
$F->set_file('player', 'flvfp.thtml');
} else {
$F->set_file('player', 'flvmg.thtml');
}
if ($playback_options['play'] == 1) {
// auto start
$playButton = '';
$playButtonMG = '';
$autoplay = 'true';
} else {
if ($I['media_tn_attached'] == 1) {
$playImage = Media::getFileUrl('tn', $I['media_filename'], 'jpg', 1);
$playButtonMG = 'flashvars.thumbUrl="' . $playImage . '";';
} else {
$playImage = $_MG_CONF['site_url'] . MG_getImageFile('blank_blk.jpg');
$playButtonMG = '';
}
$playButton = "{ url: '" . $playImage . "', overlayId: 'play' },";
$autoplay = 'false';
}
if ($I['remote_media'] == 1) {
$urlParts = array();
$urlParts = parse_url($I['remote_url']);
$pathParts = array();
$pathParts = explode('/', $urlParts['path']);
$ppCount = count($pathParts);
$pPath = '';
for ($I = 1; $I < $ppCount - 1; $I++) {
$pPath .= '/' . $pathParts[$I];
}
$videoFile = $pathParts[$ppCount - 1];
$pos = strrpos($videoFile, '.');
if ($pos === false) {
$basefilename = $videoFile;
} else {
$basefilename = substr($videoFile, 0, $pos);
}
$videoFile = $basefilename;
$streamingServerURL = "streamingServerURL: '" . $urlParts['scheme'] . '://' . $urlParts['host'] . $pPath . "',";
$streamingServerURLmg = 'flashvars.streamingServerUrl="' . $urlParts['scheme'] . '://' . $urlParts['host'] . $pPath . '";';
$streamingServer = "streamingServer: 'fms',";
} else {
$videoFile = urlencode(Media::getFileUrl('orig', $I['media_filename'], $I['media_mime_ext']));
$streamingServerURL = '';
$streamingServerURLmg = '';
$streamingServer = '';
}