Skip to content
Permalink
Browse files

initialize piwigo.com urls for both what-is-piwigo and get-piwigo pages

  • Loading branch information
plegall committed Jan 31, 2020
1 parent 7bd6720 commit b2a57f62bb48cc6f94440e01e23ad40a1c4b6f69
Showing with 49 additions and 41 deletions.
  1. +44 −0 include/functions_piwigodotorg.php
  2. +1 −40 include/get_piwigo.inc.php
  3. +3 −0 include/what_is_piwigo.inc.php
  4. +1 −1 template/what_is_piwigo.tpl
@@ -449,4 +449,48 @@ function porg_get_nb_years()
$diff = $d2->diff($d1);
return $diff->y;
}

function porg_set_pcom_urls()
{
global $page, $template;

$pcom_prefix = isset($page['porg_pcom_prefix']) ? $page['porg_pcom_prefix'] : '';

$pcom_url = array(
'pricing' => 'https://piwigo.com/pricing',
'why' => 'https://piwigo.com/why',
'blog' => 'https://piwigo.com/blog/',
'clients' => 'https://piwigo.com/clients',
);

if ('fr.' == $pcom_prefix)
{
$pcom_url = array(
'pricing' => 'https://'.$pcom_prefix.'piwigo.com/tarifs',
'why' => 'https://'.$pcom_prefix.'piwigo.com/pourquoi-choisir-piwigo',
'blog' => 'https://'.$pcom_prefix.'piwigo.com/blog/',
'clients' => 'https://'.$pcom_prefix.'piwigo.com/clients',
);
}
elseif ('de.' == $pcom_prefix)
{
$pcom_url['pricing'] = 'https://'.$pcom_prefix.'piwigo.com/preise';
$pcom_url['why'] = 'https://'.$pcom_prefix.'piwigo.com/warum-piwigo-wählen';
$pcom_url['clients'] = 'https://'.$pcom_prefix.'piwigo.com/kunden';
}
elseif ('es.' == $pcom_prefix)
{
$pcom_url['pricing'] = 'https://'.$pcom_prefix.'piwigo.com/precios';
$pcom_url['why'] = 'https://'.$pcom_prefix.'piwigo.com/por-que';
$pcom_url['clients'] = 'https://'.$pcom_prefix.'piwigo.com/clientes';
}
elseif ('it.' == $pcom_prefix)
{
$pcom_url['pricing'] = 'https://'.$pcom_prefix.'piwigo.com/plan';
$pcom_url['why'] = 'https://'.$pcom_prefix.'piwigo.com/position';
$pcom_url['clients'] = 'https://'.$pcom_prefix.'piwigo.com/examples';
}

$template->assign('PCOM_URL', $pcom_url);
}
?>
@@ -1,49 +1,10 @@
<?php
global $page;

$latest_version = porg_get_latest_version();
$template->assign(
array(
'LATEST_VERSION_NUMBER' => $latest_version['version'],
)
);

$pcom_prefix = isset($page['porg_pcom_prefix']) ? $page['porg_pcom_prefix'] : '';

$pcom_url = array(
'pricing' => 'https://piwigo.com/pricing',
'why' => 'https://piwigo.com/why',
'blog' => 'https://piwigo.com/blog/',
'clients' => 'https://piwigo.com/clients',
);

if ('fr.' == $pcom_prefix)
{
$pcom_url = array(
'pricing' => 'https://'.$pcom_prefix.'piwigo.com/tarifs',
'why' => 'https://'.$pcom_prefix.'piwigo.com/pourquoi-choisir-piwigo',
'blog' => 'https://'.$pcom_prefix.'piwigo.com/blog/',
'clients' => 'https://'.$pcom_prefix.'piwigo.com/clients',
);
}
elseif ('de.' == $pcom_prefix)
{
$pcom_url['pricing'] = 'https://'.$pcom_prefix.'piwigo.com/preise';
$pcom_url['why'] = 'https://'.$pcom_prefix.'piwigo.com/warum-piwigo-wählen';
$pcom_url['clients'] = 'https://'.$pcom_prefix.'piwigo.com/kunden';
}
elseif ('es.' == $pcom_prefix)
{
$pcom_url['pricing'] = 'https://'.$pcom_prefix.'piwigo.com/precios';
$pcom_url['why'] = 'https://'.$pcom_prefix.'piwigo.com/por-que';
$pcom_url['clients'] = 'https://'.$pcom_prefix.'piwigo.com/clientes';
}
elseif ('it.' == $pcom_prefix)
{
$pcom_url['pricing'] = 'https://'.$pcom_prefix.'piwigo.com/plan';
$pcom_url['why'] = 'https://'.$pcom_prefix.'piwigo.com/position';
$pcom_url['clients'] = 'https://'.$pcom_prefix.'piwigo.com/examples';
}

$template->assign('PCOM_URL', $pcom_url);
porg_set_pcom_urls();
?>
@@ -0,0 +1,3 @@
<?php
porg_set_pcom_urls();
?>
@@ -257,7 +257,7 @@
</div>
<div class="col-xs-6 HowToUse-cloudHosted-text">
<p>{'porg_whatispiwigo_how_to_desc3'|translate} {'porg_whatispiwigo_how_to_desc4'|translate}</p>
<a class="button button2" href="https://piwigo.com/pricing">{'porg_whatispiwigo_test_free'|translate}</a>
<a class="button button2" href="{$PCOM_URL.pricing}">{'porg_whatispiwigo_test_free'|translate}</a>
</div>
</div>
</div>

0 comments on commit b2a57f6

Please sign in to comment.
You can’t perform that action at this time.