<?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; Tutorial</title>
	<atom:link href="http://www.umbrella-development.com/tag/tutorial/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>jQuery FAQ fader</title>
		<link>http://www.umbrella-development.com/2010/04/jquery-faq-fader/</link>
		<comments>http://www.umbrella-development.com/2010/04/jquery-faq-fader/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 02:02:59 +0000</pubDate>
		<dc:creator>Umbrella</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Fader]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.umbrella-development.com/?p=259</guid>
		<description><![CDATA[A quick little jquery tutorial for anyone that&#8217;s interested. Of course I&#8217;m going to assume you have at least a little jquery knowledge. Such as setting up the basic foundation for the jquery library.
Now that that&#8217;s out of the way. Today I had to make some quick documentation for a piece of software and I [...]]]></description>
			<content:encoded><![CDATA[<p>A quick little jquery tutorial for anyone that&#8217;s interested. Of course I&#8217;m going to assume you have at least a little jquery knowledge. Such as setting up the basic foundation for the jquery library.</p>
<p>Now that that&#8217;s out of the way. Today I had to make some quick documentation for a piece of software and I wanted a simple single page FAQ system where the questions were at the top of the page and the answers would display inside a dedicated viewing window.</p>
<p>To accomplish this I decided to go with jQuery. And after writing it I figured I&#8217;d share it with you.  So lets get started.</p>
<p>First we are going to need a container for our Questions list. As well as a container (or div) for our Answers. AND&#8230;. A little travelling music please.</p>
<pre class="brush: xml;">
&lt;div id=&quot;QContainer&quot; style=&quot; margin:15px auto; &quot;&gt;
    &lt;div  style=&quot;float:left; width: 45%; &quot;&gt;
        &lt;h3&gt;Basic Topics&lt;/h3&gt;
        &lt;ul&gt;
            &lt;li &gt;Question 1&lt;/li&gt;
            &lt;li &gt;Question 2&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Pretty simple right? A standard list where we put our questions. I&#8217;ve only put in a couple examples. You will notice our first <strong>div</strong> element has the id of <strong><em>QContainer</em></strong> this is so we have a id to refer to this element inside our jquery code later. Now lets build our shell for our answer area.</p>
<pre class="brush: xml;">
&lt;div id=&quot;AContainer&quot; style=&quot;width:90%; margin:15px auto; padding:15px; overflow: auto; visibility:hidden;&quot;&gt;
    &lt;ul  &gt;
        &lt;li&gt;
            &lt;h2&gt;ANSWER 1&lt;/h2&gt;
        &lt;/li&gt;
        &lt;li&gt;
            &lt;h2&gt;ANSWER 2&lt;/h2&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>You&#8217;ll notice once again our first element in this code sample is called <strong><em>AContainer</em></strong>, again this will be referenced later in our jquery code. We&#8217;re almost there now, next we have to add some other ID&#8217;s to some elements in both the question and answer list so we can refer to them later just like our main Container div&#8217;s.  First in our Questions area, we need to give our UL an id so we can refrence it. For prosperities sake I&#8217;ve named this <strong><em>questions.</em></strong> Then we need to give each of our LI elements a title attribute that makes them unique, I decided to name them Q1 and Q2.</p>
<pre class="brush: xml;">
&lt;div id=&quot;QContainer&quot; style=&quot;width:50%; margin:15px auto; &quot;&gt;
    &lt;div  style=&quot;float:left; width: 45%; &quot;&gt;
        &lt;h3&gt;Basic Topics&lt;/h3&gt;
        &lt;ul id=&quot;questions&quot;&gt;
            &lt;li title=&quot;Q1&quot;&gt;Question 1&lt;/li&gt;
            &lt;li title=&quot;Q2&quot;&gt;Question 2&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Next we have to give our Answers area a couple more ID&#8217;s as well. I named our Answers UL element with an ID of answers and each LI needs to have an ID that corresponds to the title of the question it answers. For instance when your user clicks Question 1 which has a title value of Q1, we need an answer LI element with an ID of Q1 as well.  Look at the next example section of code if that doesn&#8217;t make any sense to you.</p>
<pre class="brush: xml;">
&lt;div id=&quot;AContainer&quot; style=&quot;width:90%; margin:15px auto; padding:15px; overflow: auto; visibility:hidden;&quot;&gt;
    &lt;ul  id=&quot;answers&quot;&gt;
        &lt;li id=&quot;Q1&quot;&gt;
            &lt;h2&gt;ANSWER 1&lt;/h2&gt;
        &lt;/li&gt;
        &lt;li id=&quot;Q2&quot;&gt;
            &lt;h2&gt;ANSWER 2&lt;/h2&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>So now we&#8217;re ready to write some jQuery code and get this thing working. Lets start with the document ready statement. We want to make sure we start with all of our Answers hidden.</p>
<pre class="brush: jscript;">
&lt;SCRIPT type=&quot;text/javascript&quot; &gt;
        $(document).ready(function() {
            $('#answers li').hide('fast', function(){
                $('#AContainer).css('visibility', 'visible');
            });
         });
    &lt;/SCRIPT&gt;
</pre>
<p>Next I wanted to make sure I could handle multiple q/a lists so I added some more code to the above ready function. We start this with creating an array of all of our question lists, so just keep adding the names of your lists to this array and all should be well.</p>
<pre class="brush: jscript;">
            var qLists=[&quot;#questions&quot;];
            for (x in qLists)
            {
                $( qLists[x] + &quot; li&quot; ).click(showAnswer);
                $( qLists[x] + &quot; li&quot; ).hover(handleHover);
                $( qLists[x] ).mouseout(handleMouseOut);
            }
</pre>
<p>Next we need to be able to show and hide the  answers when the user clicks on them&#8230; yea, finally some fun stuff! This function also goes inside the ready statement we started with, but after our array of question lists. This spod you could just copy and paste if you wanted. No changes needed. </p>
<pre class="brush: jscript;">
            function showAnswer(){
                var elem = '#' + $(this).attr('title');
                $(elem).parent().children().fadeOut('fast').delay(800);
                $(elem).fadeIn('slow');
                for (x in qLists)
                {
                    if(qLists[x] != '#'+$(this).parent().attr('id'))
                    {
                        $( qLists[x] ).children().removeClass('selected');
                    }
                }
                $(this).parent().children().removeClass('selected');
                $(this).addClass('selected');           
            }
</pre>
<p>Then I also wanted to be able to have the Question list highlight which question we were on hence we have a <strong>handleHover</strong> function . Again, just copy and paste.  Of course if we only do this and we have two lists then each list could have a highlighted question&#8230;so a FAQ with multiple lists could have an item in each list hightlighted. So to correct thia I added th <strong>handleMouseOut()</strong> function. Both of these functions require no editing and can be used as is.</p>
<pre class="brush: jscript;">
            function handleHover()
            {
                $(this).parent().children().removeClass('highlight');
                $(this).addClass('highlight');
            } 

            function handleMouseOut()
            {
                $(this).children().removeClass('highlight');
            }
</pre>
<p>one last thing you will need for this to really work you will need the following css classes. Of course you can edit these to your liking. </p>
<pre class="brush: css;">
        #answers
        {
            list-style-type: none;
            padding:0;
            margin:0;
            width:100%;
        }
        #QContainer ul
        {
            list-style-type: none;
            padding:0;
            margin:0 0 0 20px;
        }
        #QContainer ul li
        {
            diplay:block;
            cursor: pointer; cursor: hand;
            padding:3px;
            font-weight:bold;
            margin:0;
        }
        .selected { color:#000; background:#EAEAAE; }
        .highlight { background:#EAEAAE; }
</pre>
<p>Finally if you followed along correctly your javascript should look like this:</p>
<pre class="brush: jscript;">

&lt;SCRIPT type=&quot;text/javascript&quot; &gt;
        $(document).ready(function() {
            $('#answers li').hide('fast', function(){
                $('#AContainer).css('visibility', 'visible');
            });

            var qLists=[&quot;#questions&quot;];
            for (x in qLists)
            {
                $( qLists[x] + &quot; li&quot; ).click(showAnswer);
                $( qLists[x] + &quot; li&quot; ).hover(handleHover);
                $( qLists[x] ).mouseout(handleMouseOut);
            }

            function showAnswer(){
                var elem = '#' + $(this).attr('title');
                $(elem).parent().children().fadeOut('fast').delay(800);
                $(elem).fadeIn('slow');
                for (x in qLists)
                {
                    if(qLists[x] != '#'+$(this).parent().attr('id'))
                    {
                        $( qLists[x] ).children().removeClass('selected');
                    }
                }
                $(this).parent().children().removeClass('selected');
                $(this).addClass('selected');           
            }

            function handleHover()
            {
                $(this).parent().children().removeClass('highlight');
                $(this).addClass('highlight');
            }

            function handleMouseOut()
            {
                $(this).children().removeClass('highlight');
            }

         });
    &lt;/SCRIPT&gt;</pre>
<p>Of course you could expand on this and use it for things other than an FAQ display and if you do we&#8217;d love to see what you used it for and how you implemented it. Love to hear your feedback as well. Have a better way of accomplishing this please share. All we ask is that if you do use this code you make sure you are using it for good and not evil. Have a great day and check back for more tutorials and tips.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.umbrella-development.com/2010/04/jquery-faq-fader/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Featured Auctions Displayed</title>
		<link>http://www.umbrella-development.com/2010/03/featured-auctions-displayed/</link>
		<comments>http://www.umbrella-development.com/2010/03/featured-auctions-displayed/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 23:09:00 +0000</pubDate>
		<dc:creator>Umbrella</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[iLance]]></category>
		<category><![CDATA[ilance]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.umbrella-development.com/?p=243</guid>
		<description><![CDATA[It&#8217;s a common question. How do we make the front page show more than just 3 featured product or service Auctions? And it&#8217;s not as hard as you think!
Open your main.php file in your favorite editor and then find the following code
&#60;br /&#62;
        // #### FEATURE AUCTIONS ###############################################&#60;br [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a common question. How do we make the front page show more than just 3 featured product or service Auctions? And it&#8217;s not as hard as you think!</p>
<p>Open your main.php file in your favorite editor and then find the following code<span id="more-243"></span></p>
<pre class="brush: php; first-line: 1466; highlight: [1471,1475];">&lt;br /&gt;
        // #### FEATURE AUCTIONS ###############################################&lt;br /&gt;
        $show['featuredserviceauctions'] = $show['featuredproductauctions'] = false;&lt;br /&gt;
        $featuredserviceauctions = $featuredproductauctions = array();&lt;/p&gt;
&lt;p&gt;        if ($ilconfig['globalauctionsettings_serviceauctionsenabled'])&lt;br /&gt;
        {&lt;br /&gt;
                $featuredserviceauctions = $ilance-&amp;gt;auction-&amp;gt;fetch_featured_auctions('service', 3, 1, 0, '', true);&lt;br /&gt;
        }&lt;br /&gt;
        if ($ilconfig['globalauctionsettings_productauctionsenabled'])&lt;br /&gt;
        {&lt;br /&gt;
                $featuredproductauctions = $ilance-&amp;gt;auction-&amp;gt;fetch_featured_auctions('product', 3, 2, 0, '', true);&lt;br /&gt;
        }&lt;br /&gt;
</pre>
<p>You will note line 1471 and 1475 are highlighted in the code above. These are the two lines we need to edit to change the number of auctions we are displaying. You will note that in each line there is a 3. This is the number of featured auctions that will be returned. Just change that number to equal how many you want to have appear on your main page.</p>
<p> Thats it.</p>
<p>See I told you it was easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.umbrella-development.com/2010/03/featured-auctions-displayed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Member Profiles &#8211; Default Tabs?</title>
		<link>http://www.umbrella-development.com/2009/12/member-profiles-default-tabs/</link>
		<comments>http://www.umbrella-development.com/2009/12/member-profiles-default-tabs/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 02:40:33 +0000</pubDate>
		<dc:creator>Umbrella</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[iLance]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ilance]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.grimeygames.com/umdev/?p=127</guid>
		<description><![CDATA[It was recently asked in the iLance forums how to set which tab is the default that appears on a members profile when someone clicks the link. Our goal here is to make the Full Profile tab be our default visible tab whenever someone clicks a username link to go to their profile. There are several ways to [...]]]></description>
			<content:encoded><![CDATA[<p>It was recently asked in the<a href="http://www.ilance.com/forum/showthread.php?p=33976&amp;posted=1#post33976" target="_blank"> iLance forums</a> how to set which tab is the default that appears on a members profile when someone clicks the link. Our goal here is to make the Full Profile tab be our default visible tab whenever someone clicks a username link to go to their profile. There are several ways to accomplish this, so lets review them.</p>
<p>First we need to know how iLance prints the username and it&#8217;s associated link. One might think it&#8217;s straight forward, and that editing the html template will do the trick. Sorry, that&#8217;s not the case. With a little digging you will find that iLance prints the users name and profile link with a function called <strong>print_username</strong>. You&#8217;ll find this function in the <strong>functions/core/</strong> directory buried in the <strong>functions.php</strong> file.</p>
<p>The function accepts a number of parameters which you can see in the code below:</p>
<pre class="brush: php;"> 

function print_username($userid, $mode = 'href', $bold = 0, $extra = '', $extraseo = '', $displayname = '')
{
</pre>
</pre>
<ol>
<li>The userid...simple enough.</li>
<li>The Mode, upon reviewing the code you will find that there are several modes for this function to handle. those being:<br />
<strong>href, plain, custom, and url</strong>.</li>
<li>bold. A simple 1 or 0 will tell the function whether or not to make the link bold.</li>
<li>extra: allows us to pass custom parameters to the url that will be placed inside the link</li>
<li>extraseo: allows us to pass custom parameters to the url and will display the url and not return a link.</li>
<li>The final one doesn't even warrant an explaination. <img src='http://www.umbrella-development.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>Now that we know our function lets look at a couple different ways to acheive our goal. The first and simplest approach is to hack the function to make it do what we want. Simple enough. I personally am not using SEO currently so in this example I will only show how to alter the regular links.</p>
<p>First we need to find everywhere in the code where we are building the link I've highlighted the relevant lines below so you can see what I'm talking about.</p>
<pre class="brush: php; first-line: 3946; highlight: [3969,3996,4008];">

function print_username($userid, $mode = 'href', $bold = 0, $extra = '', $extraseo = '', $displayname = '')
{
        global $ilance, $myapi, $ilpage, $ilconfig;
       
        $username = fetch_user('username', intval($userid));
        $html = '';
       
        // modes: href and plain
        if (isset($mode) AND $mode == 'href')
        {
                $displayname = $username;
                // bold usernames?
                if (!empty($bold) AND $bold)
                {
                        $displayname = '&lt;strong&gt;'.$username.'&lt;/strong&gt;';
                }
                // does admin use SEO urls?
                if ($ilconfig['globalauctionsettings_seourls'])
                {
                        $html .= '&lt;a href=&quot;' . ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . print_seo_url($ilconfig['memberslistingidentifier']) . '/' . construct_seo_url_name($username) . $extraseo . '&quot; rel=&quot;nofollow&quot;&gt;' . $displayname . '&lt;/a&gt; ' . construct_username_bits(intval($userid));
                }
                else
                {
                        $html .= '&lt;a href=&quot;' . ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . $ilpage['members'] . '?id=' . intval($userid) . $extra . '&amp;profile=1&quot; rel=&quot;nofollow&quot;&gt;' . $displayname . '&lt;/a&gt; ' . construct_username_bits(intval($userid));
                }   
        }
        else if (isset($mode) AND $mode == 'plain')
        {
                $displayname = $username;
                // bold usernames?
                if (!empty($bold) AND $bold)
                {
                        $username = '&lt;strong&gt;'.$displayname.'&lt;/strong&gt;';
                }
                $html = $username;
        }
        else if (isset($mode) AND $mode == 'custom')
        {
                // bold usernames?
                if (!empty($bold) AND $bold)
                {
                        $displayname = '&lt;strong&gt;'.$displayname.'&lt;/strong&gt;';
                }
                // does admin use SEO urls?
                if ($ilconfig['globalauctionsettings_seourls'])
                {
                        $html .= '&lt;a href=&quot;' . ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . print_seo_url($ilconfig['memberslistingidentifier']) . '/' . construct_seo_url_name($username) . $extraseo . '&quot; rel=&quot;nofollow&quot;&gt;' . $displayname . '&lt;/a&gt;';
                }
                else
                {
                        $html .= '&lt;a href=&quot;' . ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . $ilpage['members'] . '?id=' . intval($userid) . $extra . '&quot; rel=&quot;nofollow&quot;&gt;' . $displayname . '&lt;/a&gt;';
                }
        }
        else if (isset($mode) AND $mode == 'url')
        {
                // does admin use SEO urls?
                if ($ilconfig['globalauctionsettings_seourls'])
                {
                        $html .= ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . print_seo_url($ilconfig['memberslistingidentifier']) . '/' . construct_seo_url_name($username) . $extraseo;
                }
                else
                {
                        $html .= ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . $ilpage['members'] . '?id=' . intval($userid) . $extra;
                }
        }
       
        return $html;
}
</pre>
<p> </p>
<p>Now we need to alter the code. Lets take our first highlighted line as an example:</p>
<pre class="brush: php;">

$html .= '&lt;a href=&quot;' . ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . $ilpage['members'] . '?id=' . intval($userid) . $extra . '&quot; rel=&quot;nofollow&quot;&gt;' . $displayname . '&lt;/a&gt; ' . construct_username_bits(intval($userid));
</pre>
<p>make it look like this:</p>
<pre class="brush: php;">

$html .= '&lt;a href=&quot;' . ((PROTOCOL_REQUEST == 'https') ? HTTPS_SERVER : HTTP_SERVER) . $ilpage['members'] . '?id=' . intval($userid) . $extra . '&amp;profile=1&quot; rel=&quot;nofollow&quot;&gt;' . $displayname . '&lt;/a&gt; ' . construct_username_bits(intval($userid));
</pre>
<p>If you look closely you will notice right after the <strong>$extra.'</strong> we added <strong>&amp;profile=1"</strong> so now it looks like this <strong>$extra . '&amp;profile=1"</strong></p>
<p>Now just do this for all three highlighted areas in the code and you're done! Right? Well, yes and no. You are if you don't mind a hackjob. The more elegant way to do this and the way it was meant to be used, albeit the more time consuming method is to use the function as it is supposed to be used. By setting the parameters the way you want them set when you call the function.</p>
<p>What did he just say?!!</p>
<p>Simple, throughout the iLance script the <strong>print_username</strong> function is called. Do a find all with your favorite editor and then recode the calls to the functions so they provide the desired results. Of course this is also the more code intense way as well and you will need to be familiar with php and html.</p>
<p>For example, the forum ask's how this can be achieved from auction area. So for example we will use a product or forward auction as an example. Navigate to a product auction on your marketplace. You will note that the page in the url that you are looking at is <strong>merch.php</strong>, open that file, follow the code to the correct template. In our case the template is <strong>listing_forward_auction.html</strong> now open that up. Follow the template html to where the link is appearing. You will find it is actually being parsed into the template as a variable called <strong>{seller}</strong></p>
<pre class="brush: xml;">

{apihook[seller_infobit_table_start]}
        
        &lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;9&quot; cellspacing=&quot;1&quot;&gt;
        &lt;tr&gt;
            &lt;td width=&quot;35%&quot;&gt;&lt;span style=&quot;font-family: arial; font-size:15px;&quot;&gt;&lt;strong&gt;{seller}&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;
</pre>
<p>Now if we go back the the merch.php file, and scroll up until we find where $seller is being set we will find something like this:</p>
<pre class="brush: php; first-line: 1469;">
$seller = print_username($res_project_user['user_id'], 'href', 0, '', '');
</pre>
<p>Now we would want to update this code to looke like this</p>
<pre class="brush: php; first-line: 1469;">
$seller = print_username($res_project_user['user_id'], 'href', 0, '&amp;profile=1', '');
</pre>
<p> </p>
<p>Now you would just have to do this simple little change all over the place. The trick is finding where you want to do it and everywhere it occurs. How to accomplish this falls outside the realm of this tutorial, but hey, you're an iLancer, which means you'll find a way! The only real problem with this, is when you upgrade your changes will be over-written so make sure you make good notes of where you changed things.</p>
<p> </p>
<p>Hope this tutorial helped some people. Now I turn it over to you, discuss...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.umbrella-development.com/2009/12/member-profiles-default-tabs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<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>
