Skip to content

Commit

Permalink
Merge branch 'download-legacy'
Browse files Browse the repository at this point in the history
Add section with link to download legacy version of MantisBT.
Minor code improvements

Fixes #25119
  • Loading branch information
dregad committed Dec 26, 2018
2 parents 9d1b3cb + 7f88b9a commit e7a8252
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 129 deletions.
66 changes: 32 additions & 34 deletions config_defaults_inc.php
@@ -1,42 +1,40 @@
<?php
$g_hostname = 'localhost';
$g_db_username = 'root';
$g_db_password = '';
$g_database_name = 'mantisbt';
# Website URLs
$g_wiki_url = '/wiki/';
$g_docs_url = '/docs/';
$g_bugs_url = '/bugs/';
$g_blog_url = '/blog/';
$g_forums_url = '/forums/';

# Website URLs
$g_wiki_url = '/wiki/';
$g_docs_url = '/docs/';
$g_bugs_url = '/bugs/';
$g_blog_url = '/blog/';
$g_forums_url = '/forums/';
# Documentation
$g_docs_path = 'master/en-US/';
$g_docs_admin_guide = 'Admin_Guide';
$g_docs_dev_guide = 'Developers_Guide';
$g_docs_erd_path = 'erd/';

# Documentation
$g_docs_path = 'master/en-US/';
$g_docs_admin_guide = 'Admin_Guide';
$g_docs_dev_guide = 'Developers_Guide';
$g_docs_erd_path = 'erd/';
# Information about latest stable release.
$g_latest_version_stable = '';

# Information about latest stable release.
$g_latest_version_stable = '1.2.16';
# Information about latest legacy release.
$g_latest_version_stable = '';

# Information about latest development release.
$g_latest_version_dev = '1.3.0b1';
$g_latest_version_dev_roadmap = '1.3.x';
# Information about latest development release.
$g_latest_version_dev = '';
$g_latest_version_dev_roadmap = '';

# Twitter Information
$g_twitter_username = 'mantisbt';
$g_twitter_consumer_key = '';
$g_twitter_consumer_secret = '';
$g_twitter_access_token = '';
$g_twitter_access_token_secret = '';
$g_twitter_tweets_count = 5;
# Twitter Information
$g_twitter_username = 'mantisbt';
$g_twitter_consumer_key = '';
$g_twitter_consumer_secret = '';
$g_twitter_access_token = '';
$g_twitter_access_token_secret = '';
$g_twitter_tweets_count = 5;

########################################
# Include user's config, if available
########################################
########################################
# Include user's config, if available
########################################

$t_config_inc = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'config_inc.php';
if ( file_exists( $t_config_inc ) ) {
require_once( $t_config_inc );
}
$t_config_inc = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'config_inc.php';
if ( file_exists( $t_config_inc ) ) {
require_once( $t_config_inc );
}
283 changes: 188 additions & 95 deletions download.php
@@ -1,110 +1,203 @@
<?php
include( "top.php" );

/**
* Print URL for SourceForge downloads
* @param null $p_version Optional version number (= subdirectory)
* @param bool $p_stable True = stable, false = development
*/
function print_sourceforge_url( $p_version = null, $p_stable = true ) {
$t_sf_url = 'https://sourceforge.net/projects/mantisbt/files/mantis-%s/%s';
if( $p_version ) {
$p_version .= '/';
}
printf( $t_sf_url,
$p_stable ? 'stable' : 'development',
$p_version
);
}

?>

<div class="row show-grid clear-both">
<div class="row show-grid clear-both">

<div class="col-sm-7 col-md-8">
<h1>Stable Release <small>| Get on latest!</small></h1>
<p>
This is the latest stable MantisBT release.
Make sure you are running the latest release to benefit from all security fixes, bug fixes, and new features.
</p>
<div class="col-sm-7 col-md-8">
<h1>Stable Release
<small>| Get on latest!</small>
</h1>
<p>
This is the latest stable MantisBT release.
Make sure you are running the latest release to benefit from all
security fixes, bug fixes, and new features.
</p>

<h3>Additional Resources:</h3>
<ul class="icons item-details">
<li>
<i class="icon-book"></i> <a href="<?php echo $g_docs_url, $g_docs_path, $g_docs_admin_guide; ?>/html-desktop/#admin.install.upgrade">How to upgrade?</a>
</li>
<li>
<i class="icon-paper-clip"></i> <a href="<?php echo $g_bugs_url; ?>changelog_page.php?project=mantisbt&amp;version=<?php echo $g_latest_version_stable; ?>">Changelog</a>
</li>
<li>
<i class="icon-check"></i> <a href="<?php echo $g_docs_url, $g_docs_path, $g_docs_admin_guide; ?>/html-desktop/#admin.install.requirements">Requirements</a>
</li>
</ul>
</div>
<div class="col-sm-5 col-md-4 note-stick stick">
<div style="font-size: 38px;"> <i class="icon-bullhorn"></i>
</div>
<br>
<h2 style="font-size: 28px;line-height: 36px">MantisBT <?php echo $g_latest_version_stable; ?></h2>
<br>
<p>
<a href="https://sourceforge.net/projects/mantisbt/files/mantis-stable/" onclick="ga('send', 'event', 'Download', 'Download');" type="button" class="ex btn btn-default btn-inverse">
Download
</a>
</p>
</div>
</div>
<h3>Additional Resources:</h3>
<ul class="icons item-details">
<li>
<i class="icon-book"></i>
<a href="<?php echo $g_docs_url, $g_docs_path, $g_docs_admin_guide; ?>/html-desktop/#admin.install.upgrade">How to upgrade?</a>
</li>
<li>
<i class="icon-paper-clip"></i>
<a href="<?php echo $g_bugs_url; ?>changelog_page.php?project=mantisbt&amp;version=<?php echo $g_latest_version_stable; ?>">Changelog</a>
</li>
<li>
<i class="icon-check"></i>
<a href="<?php echo $g_docs_url, $g_docs_path, $g_docs_admin_guide; ?>/html-desktop/#admin.install.requirements">Requirements</a>
</li>
</ul>
</div>
<div class="col-sm-5 col-md-4 note-stick stick">
<div style="font-size: 38px;"><i class="icon-bullhorn"></i>
</div>
<br>
<h2 style="font-size: 28px;line-height: 36px">
MantisBT <?php echo $g_latest_version_stable; ?></h2>
<br>
<p>
<a href="<?php print_sourceforge_url( $g_latest_version_stable ); ?>"
onclick="ga('send', 'event', 'Download', 'Download');"
type="button" class="ex btn btn-default btn-inverse">
Download
</a>
</p>
</div>
</div>
<hr>

<hr>
<?php
if( !empty( $g_latest_version_legacy ) ) {
# Documentation for legacy version is under /docs/master-X.Y.x
$t_legacy_docs_version = explode( '.', $g_latest_version_legacy, 3 );
$t_legacy_docs_version[2] = 'x';
$t_legacy_docs_version = implode( '.', $t_legacy_docs_version );
$t_legacy_docs_path = substr_replace( $g_docs_path,
'-' . $t_legacy_docs_version,
strpos( $g_docs_path, '/' ), 0
);
?>
<div class="row show-grid clear-both">
<div class="col-md-12 col-sm-12">
<h1>Legacy Release
<small> | Security and critical bugs only!</small>
</h1>
<p>Older MantisBT version, which is still supported but only gets
fixes for critical bugs and security issues.
You are strongly advised to upgrade to the latest Stable release
as soon as possible, to benefit from new developments.
</p>
</div>
</div>

<?php if ( !empty( $g_latest_version_dev ) ) { ?>
<div class="row show-grid clear-both">
<div class="col-md-12 col-sm-12">
<h1>Development Release <small>| Bleeding edge for the brave and tech savvy!</small></h1>
<p>The latest development release is intended for evaluation and testing purposes. It is not recommended for
production use, unless you are comfortable with PHP and able to troubleshoot issues that may arise. </p>
</div>
</div>
<div class="row show-grid clear-both">
<div class="col-sm-8 col-md-8">
<h3>Additional Resources:</h3>
<ul class="icons">
<ul class="item-details">
<li>
<i class="icon-paper-clip"></i>
<a href="<?php echo $g_bugs_url; ?>changelog_page.php?project=mantisbt&amp;version=<?php echo $g_latest_version_legacy; ?>">Changelog</a>
</li>
<li>
<i class="icon-check"></i>
<a href="<?php echo $g_docs_url, $t_legacy_docs_path, $g_docs_admin_guide; ?>/html-desktop/#admin.install.requirements">Requirements</a>
</li>
</ul>
</ul>
</div>
<div class="col-sm-4 col-md-4">
<a href="<?php print_sourceforge_url( $g_latest_version_legacy ); ?>"
onclick="ga('send', 'event', 'Download', 'Download MantisBT');"
type="button" class="btn btn-default btn-warning">
Download MantisBT <?php echo $g_latest_version_legacy; ?>
</a>
</div>
</div>
<hr>
<?php } ?>

<div class="row show-grid clear-both">
<div class="col-sm-8 col-md-8">
<h3>Additional Resources:</h3>
<ul class="icons">
<ul class="item-details">
<li>
<i class="icon-road"></i> <a href="<?php echo $g_bugs_url; ?>roadmap_page.php?project=mantisbt&amp;version=<?php echo $g_latest_version_dev_roadmap; ?>">Roadmap</a>
<li>
<li>
<i class="icon-paper-clip"></i> <a href="<?php echo $g_bugs_url; ?>changelog_page.php?project=mantisbt&amp;version=<?php echo $g_latest_version_dev; ?>">Changelog</a>
</li>
<li>
<i class="icon-check"></i> <a href="<?php echo $g_docs_url, $g_docs_path, $g_docs_admin_guide; ?>/html-desktop/#admin.install.requirements">Requirements</a>
</li>
</ul>
</ul>
</div>
<div class="col-sm-4 col-md-4">
<a href="https://sourceforge.net/projects/mantisbt/files/mantis-development/" onclick="ga('send', 'event', 'Download', 'Download MantisBT');" type="button" class="btn btn-default btn-warning">
Download MantisBT <?php echo $g_latest_version_dev; ?>
</a>
</div>
</div>
<?php if( !empty( $g_latest_version_dev ) ) { ?>
<div class="row show-grid clear-both">
<div class="col-md-12 col-sm-12">
<h1>Development Release
<small>| Bleeding edge for the brave and tech savvy!</small>
</h1>
<p>The latest development release is intended for evaluation and
testing purposes. It is not recommended for
production use, unless you are comfortable with PHP and able to
troubleshoot issues that may arise. </p>
</div>
</div>

<hr>
<?php } ?>
<div class="row show-grid clear-both">
<div class="col-sm-8 col-md-8">
<h3>Additional Resources:</h3>
<ul class="icons">
<ul class="item-details">
<li>
<i class="icon-road"></i>
<a href="<?php echo $g_bugs_url; ?>roadmap_page.php?project=mantisbt&amp;version=<?php echo $g_latest_version_dev_roadmap; ?>">Roadmap</a>
<li>
<li>
<i class="icon-paper-clip"></i>
<a href="<?php echo $g_bugs_url; ?>changelog_page.php?project=mantisbt&amp;version=<?php echo $g_latest_version_dev; ?>">Changelog</a>
</li>
<li>
<i class="icon-check"></i>
<a href="<?php echo $g_docs_url, $g_docs_path, $g_docs_admin_guide; ?>/html-desktop/#admin.install.requirements">Requirements</a>
</li>
</ul>
</ul>
</div>
<div class="col-sm-4 col-md-4">
<a href="<?php print_sourceforge_url( $g_latest_version_dev, false ); ?>"
onclick="ga('send', 'event', 'Download', 'Download MantisBT');"
type="button" class="btn btn-default btn-warning">
Download MantisBT <?php echo $g_latest_version_dev; ?>
</a>
</div>
</div>
<hr>
<?php } ?>

<div class="row show-grid clear-both">
<div class="col-md-12 col-sm-12">
<h1>Nightly Builds <small>| Not Supported - use at your own risk!</small></h1>
<p>These are nightly snapshots generated from the latest development branches in our Git repository. They have
only undergone minimal testing through our standard Travis CI build process, and have not been formally
prepared for release; we recommend you only use them for testing and feedback purposes. </p>
</div>
</div>
<div class="row show-grid clear-both">
<div class="col-md-12 col-sm-12">
<h1>Nightly Builds
<small>| Not Supported - use at your own risk!</small>
</h1>
<p>These are nightly snapshots generated from the latest development
branches in our Git repository. They have
only undergone minimal testing through our standard Travis CI
build process, and have not been formally
prepared for release; we recommend you only use them for testing
and feedback purposes. </p>
</div>
</div>

<div class="row show-grid clear-both">
<div class="col-sm-8 col-md-8">
<h3>Additional Resources:</h3>
<ul class="icons">
<ul class="item-details">
<li>
<i class="icon-github"></i> <a href="https://github.com/mantisbt/mantisbt">Git Repository</a>
<li>
<li>
<i class="icon-ok"></i> <a href="https://travis-ci.org/mantisbt/mantisbt">Travis CI Build Process</a>
<li>
</ul>
</ul>
</div>
<div class="col-sm-4 col-md-4">
<a href="builds.php" type="button" class="btn btn-default btn-warning" onclick="ga('send', 'event', 'Download', 'Download Nightly Builds');" >
Download Nightly Builds
</a>
</div>
</div>
<div class="row show-grid clear-both">
<div class="col-sm-8 col-md-8">
<h3>Additional Resources:</h3>
<ul class="icons">
<ul class="item-details">
<li>
<i class="icon-github"></i>
<a href="https://github.com/mantisbt/mantisbt">Git Repository</a>
<li>
<li>
<i class="icon-ok"></i>
<a href="https://travis-ci.org/mantisbt/mantisbt">Travis CI Build Process</a>
<li>
</ul>
</ul>
</div>
<div class="col-sm-4 col-md-4">
<a href="builds.php" type="button"
class="btn btn-default btn-warning"
onclick="ga('send', 'event', 'Download', 'Download Nightly Builds');">
Download Nightly Builds
</a>
</div>
</div>

<?php
include( "bot.php" );

0 comments on commit e7a8252

Please sign in to comment.