PHP Classes

PHP Sourceforge Badges: Display badges for projects hosted in SourceForge

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-03-21 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 14 All time: 11,369 This week: 73Up
Version License PHP version Categories
sourceforge-badges 1.0.0Custom (specified...8.2Graphics, Project Management, PHP 8
Description 

Author

This package can display badges for projects hosted in SourceForge.

It can take parameters that identify a project hosted in the SourceForge site.

The package can generate HTML to display several types of graphical badges and logos, for instance:

- Project logo button

- Download button

- Several badges with links like Users Love Us, Rising Star project, community choice, and SourceForge favorite.

Innovation Award
PHP Programming Innovation award nominee
March 2024
Number 4
Sourceforge is a traditional platform for hosting software projects.

This platform can track the merit of each project and can assign badges.

This package can generate several graphical badges with links on project site pages to show the merit each project hosted in SourceForge earned.

Manuel Lemos
Picture of ASCOOS CMS
  Performance   Level  
Name: ASCOOS CMS <contact>
Classes: 13 packages by
Country: Greece Greece
Age: ???
All time rank: 403823 in Greece Greece
Week rank: 3 Up1 in Greece Greece Up
Innovation award
Innovation award
Nominee: 8x

Example

<?php
/**
 * __ _ ___ ___ ___ ___ ___ ____ _ __ ___ ___
 * / _` |/ / / __/ _ \ / _ \ / / / __/| '_ ` _ \ / /
 * | (_| |\ \| (_| (_) | (_) |\ \ | (__ | | | | | |\ \
 * \__,_|/__/ \___\___/ \___/ /__/ \___\|_| |_| |_|/__/
 *
 *
 ************************************************************************************
 * @ASCOOS-NAME : ASCOOS CMS 24' *
 * @ASCOOS-VERSION : 24.0.0 *
 * @ASCOOS-CATEGORY : Block (Frontend and Administrator Side) *
 * @ASCOOS-CREATOR : Drogidis Christos *
 * @ASCOOS-SITE : www.ascoos.com *
 * @ASCOOS-LICENSE : [Commercial] http://docs.ascoos.com/lics/ascoos/AGL.html *
 * @ASCOOS-COPYRIGHT : Copyright (c) 2007 - 2024, AlexSoft Software. *
 ************************************************************************************
 *
 * @package : SourceForge Buttons & Badges
 * @subpackage : Example Buttons File
 * @source : /[ASCOOS\FRAMEWORK\Libraries\SourceForge_Badges]/tests/buttons_example.php
 * @fileNo :
 * @version : 1.0.0
 * @created : 2024-03-22 00:00:00 UTC+3
 * @updated :
 * @author : Drogidis Christos
 * @authorSite : www.alexsoft.gr
 * @license : AGL-F
 *
 * @since PHP 8.2.0
 */

 
define('ALEXSOFT_RUN_CMS', true);

 
// In ASCOOS CMS, $cms_path does not need to be declared because it is a kernel variable.
 
$cms_path = str_replace('/tests', '', str_replace('\\', '/', __DIR__));
 require_once(
$cms_path."/src/sf.class.php");

 use
ASCOOS\FRAMEWORK\Libraries\SourceForge_Badges\TSFButtons;
 
 

$args = [
   
'id' => 600983, // Integer -- The project (group_id) code
   
'title' => 'Ascoos Web Extended Studio', // String -- The title of the project
   
'project' => 'awserver', // String -- The name of the project
   
'down_codes' => ['dt','dm','dw','dd'] // dt=total, dm=month, dw=week, dd=day
];
       
$objSFButtons = new TSFButtons($args); // Create SourceForge Buttons Object
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SourceForge Badges Example</title>
    <link rel="stylesheet" href="../themes/dark/theme.css">
</head>
<body>
    <article>
        <p><?php echo $objSFButtons->DownloadButton(); ?></p>
        <p><?php echo $objSFButtons->LogoButton(5); ?></p>
        <p><?php echo $objSFButtons->LogoButton(17); // GOOD Light ?></p>
        <p><?php echo $objSFButtons->LogoButton(18); // GOOD Dark ?></p>
        <p><?php echo $objSFButtons->InfoDownloadButton(['dt','dm','dw','dd']); ?></p>
    </article>
</body>
</html>


Details

<p align="center"><img src="https://dl.ascoos.com/images/ascoos.png" /></p>

*

sourceforge-badges

Description

The sourceforge-badges displays various badges of the well-known project hosting platform, SourceForge.

<p align="center"><img src="help/sf-badges-003.png" alt="latest comfor messages" /></p>

Although the platform itself gives the code to integrate the badges, I still think that on the one hand there is code that is left over and on the other hand this should be done manually in the code.

This code simplifies the procedures, but also gives the user the ability to dynamically choose the display parameters of the badges on his website.

What are SourceForge badges

SourceGorge's badges allow us to inform our "audience" of the acceptance of our projects, which are hosted on its servers.

Each badge has a different meaning and value.

1. Rising Star

<p align="center"><img src="help/rising-star-128.png" alt="latest comfor messages" /></p>

The Rising Star badge is awarded to open source projects that have reached the milestone of 100 monthly downloads for the first time.

2. Community Choice

<p align="center"><img src="help/community-choice-128.png" alt="latest comfor messages" /></p>

The Community Choice badge is awarded to open source projects that have reached the milestone of 10,000 total downloads.

3. SourceForge Favorite

<p align="center"><img src="help/sf-favorite-128.png" alt="latest comfor messages" /></p>

The SourceForge Favorite badge is awarded to open source projects that have reached the milestone of 2,000 monthly downloads for the first time.

4. Community Leader

<p align="center"><img src="help/community-leader-128.png" alt="latest comfor messages" /></p>

The Community Leader badge is awarded to open source projects that have reached the milestone of 50,000 total downloads.

5. Open Source Excellence

<p align="center"><img src="help/open-source-excellence-128.png" alt="latest comfor messages" /></p>

The Open Source Excellence badge is awarded to open source projects that have reached the milestone of 100,000 total downloads, or 10,000 monthly downloads for the first time.


Screenshots (2)  
  • badges-screenshot.png
  • buttons-screenshot.png
  Files folder image Files (23)  
File Role Description
Files folder imagehelp (7 files)
Files folder imagesrc (2 files)
Files folder imagetests (2 files)
Files folder imagethemes (1 file, 2 directories)
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE_AGL-F.md Lic. License text
Accessible without login Plain text file README-EL.md Doc. Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (23)  /  help  
File Role Description
  Accessible without login Image file community-choice-128.png Icon Icon image
  Accessible without login Image file community-leader-128.png Icon Icon image
  Accessible without login Plain text file index.html Data Empty page
  Accessible without login Image file open-source-excellence-128.png Icon Icon image
  Accessible without login Image file rising-star-128.png Icon Icon image
  Accessible without login Image file sf-badges-003.png Data Auxiliary data
  Accessible without login Image file sf-favorite-128.png Icon Icon image

  Files folder image Files (23)  /  src  
File Role Description
  Accessible without login Plain text file index.html Data Empty page
  Plain text file sf.class.php Class Class source

  Files folder image Files (23)  /  tests  
File Role Description
  Accessible without login Plain text file badges_example.php Example Example script
  Accessible without login Plain text file buttons_example.php Example Example script

  Files folder image Files (23)  /  themes  
File Role Description
Files folder imagedark (2 files)
Files folder imagedefault (2 files)
  Accessible without login Plain text file index.html Data Auxiliary data

  Files folder image Files (23)  /  themes  /  dark  
File Role Description
  Accessible without login Plain text file index.html Data Empty page
  Accessible without login Plain text file theme.css Data Auxiliary data

  Files folder image Files (23)  /  themes  /  default  
File Role Description
  Accessible without login Plain text file index.html Data Empty page
  Accessible without login Plain text file theme.css Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadsourceforge-badges-2024-03-21.zip 195KB
Downloadsourceforge-badges-2024-03-21.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
PHP Backwards Compatibility Library Download .zip .tar.gz Included in Ascoos Framework Optional
 Version Control Unique User Downloads Download Rankings  
 100%
Total:14
This week:0
All time:11,369
This week:73Up