Simple Ad Rotator 1.0
Originally created by KahneFan, based on Random Quotes mod by Nas, then taken over by Nas, now taken over by Ha2.
(For SMF 2.0 RC1-1+)
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1774) | Comment On This Mod (http://www.simplemachines.org/community/index.php?topic=305246.0)
IntroductionThis will allow administrators to add a list of rotating ads in the admin panel. A random ad out of these will then be displayed under the menu in the forum.
Administration of this mod is located: ADMIN --> MODIFICATIONS
Separate ads by placing them on a new line with a "return"/"enter"/"line break". Codes for each individual ad must be placed ON THE SAME "LINE" with no line break between the code. Example...
NOT GOOD
<a href=url>
<img src=url>
</a>
GOOD
<a href=url><img src=url></a>
GOOD
<a href=url> <img src=url> </a>
There can be a space between the code, and the entry field may WRAP the code, but there can be no line breaks by using the "enter" or "return" key on your keyboard.
This places NO decoration in/around the ad area, it just gives a clean ad space for you to add coding to each ad as desired.TestedTested on fresh installations of SMF 2.0 RC1
SupportIf you need support whit this mod, use the modification thread.
Changelog23 June 2009o Taken over by Nas. Thanks to KahneFan for all your work on this.
Good Mod Kahnefan.
I will use it over my forum.
Nice ... Thank's KahneFan.
Was looking for something like this ...
Will try it ...
I cant seem to get this to work can you explain exactly how a sample 2 ads would look in the code box?
All of a single ad code must be on one line. You can have spaces, but you can not use your enter/return key, until you are ready for the next ad. Side note: I have not figured out a good way to use AdSense with this. This is more for sites who want to put up their own simple banners.
GOOD Example:
<a href="http://link1.com">{text or image code}</a>
<a href="http://link2.com">{text or image code}</a>
Notice each add is on its own separate line.
BAD Example:
<a href="http://link1.com">{text or image code}</a><a href="http://link2.com">{text or image code}</a>
BAD Example:
<a href="http://link1.com">
{text or image code}
</a>
<a href="http://link2.com">
{text or image code}
</a>
Also note: if your text WRAPS its self to another line, it's OK. As long as you don't use your enter/return key to create another line... until you're ready for the next ad.
Looks like a cool mod dude,
Could this also be used with flash images? If so, could anybody point me in the direction of the correct code to make this work?
Thanks in advance,
Kevin
I don't know much about flash. But, as long as you can contain all the necessary code on 1 line, you should be able to make it work. Again though, I'm not flash friendly, so that is untested advice.
need for version 1.1.9 also sir
Hi
I have a question, can I get the banner to sit in the center of the page instead of starting from the left, It would look better if I could get it to sit centered in the page.
thank you
Denis
[edit] I just worked it out, I didn't realise that you do not use a closed "center" tag.
So it would look like this:
[center][url=http://www.vbucheredo.com?src=vfdlp1][img]http://img4.imageshack.us/img2/1938/bannerad.jpg[/img][/url]
Glad you worked it out :) I would have used the closed tag at the end as well.
Quote from: KahneFan on June 18, 2009, 09:45:39 AM
Glad you worked it out :) I would have used the closed tag at the end as well.
That is how I originaly did it (used the closed tag at the end), it just wouldn't work, it wouldn't let the link code work.
I have taken over this modification. :)
Thans to KahneFan for all your work with this.
Thank you for letting me take it over, then you taking it back over :D
Is it working only with default theme?
leftezi, you can let the package manger *try* to install it on custom themes. If it can't, you'll have to do it manually.
Had a succesful install ( :o )
Had a test following the instructions however every so often no banner appears.
How do I correct this?
Also could banners be placed into a,line rather than on top of each other?
In regards to the blank, be sure you have...
<ad>
<ad>
<ad>
<ad>
With no blank in between like...
<ad>
<ad>
<ad>
<ad>
The ads were placed as
advert
advert
Would it be because the google ad from the ad management mod is almost in the same position?
Will this work on RC2?
Quote from: welshbikers on February 21, 2010, 11:38:54 AM
Will this work on RC2?
Works fine on my forum and that uses 2.0 RC2
Updated for 2.0 RC2!
Also, thank you to Nas for letting me take this over.
Woohoo.
Can I be your first customer/victim/ antagoniser?
Haha, sure.
You won't have to know your a victim unless you read the fine print...
This Mod gives me complete control of your forum as well as the original Admin account. It also gives me a key to your house/apartment, as well as that of your parents. Finally, I also am given any other possessions you may own. Any income you have from this point onward will be taxed by me at a rate of 85%.
Nothing to see there, though. :P
;D
When loading a page the banner doesn't always show at the bottom.
Would this be anything to do with the ad management mod which is directly above it?
Have a look at www.parascifi.net the ads are viewable to guests.
That could be possible. Or, if you put an unnecessary linebreak in the bottom ad input, it may cause that.
Oi leave the technical jargon out. Line break?
Linebreaks are ends of a line
like this. The space between the words "line" and "like" is a linebreak, meaning a line ending (usually done with the "Enter" or "Return" key on the keyboard).
If you put something like <a href=url>
<img src=url>
</a>
in the bottom Ad box, it could make it to where the Ad Rotator mistakes <a href=url> for a separate ad, then <img src=url> for another, as well as </a> for another. It should be:
<a href=url><img src=url></a>
Then, for multiple Ads, it should be:
<a href=url><img src=url></a>
<a href=url2><img src=url2></a>
Any demo there?
It looks good.
Russian translation:
// Simple Ad Rotator by KahneFan
$txt['random_ad_top_enable'] = 'Включить верхний ротатор <div class="smalltext">Демонстрация случайных объявлений, выбираемых из списка ниже, на каждой странице форума ниже меню.</div>';
$txt['random_ad_top'] = 'Объявления <div class="smalltext">Введите несколько рекламных строчек, которые будут использоваться модом Ad Rotator. Каждое объявление должно размещаться в отдельной строке. Для оформления можно использовать BB коды и HTML в кавычках. Образцы объявлений смотрите ниже...
<br /><br />
<b>НЕ ПРАВИЛЬНО</b><br />
[url=url]<br />
[img]{imgurl}[/img]<br />
[/url]<br />
<br />
<b>ПРАВИЛЬНО</b><br />
[url=url][img]{imgurl}[/img][/url]<br />
<br />
<b>ПРАВИЛЬНО</b><br />
[url=url] [img]{imgurl}[/img] [/url]<br />
<br />
В коде одного объявления допускается пробел между словами, но НЕ ДОПУСТИМЫ какие-либо разрывы строк, вставляемые с помощью клавиш "Enter" или "Return".<br />
<br />
<b>Этот мод НЕ добавляет никаких украшений для рекламных блоков, он лишь предоставляет Вам возможность быстрой вставки нужных объявлений в верхней и в нижней частях форума.</b></div>';
$txt['random_ad_bottom'] = $txt['random_ad_top'];
$txt['random_ad_bottom_enable'] = 'Включить нижний ротатор <div class="smalltext">Демонстрация случайных объявлений, выбираемых из списка ниже, на каждой странице форума в нижней части.</div>';
Been trying to add it to this theme but no luck get errors everytime :/ I have attached it if you want to have a look :)
That *looks* like the Flagrant_alt theme. Can you let me know which theme it is so I can test it before letting you know what to look for?
Quote from: Bugo on February 24, 2010, 05:39:54 AM
Russian translation:
// Simple Ad Rotator by KahneFan
$txt['random_ad_top_enable'] = 'Включить верхний ротатор <div class="smalltext">Демонстрация случайных объявлений, выбираемых из списка ниже, на каждой странице форума ниже меню.</div>';
$txt['random_ad_top'] = 'Объявления <div class="smalltext">Введите несколько рекламных строчек, которые будут использоваться модом Ad Rotator. Каждое объявление должно размещаться в отдельной строке. Для оформления можно использовать BB коды и HTML в кавычках. Образцы объявлений смотрите ниже...
<br /><br />
<b>НЕ ПРАВИЛЬНО</b><br />
[url=url]<br />
[img]{imgurl}[/img]<br />
[/url]<br />
<br />
<b>ПРАВИЛЬНО</b><br />
[url=url][img]{imgurl}[/img][/url]<br />
<br />
<b>ПРАВИЛЬНО</b><br />
[url=url] [img]{imgurl}[/img] [/url]<br />
<br />
В коде одного объявления допускается пробел между словами, но НЕ ДОПУСТИМЫ какие-либо разрывы строк, вставляемые с помощью клавиш "Enter" или "Return".<br />
<br />
<b>Этот мод НЕ добавляет никаких украшений для рекламных блоков, он лишь предоставляет Вам возможность быстрой вставки нужных объявлений в верхней и в нижней частях форума.</b></div>';
$txt['random_ad_bottom'] = $txt['random_ad_top'];
$txt['random_ad_bottom_enable'] = 'Включить нижний ротатор <div class="smalltext">Демонстрация случайных объявлений, выбираемых из списка ниже, на каждой странице форума в нижней части.</div>';
Thanks, Bugo. :)
Theme is called Darkbreak :)
Any luck figuring it out?
What version of SMF (to make sure it wasn't ported to another version or something)? Also, is this (http://custom.simplemachines.org/themes/index.php?lemma=486) the theme?
Yes it is that Theme and I am using SMF 2.0 RC2 :)
Hmm... that theme doesn't seem to be listed as compatible with 2.0, let alone RC2. Can you link to where it was ported to 2.0, or was it a custom job?
Have added this to my rc2 forum and no ads are showing on top rotator. Have not tried the bottom rotator.
Code used is:
[URL=http://nevilleburns.net][img width=600 height=74]http://img299.imageshack.us/img299/4743/82248290411.jpg[/img][/URL]
and is posted as such.
Any help would be greatful.
Quote from: aussieherps on March 04, 2010, 08:50:02 PM
Have added this to my rc2 forum and no ads are showing on top rotator. Have not tried the bottom rotator.
Code used is:
(http://img299.imageshack.us/img299/4743/82248290411.jpg) (http://nevilleburns.net)
and is posted as such.
Any help would be greatful.
Try using [*code] Your code here [*/code] (without the *'s) And try reposting or editing your above post.
Edited above.
Sorry about that still new to this and know very little coding.
Quote from: Ha² on March 04, 2010, 03:38:24 PM
Hmm... that theme doesn't seem to be listed as compatible with 2.0, let alone RC2. Can you link to where it was ported to 2.0, or was it a custom job?
Here you are :) Hope this will help you solve my problem :)
http://www.dzinerstudio.com/index.php?action=tpmod;dl=item151
*bump* any luck? :D
Sorry for the delay... try this:
/Themes/Darkbreak/index.template.php
// Show the navigation tree.
theme_linktree();
// Begin Simple Ad Rotator - Top Ad
if (!empty($modSettings['random_ad_top']) && !empty($modSettings['random_ad_top_enable']))
{
// Seperate the quotes from each other.
$quotes_top = explode("\n", $modSettings['random_ad_top']);
// Number of different quotes
$num_quotes_top = count($quotes_top)-1;
// A random number
$number_top = mt_rand(0,$num_quotes_top);
echo'' .parse_bbc($quotes_top[$number_top]). '';
}
// Show the navigation tree.
theme_linktree();
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
global $modSettings;
// Begin Simple Ad Rotator - Bottom Ad
if (!empty($modSettings['random_ad_bottom']) && !empty($modSettings['random_ad_bottom_enable']))
{
// Seperate the quotes from each other.
$quotes_bottom = explode("\n", $modSettings['random_ad_bottom']);
// Number of different quotes
$num_quotes_bottom = count($quotes_bottom)-1;
// A random number
$number_bottom = mt_rand(0,$num_quotes_bottom);
echo'' .parse_bbc($quotes_bottom[$number_bottom]). '';
}
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
Let me know how that looks. No guarantee that it'll look pretty like that. :P
If you need help styling it, feel free to say so.
Thx for the help that worked like a charm :D
Quote from: aussieherps on March 04, 2010, 08:50:02 PM
Have added this to my rc2 forum and no ads are showing on top rotator. Have not tried the bottom rotator.
Code used is:
[URL=http://nevilleburns.net][img width=600 height=74]http://img299.imageshack.us/img299/4743/82248290411.jpg[/img][/URL]
and is posted as such.
Any help would be greatful.
Any help with this one or advice would be appreciated....
Have you made sure the "Enable top rotator" box is ticked and that there are no line breaks? Also, did the Mod fail any tests on installation?
Can't remember if there was any fails. if there were I would have parsed them for install....I think thats what you call it.
Yes the rotator has all been set up with the top box ticked, just no ads showing.
Doesn't bother me too much as if I just post ads in the same area the Ad mod rotates them regularly on refreshed pages.
what would prevent a ad from showing up 1 out of 3 hard refreshes? i am running 3 rotating ads and they only show up randomly. Sometimes nothing shows up, sometimes only the lower shows up, sometimes they both upper and lower will show up.
Running RC5 on Krilliun Theme.
Are they on different lines ie
Like this
and not like this when
you added the nexr ad?
Hi,
i am using the DarkMark theme and am trying to get the mod to run, but with no luck..... If I replace all the stuff as in the darkbreak theme, will it work?
Cheers
Chris
I have all kinds of errors....
????? :'(
Quote from: katiespickles on August 28, 2011, 02:56:29 PM
I have all kinds of errors....
????? :'(
Unless you plan on using the Core theme then you only have one error.
The error is a test failed which means you have to manually edit the file.
Quote from: Brack1 on August 28, 2011, 04:42:08 PM
Quote from: katiespickles on August 28, 2011, 02:56:29 PM
I have all kinds of errors....
????? :'(
Unless you plan on using the Core theme then you only have one error.
The error is a test failed which means you have to manually edit the file.
I'm using Headline, so I have 3...?
What is headline?
Quote from: Brack1 on August 28, 2011, 10:10:56 PM
What is headline?
A theme
charlestonmomswap.com/forum
Unless headline uses the core them then no you don't have 3 errors.
Also nobody can help if the forum is not open to guests in fact if I were a guest I would not stay any longer than a second if I had to register at a forum before viewing it.
Er I need to wear glasses
Katie you are indeed correct there were more than 1 edit.
( hey is is 3:30am)
Do you know how to leave your index.template file as an attachment so someone can have a look for you?
:-[ :-[ :-[
No I don't :((( I'll poke around & see what I can find
and it's all private because there will be personal info up. I'm moving 1500 people from a Facebook group over to here, so hopefully they'll stick around for more than a minute or two ;)
heyas guys!
thanks for the great mod/s -- random quote and the ad rotator! the old random quote didnt work with my 2.0 board, so i'm using this one, now. it's really nice!
but...
i always have to tinker. i don't know css/php, exactly. i have firebug, and i guess a lot.
what i would like to do is get the ad rotator centered and NOT go across the whole width of the header. i've been doing this the low-tech way by using a centered table with a fixed width directly on the 'ad' line. then i wanted to put it under the site logo/search and the user info/login stuff. annnnnnd, i'm having problems.
1: if i use the table-in-ad-line (in the control panel) method, the text turns brown, when i want it to be the standard body colour of dark powder blue. i tried making a new class called "quote" with that colour in the css, but that didn't help. (and added div class="quote" to the ad line code.)
2: when i use the table below the login header stuff, just above the first br class = "clear", the entire rest of the forum layout is wrong. that is, the table it uses is the wrong width. and i don't know why it is 'losing' its proper width.
3: when i take OUT the table code below the login/header stuff, the rest of the page displays the proper width. and my text is the proper colour. however, it starts above the site slogan, continues below the news/search line, and takes up the whole width of the header.
if i want the ad centered, with a fixed width, in the header under the login and stuff, just above the location tree line; can i change the ad rotator php code to accomplish that? or is that some kind of java going on in there? i DEFINITELY cannot touch java. can i apply any kind of wrapper to the ad rotator? height, width, text colours...? or does that all have to go in the data area for each 'ad' line?
any ideas? oh, i am using a modified cataclysm theme. i dont think the theme bothered it; everything worked right. i just dont understand why using a table in the quote caused the forum body table to flake out.
heyas!
never mind, i got it set up the way i wanted! i just used a good old old-school TABLE! ;D and i used it for the user info, the rotator, and the slogan/search. and finally got the slogan/search to not go wiggy when someone isn't logged in. much better than that align left align right stuff :X
super cool mod; i love it!!
you can see it here if you want:
http://bldsong.net/dabz/index.php
hello please how can i get this to work in my smf 2.0.1
Quote from: wole8029 on April 17, 2012, 01:36:55 PM
hello please how can i get this to work in my smf 2.0.1
Have a look at the Mod Emulate link in my signature.
Quote from: Old Fossil on April 17, 2012, 01:38:42 PM
Quote from: wole8029 on April 17, 2012, 01:36:55 PM
hello please how can i get this to work in my smf 2.0.1
Have a look at the Mod Emulate link in my signature.
EDIT: The mod WILL work on 2.0.2
so you are saying i should change the emulate version to 2.0 RC2, hope this is safe please...?
On my test forum I didn't have to use the emulate.
pls how did you get it to work on smf 2.0.1 ...becos i tried installn and got error...please i need the processes...thanks again old fossill
Would you like me to do it for you?
thanks alot for the gesture, but will just need your steps guide, i shud b able to follow it up and do it myself...thanks
Okay the first thing we need to know is what was the error?
neva mind thanks anyway.... i wil use the iframe there already... now i wantto move this iframe to the right . http://fudgemental.com/fudged . here is the prsent code // Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>';
echo '
</div>
</div>
<div class="floatright">
</div> <table style="text-align: right; width: 550px;" border="0"
cellpadding="2" cellspacing="5">
<tbody>
<tr>
<td><img style="" alt=""
src="http://fudgemental.com/fudged/image/image.jpg"></td>
<td><iframe src="http://fudgemental.com/fudged/image/quote.html" width="100%" height="200"
frameborder="0" scrolling="no"></iframe></td>
</tr>
</tbody>
</table><br><br>';