Did you recently take my advice on manging banners ?您最近是否考虑我的意见manging旗帜 ?Or maybe you’re just putting advertisements on your site for the first time this month?或者,也许您只是把广告在您的网站上首次本月?Either way you’ll find as your sites grow, its a lot of work to manage banner advertisements.无论哪种方式,您可以找到您的网站增加,其大量的工作来管理横幅广告。You could go with something like OpenAds but applications like this are taxing on server efficiency - particularly if you’re on a shared hosting plan (The newest versin of OpenAds utilizes 16mb of ram).你可以选择Openads的东西,但像这样的应用是在服务器上征税效率-特别是如果您对代管的共同计划(最新v ersin的O penads的使用1 6MB的内存) 。Sometimes simple is better and effective!有时简单的是更好的和有效的!Here’s some PHP coding tips to set yourself up for banner automation.下面是一些PHP的编码提示您确定了旗帜的自动化。
The first step involves grabbing the current pages domain.第一步涉及抢夺目前网页的网域。Break the url on the slashes like so.打破网址斜线一样。This should go in your template page.这应该在您的模板页面。 $parts = explode(”/”, $HTTP_HOST);$部分=爆炸("/", $ HTTP_HOST ) ;
This creates an array which we can now pick and choose an element to access.这将创建一个数组现在我们可以选择一个组成部分访问。The first array “0″ is the first part of the array.第一阵列“ 0 ”是第一部分的阵列。This contains everything between the http:// and the start of the next slash if there is one.这一切都包含http://之间并开始下一个斜线,如果是其中之一。We’re going to store that in variable “$whichsite”. NOTE : You can apply these same rules to directories or pages within a site by incrementing the part variable.我们将存储在变量“ $ whichsite 。 ” 注意:您可以适用于这些相同的规则,目录或网页在一个网站的递增的部分变量。This should go your template page.这应该去您的模板页面。 $whichsite = $parts[0];$ whichsite = $部分[ 0 ] ;
Now use an includes in the spot on your page (probably in a template somewhere on your site) where you want the ad to appear.现在,使用包括在现货在您的网页上(可能是在一个模板的某个网站)您想要的广告出现。This again, goes in your sites template.这一次,不用在您的网站模板。 include http://www.domain.com/ads.php?whichsite=$whichsite;包括http://www.domain.com/ads.php?whichsite = $ whichsite ;
Create an IF statement to check and see what domain is being selected. NOTE: if its not a sub-domain you’ will want to enter its WWW counterpart since a site can usually be accessed by domain.com or www.domain.com.创建一个IF语句来检查,看看域是被选中。注意:如果它不是一个子网域你将要进入其对应的WWW网站,因为通常可以访问的domain.com或www.domain.com 。 if($whichsite == “www.extreme-gamerz.org” || $whichsite == “extreme-gamerz.org”)如果( $ whichsite == “ www.extreme - gamerz.org ” | | $ whichsite == “极端gamerz.org ” ) If there are any additional links you want to have the same condition for continue to add them by separating them with a “||”.如果有任何额外的链接,您想拥有同样的条件,继续增加它们的分隔与"||".This specifies an OR statement in PHP.这种指定或声明在PHP 。This code should go in a new document named “ads.php” which we called in the past step.此代码应该在一个新的文件名为“ ads.php ”我们呼吁在过去的一步。Your ads should go in-between each if statement accordingly.您的广告应该在相互如果相应的声明。
The code in your template should look like this:该代码在您的范本看起来应该如下:
//Catch all banner (if you use this add in a non-applicable spot) it will display this code) You could use this alone as a substitue for sub.domain1.com if you are only doing this on 2 sites.
If you’re starting to learn PHP/mySQL I would strongly suggest an activity that would involve setting up a database which tracks banner loads.如果你开始学习的PHP / MySQL的我会强烈建议的活动将包括建立一个数据库,其中轨道旗帜负荷。You could also set up a simple system that manages the domains and ads while you’re at it.您还可以建立一个简单的系统管理的领域和广告,而您是在它。Break the steps down and use this as a learning tool.休息的步骤,并以此作为学习工具。The only way I ever learned is when I had an excuse to create something or had a problem that needed fixing.唯一的办法是我的教训就是当我的一个借口或创造的东西出现了问题,需要修复。The possibilities are endless as you can apply this concept to things other then banner advertising!可能性是无穷尽的,您可以套用这个概念,其他的事情然后横幅广告!Be creative with it!有创意呀!
Danny Cooper : I have a blog in a very rare niche, most people, around 80%, who search for it...丹尼库珀 :我有一个博客中一个非常罕见的壁龛,大多数人,约80 % ,谁搜寻...- [Go To Post]-[转到邮政]
Todd : A good point you made by “Make yourself easily reachable.托德 :一个好的,您提出的“让你轻松地到达。One of your biggest...您的其中一个最大的...- [Go To Post]-[转到邮政]
A lot of changes going on with Google Analytics: http://analytics.blogspot.com.很多改变目前正在同谷歌分析: http://analytics.blogspot.com 。Some of which will be helpful in making money online =)其中一些将有助于赚钱在线= )
How Often To Post New Content On Your Website Or Blog http://tinyurl.com/58ugms多久后新的内容在您的网站或博客http://tinyurl.com/58ugms
Done creating the automatic image thumbnailing script.完成创造了自动图像thumbnailing脚本。Now its time to make it better by trying to break it =)现在,它的时间,使之更好地试图打破它= )
Streaming live AT http://toddrecommends.tv/live/住在流http://toddrecommends.tv/live/
Off to hang out with @sclemens @toddkedwards and @payneb关闭挂起了sclemens @ @ @ toddkedwards和payneb
Ha.哈。Debugging a site and found this from a previous developer: "This makes no sense but hopefully will never be executed."调试的网站,发现这个从先前的开发商: “这没有任何意义,但希望将永远不会被处决。 ”:-\ : -\
发表评论: