当前位置: 首页>>代码示例>>PHP>>正文


PHP getUserAttributeValues函数代码示例

本文整理汇总了PHP中getUserAttributeValues函数的典型用法代码示例。如果您正苦于以下问题:PHP getUserAttributeValues函数的具体用法?PHP getUserAttributeValues怎么用?PHP getUserAttributeValues使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getUserAttributeValues函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Sql_Query

     }
 } else {
     ## mark blacklisted, just in case ##17288
     Sql_Query(sprintf('update %s set blacklisted = 1 where id = %d', $tables['user'], $userid));
     ++$foundBlacklisted;
 }
 $subscribemessage = str_replace('[LISTS]', $listoflists, getUserConfig('subscribemessage', $userid));
 if (!TEST && $importdata['notify'] == 'yes' && $addition) {
     sendMail($email, getConfig('subscribesubject'), $subscribemessage, system_messageheaders(), $envelope);
     if ($throttle_import) {
         sleep($throttle_import);
     }
 }
 # history stuff
 $current_data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables['user'], $userid));
 $current_data = array_merge($current_data, getUserAttributeValues('', $userid));
 foreach ($current_data as $key => $val) {
     if (!is_numeric($key)) {
         if (isset($old_data[$key]) && $old_data[$key] != $val && $key != 'modified') {
             $history_entry .= "{$key} = {$val}\nchanged from {$old_data[$key]}\n";
         }
     }
 }
 if (!$history_entry) {
     $history_entry = "\n" . $GLOBALS['I18N']->get('No data changed');
 }
 # check lists
 $listmembership = array();
 $req = Sql_Query("select * from {$tables['listuser']} where userid = {$userid}");
 while ($row = Sql_Fetch_Array($req)) {
     $listmembership[$row['listid']] = listName($row['listid']);
开发者ID:gillima,项目名称:phplist3,代码行数:31,代码来源:import1.php

示例2: sendEmail

function sendEmail($messageid, $email, $hash, $htmlpref = 0, $rssitems = array(), $forwardedby = array())
{
    $getspeedstats = VERBOSE && !empty($GLOBALS['getspeedstats']) && isset($GLOBALS['processqueue_timer']);
    $sqlCountStart = $GLOBALS["pagestats"]["number_of_queries"];
    $isTestMail = isset($_GET['page']) && $_GET['page'] == 'send';
    ## for testing concurrency, put in a delay to check if multiple send processes cause duplicates
    #usleep(rand(0,10) * 1000000);
    global $strThisLink, $strUnsubscribe, $PoweredByImage, $PoweredByText, $cached, $website, $counters;
    if ($email == "") {
        return 0;
    }
    if ($getspeedstats) {
        output('sendEmail start ' . $GLOBALS['processqueue_timer']->interval(1));
    }
    #0013076: different content when forwarding 'to a friend'
    if (FORWARD_ALTERNATIVE_CONTENT) {
        $forwardContent = sizeof($forwardedby) > 0;
    } else {
        $forwardContent = 0;
    }
    if (empty($cached[$messageid])) {
        if (!precacheMessage($messageid, $forwardContent)) {
            unset($cached[$messageid]);
            logEvent('Error loading message ' . $messageid . '  in cache');
            return 0;
        }
    } else {
        #  dbg("Using cached {$cached[$messageid]["fromemail"]}");
        if (VERBOSE) {
            output('Using cached message');
        }
    }
    if (VERBOSE) {
        output(s('Sending message %d with subject %s to %s', $messageid, $cached[$messageid]["subject"], $email));
    }
    ## at this stage we don't know whether the content is HTML or text, it's just content
    $content = $cached[$messageid]['content'];
    if (VERBOSE && $getspeedstats) {
        output('Load user start');
    }
    $userdata = array();
    $user_att_values = array();
    #0011857: forward to friend, retain attributes
    if ($hash == 'forwarded' && defined('KEEPFORWARDERATTRIBUTES') && KEEPFORWARDERATTRIBUTES) {
        $user_att_values = getUserAttributeValues($forwardedby['email']);
    } elseif ($hash != 'forwarded') {
        $user_att_values = getUserAttributeValues($email);
    }
    if (!is_array($user_att_values)) {
        $user_att_values = array();
    }
    foreach ($user_att_values as $key => $val) {
        $newkey = cleanAttributeName($key);
        ## in the help, we only list attributes with "strlen < 20"
        unset($user_att_values[$key]);
        if (strlen($key) < 20) {
            $user_att_values[$newkey] = $val;
        }
    }
    # print '<pre>';var_dump($user_att_values);print '</pre>';exit;
    $query = sprintf('select * from %s where email = ?', $GLOBALS["tables"]["user"]);
    $rs = Sql_Query_Params($query, array($email));
    $userdata = Sql_Fetch_Assoc($rs);
    if (empty($userdata['id'])) {
        $userdata = array();
    }
    #var_dump($userdata);
    if (stripos($content, "[LISTS]") !== false) {
        $listsarr = array();
        $req = Sql_Query(sprintf('select list.name from %s as list,%s as listuser where list.id = listuser.listid and listuser.userid = %d', $GLOBALS["tables"]["list"], $GLOBALS["tables"]["listuser"], $userdata["id"]));
        while ($row = Sql_Fetch_Row($req)) {
            array_push($listsarr, $row[0]);
        }
        if (!empty($listsarr)) {
            $html['lists'] = join('<br/>', $listsarr);
            $text['lists'] = join("\n", $listsarr);
        } else {
            $html['lists'] = $GLOBALS['strNoListsFound'];
            $text['lists'] = $GLOBALS['strNoListsFound'];
        }
        unset($listsarr);
    }
    if (VERBOSE && $getspeedstats) {
        output('Load user end');
    }
    if ($cached[$messageid]['userspecific_url']) {
        if (VERBOSE && $getspeedstats) {
            output('fetch personal URL start');
        }
        ## Fetch external content, only if the URL has placeholders
        if ($GLOBALS["can_fetchUrl"] && preg_match("/\\[URL:([^\\s]+)\\]/i", $content, $regs)) {
            while (isset($regs[1]) && strlen($regs[1])) {
                $url = $regs[1];
                if (!preg_match('/^http/i', $url)) {
                    $url = 'http://' . $url;
                }
                $remote_content = fetchUrl($url, $userdata);
                # @@ don't use this
                #      $remote_content = includeStyles($remote_content);
                if ($remote_content) {
//.........这里部分代码省略.........
开发者ID:bcantwell,项目名称:website,代码行数:101,代码来源:sendemaillib.php

示例3: Sql_Query

  print $subscribepagedata["header"];
  if ($_SESSION["adminloggedin"]) {
  	print '<p><b>You are logged in as '.$_SESSION["logindetails"]["adminname"].'</b></p>';
    print '<p><a href="'.$adminpages.'">Back to the main admin page</a></p>';
    if ($_POST["makeconfirmed"]) {
    	$sendrequest = 0;
      Sql_Query(sprintf('update %s set confirmed = 1 where email = "%s"',$tables["user"],$email));
    } else {
    	$sendrequest = 1;
		}
  } else {
  	$sendrequest = 1;
  }
  
  # personalise the thank you page
  $user_att = getUserAttributeValues($email);
  while (list($att_name,$att_value) = each ($user_att)) {
  	foreach (array("strEmailConfirmation","strThanks","strEmailFailed") as $var) {
      if (eregi("\[".$att_name."\]",$GLOBALS[$var],$regs))
        $GLOBALS[$var] = eregi_replace("\[".$att_name."\]",$att_value,$GLOBALS[$var]);
      if (eregi("\[email\]",$GLOBALS[$var],$regs))
	      $GLOBALS[$var] = eregi_replace("\[email\]",$email,$GLOBALS[$var]);
   	}
  }

  if ($sendrequest) {
  	if (sendMail($email, getConfig("subscribesubject:$id"), $subscribemessage,system_messageheaders($email),$envelope)) {
    	sendAdminCopy("Lists subscription",$email . " has subscribed to $lists");
  		print '<h3>'.$strThanks.'</h3>';
      print $strEmailConfirmation;
   	} else {
开发者ID:radicaldesigns,项目名称:amp,代码行数:31,代码来源:subscribelib2.php

示例4: getUserConfig

function getUserConfig($item, $userid = 0)
{
    global $default_config, $tables, $domain, $website;
    $hasconf = Sql_Table_Exists($tables["config"]);
    $value = '';
    if ($hasconf) {
        $query = 'select value,editable from ' . $tables['config'] . ' where item = ?';
        $req = Sql_Query_Params($query, array($item));
        if (!Sql_Num_Rows($req)) {
            if (array_key_exists($item, $default_config)) {
                $value = $default_config[$item]['value'];
            }
        } else {
            $row = Sql_fetch_Row($req);
            $value = $row[0];
            if ($row[1] == 0) {
                $GLOBALS['noteditableconfig'][] = $item;
            }
        }
    }
    # if this is a subpage item, and no value was found get the global one
    if (!$value && strpos($item, ":") !== false) {
        list($a, $b) = explode(":", $item);
        $value = getUserConfig($a, $userid);
    }
    if ($userid) {
        $query = 'select uniqid, email from ' . $tables['user'] . ' where id = ?';
        $rs = Sql_Query_Params($query, array($userid));
        $user_req = Sql_Fetch_Row($rs);
        $uniqid = $user_req[0];
        $email = $user_req[1];
        # parse for placeholders
        # do some backwards compatibility:
        # hmm, reverted back to old system
        $url = getConfig("unsubscribeurl");
        $sep = strpos($url, '?') !== false ? '&' : '?';
        $value = str_ireplace('[UNSUBSCRIBEURL]', $url . $sep . 'uid=' . $uniqid, $value);
        $url = getConfig("confirmationurl");
        $sep = strpos($url, '?') !== false ? '&' : '?';
        $value = str_ireplace('[CONFIRMATIONURL]', $url . $sep . 'uid=' . $uniqid, $value);
        $url = getConfig("preferencesurl");
        $sep = strpos($url, '?') !== false ? '&' : '?';
        $value = str_ireplace('[PREFERENCESURL]', $url . $sep . 'uid=' . $uniqid, $value);
        $value = str_ireplace('[EMAIL]', $email, $value);
        $value = parsePlaceHolders($value, getUserAttributeValues($email));
    }
    $value = str_ireplace('[SUBSCRIBEURL]', getConfig("subscribeurl"), $value);
    $value = preg_replace('/\\[DOMAIN\\]/i', $domain, $value);
    #@ID Should be done only in one place. Combine getConfig and this one?
    $value = preg_replace('/\\[WEBSITE\\]/i', $website, $value);
    if ($value == "0") {
        $value = "false";
    } elseif ($value == "1") {
        $value = "true";
    }
    return $value;
}
开发者ID:dehvCurtis,项目名称:phplist,代码行数:57,代码来源:defaultconfig.php

示例5: Sql_Fetch_Row_Query

        if (ENABLE_RSS) {
            $msgcount = Sql_Fetch_Row_Query("select count(*) from {$tables["rssitem"]},{$tables["rssitem_user"]}\n        where {$tables["rssitem"]}.list = {$id} and {$tables["rssitem"]}.id = {$tables["rssitem_user"]}.itemid and\n        {$tables["rssitem_user"]}.userid = {$user["id"]}");
            if ($msgcount[0]) {
                $ls->addColumn($user["email"], $GLOBALS['I18N']->get("# rss"), $msgcount[0]);
            }
            if ($user["rssfrequency"]) {
                $ls->addColumn($user["email"], $GLOBALS['I18N']->get("rss freq"), $user["rssfrequency"]);
            }
            $last = Sql_Fetch_Row_Query("select last from {$tables["user_rss"]} where userid = " . $user["id"]);
            if ($last[0]) {
                $ls->addColumn($user["email"], $GLOBALS['I18N']->get("last sent"), $last[0]);
            }
        }
        if (sizeof($columns)) {
            # let's not do this when not required, adds rather many db requests
            $attributes = getUserAttributeValues('', $user['id']);
            #      foreach ($attributes as $key => $val) {
            #          $ls->addColumn($user["email"],$key,$val);
            #      }
            foreach ($columns as $column) {
                if (isset($attributes[$column]) && $attributes[$column]) {
                    $ls->addColumn($user["email"], $column, $attributes[$column]);
                }
            }
        }
    }
    print $ls->display();
}
if ($access == "view") {
    return;
}
开发者ID:radicaldesigns,项目名称:amp,代码行数:31,代码来源:members.php

示例6: sendEmail

function sendEmail($messageid, $email, $hash, $htmlpref = 0, $rssitems = array(), $forwardedby = array())
{
    global $strThisLink, $PoweredByImage, $PoweredByText, $cached, $website;
    if ($email == "") {
        return 0;
    }
    #0013076: different content when forwarding 'to a friend'
    if (FORWARD_ALTERNATIVE_CONTENT) {
        $forwardContent = sizeof($forwardedby) > 0;
        $messagedata = loadMessageData($messageid);
    } else {
        $forwardContent = 0;
    }
    if (empty($cached[$messageid])) {
        $domain = getConfig("domain");
        $message = Sql_query("select * from {$GLOBALS["tables"]["message"]} where id = {$messageid}");
        $cached[$messageid] = array();
        $message = Sql_fetch_array($message);
        if (ereg("([^ ]+@[^ ]+)", $message["fromfield"], $regs)) {
            # if there is an email in the from, rewrite it as "name <email>"
            $message["fromfield"] = ereg_replace($regs[0], "", $message["fromfield"]);
            $cached[$messageid]["fromemail"] = $regs[0];
            # if the email has < and > take them out here
            $cached[$messageid]["fromemail"] = ereg_replace("<", "", $cached[$messageid]["fromemail"]);
            $cached[$messageid]["fromemail"] = ereg_replace(">", "", $cached[$messageid]["fromemail"]);
            # make sure there are no quotes around the name
            $cached[$messageid]["fromname"] = ereg_replace('"', "", ltrim(rtrim($message["fromfield"])));
        } elseif (ereg(" ", $message["fromfield"], $regs)) {
            # if there is a space, we need to add the email
            $cached[$messageid]["fromname"] = $message["fromfield"];
            $cached[$messageid]["fromemail"] = "listmaster@{$domain}";
        } else {
            $cached[$messageid]["fromemail"] = $message["fromfield"] . "@{$domain}";
            ## makes more sense not to add the domain to the word, but the help says it does
            ## so let's keep it for now
            $cached[$messageid]["fromname"] = $message["fromfield"] . "@{$domain}";
        }
        # erase double spacing
        while (ereg("  ", $cached[$messageid]["fromname"])) {
            $cached[$messageid]["fromname"] = eregi_replace("  ", " ", $cached[$messageid]["fromname"]);
        }
        ## this has weird effects when used with only one word, so take it out for now
        #    $cached[$messageid]["fromname"] = eregi_replace("@","",$cached[$messageid]["fromname"]);
        $cached[$messageid]["fromname"] = trim($cached[$messageid]["fromname"]);
        $cached[$messageid]["to"] = $message["tofield"];
        #0013076: different content when forwarding 'to a friend'
        $cached[$messageid]["subject"] = $forwardContent ? stripslashes($messagedata["forwardsubject"]) : $message["subject"];
        $cached[$messageid]["replyto"] = $message["replyto"];
        #0013076: different content when forwarding 'to a friend'
        $cached[$messageid]["content"] = $forwardContent ? stripslashes($messagedata["forwardmessage"]) : $message["message"];
        if (USE_MANUAL_TEXT_PART && !$forwardContent) {
            $cached[$messageid]["textcontent"] = $message["textmessage"];
        } else {
            $cached[$messageid]["textcontent"] = '';
        }
        #0013076: different content when forwarding 'to a friend'
        $cached[$messageid]["footer"] = $forwardContent ? stripslashes($messagedata["forwardfooter"]) : $message["footer"];
        $cached[$messageid]["htmlformatted"] = $message["htmlformatted"];
        $cached[$messageid]["sendformat"] = $message["sendformat"];
        if ($message["template"]) {
            $req = Sql_Fetch_Row_Query("select template from {$GLOBALS["tables"]["template"]} where id = {$message["template"]}");
            $cached[$messageid]["template"] = stripslashes($req[0]);
            $cached[$messageid]["templateid"] = $message["template"];
            #   dbg("TEMPLATE: ".$req[0]);
        } else {
            $cached[$messageid]["template"] = '';
            $cached[$messageid]["templateid"] = 0;
        }
        ## @@ put this here, so it can become editable per email sent out at a later stage
        $cached[$messageid]["html_charset"] = getConfig("html_charset");
        ## @@ need to check on validity of charset
        if (!$cached[$messageid]["html_charset"]) {
            $cached[$messageid]["html_charset"] = 'iso-8859-1';
        }
        $cached[$messageid]["text_charset"] = getConfig("text_charset");
        if (!$cached[$messageid]["text_charset"]) {
            $cached[$messageid]["text_charset"] = 'iso-8859-1';
        }
    }
    # else
    #  dbg("Using cached {$cached[$messageid]["fromemail"]}");
    if (VERBOSE) {
        output($GLOBALS['I18N']->get('sendingmessage') . ' ' . $messageid . ' ' . $GLOBALS['I18N']->get('withsubject') . ' ' . $cached[$messageid]["subject"] . ' ' . $GLOBALS['I18N']->get('to') . ' ' . $email);
    }
    # erase any placeholders that were not found
    #  $msg = ereg_replace("\[[A-Z ]+\]","",$msg);
    #0011857: forward to friend, retain attributes
    if ($hash == 'forwarded' && defined('KEEPFORWARDERATTRIBUTES') && KEEPFORWARDERATTRIBUTES) {
        $user_att_values = getUserAttributeValues($forwardedby['email']);
    } else {
        $user_att_values = getUserAttributeValues($email);
    }
    $userdata = Sql_Fetch_Assoc_Query(sprintf('select * from %s where email = "%s"', $GLOBALS["tables"]["user"], $email));
    $url = getConfig("unsubscribeurl");
    $sep = ereg('\\?', $url) ? '&' : '?';
    $html["unsubscribe"] = sprintf('<a href="%s%suid=%s">%s</a>', $url, $sep, $hash, $strThisLink);
    $text["unsubscribe"] = sprintf('%s%suid=%s', $url, $sep, $hash);
    $html["unsubscribeurl"] = sprintf('%s%suid=%s', $url, $sep, $hash);
    $text["unsubscribeurl"] = sprintf('%s%suid=%s', $url, $sep, $hash);
    #0013076: Blacklisting posibility for unknown users
//.........这里部分代码省略.........
开发者ID:kvervo,项目名称:phplist-aiesec,代码行数:101,代码来源:sendemaillib.php

示例7: getUserAttributeValues

 public function getUserAttributeValues($email)
 {
     return getUserAttributeValues($email);
 }
开发者ID:Talkpoppycock,项目名称:phplist-plugin-viewbrowser,代码行数:4,代码来源:DAO.php


注:本文中的getUserAttributeValues函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。