<?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>btdsoft.com &#187; OpenX Tips</title>
	<atom:link href="http://btdsoft.com/category/openx-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://btdsoft.com</link>
	<description>OpenX Installation And Support</description>
	<lastBuildDate>Tue, 15 May 2012 01:47:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Openx Market 500 error Fix for cpanel servers</title>
		<link>http://btdsoft.com/openx-market-fix-for-cpanel-servers/</link>
		<comments>http://btdsoft.com/openx-market-fix-for-cpanel-servers/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 16:55:14 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[OpenX Tips]]></category>

		<guid isPermaLink="false">http://btdsoft.com/?p=413</guid>
		<description><![CDATA[Warning this information may be outdated. Please see the forum for up to date RevMax help and instructions. http://www.openxpayments.com. At times when I install OpenX on a cpanel server, after log out, then back in, on a new installation, I will receive a error: 500 server error. Internal Server Error The server encountered an internal [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Warning this information may be outdated</strong>. Please see the forum for up to date RevMax help and instructions. <a href="http://www.openxpayments.com">http://www.openxpayments.com</a>.</p>
<p>At times when I install OpenX on a cpanel server, after log out, then back in, on a new installation, I will receive a error: 500 server error.</p>
<blockquote><p>Internal Server Error<br />
The server encountered an internal error or misconfiguration and was unable to complete your request.
</p></blockquote>
<p>The infamous &#8220;500 internal server error&#8221; . The server leaving you with no real clues as to what actaully happened,</p>
<p>This is usually caused by permissions defined in<br />
/openx/lib/OX/Plugin/PluginManager.php on line 52 .<br />
Make sure they are defined correctly for your enviroment.</p>
<p>see more for helpful file permissions script.<br />
<span id="more-413"></span></p>
<p>In hopes of helping others on cpanel servers overcome this openxmarket 777 permissions issue, I took a moment to patch together the code below from <a href="http://snipplr.com/view/5350/recursive-chmod-in-php/">snipplr</a>.<br />
If you have experienced the error, and are looking for answers, simply place the below file on your server within the /openx folder and call it in a browser. It will correctly set all folder and file permissions on a cpanle server with suphp. <a href="http://btdsoft.com/file-permission-problems-uid99">Related post</a>.</p>
<p>Feel free to modify it to use on other files / folders where the permissions should be 755 for folders and 644 for files as needed. It will correctly set all sub directories and file permissions.</p>
<p>copy and paste to new file marketfix.php or other.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
 <span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'init.php'</span><span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #000000; font-weight: bold;">function</span> oxMarketChmod<span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$filePerm</span><span style="color: #339933;">=</span><span style="color: #208080;">0644</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dirPerm</span><span style="color: #339933;">=</span><span style="color: #208080;">0755</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// Check if the path exists</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #666666; font-style: italic;">// See whether this is a file</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// Chmod the file with our given permissions</span>
      <span style="color: #990000;">chmod</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$filePerm</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// If this is a directory...</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// Then get an array of the contents</span>
      <span style="color: #000088;">$foldersAndFiles</span> <span style="color: #339933;">=</span> <span style="color: #990000;">scandir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// Remove &quot;.&quot; and &quot;..&quot; from the list</span>
      <span style="color: #000088;">$entries</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_slice</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$foldersAndFiles</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// Parse every result...</span>
      <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$entries</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$entry</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// And call this function again recursively, with the same permissions</span>
      oxMarketChmod<span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$entry</span><span style="color: #339933;">,</span> <span style="color: #000088;">$filePerm</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dirPerm</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #666666; font-style: italic;">// When we are done with the contents of the directory, we chmod the directory itself</span>
      <span style="color: #990000;">chmod</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dirPerm</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #666666; font-style: italic;">// Everything seemed to work out well, return TRUE</span>
      <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
     <span style="color: #000088;">$plugins</span> <span style="color: #339933;">=</span> oxMarketChmod<span style="color: #009900;">&#40;</span>MAX_PATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/plugins/etc/oxMarket'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$admin</span> <span style="color: #339933;">=</span> oxMarketChmod<span style="color: #009900;">&#40;</span>MAX_PATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/www/admin/plugins/oxMarket'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$admin</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$plugins</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;All Done, you can &lt;a href='www/admin/'&gt;login&lt;/a&gt; now&quot;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Something has gone wrong... Perhaps oxMarket dosent exist?'</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://btdsoft.com/openx-market-fix-for-cpanel-servers/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>File permission problems (UID:99)</title>
		<link>http://btdsoft.com/file-permission-problems-uid99/</link>
		<comments>http://btdsoft.com/file-permission-problems-uid99/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 02:07:29 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[OpenX Tips]]></category>

		<guid isPermaLink="false">http://btdsoft.com/?p=411</guid>
		<description><![CDATA[Warning this information may be outdated. Please see the forum for up to date RevMax help and instructions. http://www.openxpayments.com. It has come to my attention that some host seem a bit out dated and perhaps a bit unsecured as per files users and permissions. I am still researching it myself and looking for a solution [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Warning this information may be outdated</strong>. Please see the forum for up to date RevMax help and instructions. <a href="http://www.openxpayments.com">http://www.openxpayments.com</a>.</p>
<p>It has come to my attention that some host seem a bit out dated and perhaps a bit unsecured as per files users and permissions. I am still researching it myself and looking for a solution that could possible fit all host. Until then if you encounter file permissions problems hopefully this will help.</p>
<p><span id="more-411"></span></p>
<blockquote><p>Default installation php as mod_php module is one the biggest security hole at web servers software.<br />
Lets consider why. If you have php installed as mod_php then all php applications are run under common user &#8216;nobody&#8217; or &#8216;www&#8217; or &#8216;apache&#8217;. It means if a user &#8216;smith&#8217; has files located at his home directory, everyone else who has an account at the same server can read ( and modify ) his files using regular PHP-based filemanager. </p>
<p>To avoid this problem apache provides &#8216;suexec&#8217; technology to run users&#8217; software under their own system accounts. It means user &#8216;smith&#8217; has &#8216;my_secure_data.txt&#8217; chowned to &#8216;smith&#8217; and it will work because his applications are run under &#8216;smith&#8217; system account at suexec enviroment. Basically, suexec technology is provided for applications running as cgi scripts.</p>
<p><a href="http://www.phpasks.com/suphp/">http://www.phpasks.com/suphp/</a>
</p></blockquote>
<p>On Non-suphp server environment, if a php script has to upload a file on a folder, (eg:  OpenX plugins) in order to get it uploaded to the folder, it needs to have world writable permissions (777). </p>
<p>As plugins are uploaded by php,On Non-suphp server environment it is usually assigned user id of 99. This will make any php uploaded files to not be owned by the ftp user and unable to change permissions, or delete them. </p>
<p><strong>THE PROBLEM</strong>: For convenience RevMax sets all directory (755) and file (644) permissions on install and may cause errors. <strong>You must </strong> however manually set permissions for the clients folder /openx/clients, after uploading.</p>
<p>You can test your server for this issue. If you can use phpinfo() you can create a php file with the following contents:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Upload it to a web accessable folder on the server and browse to it in a browser, then look where it says <strong>Server API</strong>. If the value says Apache then its not running PHP using suPHP. If it says CGI then it is running suPHP.</p>
<p>If you know or can see this (uid:99) to be the issue, you can chown all the package folders and files, and chmod as needed. to restore functionality. Here&#8217;s some <a href="http://en.wikipedia.org/wiki/Chown">more info</a> on &#8220;chown&#8221; and shell commands that may help.</p>
<p>If you know this before install you can uncompress the package and upload the files with ftp and set permissions accordingly, then log in to OpenX and install the plugin. You should then have ownership of all files and folders of the RevMax plugin. Plugin files and folders should be uploaded to the OpenX directory as seen in the unzipped package.</p>
<p>openx/clients&#8230;.<br />
openx/plugins/etc&#8230;.<br />
openx/www/admin/plugins&#8230;</p>
<p>To fix this problem permanently you may wish to follow <a href="http://www.phpasks.com/suphp/">this link </a>and secure your server and install the suphp module for apache. This will of course make you go thru all of the plugins and reset file ownership and permissions as they are created on install with php and will cause  errors as seen in openxmarket  install on a cpanel server.</p>
<p>I am currently working on scripting to check for server variations, and hopefully fix this issue for these environments.</p>
<p>As always you can <a href="http://btdsoft.com/contact-btdsoft/">contact me</a> directly or <a href="http://btdsoft.com/forum">post to the forum </a>if you have questions or need help.</p>
]]></content:encoded>
			<wfw:commentRss>http://btdsoft.com/file-permission-problems-uid99/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenX Stats Problem</title>
		<link>http://btdsoft.com/openx-stats-problem/</link>
		<comments>http://btdsoft.com/openx-stats-problem/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 10:45:55 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[OpenX Tips]]></category>
		<category><![CDATA[OpenX Security]]></category>

		<guid isPermaLink="false">http://btdsoft.com/?p=306</guid>
		<description><![CDATA[OpenX Delivery Security Update I have been dealing with the stats being off for advertisers and publishers with a few clients for the last month. It seems the OpenX team has located the source of the problem and released a patch. Blind SQL injection vulnerability The problem seems to stem from a blind SQL injection [...]]]></description>
			<content:encoded><![CDATA[<h3>OpenX Delivery Security Update</h3>
<p>I have been dealing with the stats being off for advertisers and publishers with a few clients for the last month.  It seems the OpenX team has located the source of the problem and released a patch. <span id="more-306"></span></p>
<h3>Blind SQL injection vulnerability</h3>
<p>The problem seems to stem from a blind SQL injection vulnerability within the OpenX delivery engine, as described in OpenX security advisory OPENX-SA-2008-002. <a href="http://seclists.org/bugtraq/2008/Oct/0048.html" target="New">More Info</a>.</p>
<blockquote><p>Input passed to the &#8220;bannerid&#8221; parameter in www/delivery/ac.php is not properly sanitised before being used in SQL queries. This can be exploited to manipulate SQL queries by injecting arbitrary SQL code.</p></blockquote>
<p>I have noted that all affected systems stats began to come more in line with actual adview and click through values, after applying the security patch.</p>
<h3>Upgrading the OpenX delivery engine</h3>
<p>Its a fairly simple and straight forward process of upgrading the openx delivery engine. You can download the patch from the OpenX website, and upload the files to your server. As always back up your files before you begin. You may also choose to upgrade your OpenX install to the latest non affected version. You can find the files and more information <a href="https://developer.openx.org/wiki/display/DOCS/OpenX+patch+notes+(r26860)?UA-2882459-1=1100841993" target="_New">here</a>.</p>
<h3>Getting Help</h3>
<p>If you do not feel comfortable upgrading OpenX or the delivery engine, as always my <a href="http://btdsoft.com/products-page/">services</a> are affordable and timely. Feel free to <a href="http://btdsoft.com/contact-btdsoft/">contact me</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://btdsoft.com/openx-stats-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenX &quot;INSERT_RANDOM_NUMBER_HERE&quot;</title>
		<link>http://btdsoft.com/openx-insert_random_number_here/</link>
		<comments>http://btdsoft.com/openx-insert_random_number_here/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 19:05:42 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[OpenX Tips]]></category>

		<guid isPermaLink="false">http://btdsoft.com/?p=302</guid>
		<description><![CDATA[Openx Invocation Tags Requiring Random Numbers One of least understood and most often asked questions in regards to the OpenX banner invocation code must be the &#8220;INSERT_RANDOM_NUMBER_HERE&#8221; placed within the image, java and iframe invocation codes by OpenX. This post will attempt to clarify this and give you some simple examples as to implementing on [...]]]></description>
			<content:encoded><![CDATA[<h3>Openx  Invocation Tags Requiring Random Numbers</h3>
<p>One of least understood and most often asked questions in regards to the OpenX banner invocation code must be the &#8220;INSERT_RANDOM_NUMBER_HERE&#8221; placed within the image, java and iframe invocation codes by OpenX.</p>
<p>This post will attempt to clarify this and give you some simple examples as to implementing on your site <span id="more-302"></span></p>
<p>Within the invocation code for a zone using the image, iframe, or javascript tag, there&#8217;s a part called &#8220;cb=INSERT_RANDOM_NUMBER_HERE&#8221;.</p>
<h3>What is it ? Why is it needed ?</h3>
<p>This is a unique number required to stop browser caching of your banners and ensures each end user will receive a new ad on page load. If we took the above example and simply inserted &#8220;cb=123&#8243;, the end user being a web browser or spider would eventually see this ad as a static non changing item and cache it.  The user would then begin to see the same ad each time he accessed your page as its now stored in his browser cache  with the stated id of 123.</p>
<p>If we generate a new number each time the ad is called, the browser, sees this as new content, and as such loads the new content on each visit.</p>
<p>Depending on your sites cms, design or other there are several language specific ways to generate this new random number on each page load. I will give a few examples below. Feel free to copy and paste as needed. Please perform test before implementing , or use at your own risk.</p>
<h3>How to Generate A Random Number</h3>
<p><strong>php example:</strong><br />
First as its my personal favorite language I will provide an example in php.<br />
This is the part that generates the number. If you are using more than 1 invocation tag on your site or within your template then place this code above your first banner call.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$random_number</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">999999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Now we have a random number being generated each time the page is accessed. We can now place the random number within the OpenX banner invocation code.</p>
<p>Where you have “cb=INSERT_RANDOM_NUMBER_HERE”, simply replace  as shown below</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">cb=<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$random_number</span>&quot;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>You now have a new unique id generated and inserted with php on each and every page load.</p>
<p><strong> Java example:</strong><br />
Here&#8217;s an example for those with static html pages.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
var randomnumber<span style="color: #339933;">=</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">99999999999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;a href='http://domain.com/ck.php?n=3874N2&amp;cb=&quot;</span><span style="color: #339933;">+</span>randomnumber<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&gt;&lt;img src='http://domain.com/avw.php?zoneid=1&amp;n=3874N2&amp;cb=&quot;</span><span style="color: #339933;">+</span>randomnumber<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&gt;&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>In order to implement the above code you will first need to generate a valid Image invocation tag from within OpenX to make sure that the domain and path to OpenX are valid, and that the < img > tag has the correct zoneid. So a valid invocation tag would look similar to below.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span><span style="color: #339933;">&gt;&lt;!--</span><span style="color: #666666; font-style: italic;">//&lt;![CDATA[</span>
   var m3_u <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>location.<span style="color: #006633;">protocol</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'https:'</span><span style="color: #339933;">?</span><span style="color: #0000ff;">'https://www.openxpayments.com/openx-2/www/delivery/ajs.php'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'http://www.openxpayments.com/openx-2/www/delivery/ajs.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   var m3_r <span style="color: #339933;">=</span> <span style="color: #003399;">Math</span>.<span style="color: #006633;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">99999999999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>document.<span style="color: #006633;">MAX_used</span><span style="color: #009900;">&#41;</span> document.<span style="color: #006633;">MAX_used</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">','</span><span style="color: #339933;">;</span>
   document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;scr&quot;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;ipt type='text/javascript' src='&quot;</span><span style="color: #339933;">+</span>m3_u<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;?zoneid=1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;amp;cb='</span> <span style="color: #339933;">+</span> m3_r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">MAX_used</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">','</span><span style="color: #009900;">&#41;</span> document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;amp;exclude=&quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #006633;">MAX_used</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">charset</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">'&amp;amp;charset='</span><span style="color: #339933;">+</span>document.<span style="color: #006633;">charset</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">characterSet</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">'&amp;amp;charset='</span><span style="color: #339933;">+</span>document.<span style="color: #006633;">characterSet</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;amp;loc=&quot;</span> <span style="color: #339933;">+</span> escape<span style="color: #009900;">&#40;</span>window.<span style="color: #006633;">location</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">referrer</span><span style="color: #009900;">&#41;</span> document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;amp;referer=&quot;</span> <span style="color: #339933;">+</span> escape<span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">referrer</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">context</span><span style="color: #009900;">&#41;</span> document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;context=&quot;</span> <span style="color: #339933;">+</span> escape<span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">context</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #006633;">mmm_fo</span><span style="color: #009900;">&#41;</span> document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;amp;mmm_fo=1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   document.<span style="color: #006633;">write</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&gt;&lt;<span style="color: #000099; font-weight: bold;">\/</span>scr&quot;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;ipt&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//]]&gt;--&gt;&lt;/script&gt;&lt;noscript&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
var randomnumber<span style="color: #339933;">=</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">99999999999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;a href='http://www.openxpayments.com/openx-2/www/delivery/ck.php?n=acb4cacc&amp;amp;cb==&quot;</span><span style="color: #339933;">+</span>randomnumber<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&gt;&lt;img src='http://www.openxpayments.com/openx-2/www/delivery/avw.php?zoneid=1&amp;amp;n=acb4cacc&amp;cb=&quot;</span><span style="color: #339933;">+</span>randomnumber<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&gt;&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Granted with all the code that&#8217;s a hard one to understand and implement. But if you look closely you will note the only changes that were made were to the image tag.</p>
<p><strong> ASP example:</strong><br />
Hopefully there&#8217;s not a lot of folks using asp these days. I personally find it cumbersome, and it will stall my browser on most page visits. Perhaps a good definition of ironic as I browse with ie7.</p>
<p>First generate the random number with ASP, remembering to place it above any banner invocation tags on your page.</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;%</span>
<span style="color: #990099; font-weight: bold;">Dim</span> my_num
Randomize
my_num <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Int</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#40;</span>rnd<span style="color: #006600; font-weight: bold;">*</span><span style="color: #800000;">10</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight:bold;">&#41;</span>+<span style="color: #800000;">1</span>
<span style="color: #000000; font-weight: bold;">%&gt;</span></pre></div></div>

<p>Then within your invocation tags, where you have &#8220;cb=INSERT_RANDOM_NUMBER_HERE&#8221;,  replace as shown below.</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">cb=<span style="color: #000000; font-weight: bold;">&lt;%</span> <span style="color: #990099; font-weight: bold;">Response</span>.<span style="color: #330066;">Write</span> my_num <span style="color: #000000; font-weight: bold;">%&gt;</span></pre></div></div>

<p><strong>Conclusion:</strong><br />
Hopefully that will have you well on your way to generating a random number, for your OpenX invocation code in order to stop browser caching and ensure your ads are being shown properly.</p>
<p>If you feel you still need help you can leave a post on our <a href="http://www.btdsoft.com/forum/">forum</a>, and hopefully I or another will have a chance to answer you soon. If not Our <a href="http://btdsoft.com/products-page/">services</a> are affordable and timely.</p>
]]></content:encoded>
			<wfw:commentRss>http://btdsoft.com/openx-insert_random_number_here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Like Text Ads Using OpenX</title>
		<link>http://btdsoft.com/google-like-text-ads-using-openx/</link>
		<comments>http://btdsoft.com/google-like-text-ads-using-openx/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 05:58:00 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[OpenX Tips]]></category>

		<guid isPermaLink="false">http://btdsoft.com/?p=291</guid>
		<description><![CDATA[I have had a lot of people ask me if its possible to use OpenX to show google like text ads. My reply is usually it should be easier than you think. Just create some text ads and add a little style. I haven&#8217;t seen any in practice yet so I took a moment to [...]]]></description>
			<content:encoded><![CDATA[<p>I have had a lot of people ask me if its possible to use OpenX to show google like text ads. My reply is usually it should be easier than you think. Just create some text ads and add a little style.</p>
<p>I haven&#8217;t seen any in practice yet so I took a moment to create an example for those that would like to show ads similar to google. <span id="more-291"></span></p>
<h3>Creating ads and publisher zone</h3>
<p>First you will need to decide what text ads you would like to show and where. You probably already have that one or you wouldn&#8217;t be here. For this example I created four 150 X 150 text ads within OpenX to form a 160X600 skyscraper ad.<br />
<a href="http://btdsoft.com/wp-content/uploads/2008/09/text-ad-1.gif"><img src="http://btdsoft.com/wp-content/uploads/2008/09/text-ad-1-300x214.gif" alt="" title="text-ad-1" width="300" height="214" class="alignnone size-medium wp-image-292" /></a><br />
You can now go through and create more depending on your needs or simply use the handy copy feature within OpenX as I have.<br />
<a href="http://btdsoft.com/wp-content/uploads/2008/09/text-ad-duplicate.gif"><img src="http://btdsoft.com/wp-content/uploads/2008/09/text-ad-duplicate-300x214.gif" alt="" title="text-ad-duplicate" width="300" height="214" class="alignnone size-medium wp-image-293" /></a><br />
Now that you have a few ads created to fit your needs, you will need to create a publisher and or zone to show them. Then link the text ads you have created to the publishers zone.<br />
<a href="http://btdsoft.com/wp-content/uploads/2008/09/publisher-zone-linked-banne.gif"><img src="http://btdsoft.com/wp-content/uploads/2008/09/publisher-zone-linked-banne-300x214.gif" alt="" title="publisher-zone-linked-banne" width="300" height="214" class="alignnone size-medium wp-image-294" /></a></p>
<h3>Creating the css and html</h3>
<p>Now heres the part where you ad a little style to bring them together to form one ad unit. If you dont have an editor you can find a number of online css box creators. Try a google  search for &#8220;<a href="http://www.google.com/search?sourceid=navclient&#038;ie=UTF-8&#038;rlz=1T5GGLL_enUS253US253&#038;q=css+box+creator" target="_New">css box creator</a> &#8221; Or simpler still do some quick coppy and past from mine below. Please save the images to your own server if you choose to use the code and change the background image urls.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.oxad160</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">160px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">600</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f90</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oxad160</span> p <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">padding</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> small<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#463E3F</span><span style="color: #00AA00;">;</span>
     <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oxtop</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">http://www.btdsoft.com/examples/images/tr.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
   <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.oxbottom</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">http://www.btdsoft.com/examples/images/br.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
img<span style="color: #6666ff;">.corner</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span> !important<span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.adcontent</span> <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">padding</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> small<span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Now you need a bit of html to show the ads on your web page. Below is what I have created for this example.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;oxad160&quot;&gt;
   &lt;div class=&quot;oxtop&quot;&gt;
	 &lt;img src=&quot;http://www.btdsoft.com/examples/images/tl.gif&quot; alt=&quot;&quot;
	 width=&quot;15&quot; height=&quot;15&quot; class=&quot;corner&quot;
	 style=&quot;display: none&quot; /&gt;
   &lt;/div&gt;
&lt;div class=&quot;adcontent&quot;&gt;
*** Insert ad code here***
&lt;/div&gt;
&lt;div class=&quot;adcontent&quot;&gt;
*** Insert ad code here***
&lt;/div&gt;
&lt;div class=&quot;adcontent&quot;&gt;
*** Insert ad code here***
&lt;/div&gt;
&lt;div class=&quot;adcontent&quot;&gt;
*** Insert ad code here***
 &lt;/div&gt;
 &lt;p&gt; ads by &lt;a href=&quot;http://www.oxrev.com&quot;&gt;OxRev.com&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;oxbottom&quot;&gt;
	 &lt;img src=&quot;http://www.btdsoft.com/examples/images/bl.gif&quot; alt=&quot;&quot;
	 width=&quot;15&quot; height=&quot;15&quot; class=&quot;corner&quot;
	 style=&quot;display: none&quot; /&gt;
	&lt;/div&gt;
   &lt;/div&gt;</pre></div></div>

<h3>Putting it all together</h3>
<p> We now have a group of text ads, a publisher and zone, bits of css and html. Lets put it together and see if it works. For this example I have saved the css as 160.css, and the html box as a template that I can plug in anywhere I choose to later. I have uploaded the css file and the corner images to a server. Now Once I place the html box on a page I will need to import the css file with it in order for the images and formatting to apear correctly. For this I have used an import command.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;style&gt;
@import url(&quot;http://www.btdsoft.com/examples/160.css&quot;);
&lt;/style&gt;</pre></div></div>

<p>Place this bit of code directly before the first div tag of your box, remembering to change the url to your server location.</p>
<p>Now you need to get the banner code from OpenX. Here I have chosen java, remembering to check  &#8220;Don&#8217;t show a banner from the same campaign again on the same page&#8221;. This will keep OpenX from repeating ads.<br />
<a href="http://btdsoft.com/wp-content/uploads/2008/09/text-invocation-code.gif"><img src="http://btdsoft.com/wp-content/uploads/2008/09/text-invocation-code-300x214.gif" alt="" title="text-invocation-code" width="300" height="214" class="alignnone size-medium wp-image-295" /></a><br />
Just insert your code from OpenX everywhere I have &#8220;*** Insert ad code here***&#8221; above in the html example. You only need the one code repeated as OpenX wont repeat the same ad. Upload your test to a server or preview it in your editor and you should see something like the example <a href="http://www.btdsoft.com/examples/cssbox.html" target="_new">here</a>.</p>
<h3>Different layouts</h3>
<p>If you dont want to fool with css, its easy to create the same thing in any format. Just use the above creating ads, zones, and invocation code methods. You can have a few lines like google or a simple one line text link. Just remember to tell OpenX not to show the same ad from the same campaign on the same page.<br />
In order for this to work correctly an advertiser must not have all ads in one campaign. Keep their text ads in one campaign and banner ads in another. If OpenX see&#8217;s there&#8217;s another ad from the same campaign on the page. it will do its job and not show another as instructed.<br />
<!-smartads-><br />
<br/><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://btdsoft.com/google-like-text-ads-using-openx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

