mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
related to #1428 better icon for install btn and better indentation in php
This commit is contained in:
@@ -45,36 +45,34 @@ DELETE FROM '.CADDIE_TABLE.'
|
||||
if (userprefs_get_param('promote-mobile-apps', true))
|
||||
{
|
||||
$query = '
|
||||
SELECT registration_date
|
||||
FROM '.USER_INFOS_TABLE.'
|
||||
WHERE user_id = 1
|
||||
;';
|
||||
|
||||
$result = pwg_db_fetch_assoc(pwg_query($query));
|
||||
$register_date = $result['registration_date'];
|
||||
SELECT registration_date
|
||||
FROM '.USER_INFOS_TABLE.'
|
||||
WHERE registration_date IS NOT NULL
|
||||
ORDER BY user_id ASC
|
||||
LIMIT 1
|
||||
;';
|
||||
list($register_date) = pwg_db_fetch_row(pwg_query($query));
|
||||
|
||||
$query = '
|
||||
SELECT count(*) as nb_categories
|
||||
FROM '.CATEGORIES_TABLE.'
|
||||
;';
|
||||
|
||||
$result = pwg_db_fetch_assoc(pwg_query($query));
|
||||
$nb_cats = $result['nb_categories'];
|
||||
SELECT COUNT(*)
|
||||
FROM '.CATEGORIES_TABLE.'
|
||||
;';
|
||||
list($nb_cats) = pwg_db_fetch_row(pwg_query($query));
|
||||
|
||||
$query = '
|
||||
SELECT count(*) as nb_images
|
||||
FROM '.IMAGES_TABLE.'
|
||||
;';
|
||||
SELECT COUNT(*)
|
||||
FROM '.IMAGES_TABLE.'
|
||||
;';
|
||||
list($nb_images) = pwg_db_fetch_row(pwg_query($query));
|
||||
|
||||
$result = pwg_db_fetch_assoc(pwg_query($query));
|
||||
$nb_images = $result['nb_images'];
|
||||
|
||||
// 2 Weeks = 1209600 seconds
|
||||
// To see the mobile app promote, the account must have 2 weeks ancient, 3 albums created and 30 photos uploaded
|
||||
$template->assign("PROMOTE_MOBILE_APPS", (time() - strtotime($register_date) > 1209600 and $nb_cats >= 3 and $nb_images >= 30));
|
||||
} else {
|
||||
$template->assign("PROMOTE_MOBILE_APPS", (strtotime($register_date) < strtotime('2 weeks ago') and $nb_cats >= 3 and $nb_images >= 30));
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign("PROMOTE_MOBILE_APPS", false);
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Formats Mode |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
@@ -462,7 +462,7 @@ jQuery(document).ready(function(){
|
||||
<div class="right-side">
|
||||
<div class="promote-text">
|
||||
<span>{"Install Piwigo on mobile"|@translate|escape:javascript}</span>
|
||||
<a href="https://piwigo.org/mobile-applications" target="_blank"><span class="go-to-porg icon-download">{"Install"|@translate|escape:javascript}</span></a>
|
||||
<a href="https://piwigo.org/mobile-applications" target="_blank"><span class="go-to-porg icon-link-1">{"Install"|@translate|escape:javascript}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user