[IMPROVEMENT] Website automated covergen creator

Suggestions and comments about the ReactOS website

Moderator: Moderator Team

Post Reply
forart
Posts: 1050
Joined: Mon Nov 29, 2004 1:36 pm
Location: Italy
Contact:

[IMPROVEMENT] Website automated covergen creator

Post by forart »

From the other 3ad:
forart wrote:OK guyz, here's the 1st CoverGen (raw & dirty, just to show potentials) version modified specifically for ReactOS, codenamed ROSMOD:

Code: Select all

<?php

// CoverGen v.0.1.2 ROSMOD  
// CC By-Nc-Sa 2009 F.O.R.A.R.T. fe Foundation

require('fpdf.php');

$remoto = $_GET['remoto'];
$pagina = $_GET['pagina'];
$copertina = $_GET['copertina'];

if ($copertina == "DVD") { $Lcover= 270; $Acover= 180; $Ldorso=15; } else { $Lcover= 250; $Acover= 125; $Ldorso=0;};

if ($pagina == "A4") { $Lpaper=297; $Apaper=210; } else { $Lpaper=279; $Apaper=216; };

$sx=($Lpaper-$Lcover)/2; $su=($Apaper-$Acover)/2; $disdo=($Lcover-$Ldorso)/2;

$formato = array($Lpaper,$Apaper);

$pdf = new FPDF('Landscape','mm',$formato);

$pdf->SetMargins($sx,$su,$sx);

$pdf->SetAutoPageBreak(0);

if ( file_exists(str_replace(".", "", $_GET['vers'])."_changes.txt") ) { $changes = file_get_contents(str_replace(".", "", $_GET['vers'])."_changes.txt"); } else { $changes = "Changelog not available"; }

$pdf->AddPage();
$pdf->SetAuthor('CC by-nc-sa / Associazione Forward Agency ODV');
$pdf->image($remoto, $sx, $su, $Lcover, $Acover);
$pdf->Line(0, $su, $Lpaper, $su);
$pdf->Line(0, $su+$Acover, $Lpaper, $su+$Acover);
$pdf->Line($sx, 0, $sx, $Apaper);
$pdf->Line($sx+$Lcover, 0, $sx+$Lcover, $Apaper);
$pdf->Line($disdo+$sx, 0, $disdo+$sx, $Apaper);
$pdf->Line(($disdo+$sx)+$Ldorso, 0, ($disdo+$sx)+$Ldorso, $Apaper);
$pdf->SetDrawColor(255,0,0);
$pdf->Rect($sx, $su, $Lcover, $Acover, "D");
$pdf->Rect($disdo+$sx, $su, $Ldorso, $Acover, "D");

$pdf->SetFont('Times','I',11);
$pdf->SetTextColor(255,255,255);
$pdf->SetXY(30,75);
$pdf->MultiCell( 0, 5, $changes );

$pdf->SetFont('Arial','B',20);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(-$sx+5,$su+5);
$pdf->Cell(0, 5, $_GET['vers'], 0, 0, 'R');

$pdf->Output();
?>
As you can see it uses an external txt file (direct link) as data source to print changes and variable (GET) for version.

Click here to generate the example on the fly: http://www.forart.it/progetti/covergen/ ... g&vers=0.4

Try to change "vers" (put what you want) and "remoto" (put http://www.forart.it/images/ros1.png or http://www.forart.it/images/ros3.png) parameters...

This means that if a script like this is adopted, it can generate updated covers "automatically" by getting data directly from website's database.

EDIT: just for fun
http://www.forart.it/progetti/covergen/ ... ILD%207601
Hope that inspires !
»Forward Agency NPO
In progress we (always) trust.

vicmarcal
Test Team
Posts: 2732
Joined: Mon Jul 07, 2008 12:35 pm

Re: [IMPROVEMENT] Website automated covergen creator

Post by vicmarcal »

Noting it down for our next website ;)

middings
Posts: 1027
Joined: Tue May 07, 2013 9:18 pm
Location: California, USA

Re: [IMPROVEMENT] Website automated covergen creator

Post by middings »

A DVD case cover will add some fun to the next ReactOS release and to builds distributed by the devs at conferences they visit.

Is there also a matching CD jewel case cover?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest