<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Umbrella Development &#187; Premiere</title>
	<atom:link href="http://www.umbrella-development.com/tag/premiere/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.umbrella-development.com</link>
	<description></description>
	<lastBuildDate>Sat, 03 Apr 2010 02:06:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding to Daily Auction Newsletters</title>
		<link>http://www.umbrella-development.com/2009/12/adding-to-daily-auction-newsletters/</link>
		<comments>http://www.umbrella-development.com/2009/12/adding-to-daily-auction-newsletters/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 01:44:22 +0000</pubDate>
		<dc:creator>Umbrella</dc:creator>
				<category><![CDATA[iLance]]></category>
		<category><![CDATA[Addon]]></category>
		<category><![CDATA[ilance]]></category>
		<category><![CDATA[Premiere]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.grimeygames.com/umdev/?p=76</guid>
		<description><![CDATA[I was recently asked by a client who purchased our Premiere addon how they could update their cron_daily_auction_newsletter email template so that the listing includes whether or not the New projects are premiere only or not. So I thought I would share that information here, incase anyone else has a similar request.
This tutorial is being [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked by a client who purchased our Premiere addon how they could update their cron_daily_auction_newsletter email template so that the listing includes whether or not the New projects are premiere only or not. So I thought I would share that information here, incase anyone else has a similar request.</p>
<p>This tutorial is being written for ilance version 3.1.9, while it should stand true for 3.1.8 and the upcoming 3.2.0, you should make sure you pay extra close attention to your files if you aren&#8217;t using a vanilla installation of iLance 3.1.9.</p>
<p>Now, we will want to open up our<strong> class.subscription.inc.php </strong>located in the <strong>root/functions/api</strong> directory of your site.</p>
<p>Next you will want to do a Find (cntrl+f) for <strong>cron_daily_auction_newsletter</strong>, your first location should be around line #1948. This is where the iLance system kicks off who get&#8217;s which daily service auction announcements from the site for their selected categories. Of course this spot in the code really just loads the template from the database and then replaces variable parameters with actual information which is created prior to this snippet of code.</p>
<p><strong>Step 1:</strong></p>
<pre class="brush: php; first-line: 1945; highlight: [1948];">
// email user
$ilance-&gt;email-&gt;mail = $seller['email'];
$ilance-&gt;email-&gt;slng = fetch_user_slng($seller['user_id']);
$ilance-&gt;email-&gt;get('cron_daily_auction_newsletter');
$ilance-&gt;email-&gt;set(array(
'{{newsletterbody}}' =&gt; $messagebody,
'{{total}}' =&gt; count($projectsToSend),
));

$ilance-&gt;email-&gt;send();
</pre>
<p><strong>Step 2:</strong><br />
So now that we have a starting point, we need to scroll back up in the file to around line #1894 <em>(your line numbers may very)</em> where you will find the following code:</p>
<pre class="brush: php; first-line: 1894; highlight: [1948];">
if ($ilance-&gt;db-&gt;num_rows($buyerinfo) &gt; 0)
{
     $res_buyer_name = $ilance-&gt;db-&gt;fetch_array($buyerinfo);&lt;/pre&gt;
$messagebody .= strip_vulgar_words(un_htmlspecialchars(stripslashes($project['project_title']))) . &quot;\n&quot;;

// todo: check for seo

$messagebody .= HTTP_SERVER . &quot;rfp.php?id=&quot; . $project['project_id'] . &quot;\n&quot;;

$messagebody .= $phrase['_category'] . &quot;: &quot; . $ilance-&gt;categories-&gt;title(fetch_user_slng($seller['user_id']), 'service', $project['cid']) . &quot;\n&quot;;

$messagebody .= $phrase['_buyer'] . &quot;: &quot; . $res_buyer_name['username'] . &quot;\n&quot;;

$messagebody .= $phrase['_time_left'] . &quot;: &quot; . $ilance-&gt;auction-&gt;auction_timeleft($project['project_id'], '', '', 0, 0, 1) . &quot;\n&quot;;

$messagebody .= &quot;************\n&quot;;

}
</pre>
<p><strong>Step 3:<br />
</strong>Now we need to edit the code from above. You can put it anywhere in there really, but we will put it after the category for our example. First we will check to see if this is a premiere only auction. Do do this we will write the following code.</p>
<pre class="brush: php;">

if($project['premiere_only'] == 1)
{

}
</pre>
<p>We will then create our additional text if the if statement is valid.</p>
<pre class="brush: php;">
if($project['premiere_only'] == 1)
{
$messagebody .= &quot;Project Type: Premiere Only\n&quot;;
}
</pre>
<p>If we want to keep our listings similar we could add an else statement as well like so&#8230;</p>
<pre class="brush: php;">
if($project['premiere_only'] == 1)
{
$messagebody .= &quot;Project Type: Premiere Only\n&quot;;
}else{
$messagebody .= &quot;Project Type: Standard\n&quot;;
}
</pre>
<p><strong>Putting it all together:</strong></p>
<pre class="brush: php; first-line: 1894;">
if ($ilance-&gt;db-&gt;num_rows($buyerinfo) &gt; 0)
{
$res_buyer_name = $ilance-&gt;db-&gt;fetch_array($buyerinfo);&lt;/pre&gt;
$messagebody .= strip_vulgar_words(un_htmlspecialchars(stripslashes($project['project_title']))) . &quot;\n&quot;;

// todo: check for seo

$messagebody .= HTTP_SERVER . &quot;rfp.php?id=&quot; . $project['project_id'] . &quot;\n&quot;;

$messagebody .= $phrase['_category'] . &quot;: &quot; . $ilance-&gt;categories-&gt;title(fetch_user_slng($seller['user_id']), 'service', $project['cid']) . &quot;\n&quot;;
if($project['premiere_only'] == 1)
{
$messagebody .= &quot;Project Type: Premiere Only\n&quot;;
}else{
$messagebody .= &quot;Project Type: Standard\n&quot;;
}

$messagebody .= $phrase['_buyer'] . &quot;: &quot; . $res_buyer_name['username'] . &quot;\n&quot;;

$messagebody .= $phrase['_time_left'] . &quot;: &quot; . $ilance-&gt;auction-&gt;auction_timeleft($project['project_id'], '', '', 0, 0, 1) . &quot;\n&quot;;

$messagebody .= &quot;************\n&quot;;

}
</pre>
<div id="authorbox">
<h3>About Premiere Only Addon</h3>
<p>Premiere Only Addon for iLance 3.1.9 allows you, the marketplace owner, to select various subscription plan types as Premiere Accounts. Once these are established your marketplace members will have the option to allow only Premiere members to bid on their Service Auctions, which in turn encourages non premiere members to upgrade their accounts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.umbrella-development.com/2009/12/adding-to-daily-auction-newsletters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
