some ratings fixes
This commit is contained in:
parent
46eda6e723
commit
59828593c1
@ -247,7 +247,7 @@ function sync_directories($dirmode) {
|
|||||||
logger('rating updated');
|
logger('rating updated');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$z = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values( '%s', '%s', %d, '%s', '%s', 1 ) ",
|
$z = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ",
|
||||||
dbesc($rr['channel']),
|
dbesc($rr['channel']),
|
||||||
dbesc($rr['target']),
|
dbesc($rr['target']),
|
||||||
intval($rr['rating']),
|
intval($rr['rating']),
|
||||||
|
@ -185,29 +185,6 @@ function poco_load($xchan = '',$url = null) {
|
|||||||
|
|
||||||
$total ++;
|
$total ++;
|
||||||
|
|
||||||
|
|
||||||
$r = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 0 limit 1",
|
|
||||||
dbesc($xchan),
|
|
||||||
dbesc($hash)
|
|
||||||
);
|
|
||||||
|
|
||||||
if(! $r) {
|
|
||||||
q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', 0 ) ",
|
|
||||||
dbesc($xchan),
|
|
||||||
dbesc($hash),
|
|
||||||
intval($rating),
|
|
||||||
dbesc($rating_text),
|
|
||||||
dbesc(datetime_convert())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
q("update xlink set xlink_updated = '%s', xlink_rating = %d, xlink_rating_text = '%s' where xlink_id = %d",
|
|
||||||
dbesc(datetime_convert()),
|
|
||||||
intval($rating),
|
|
||||||
dbesc($rating_text),
|
|
||||||
intval($r[0]['xlink_id'])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
logger("poco_load: loaded $total entries",LOGGER_DEBUG);
|
logger("poco_load: loaded $total entries",LOGGER_DEBUG);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user