added spaces + some curly braces + some usage of dbm::is_result()

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-04-04 19:47:32 +02:00 committed by Roland Häder
parent 27b3943cc7
commit cdff732044
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
2 changed files with 25 additions and 27 deletions

View File

@ -590,7 +590,7 @@ function update_contact_birthdays() {
// This only handles foreign or alien networks where a birthday has been provided. // This only handles foreign or alien networks where a birthday has been provided.
// In-network birthdays are handled within local_delivery // In-network birthdays are handled within local_delivery
$r = q("SELECT * FROM contact WHERE `bd` != '' AND `bd` > '0001-01-01' AND SUBSTRING(`bd`,1,4) != `bdyear` "); $r = q("SELECT * FROM `contact` WHERE `bd` != '' AND `bd` > '0001-01-01' AND SUBSTRING(`bd`, 1, 4) != `bdyear` ");
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
foreach ($r as $rr) { foreach ($r as $rr) {
@ -598,14 +598,12 @@ function update_contact_birthdays() {
$nextbd = datetime_convert('UTC','UTC','now','Y') . substr($rr['bd'], 4); $nextbd = datetime_convert('UTC','UTC','now','Y') . substr($rr['bd'], 4);
/** /*
*
* Add new birthday event for this person * Add new birthday event for this person
* *
* $bdtext is just a readable placeholder in case the event is shared * $bdtext is just a readable placeholder in case the event is shared
* with others. We will replace it during presentation to our $importer * with others. We will replace it during presentation to our $importer
* to contain a sparkle link and perhaps a photo. * to contain a sparkle link and perhaps a photo.
*
*/ */
// Check for duplicates // Check for duplicates
@ -638,7 +636,6 @@ function update_contact_birthdays() {
// update bdyear // update bdyear
q("UPDATE `contact` SET `bdyear` = '%s', `bd` = '%s' WHERE `uid` = %d AND `id` = %d", q("UPDATE `contact` SET `bdyear` = '%s', `bd` = '%s' WHERE `uid` = %d AND `id` = %d",
dbesc(substr($nextbd,0,4)), dbesc(substr($nextbd,0,4)),
dbesc($nextbd), dbesc($nextbd),

View File

@ -82,6 +82,7 @@ function format_event_html($ev, $simple = false) {
} }
/* /*
@TODO old-lost code found?
function parse_event($h) { function parse_event($h) {
require_once('include/Scrape.php'); require_once('include/Scrape.php');