<?php
+require_once('mod/settings.php');
+
+function delegate_init(&$a) {
+ return settings_init($a);
+}
+
function delegate_content(&$a) {
$r = q("select `nickname` from user where uid = %d limit 1",
intval($id)
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
$r = q("select id from contact where uid = %d and nurl = '%s' limit 1",
intval(local_user()),
dbesc(normalise_link($a->get_baseurl() . '/profile/' . $r[0]['nickname']))
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
q("insert into manage ( uid, mid ) values ( %d , %d ) ",
intval($a->argv[2]),
intval(local_user())
dbesc($a->user['email']),
dbesc($a->user['password'])
);
- if(count($r))
+ if(dbm::is_result($r))
$full_managers = $r;
$delegates = array();
intval(local_user())
);
- if(count($r))
+ if(dbm::is_result($r))
$delegates = $r;
$uids = array();
dbesc(NETWORK_DFRN)
);
- if(! count($r)) {
+ if(! dbm::is_result($r)) {
notice( t('No potential page delegates located.') . EOL);
return;
}
$nicknames = array();
- if(count($r)) {
+ if(dbm::is_result($r)) {
foreach($r as $rr) {
$nicknames[] = "'" . dbesc(basename($rr['nurl'])) . "'";
}
$r = q("select `uid`, `username`, `nickname` from user where nickname in ( $nicks )");
- if(count($r))
+ if(dbm::is_result($r))
foreach($r as $rr)
if(! in_array($rr['uid'],$uids))
$potentials[] = $rr;
+ require_once("mod/settings.php");
+ settings_init($a);
+
$o = replace_macros(get_markup_template('delegate.tpl'),array(
'$header' => t('Delegate Page Management'),
'$base' => $a->get_baseurl(),
return $o;
-}
\ No newline at end of file
+}