Did you recently take my advice on manging banners ? Jeste li nedavno uzeti moj savjet o manging bannera? Or maybe you’re just putting advertisements on your site for the first time this month? Ili ste možda upravo stavljanjem reklame na Vašoj web lokaciji po prvi put ovaj mjesec? Either way you’ll find as your sites grow, its a lot of work to manage banner advertisements. Ili ćete naći način kako rastu Vaše web stranice, svoje puno posla za upravljanje banner reklama. 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). Možete ići s nešto poput OpenAds ali aplikacija poput ovog su oporezivanje na poslužitelju učinkovitost - posebno ako ste na zajedničko hosting plan (Najnoviji versin od OpenAds koristi 16MB RAM-a). Sometimes simple is better and effective! Ponekad jednostavno je bolje i na snazi! Here’s some PHP coding tips to set yourself up for banner automation. Evo nekih savjeta za PHP kodiranje postaviti sebe za banner automatizacija.

The first step involves grabbing the current pages domain. Prvi korak uključuje grabbing trenutne stranice domena. Break the url on the slashes like so. Break url na slashes kao tako. This should go in your template page. Ovo bi trebao ići u svoj predložak stranicu.
$parts = explode(”/”, $HTTP_HOST); $ dijelova = eksplodirati ("/", $ HTTP_HOST);

This creates an array which we can now pick and choose an element to access. To stvara niz koji smo sada mogu izabrati element za pristup. The first array “0″ is the first part of the array. Prvi niz "0" je prvi dio u polje. This contains everything between the http:// and the start of the next slash if there is one. Ona sadrži sve što je između http:// i početak sljedećeg prorez ako postoji jedan. 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. Želja nam je da ide za pohranu koji u varijablu "$ whichsite". NAPOMENA: Možete primijeniti te ista pravila za direktorije ili na web stranicama u roku od incrementing dio varijable. This should go your template page. To bi trebalo ići predloška stranica.
$whichsite = $parts[0]; $ $ = whichsite dijelova [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. Sada uključuje korištenje u mjesto na Vašoj stranici (vjerojatno u predložak negdje na Vašoj web lokaciji), gdje želite da se oglas pojavi. This again, goes in your sites template. To opet ide u vaš predložak web-mjesta.
include http://www.domain.com/ads.php?whichsite=$whichsite; uključuju 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. Napravi AKO izjavi provjeriti i vidjeti što se odabrali domenu. NAPOMENA: ako svoje ne pod-domena te će se želite upisati svoje WWW kolega jer je stranica se obično može pristupiti domain.com ili www.domain.com.
if($whichsite == “www.extreme-gamerz.org” || $whichsite == “extreme-gamerz.org”) if ($ whichsite == "www.extreme-gamerz.org" | | $ whichsite == "ekstremnih-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 “||”. Ako postoje bilo kakve dodatne linkove želite imati isti uvjet za dalje dodajte ih odvojio ih s "||". This specifies an OR statement in PHP. To navodi jedan ILI izjavu u PHP. This code should go in a new document named “ads.php” which we called in the past step. Taj broj bi trebao ići u novi dokument pod nazivom "ads.php" koje smo u prošlosti nazivaju, korak. Your ads should go in-between each if statement accordingly. Oglasi bi trebali ići u-između svake ako izjavu u skladu s tim.

The code in your template should look like this: Kod u vaš predložak bi trebao izgledati ovako:

  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.
  7. <?php } ?>

And your ads.php script for your advertisements should look something like this: I vaš ads.php skripti za vaše reklame bi trebao izgledati otprilike ovako:

  1. <?php
  2. $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. Ako ste počinje učiti PHP / MySQL bih snažno predložiti aktivnosti koje bi uključivati i postavljanje baze podataka koja pjesama učitava bannera. You could also set up a simple system that manages the domains and ads while you’re at it. Možete također postaviti jednostavan sustav koji upravlja domene i oglase dok ste na njemu. Break the steps down and use this as a learning tool. Break korake dolje i koristiti kao alat za učenje. The only way I ever learned is when I had an excuse to create something or had a problem that needed fixing. Jedini način sam ikad saznao je kada sam imao izgovor da napravite nešto ili je imao problem koji je potrebno pričvršćivanje. The possibilities are endless as you can apply this concept to things other then banner advertising! U mogućnosti su beskrajne kako možete primijeniti taj pojam na druge stvari onda Banner oglašavanje! Be creative with it! Budite kreativni sa njom!



Leave A Comment: Ostavi komentar:

Comments RSS Feed Komentari RSS Feed

5 3 = 5 3 =

Custom Theme by Rob Malon | Content & Design © 2008 - Rob Malon [dot] Com. Custom Theme by Rob Malon | Sadržaj & Design © 2008 - Rob Malon [dot] com. "));
"));