Dynamic content for downloads
This commit is contained in:
parent
baf87075d3
commit
10d4c864a2
118
functions.php
118
functions.php
@ -27,26 +27,46 @@ function openmamba_download_link($milestone, $medium, $currarch, $ext, $mlword,
|
||||
$displaymilestone = "$milestone";
|
||||
}
|
||||
$currreleasetag=$releaseTag[$medium.'-'.$milestone.'-'.$lang.'-'.$currarch];
|
||||
$ret = '';
|
||||
if ("$currreleasetag" != "") {
|
||||
echo "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>";
|
||||
echo "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'><a href=\"/media/$milestone/$medium/$lang/openmamba-$medium-$lang-$currreleasetag.$currarch$ext\">";
|
||||
echo "openmamba $displaymilestone $medium ";
|
||||
echo _e('for','responsive')." $currarch ($mlword)</a> </h5>";
|
||||
echo "<i>";
|
||||
echo _e('File size:','responsive').' '.$sizeMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch].'B; ';
|
||||
echo _e('Date','responsive').': '.substr($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch],
|
||||
$ret .= "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>";
|
||||
$ret .= "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'><a href=\"/media/$milestone/$medium/$lang/openmamba-$medium-$lang-$currreleasetag.$currarch$ext\">";
|
||||
$ret .= "openmamba $displaymilestone $medium ";
|
||||
$ret .= __('for','responsive')." $currarch ($mlword)</a> </h5>";
|
||||
$ret .= "<i>";
|
||||
$ret .= __('File size:','responsive').' '.$sizeMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch].'B; ';
|
||||
$ret .= __('Date','responsive').': '.substr($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch],
|
||||
0, strpos($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch], ' '));
|
||||
echo "; Md5: " . $md5Medium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch];
|
||||
echo "</i></td></tr></table>";
|
||||
$ret .= "; Md5: " . $md5Medium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch];
|
||||
$ret .= "</i></td></tr></table>";
|
||||
} else {
|
||||
echo "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>";
|
||||
echo "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'>";
|
||||
echo "openmamba $displaymilestone $medium ";
|
||||
echo _e('for','responsive')." $currarch ($mlword) </h5>";
|
||||
echo "<i><font color=red>";
|
||||
echo _e('Sorry, download is temporary unavailable. If the problem persists please report the problem.','responsive');
|
||||
echo "</font></i></td></tr></table>";
|
||||
$ret .= "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>";
|
||||
$ret .= "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'>";
|
||||
$ret .= "openmamba $displaymilestone $medium ";
|
||||
$ret .= __('for','responsive')." $currarch ($mlword) </h5>";
|
||||
$ret .= "<i><font color=red>";
|
||||
$ret .= __('Sorry, download is temporary unavailable. If the problem persists please report the problem.','responsive');
|
||||
$ret .= "</font></i></td></tr></table>";
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function openmamba_infofile($mediaprefix, $milestone, $fallbackmilestone, $medium, $outputlang, $filename) {
|
||||
if (file_exists("$mediaprefix/$milestone/$medium/info/$filename.$outputlang.html.inc")) {
|
||||
$script_file = "$mediaprefix/$milestone/$medium/info/$filename.$outputlang.html.inc";
|
||||
} else if (file_exists("$mediaprefix/$fallbackmilestone/$medium/info/$filename.$outputlang.html.inc")) {
|
||||
$script_file = "$mediaprefix/$fallbackmilestone/$medium/info/$filename.$outputlang.html.inc";
|
||||
}
|
||||
$ret = '';
|
||||
if ($script_file) {
|
||||
$file = fopen($script_file, "r");
|
||||
while (!feof($file)) {
|
||||
$b=fread($file,1024);
|
||||
$ret .= $b;
|
||||
}
|
||||
fclose($file);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function openmamba_download_func( $atts ) {
|
||||
@ -74,40 +94,54 @@ function openmamba_download_func( $atts ) {
|
||||
$outputlang = get_bloginfo("language");
|
||||
if ("$outputlang" != "it") {
|
||||
$outputlang = "en";
|
||||
$forword = "for";
|
||||
$mlword = "multilanguage";
|
||||
} else {
|
||||
$forword = "per";
|
||||
$mlword = "multilingue";
|
||||
}
|
||||
print "<h3>openmamba $medium $displaymilestone</h3>";
|
||||
$ret = "<h3>openmamba $medium $displaymilestone</h3>";
|
||||
|
||||
if (file_exists("$mediaprefix/$milestone/$medium/info/description.$outputlang.html.inc")) {
|
||||
$script_file = "$mediaprefix/$milestone/$medium/info/description.$outputlang.html.inc";
|
||||
} else if (file_exists("$mediaprefix/$fallbackmilestone/$medium/info/description.$outputlang.html.inc")) {
|
||||
$script_file = "$mediaprefix/$fallbackmilestone/$medium/info/description.$outputlang.html.inc";
|
||||
}
|
||||
if ($script_file) {
|
||||
$file = fopen($script_file, "r");
|
||||
while (!feof($file)) {
|
||||
$b=fread($file,1024);
|
||||
print $b;
|
||||
$ret .= do_shortcode(
|
||||
openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"description"));
|
||||
|
||||
$ret .= "<br><br>";
|
||||
if ($a['multilang']) {
|
||||
reset($archname);
|
||||
while (list(, $currarch) = each($archname)) {
|
||||
if (strpos(";".$a['archs'].";",$currarch) == false) continue;
|
||||
$ret .= openmamba_download_link($milestone,$medium,$currarch,$ext,$mlword,"en");
|
||||
}
|
||||
fclose($file);
|
||||
}
|
||||
reset($archname);
|
||||
while (list(, $currarch) = each($archname)) {
|
||||
if (strpos(";".$a['archs'].";",$currarch) == false) continue;
|
||||
if ($a['multilang']) {
|
||||
openmamba_download_link($milestone,$medium,$currarch,$ext,$mlword,"en");
|
||||
} else {
|
||||
openmamba_download_link($milestone,$medium,$currarch,$ext,"italiano","it");
|
||||
openmamba_download_link($milestone,$medium,$currarch,$ext,"english","en");
|
||||
openmamba_download_link($milestone,$medium,$currarch,$ext,"español","es");
|
||||
} else {
|
||||
reset($archname);
|
||||
$langs = array('it' => 'italiano','en' => 'english','es' => 'español');
|
||||
while (list(, $currarch) = each($archname)) {
|
||||
if (strpos(";".$a['archs'].";",$currarch) == false) continue;
|
||||
$ret .= openmamba_download_link($milestone,$medium,$currarch,$ext,$langs[$outputlang],$outputlang);
|
||||
}
|
||||
foreach ($langs as $l => $lang) {
|
||||
if ($l == $outputlang) continue;
|
||||
reset($archname);
|
||||
while (list(, $currarch) = each($archname)) {
|
||||
if (strpos(";".$a['archs'].";",$currarch) == false) continue;
|
||||
$out .= openmamba_download_link($milestone,$medium,$currarch,$ext,$lang,$l);
|
||||
}
|
||||
}
|
||||
$ret .= do_shortcode("[expand title=\"". __("More languages...",responsive) . "\"]". $out ."[/expand]");
|
||||
}
|
||||
echo "<hr>";
|
||||
return;
|
||||
|
||||
$ret .= do_shortcode(" [expand title=\"".__("Features",responsive)."\"]".
|
||||
openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"features").
|
||||
"[/expand]");
|
||||
|
||||
$ret .= do_shortcode(" [expand title=\"".__("Requirements",responsive)."\"]".
|
||||
openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"requirements").
|
||||
"[/expand]");
|
||||
|
||||
$ret .= do_shortcode(" [expand title=\"".__("Preparation",responsive)."\"]".
|
||||
openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"howto").
|
||||
"[/expand]");
|
||||
|
||||
$ret .= "<hr>";
|
||||
return $ret;
|
||||
}
|
||||
add_shortcode('openmamba_download', 'openmamba_download_func');
|
||||
|
||||
|
BIN
languages/it.mo
BIN
languages/it.mo
Binary file not shown.
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Responsive Theme\n"
|
||||
"Report-Msgid-Bugs-To: bugs@openmamba.org\n"
|
||||
"POT-Creation-Date: 2014-12-29 14:26+0100\n"
|
||||
"POT-Creation-Date: 2015-01-04 16:16+0100\n"
|
||||
"PO-Revision-Date: 2014-12-08 16:25+0100\n"
|
||||
"Last-Translator: Silvan Calarco <silvan.calarco@mambasoft.it>\n"
|
||||
"Language-Team: Italian, Italy\n"
|
||||
@ -24,24 +24,41 @@ msgstr "Leggi di più ›"
|
||||
msgid "Pages:"
|
||||
msgstr "Pagine:"
|
||||
|
||||
#: ../functions.php:34 ../functions.php:45
|
||||
#: ../functions.php:35 ../functions.php:46
|
||||
msgid "for"
|
||||
msgstr "per"
|
||||
|
||||
#: ../functions.php:36
|
||||
#: ../functions.php:37
|
||||
msgid "File size:"
|
||||
msgstr "Dimensione file:"
|
||||
|
||||
#: ../functions.php:37
|
||||
#: ../functions.php:38
|
||||
msgid "Date"
|
||||
msgstr "Data"
|
||||
|
||||
#: ../functions.php:47
|
||||
#: ../functions.php:48
|
||||
msgid ""
|
||||
"Sorry, download is temporary unavailable. If the problem persists please "
|
||||
"report the problem."
|
||||
msgstr "Il download non è temporaneamente disponibile. Se il problema persiste "
|
||||
"ti ringraziamo se ci puoi segnalare il problema."
|
||||
msgstr ""
|
||||
"Il download non è temporaneamente disponibile. Se il problema persiste ti "
|
||||
"ringraziamo se ci puoi segnalare il problema."
|
||||
|
||||
#: ../functions.php:106
|
||||
msgid "Features"
|
||||
msgstr "Caratteristiche"
|
||||
|
||||
#: ../functions.php:110
|
||||
msgid "Requirements"
|
||||
msgstr "Requisiti"
|
||||
|
||||
#: ../functions.php:114
|
||||
msgid "Preparation"
|
||||
msgstr "Preparazione"
|
||||
|
||||
#: ../functions.php:140
|
||||
msgid "More languages..."
|
||||
msgstr "Altre lingue..."
|
||||
|
||||
#: ../header-webbuild.php:87
|
||||
msgid "↓ Skip to Main Content"
|
||||
@ -59,3 +76,7 @@ msgstr "Registrati"
|
||||
#, php-format
|
||||
msgid "Howdy, %1$s"
|
||||
msgstr "Salve, %1$s"
|
||||
|
||||
#: ../sidebar-top.php:40
|
||||
msgid "Logout"
|
||||
msgstr "Esci"
|
||||
|
3
languages/update-po.sh
Executable file
3
languages/update-po.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
xgettext --default-domain=responsive --language=PHP --keyword=__ --keyword=_e --sort-by-file --copyright-holder="Silvan Calarco" --package-name=openmamba --package-version=1.0 --msgid-bugs-address="bugs@openmamba.org" ../*.php
|
||||
msgmerge it.po responsive.po -o it.po
|
23
style.css
23
style.css
@ -183,3 +183,26 @@ a.mytoplink:active {
|
||||
outline: 0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Disable focus rectangle in Collape-O-Matic */
|
||||
|
||||
.collapseomatic:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.collapseomatic_content {
|
||||
background-color: #CDE1CA;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.collapseomatic_content ul {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.collapseomatic_content p {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.collapseomatic_content div {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
2835
style.css.bak
2835
style.css.bak
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user