示例#1
0
    $user['useravatar'] = "notallowed";
} elseif ($config['useravatar'] == 1) {
    if ($intavatar == "avatar/noavatar.png") {
        $user['useravatar'] = "";
    } else {
        $user['useravatar'] = $intavatar;
    }
} elseif ($config['useravatar'] == 2) {
    if ($user['useravatar']) {
        checksize($user['useravatar']);
    }
} elseif ($config['useravatar'] == 3) {
    if ($intavatar != "avatar/noavatar.png" && !$user['useravatar']) {
        $user['useravatar'] = $intavatar;
    } elseif ($user['useravatar']) {
        checksize($user['useravatar']);
    } else {
        $user['useravatar'] = "";
    }
} else {
    $user['useravatar'] = "";
}
// check signature length.
if ($config['sig_restrict']) {
    if (!check_siglen(preparse_code($user['usersignature']))) {
        $err_msg .= 'Ihre Signatur enthält zuviele Zeichen (max. ' . $config['sig_maxlen'] . ') oder besteht aus zu vielen Zeilen (max. ' . $config['sig_maxlines'] . ').';
    }
}
if (!$user['userpassword']) {
    $err_msg .= 'Bitte geben Sie ein Passwort an';
}
示例#2
0
// echo lang('wish_list');
?>
</span>
    <table border="0" class="table table-striped"><tr>
    <td width="148">Sku</td>
    <td width="148">Product Name</td>
    <td width="338">Product Description</td>
    <td width="195">Size</td>
    <td width="165">Price</td>
    <td width="210">Date Saved</td>
    <td width="210">Action</td>
    
    </tr>
    <?php 
foreach ($watch_list as $watch) {
    $size = checksize($wish->productid);
    ?>
	
<tr>
<td><input type="text" class="span1" name="sku" id="sku" value="<?php 
    echo $watch->sku;
    ?>
" disabled="disabled" /></td>
<td><input type="text" name="name" id="name" value="<?php 
    echo $watch->name;
    ?>
" disabled="disabled" /></td>
<td><input type="text" name="description" id="description" value="<?php 
    echo $watch->description;
    ?>
" disabled="disabled" /></td>
	/**
	 * GetSubscribersFromSegment
	 * Get subscribers from segment. This is esentially the same functions as Subscribers::GetSubscribers(),
	 * but it uses segment's information to fetch subscribers instead of search filter.
	 *
	 * @param Array $segmentIDs An array of segments that we want to fetch subscribers ID from
	 * @param Boolean $countonly Whether to only do a count or get the list of subscribers as well.
	 * @param Array $queuedetails If this is not an empty array, the subscribers returned from the query are put directly into this queue (based on the array fields).
	 *
	 * @return Mixed This will return the count only if that is set to true. Otherwise this will return an array of data including the count and the subscriber list.
	 *
	 * @uses SENDSTUDIO_TABLEPREFIX
	 * @uses Segment_API
	 * @uses Segment_API::Load()
	 * @uses Segment_API::GetSearchInfo()
	 * @uses Segment_API::ReplaceLists()
	 * @uses Segment_API::ReplaceRules()
	 * @uses Segment_API::GetSubscribersCount()
	 * @uses Segment_API::GetSubscribersQueryString()
	 * @uses Db::Query()
	 * @uses Db::FetchOne()
	 * @uses Db::Fetch()
	 */
	function GetSubscribersFromSegment($segmentIDs, $countonly = false, $queuedetails = null, $sortdetails = array())
	{
		$return = array('count' => 0, 'subscriberlist' => 0, 'lists' => array());

		if (empty($sortdetails)) {
			$sortdetails = array('SortBy' => 'emailaddress', 'Direction' => 'asc', 'Max' => 100);
		}

		require_once(dirname(__FILE__) . '/segment.php');

		$count = 0;
		$lists = array();
		$selectQueries = array();
		foreach ($segmentIDs as $id) {
			$segmentAPI = new Segment_API();

			// Cannot load segment
			$status = $segmentAPI->Load($id);
			if (!$status) {
				return array();
			}

			// Get lists that are used in this segment
			$tempLists = $segmentAPI->GetMailingListUsed();
			$lists = array_merge($lists, $tempLists);

			// Get count
			$count += $segmentAPI->GetSubscribersCount(0, true);

			// Get query
			$tempQuery = $segmentAPI->GetSubscribersQueryString(true);
			$selectQueries[] = preg_replace('/^SELECT .*? FROM?/i', '', $tempQuery);
		}
		unset($segmentAPI);

		checksize($count, (isset($sortdetails['Max'])? $sortdetails['Max'] : 100), $countonly);
		$return['count'] = $count;
		$return['lists'] = $lists;

		if (empty($selectQueries)) {
			return array();
		}

		if ($countonly) {
			return $return;
		}

		if (empty($queuedetails)) {
			$temp = 'SELECT DISTINCT subscribers.subscriberid AS subscriberid FROM ';
			$selectQuery = $temp . implode(" UNION {$temp}", $selectQueries);
		} else {
			$queueID = intval($queuedetails['queueid']);
			$queueType = $this->Db->Quote($queuedetails['queuetype']);
			$queueOwnerID = intval($queuedetails['ownerid']);

			$temp = "SELECT DISTINCT {$queueID}, '{$queueType}', {$queueOwnerID}, subscribers.subscriberid, 0 FROM ";

			$selectQuery = 'INSERT INTO [|PREFIX|]queues (queueid, queuetype, ownerid, recipient, processed)';
			$selectQuery .= $temp . implode(" UNION {$temp}", $selectQueries);
		}

		setmax($sortdetails, $selectQuery);
		$selectQuery = preg_replace('/l.subscribedate/', 'subscribers.subscribedate', $selectQuery);

		$search_result = $this->Db->Query($selectQuery);
		if (!$search_result) {
			trigger_error(__CLASS__ . '::' . __METHOD__ . " -- Unable to query database with the following query string: {$selectQuery}", E_USER_NOTICE);
			return array();
		}

		if (!empty($queuedetails)) {
			return array();
		}

		$subscriber_results = array();
		while ($row = $this->Db->Fetch($search_result)) {
			$subscriber_results[] = $row;
		}
		$return['subscriberlist'] = $subscriber_results;

		return $return;
	}