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はあなたがこのようなアプリケーションのようなものでサーバの効率に課税されますなる可能性がある-特に場合は、共有ホスティングO penAds計画に(最新矢1 6MB以上のR AMを利用している) 。 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.は、スラッシュで休憩のURLは次のように。 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; whichsite http://www.domain.com/ads.php?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 - " == " 極端な| | $ whichsite gamerz.org - " ) 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.お客様の広告に行く必要に応じて、それぞれの間にif文。

The code in your template should look like this:あなたはこのようにするテンプレート内のコード:

  1. <?php if ( $whichsite == "www.domain1.com" || $whichsite == "domain1.com" ) { ?>
  2. //Replace this with banners for this site
  3. <?php } elseif ( $whichsite == "sub.domain1.com" ) { ?>
  4. //Banners code for sub.domain1.com
  5. <?php } else { ?>
  6. //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. キャッチ//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. 2 //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.
  7. <?php } ?>

And your ads.php script for your advertisements should look something like this:そして、あなたの広告をads.phpスクリプトは次のような感じです:

  1. <?php
  2. $parts = explode ( "/" , $HTTP_HOST ) ; = $parts = explode ( "/" , $HTTP_HOST ) ;
  3. $whichsite = $parts [ 0 ] ;
  4. include "http://www.domain.com/ads.php?whichsite=$whichsite" ;
  5. ?>

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!それを創造的に!



Leave A Comment:コメントを残す:

Comments RSS Feed コメントのRSSフィード

5 Plus 2 = 5プラス2 =

Custom Theme by Rob Malon | Content & Design © 2008 - Rob Malon [dot] Com. カスタムテーマロブマロン|コンテンツ&デザイン© 2008 -ロブマロン[ドット]コム。 "));
"));