function display($string, $current) { global $inHead; global $config; $tabs = array(); $tabs['upload'] = array('url' => 'plog-upload.php', 'caption' => plog_tr('<em>U</em>pload')); $tabs['import'] = array('url' => 'plog-import.php?nojs=1', 'caption' => plog_tr('<em>I</em>mport'), 'onclick' => "window.location='plog-import.php'; return false;"); $tabs['manage'] = array('url' => 'plog-manage.php', 'caption' => plog_tr('<em>M</em>anage')); $tabs['feedback'] = array('url' => 'plog-feedback.php', 'caption' => plog_tr('<em>F</em>eedback')); $tabs['options'] = array('url' => 'plog-options.php', 'caption' => plog_tr('<em>O</em>ptions')); $tabs['themes'] = array('url' => 'plog-themes.php', 'caption' => plog_tr('<em>T</em>hemes')); $tabs['plugins'] = array('url' => 'plog-plugins.php', 'caption' => plog_tr('<em>P</em>lugins')); $tabs['view'] = array('url' => $config['gallery_url'], 'caption' => plog_tr('<em>V</em>iew'), 'onclick' => "window.open('" . $config['gallery_url'] . "'); return false;"); $tabs['support'] = array('url' => 'http://www.plogger.org/forum/', 'caption' => plog_tr('<em>S</em>upport'), 'onclick' => "window.open('http://www.plogger.org/forum/'); return false;"); $tabs['logout'] = array('url' => $_SERVER['PHP_SELF'] . '?action=log_out', 'caption' => plog_tr('<em>L</em>og out')); // Get the accesskey from the localization - it should be surrounded by <em> tags foreach ($tabs as $key => $data) { if (preg_match('|<em>(.*)</em>|', $data['caption'], $matches)) { $tabs[$key]['accesskey'] = $matches[1]; } } $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Plogger ' . plog_tr('Gallery Admin') . '</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="' . $config['gallery_url'] . 'plog-admin/css/admin.css" type="text/css" media="all" /> <link rel="stylesheet" href="' . $config['gallery_url'] . 'plog-admin/css/lightbox.css" type="text/css" media="all" /> <script type="text/javascript" src="' . $config['gallery_url'] . 'plog-admin/js/prototype.js"></script> <script type="text/javascript" src="' . $config['gallery_url'] . 'plog-admin/js/plogger.js"></script> <script type="text/javascript" src="' . $config['gallery_url'] . 'plog-admin/js/lightbox.js"></script> ' . $inHead . ' </head> <body onload="initLightbox();"> <div id="header"> <div id="logo"> <img src="' . $config['gallery_url'] . 'plog-admin/images/plogger.gif" width="393" height="90" alt="Plogger" /> </div><!-- /logo --> <div id="plogger-version"> <div class="align-right"> ' . $config['version'] . ' [' . plogger_show_server_info_link() . '] </div><!-- /align-right --> ' . plogger_generate_server_info() . ' </div><!-- /plogger-version --> <div style="clear: both; height: 15px;"> </div> <div id="tab-nav"> <ul>'; foreach ($tabs as $tab => $data) { $output .= ' <li'; if ($current == $tab) { $output .= ' id="current"'; } $output .= '><a'; if (!empty($data['onclick'])) { $output .= ' onclick="' . $data['onclick'] . '"'; } if (!empty($data['accesskey'])) { $output .= ' accesskey="' . $data['accesskey'] . '"'; } $output .= ' href="' . $data['url'] . '">' . $data['caption'] . '</a></li>'; } $output .= ' </ul> </div><!-- /tab-nav --> </div><!-- /header --> <div id="content"> ' . $string . ' </div><!-- /content -->'; if (defined('PLOGGER_DEBUG') && PLOGGER_DEBUG == '1') { $output .= trace('Queries: ' . $GLOBALS['query_count'], false); foreach ($GLOBALS['queries'] as $q) { $output .= trace($q, false); } $output .= trace(plog_timer('end'), false); } $output .= "\n\n" . '</body> </html>'; echo $output; close_db(); close_ftp(); exit; }
echo plog_tr('There was an error with the MySQL connection') . '!'; } // If no errors, tell the user their login and password and link them to the login if (empty($errors)) { echo "\n\t" . '<h1>' . plog_tr('Plogger Install Complete') . '</h1>'; echo "\n\n\t" . '<p class="info width-700">' . plog_tr('You have successfully installed Plogger!') . '<br /><br />'; echo "\n\t" . sprintf(plog_tr('Your username is %s and your password is %s'), '<strong>' . $_SESSION['install_values']['admin_username'] . '</strong>', '<strong>' . $_SESSION['install_values']['admin_password'] . '</strong>'); echo '</p>'; if (is_open_perms(PLOGGER_DIR . 'plog-content/')) { echo "\n\n\t" . '<p class="actions width-700">' . sprintf(plog_tr('You can now CHMOD the %s directory back to 0755'), '<strong>plog-content/</strong>') . '.</p>'; } echo "\n\n\t" . '<form action="index.php?r=plog-options.php" method="post">'; echo "\n\t\t" . '<p><input class="submit" type="submit" name="login" value="' . plog_tr('Log In') . '" /></p>'; echo "\n\t" . '</form>' . "\n"; unset($_SESSION['plogger_config']); unset($_SESSION['install_values']); } else { // Else display the errors } } } } else { // Otherwise it's installed echo '<p>' . plog_tr('Plogger is already installed') . '.</p>'; } close_db(); close_ftp(); ?> </body> </html>
function the_plogger_gallery() { // Collections mode (show all albums within a collection) it's the default $use_file = 'collections.php'; if ($GLOBALS['plogger_level'] == 'picture') { $use_file = 'picture.php'; } elseif ($GLOBALS['plogger_level'] == 'search') { if ($GLOBALS['plogger_mode'] == 'slideshow') { $use_file = 'slideshow.php'; } else { $use_file = 'search.php'; } } elseif ($GLOBALS['plogger_level'] == 'album') { // Album level display mode (display all pictures within album) if ($GLOBALS['plogger_mode'] == 'slideshow') { $use_file = 'slideshow.php'; } else { $use_file = 'album.php'; } } else { if ($GLOBALS['plogger_level'] == 'collection') { $use_file = 'collection.php'; } else { if ($GLOBALS['plogger_level'] == '404') { $use_file = '404.php'; } } } // If the theme does not have the requested file, then use the one from the default template if (file_exists(THEME_DIR . '/' . $use_file)) { include THEME_DIR . '/' . $use_file; } else { include PLOGGER_DIR . '/plog-content/themes/default/' . $use_file; } // Close the connections close_db(); if (function_exists('close_ftp')) { close_ftp(); } // Debug dump at bottom if (defined('PLOGGER_DEBUG') && PLOGGER_DEBUG == '1') { trace('Queries: ' . $GLOBALS['query_count']); foreach ($GLOBALS['queries'] as $q) { trace($q); } trace(plog_timer('end')); } }