Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
laufhannes committed Aug 14, 2011
1 parent 67101ed commit bbb90d6
Show file tree
Hide file tree
Showing 23 changed files with 3,002 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/install/update-v0.6.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS `runalyze_conf` (
-- Add enum 'tool' for plugins
--

ALTER TABLE `runalyze_plugin` CHANGE `type` `type` ENUM( 'panel', 'stat', 'draw', 'tool' ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL
ALTER TABLE `runalyze_plugin` CHANGE `type` `type` ENUM( 'panel', 'stat', 'draw', 'tool' ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL ;



Expand Down Expand Up @@ -101,7 +101,6 @@ INSERT INTO `runalyze_plugin` (`id`, `key`, `type`, `filename`, `name`, `descrip
(3, 'RunalyzePluginPanel_Prognose', 'panel', 'panel.prognose.inc.php', 'Prognose', 'Anzeige der aktuellen Wettkampfprognose.', 'distances|array=1, 3, 5, 10, 21.1, 42.2|Distanzen für die Prognose (kommagetrennt)', 2, 3),
(4, 'RunalyzePluginPanel_Schuhe', 'panel', 'panel.schuhe.inc.php', 'Schuhe', 'Anzeige der bisher gelaufenen Kilometer mit den aktiven Schuhen, bei Bedarf auch der alten Schuhe.', '', 2, 4),
(5, 'RunalyzePluginPanel_Sportler', 'panel', 'panel.sportler.inc.php', 'Sportler', 'Anzeige der Sportlerdaten wie Gewicht und aktueller Ruhepuls (auch als Diagramm).', 'use_weight|bool=true|Gewicht protokollieren\r\nuse_body_fat|bool=true|Fettanteil protokollieren\r\nuse_pulse|bool=true|Ruhepuls protokollieren\r\nwunschgewicht|int=68.0|Wunschgewicht', 1, 5),
(17, 'RunalyzePluginTool_Cacheclean', 'tool', 'class.RunalyzePlugin_CachecleanTool.php', 'Cacheclean', 'Löscht den Cache der Diagramme. Sollte genutzt werden, falls Probleme mit Diagrammen auftauchen.', '', 1, 99),
(6, 'RunalyzePluginStat_Schuhe', 'stat', 'stat.schuhe.inc.php', 'Schuhe', 'Ausführliche Statistiken zu den Schuhen: Durchschnittliche, maximale und absolute Leistung (Kilometer / Tempo).', '', 1, 4),
(7, 'RunalyzePluginStat_Analyse', 'stat', 'stat.analyse.inc.php', 'Analyse', 'Analyse des Trainings zum Tempo, der Distanz und den verschiedenen Trainingstypen.', 'use_type|bool=true|Trainingstypen analysieren\r\nuse_pace|bool=true|Tempobereiche analysieren\r\nuse_pulse|bool=true|Pulsbereiche analysieren\r\nlowest_pulsegroup|int=65|Niedrigster Pulsbereich (%HFmax)\r\npulsegroup_step|int=5|Pulsbereich: Schrittweite\r\nlowest_pacegroup|int=360|Niedrigster Tempobereich (s/km)\r\nhighest_pacegroup|int=210|Höchster Tempobereich (s/km)\r\npacegroup_step|int=15|Tempobereich: Schrittweite', 1, 2),
(8, 'RunalyzePluginStat_Statistiken', 'stat', 'stat.statistiken.inc.php', 'Statistiken', 'Allgemeine Statistiken: Monatszusammenfassung in der Jahresübersicht für alle Sportarten.', '', 1, 1),
Expand All @@ -113,6 +112,7 @@ INSERT INTO `runalyze_plugin` (`id`, `key`, `type`, `filename`, `name`, `descrip
(14, 'RunalyzePluginStat_Trainingspartner', 'stat', 'stat.trainingspartner.inc.php', 'Trainingspartner', 'Wie oft hast du mit wem gemeinsam trainiert?', '', 2, 9),
(15, 'RunalyzePluginStat_Hoehenmeter', 'stat', 'stat.hoehenmeter.inc.php', 'Höhenmeter', 'Die steilsten und bergigsten Läufe sowie der Überblick über die absolvierten Höhenmeter aller Monate.', '', 2, 10),
(16, 'RunalyzePluginStat_Laufabc', 'stat', 'stat.laufabc.inc.php', 'Lauf-ABC', 'Wie oft hast du Lauf-ABC absolviert?', '', 2, 11),
(17, 'RunalyzePluginTool_Cacheclean', 'tool', 'class.RunalyzePlugin_CachecleanTool.php', 'Cacheclean', 'Löscht den Cache der Diagramme. Sollte genutzt werden, falls Probleme mit Diagrammen auftauchen.', '', 1, 99),
(18, 'RunalyzePluginTool_DatenbankCleanup', 'tool', 'class.RunalyzePlugin_DatenbankCleanupTool.php', 'Datenbank-Cleanup', 'Reinigt die Datenbank. Dies ist unter Umständen nach dem Löschen von Trainings notwendig.', '', 1, 99);

--
Expand Down
56 changes: 56 additions & 0 deletions plugin/class.RunalyzePluginPanel_Prognose.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* This file contains the class of the RunalyzePluginPanel "Prognose".
*/
$PLUGINKEY = 'RunalyzePluginPanel_Prognose';
/**
* Class: RunalyzePluginPanel_Prognose
*
* @author Hannes Christiansen <[email protected]>
* @version 1.0
* @uses class::Plugin
* @uses class::PluginPanel
* @uses class::Helper
*/
class RunalyzePluginPanel_Prognose extends PluginPanel {
/**
* Initialize this plugin
* @see PluginPanel::initPlugin()
*/
protected function initPlugin() {
$this->type = Plugin::$PANEL;
$this->name = 'Prognose';
$this->description = 'Anzeige der aktuellen Wettkampfprognose.';

Error::getInstance()->addTodo('PrognosePanel: Add Zwischenzeiten/Marschtabelle', __FILE__, __LINE__);
}

/**
* Set default config-variables
* @see PluginPanel::getDefaultConfigVars()
*/
protected function getDefaultConfigVars() {
$config = array();
$config['distances'] = array('type' => 'array', 'var' => array(1, 3, 5, 10, 21.1, 42.2), 'description' => 'Distanzen f&uuml;r die Prognose (kommagetrennt)');

return $config;
}

/**
* Method for getting the right symbol(s)
* @see PluginPanel::getRightSymbol()
*/
protected function getRightSymbol() {
return '';
}

/**
* Display the content
* @see PluginPanel::displayContent()
*/
protected function displayContent() {
foreach ($this->config['distances']['var'] as $km)
echo Helper::Prognosis((double)$km, ((double)$km <= 3));
}
}
?>
91 changes: 91 additions & 0 deletions plugin/class.RunalyzePluginPanel_Rechenspiele.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php
/**
* This file contains the class of the RunalyzePluginPanel "Rechenspiele".
*/
$PLUGINKEY = 'RunalyzePluginPanel_Rechenspiele';
/**
* Class: RunalyzePluginPanel_Rechenspiele
*
* @author Hannes Christiansen <[email protected]>
* @version 1.0
* @uses class::Plugin
* @uses class::PluginPanel
* @uses class::Helper
* @uses class::JD
* @uses class::Ajax
* @uses MAX_ATL
* @uses MAX_CTL
* @uses VDOT_FORM
*/
class RunalyzePluginPanel_Rechenspiele extends PluginPanel {
/**
* Initialize this plugin
* @see PluginPanel::initPlugin()
*/
protected function initPlugin() {
$this->type = Plugin::$PANEL;
$this->name = 'Rechenspiele';
$this->description = 'Anzeige von Rechenspielen zur M&uuml;digkeit, Grundlagenausdauer und Trainingsform. Zus&auml;tzlich werden auch empfohlene Trainingsgeschwindigkeiten angezeigt.';
}

/**
* Set default config-variables
* @see PluginPanel::getDefaultConfigVars()
*/
protected function getDefaultConfigVars() {
$config = array();

return $config;
}

/**
* Method for getting the right symbol(s)
* @see PluginPanel::getRightSymbol()
*/
protected function getRightSymbol() {
return Ajax::window('<a href="plugin/window.rechenspiele.form.php" title="Form anzeigen">'.Icon::get(Icon::$FATIGUE, 'Form anzeigen').'</a>').NL;
}

/**
* Display the content
* @see PluginPanel::displayContent()
*/
protected function displayContent() {
echo('<small class="right r">');

$vVDOT = JD::VDOT2v(VDOT_FORM);

$t = array();
$t[] = array('kurz' => 'RL', 'pVDOT' => '59-64');
$t[] = array('kurz' => 'DL', 'pVDOT' => '65-74');
$t[] = array('kurz' => 'LL', 'pVDOT' => '65-74');
$t[] = array('kurz' => 'TDL', 'pVDOT' => '83-88');
$t[] = array('kurz' => 'IT', 'pVDOT' => '95-100');
$t[] = array('kurz' => 'WHL', 'pVDOT' => '105-110');

foreach ($t as $train) {
$train_tempo = explode('-',$train['pVDOT']);
echo ('
'.$train['kurz'].': <em>'.JD::v2Pace($vVDOT*$train_tempo[1]/100).'</em> - <em>'.JD::v2Pace($vVDOT*$train_tempo[0]/100).'</em>/km<br />');
}

$atl = (MAX_ATL == 0) ? 0 : round(100*Helper::ATL()/MAX_ATL);
$ctl = (MAX_CTL == 0) ? 0 : round(100*Helper::CTL()/MAX_CTL);

echo('</small>
<div class="left" style="width:60%;">
<p><span>'.$atl.' &#37;</span> <strong>M&uuml;digkeit</strong> <small>(ATL)</small></p>
<p><span>'.$ctl.' &#37;</span> <strong>Fitnessgrad</strong> <small>(CTL)</small></p>
<p><span>'.Helper::TSB().'</span> <strong>Stress Balance</strong> <small>(TSB)</small></p>
<p><span>'.round(VDOT_FORM,2).'</span> <strong>VDOT</strong></p>
<p><span>'.Helper::BasicEndurance().'</span> <strong>Grundlagenausdauer</strong></p>
</div>');

echo HTML::clearBreak();

// Fix for clear break in IE
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
echo '&nbsp;';
}
}
?>
75 changes: 75 additions & 0 deletions plugin/class.RunalyzePluginPanel_Schuhe.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php
/**
* This file contains the class of the RunalyzePluginPanel "Schuhe".
*/
$PLUGINKEY = 'RunalyzePluginPanel_Schuhe';
/**
* Class: RunalyzePluginPanel_Schuhe
*
* @author Hannes Christiansen <[email protected]>
* @version 1.0
* @uses class::Plugin
* @uses class::PluginPanel
* @uses class::Mysql
* @uses inc/draw/plugin.schuhe.php
*/
class RunalyzePluginPanel_Schuhe extends PluginPanel {
/**
* Initialize this plugin
* @see PluginPanel::initPlugin()
*/
protected function initPlugin() {
$this->type = Plugin::$PANEL;
$this->name = 'Schuhe';
$this->description = 'Anzeige der gelaufenen Kilometer aller Schuhe.';
}

/**
* Set default config-variables
* @see PluginPanel::getDefaultConfigVars()
*/
protected function getDefaultConfigVars() {
$config = array();

return $config;
}

/**
* Method for getting the right symbol(s)
* @see PluginPanel::getRightSymbol()
*/
protected function getRightSymbol() {
return Ajax::window('<a href="plugin/window.schuhe.php" title="Schuh hinzuf&uuml;gen">'.Icon::get(Icon::$RUNNINGSHOE, 'Schuh hinzuf&uuml;gen').'</a>');
}

/**
* Display the content
* @see PluginPanel::displayContent()
*/
protected function displayContent() {
echo('<div id="schuhe">');

$inuse = true;
$schuhe = Mysql::getInstance()->fetchAsArray('SELECT `id`, `name`, `km`, `inuse` FROM `'.PREFIX.'shoe` ORDER BY `inuse` DESC, `km` DESC');
foreach ($schuhe as $i => $schuh) {
if ($inuse && $schuh['inuse'] == 0) {
echo('<div id="hiddenschuhe" style="display:none;">'.NL);
$inuse = false;
}

echo('
<p style="background-image:url(inc/draw/plugin.schuhe.php?km='.round($schuh['km']).');">
<span>'.Helper::Km($schuh['km']).'</span>
<strong>'.DataBrowser::getSearchLink($schuh['name'], 'opt[shoeid]=is&val[shoeid][0]='.$schuh['id']).'</strong>
</p>'.NL);
}

if (!$inuse)
echo '</div>';
echo '</div>';

echo Ajax::toggle('<a class="right" href="#schuhe" name="schuhe">Alte Schuhe anzeigen</a>', 'hiddenschuhe');
echo HTML::clearBreak();
}
}
?>
96 changes: 96 additions & 0 deletions plugin/class.RunalyzePluginPanel_Sportler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php
/**
* This file contains the class of the RunalyzePluginPanel "Sportler".
*/
$PLUGINKEY = 'RunalyzePluginPanel_Sportler';
/**
* Class: RunalyzePluginPanel_Sportler
*
* @author Hannes Christiansen <[email protected]>
* @version 1.0
* @uses class::Plugin
* @uses class::PluginPanel
* @uses class::Mysql
* @uses class::Ajax
* @uses inc/draw/plugin.sportler.fett.php
* @uses inc/draw/plugin.sportler.gewicht.php
*/
class RunalyzePluginPanel_Sportler extends PluginPanel {
/**
* Initialize this plugin
* @see PluginPanel::initPlugin()
*/
protected function initPlugin() {
$this->type = Plugin::$PANEL;
$this->name = 'Sportler';
$this->description = 'Anzeige der Sportlerdaten wie Gewicht und aktueller Ruhepuls (auch als Diagramm).';
}

/**
* Set default config-variables
* @see PluginPanel::getDefaultConfigVars()
*/
protected function getDefaultConfigVars() {
$config = array();
$config['use_weight'] = array('type' => 'bool', 'var' => true, 'description' => 'Gewicht protokollieren');
$config['use_body_fat'] = array('type' => 'bool', 'var' => true, 'description' => 'Fettanteil protokollieren');
$config['use_pulse'] = array('type' => 'bool', 'var' => true, 'description' => 'Ruhepuls protokollieren');
$config['wunschgewicht'] = array('type' => 'int', 'var' => 0, 'description' => 'Wunschgewicht');

return $config;
}

/**
* Method for getting the right symbol(s)
* @see PluginPanel::getRightSymbol()
*/
protected function getRightSymbol() {
return Ajax::window('<a href="plugin/window.sportler.php" title="Daten hinzuf&uuml;gen">'.Icon::get(Icon::$ADD, 'Daten hinzuf&uuml;gen').'</a>');
}

/**
* Display the content
* @see PluginPanel::displayContent()
*/
protected function displayContent() {
echo('
<div id="sportler">
<div id="sportler-gewicht" class="change">');

$dat = User::getLastRow();
if ($this->config['use_weight'])
$left = '<strong title="'.date("d.m.Y", $dat['time']).'">'.Helper::Unknown($dat['weight']).' kg</strong>';

if ($this->config['use_pulse'])
$right = Helper::Unknown($dat['pulse_rest']).' bpm / '.Helper::Unknown($dat['pulse_max']).' bpm';

echo(' <p>
<span>'.$right.'</span>
<a class="change" href="sportler-analyse" target="sportler"><del>Analyse</del>/Allgemein:</a>
'.$left.'
</p>
<div class="c">
<img src="inc/draw/plugin.sportler.gewicht.php" alt="Diagramm" style="width:320px; height:148px;" />
</div>
</div>
<div id="sportler-analyse" class="change" style="display:none;">');

$left = ''; $right = '';
if ($this->config['use_body_fat'])
$left = '<small>'.Helper::Unknown($dat['fat']).'&#37;Fett, '.Helper::Unknown($dat['water']).'&#37;Wasser, '.Helper::Unknown($dat['muscles']).'&#37;Muskeln</small>';

echo(' <p>
<span>'.$right.'</span>
<a class="change" href="sportler-gewicht" target="sportler">Analyse/<del>Allgemein</del>:</a>
'.$left.'
</p>
<div class="c">
<img src="inc/draw/plugin.sportler.fett.php" alt="Diagramm" style="width:320px; height:148px;" />
</div>
</div>
</div>');
}
}
?>
Loading

0 comments on commit bbb90d6

Please sign in to comment.