mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-21 09:03:38 +02:00
related to #1428 better icon for install btn and better indentation in php
This commit is contained in:
+20
-22
@@ -45,36 +45,34 @@ DELETE FROM '.CADDIE_TABLE.'
|
|||||||
if (userprefs_get_param('promote-mobile-apps', true))
|
if (userprefs_get_param('promote-mobile-apps', true))
|
||||||
{
|
{
|
||||||
$query = '
|
$query = '
|
||||||
SELECT registration_date
|
SELECT registration_date
|
||||||
FROM '.USER_INFOS_TABLE.'
|
FROM '.USER_INFOS_TABLE.'
|
||||||
WHERE user_id = 1
|
WHERE registration_date IS NOT NULL
|
||||||
;';
|
ORDER BY user_id ASC
|
||||||
|
LIMIT 1
|
||||||
$result = pwg_db_fetch_assoc(pwg_query($query));
|
;';
|
||||||
$register_date = $result['registration_date'];
|
list($register_date) = pwg_db_fetch_row(pwg_query($query));
|
||||||
|
|
||||||
$query = '
|
$query = '
|
||||||
SELECT count(*) as nb_categories
|
SELECT COUNT(*)
|
||||||
FROM '.CATEGORIES_TABLE.'
|
FROM '.CATEGORIES_TABLE.'
|
||||||
;';
|
;';
|
||||||
|
list($nb_cats) = pwg_db_fetch_row(pwg_query($query));
|
||||||
$result = pwg_db_fetch_assoc(pwg_query($query));
|
|
||||||
$nb_cats = $result['nb_categories'];
|
|
||||||
|
|
||||||
$query = '
|
$query = '
|
||||||
SELECT count(*) as nb_images
|
SELECT COUNT(*)
|
||||||
FROM '.IMAGES_TABLE.'
|
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
|
// 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));
|
$template->assign("PROMOTE_MOBILE_APPS", (strtotime($register_date) < strtotime('2 weeks ago') and $nb_cats >= 3 and $nb_images >= 30));
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$template->assign("PROMOTE_MOBILE_APPS", false);
|
$template->assign("PROMOTE_MOBILE_APPS", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | Formats Mode |
|
// | Formats Mode |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ jQuery(document).ready(function(){
|
|||||||
<div class="right-side">
|
<div class="right-side">
|
||||||
<div class="promote-text">
|
<div class="promote-text">
|
||||||
<span>{"Install Piwigo on mobile"|@translate|escape:javascript}</span>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user