Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
redhairz
Worker
Worker


Joined: Nov 17, 2006
Posts: 222

PostPosted: Thu Jul 09, 2009 11:27 am Reply with quote

Hi guys raven team can you help me on this one. i am using the theme same as this site fusbi someting. i wanted to show the ads banner similar to raven site just beside the logo how do i do it? guide me please?

sorry do i need to add a $ads or $banner in the theme.php? to display the banner like raven site,

_________________
Jesus is Alive, He is our joy, be it good times or bad time. 
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 910

PostPosted: Thu Jul 09, 2009 8:52 pm Reply with quote

Go into your theme and open theme.php....

Go to the header section...

and insert
Code:
   echo ads(1);


The # is the # of the ad location that you created in admin->advertising

Dawg
 
View user's profile Send private message
redhairz
PostPosted: Mon Jul 13, 2009 9:29 am Reply with quote

thanks dawg i will give it a go and see whats happen
 
NeapolitanWorld
Involved
Involved


Joined: Nov 06, 2005
Posts: 337
Location: Los Angeles, USA

PostPosted: Mon Jul 13, 2009 3:51 pm Reply with quote

This thread might also help you out regarding this.
Only registered users can see links on this board! Get registered or login!

Good luck!

_________________
My Raven Site Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue Jul 14, 2009 11:34 am Reply with quote

Funny you should bring this up. I am working on the advertising module for RN 2.4 and finding some very strange things. I am not yet sure I am right but I think that block positioning for anything else but top center of the banner is broken or never worked. I'm not sure that creating positions for blocks through the advertising administration module does a darned thing except frustrate admins. The admin screen says you have to put a call to ads(x) in your theme where x is the number of the position that you set up in advertising administration. But I don't see this working nor do I see anywhere in the code where it can work.

You can activate the advertising block (from the /blocks directory) and place that block anywhere you want as a block.

I've looked on M.'s site referenced in the other thread and I can see he has a ad positioned to the right side of the banner area. But that's wrapped in a div. I suppose you could do that and if you create your ad as javascript/html put the div right in it but otherwise I don't know how you can position an ad anywhere other than in the center of the ad area. The ads() function that is called is in mainfile and I don't see it doing anything other than centering an ad and returning the results to your theme which then echoes the centered ad.

In short I think positioning in the advertising module is broken or perhaps more precisely it has never actually been implemented. Correct me if I am wrong.
 
View user's profile Send private message Visit poster's website
fkelly
PostPosted: Tue Jul 14, 2009 12:40 pm Reply with quote

Worth noting to avoid frustration: there are numerous SQL errors in advertising/admin/index.php. You can't for instance change the name of a client or the name of a plan or even the name of a banner. These will be corrected in the next release.
 
Dawg
PostPosted: Tue Jul 14, 2009 1:59 pm Reply with quote

fkelly,
I do not use ad calls in my header but I do use them at the top of different MODS and on the side of some mods. It works as expected. I created the ad position in the Ad Module and then created the call where I wanted it to show up.

Code:
echo "<br/>";

echo "<center>"
. "  <table width='100%' cellspacing='0' cellpadding='0'>"
. "    <tr>"
. "      <td width='25%'><center>";
echo ads(3);
echo "      </center>      </td>"
. "      <td width='3'></td>"
. "      <td width='25%'><center>";
echo ads(3);
echo "      </center>      </td>"
. "      <td width='3'></td>"
. "      <td width='25%'><center>";
echo ads(3);
echo "      </center>      </td>"
. "      <td width='3'></td>"
. "      <td width='25%'><center>";
echo ads(3);
echo "      </center>      </td>"
. "    </tr>"
. "  </table>"


That is a cut and paste right out of the Module where I use it. If you would like to look for yourself...Just let me know.

Dawg

[/code]
 
Dawg
PostPosted: Tue Jul 14, 2009 7:02 pm Reply with quote

Fkelly,
If youa re working on this thing already....May I sugggest a function to remove an ad based on the date.

Example. They pay me for 3 months. So I go create the ad....and make it availible for 3 months. After 2 1/2 months....I get an e-mail that this ad is about to expire....and I have to add more time to the ad so it to stay active.

Just my .02

Dawg
 
fkelly
PostPosted: Tue Jul 14, 2009 7:28 pm Reply with quote

Dawg. Thanks for the code example. From the way I interpret it you are positioning the ad yourself with your html code (i.e., the center command). That's okay I guess and maybe it was just my fevered imagination thinking that if the advertising module let you position a banner that it would take care of actually positioning it appropriately.

As to the enhancement ... well I will have to see. My first priority is to make what is already there work correctly. There's a million little issues we are discussing internally such as absolutely crazy filtering that the ad module does on input as well as the SQL errors I mentioned previously.
 
Dawg
PostPosted: Tue Jul 14, 2009 7:38 pm Reply with quote

One other thing I might bring up about the ad mod and how it works....

It would be nice to have it so one any one page....You do not get the same ad twice unless it runs out of ads.

Ad one random 1-10, Ad two Random 1-9, ad three random 1-8 sort of thing.

Just my .02 from someone that uses it alot.

Dawg
 
fkelly
PostPosted: Tue Jul 14, 2009 7:50 pm Reply with quote

A good suggestion Dawg.

Just to elaborate a bit on an earlier point: when you call the function ads(x) with a number where x is all that I can really see happening is that you are feeding a position number into the SQL in mainfile in the statement:

Code:
   $sql = 'SELECT bid, impmade, imageurl, clickurl, alttext FROM '.$prefix.'_banner WHERE position='.$position.' AND active=1 LIMIT '.$bannum.',1';


So a position is really a subset of all the banners you have and each banner has a position number associated with it. That's ALL you are doing unless you specifically do the positioning yourself as you have shown in your code example. You can call the position "right" or "center up" or "rumplestilskin" ... it makes no difference. Your code to display the banner has to handle any positioning. And the code from theme.php in conjunction with mainfile simply positions the ad in the center of the banner area at the top of the page.
 
Dawg
PostPosted: Tue Jul 14, 2009 8:05 pm Reply with quote

Bingo. You got it.

You can call the position anything you like. It does not matter.

I have 10 side ads lets say....

I have block-advertising_1.php, block-advertising_2.php....3 and so on....but they all call the same code.
Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2006 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
    Header('Location: ../index.php');
    die();
}

// Position "1" by default is for block advertising. You can change this from your admin panel
$content = '<br />';
$content .= ads(2);
$content .= '<br />';

?>


I have the same for Center blocks....

I also have what I call Forum_top ads which I posted the code for above.

Dawg
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Wed Jul 15, 2009 1:15 am Reply with quote

@ fkelly - yes, ads(x) simply displays the code you entered into advertising module for the image/banner/script or whatever. Ad 'positioning' is purely in the context of 'where on the page'. The actual 'alignment' of the ad is done by wrapping the call to ads(x) with whatever html you need.

Of course, you can add the 'alignment' as part of the process when creating a new banner ad (provided it doesn't get stripped out).

@ Dawg - ads are designed to rotate ads on a 'per position' basis, so if you use ads(3) and ads(3) within the same block (as an example) you do run the risk of duplicate ads being shown. The only way around that is to use two seperate ad calls like ads(3) and ads(4) - but this means you are displaying two ads instead of one.
Unless you write a routine to perhaps rotate between ads(3) and ads(4) based on whatever criteria you need (odd number and even number of hours?)
 
View user's profile Send private message Send e-mail
Dawg
PostPosted: Wed Jul 15, 2009 3:58 am Reply with quote

Guardian2003 wrote:


@ Dawg - ads are designed to rotate ads on a 'per position' basis, so if you use ads(3) and ads(3) within the same block (as an example) you do run the risk of duplicate ads being shown. The only way around that is to use two seperate ad calls like ads(3) and ads(4) - but this means you are displaying two ads instead of one.
Unless you write a routine to perhaps rotate between ads(3) and ads(4) based on whatever criteria you need (odd number and even number of hours?)


I would think that this could be done on a perpage basis.

Create an array of ads for each position in the header (start of the page) and have the function pull a random one and recreate the array minus the one already choosen. (I just woke up...I will think about this some more...)

Just a thought...

Dawg
 
fkelly
PostPosted: Wed Jul 15, 2009 6:27 am Reply with quote

Dawg you had me thinking about the "non-random" rotation last night. Problem is that currently there is no way to "remember" from page load to page load which ad has already been presented. The array you mention would be recreated on every page load so that wouldn't work.

What we would have to do is create a session-ads table and store, for each session, which ads have previously been presented, then search it at the beginning of a page load and only select ads that haven't been presented. Then when they've all been presented start over with the table. I'm not even sure we use sessions in a standard fashion in RN now so we'd have to look at that too -- where and how we get the session id. Over the long run this might be feasible but it's not something that can be fit into a release we are trying to get out the door soon.
 
Dawg
PostPosted: Wed Jul 15, 2009 8:36 am Reply with quote

Fkelly,
I am not suggesting doing it from page to page.....just on a single page.

On any one page it pulls an array of ad(X). Randomize the array and serve the ads in the order they appear in the array.

Next page load.....it does the same thing but is NOT keeps up with what appeared on the last page....just the page that it is loading now.

Dawg
 
duck
Involved
Involved


Joined: Jul 03, 2006
Posts: 273

PostPosted: Thu Jul 16, 2009 7:49 am Reply with quote

just throwing in a 2 cents idea here though I haven't played with Ads module myself much but what if:

For the page itself with several ads on it you do as suggested by Dawg and run the calls building an array of Ads to display where each ad position has only one ad (unless purchased otherwise) and then once you have your array you could just save that as a serialized cookie so on page 2 you can check the cookie and compare the array against a new set so that page 2 is also not duplicated. Then there is no need for table tracking while maximizing your potential for unique ads display.
 
View user's profile Send private message
Guardian2003
PostPosted: Thu Jul 16, 2009 8:04 am Reply with quote

But bots don't use cookies or sessions.
The ads behave as they should, rotating unique ads on a per ads(x) basis.
If you need more than one ad in a given space then it's really down to the user to wrap the ads in the code of his or her choice.
Otherwise you end up adding a ton of code all over the place to support what you are proposing and may only get used to it's full potential on maybe a handful of sites.
 
Dawg
PostPosted: Thu Jul 16, 2009 8:25 am Reply with quote

Guardian2003 wrote:

Otherwise you end up adding a ton of code all over the place to support what you are proposing and may only get used to it's full potential on maybe a handful of sites.


G,
Are you talking about what Duck suggested or what I suggested?

Dawg
 
fkelly
PostPosted: Thu Jul 16, 2009 8:55 am Reply with quote

Duck's suggestion has the potential to replace a MYSQL table based approach, that is true. But Guardian is right about bots and about the issue of extra code and code support.

Right now we are up to our eyeballs in trying to debug the Advertising module for RN2.4, I can tell you that. If all goes well we will be including the wysiwyg editor throughout and fixing a lot of bugs and making it xhtml compliant (try validating the current screens). After that we can focus on enhancements.

The raw material is there in the code in the advertising module, in the mainfile function ads() and in the advertising block to do what you want Dawg. If you look at how the SQL retrieves blocks with a given bposition and you set up your bpositions appropriately you could easily modify a block to present several ads in a group. Just do a for each on each retrieved ad that matched the bposition you want.

This is a topic we should revisit (and I'm not suggesting this to stifle the current discussion) after 2.4 is out the door and we can all look at the results.
 
duck
PostPosted: Thu Jul 16, 2009 8:59 am Reply with quote

Guardian2003 wrote:
But bots don't use cookies or sessions.


I don't quite follow the purpose of that statement? Why would you care what the bots use?

As for ton of code I don't think more than a dozen or so lines would be needed to accomplish all of this but again I am not familiar with the Ads module. But really all we doing is reading writing an array in a couple places.
 
Guardian2003
PostPosted: Thu Jul 16, 2009 10:02 am Reply with quote

@ Duck
Quote:
you can check the cookie and compare the array against a new set..

Unless I have misunderstood your idea, that wouldn't be possible as bots/search engines don't use cookies.
I was trying to write a lengthy reply with code examples but it is just way to hot here for me to concentrate for amount amount of time.
In a nut shell;
You have three small banners running in a line left to right across the screen
Using Dawgs example which he is using - ads(1), ads(1) and ads(1)
Each position [ads(x)] has (to make the maths simple) 30 banners associated with that position.
This means that in Dawgs case he runs an approximate 30% chance of the same banner appearing in more than one postion.
Your suggestion was to use cookies to determine if a banner had been shown in the first ads(1) position to ensure it would not be shown in the second ads(1) position - this would work fine for a browser but not for a bot/search engine as they are not able to use cookies.
Of course it is a viable solution, so long as you don't mind presenting more than one duplicate banner to anonymous users - though I'm not sure how that would affect the accuracy of 'impression' counts. The count itself would be accurate but I'm not sure a paying client would want a count 'wasted' because his banner appeared more than once on the same page.

The way to do it at the moment would be to use ads(x) ads(y() and ads(z) - these can be placed 'on page' in exactly the same way as before but instead of 30 banners all allocated to the same ad position, you have 10 banners for each position. Provided you have not added the same banner to more than one position in the banner admin area, there should be no dupes.

If it were me, I would actually create four positions;
ads(w), ads(x) ads(y) ads(z) - I would use ads(z) for my own use, google, affilliate ads, 'advertise here' or something else but I would wrap the displaying 'on page' with an IF ELSE loop so that if no client banner were found in any position, to substitute it with my own just to keep the theme design symmetry or I guess I could just create a blank background image to match the site.

I'm not saying what you have proposed is no good, we always welcome ideas/input but maybe I should revisit this when I'm cooler and my forehead is not leaking all over my keyboard.
 
duck
PostPosted: Thu Jul 16, 2009 12:03 pm Reply with quote

@Guardian

Sorry I am still confused as to why search engines not using cookies is a concern? Who cares what a search engine sees? They are not gonna call your advertisers up and buy something? If the ad system is counting search engine views as a view then as an advertiser I would be annoyed. I want people viewing my ads not search engines. But maybe I am confused and thinking about this wrong if so could you explain with more detail why search engines play a part in the cookie setting process?
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Thu Jul 16, 2009 6:14 pm Reply with quote

@duck, I think it was in relationship to trying to have "memory" across pages. However, if the issue is really what Guardian has last described, then ignore the whole cookie comment as it does not apply (correct me if I am wrong Guardian).

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Guardian2003
PostPosted: Fri Jul 17, 2009 12:28 am Reply with quote

Yes, I was meaning that as bots/search engines cannot use/create/delete cookies then it would be impossible to ensure you are showing a different unique set of ads to them.
duck wrote:
If the ad system is counting search engine views as a view then as an advertiser I would be annoyed.

Exactly my point! A search engine 'loads' the page when it crawls them so the potential is there for it to see duplicated adverts.
Of course the search engine could care less what it see's but from a moralistic standpoint, your wasting advertisers money.

Of course you can get around it by creating an array/multi-dimensional array or using some other 'check' to determine if a specific banner has already been deployed but this should be added to the page and nothing to do with the actual Advertising module.
The Advertising module is not psychic so it has no way of knowing in advance which combination of ads you are going to display - easily fixed by ensuring it only displays unique ads but what happens them if you wanted to promote two of your own ads with a client ad in the middle?

I'm not saying it cannot be done, I'm just throwing some input at it for discussion.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©