added spaces + some curly braces + some usage of dbm::is_result()
Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
parent
27b3943cc7
commit
cdff732044
2 changed files with 25 additions and 27 deletions
|
@ -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),
|
||||||
|
|
|
@ -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');
|
||||||
|
|
Loading…
Add table
Reference in a new issue