The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Advertisement under first post of all posts

Go down

Solved Advertisement under first post of all posts

Post by Luffy on 14/11/2014, 21:09

Hello,

I want to add an advertisement box under all first posts. I have one but that one appears only when you have 2 pages. I want it to be visible under all first posts even if you have only the topic.

Topic post1
Advertisement
Post2
Post3...
avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Guest on 14/11/2014, 21:11

Hello MrMind,
Have you tried the following tutorial here at Forumotion English Support Forum?
http://help.forumotion.com/t97416-advertising-poster-on-punbb-phpbb2

It was written for PunBB forums so try it out and see if it works.

Hope this helps answer your question.

-James

Guest
Guest


Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 14/11/2014, 21:13

I've seen the tutorial. I don't want a poster. I only need a box where i can write my advertisements.
I don't want it under every post. Only after the first post of each thread.



avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Mati on 14/11/2014, 22:20

Add this in your Javascript Codes

Title: Advertisement
Placement : In the topics
Code:

$(function(){$('.post:first').after('<div id="Advertisement" style="border-radius: 3px; background: #eee;  border: 1px solid #ccc; font-size: 13px; margin-bottom: 10px;  padding: 10px; margin-top: 10px; text-align:center;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nibh urna, euismod ut ornare non, volutpat vel tortor. Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis urna gravida mollis.</div>')});

Demo -> http://matiforum.forumotion.net/t36-posting-contest
avatar
Mati
Active Poster

Posts : 1905
Reputation : 291
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://forumdirectory.forumotion.net/

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 15/11/2014, 13:36

Hello Mati,

That code seemed ok but as i looked to 2-3 posts, it looks ok if the post has several pages and/or if the post has only one reply in it. Check out this one that has just one reply in the topic.
http://informationforumgr.forumgreek.com/t4353-topic#9860



avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 17/11/2014, 00:45

Bumping time! Smile



avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 17/11/2014, 01:33

I think there is either an error in your template or code because the first post is wrapping the next posts making them its children. That makes using :first or :eq(0) useless you write $('.post .post:first').before('content')
avatar
Ange Tuteur
Forumaster

Male Posts : 13194
Reputation : 2907
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by azwiz on 17/11/2014, 07:52

.


Last edited by azwiz on 18/11/2014, 00:44; edited 2 times in total (Reason for editing : unintentional link post and posted in wrong forum , it is gone , in my block)
avatar
azwiz
Forumember

Male Posts : 487
Reputation : 7
Language : english
Location : Apache Junction , Arizona USA

http://valleyofthesun.forumotion.co.uk/

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 17/11/2014, 09:02

@azwiz wrote:It's taken me 4 days to get to this point , given the option to post . I have been trying to contact buttercup . I need every kind of help possible . I just acquired an awesome forum from its founder . I am very excited but don't know the first thing about forums . Especially the lingo interpretation for the forumotion formats . I need to learn everything about managing my forum . Also need to know the proper protocol for becoming the founder . Please and thank you .
http://littlemunks.forumotion.co.uk/
This is my new forum.
By the way forum of the forums would not accept my forum username and password . They are two different identities now .I don't know if that is good or not . I don't like it .
Welcome to Forumotion, azwiz.

As you're new, here are some topics that you might find helpful :
Forum rules
Frequently Asked Questions
Tips and tricks

You can also check my signature for additional links.

As this is MrMind's support topic, I advise you to create your own topic under one of the categories in the Support Section.

Thank you and have a nice day.
avatar
Ange Tuteur
Forumaster

Male Posts : 13194
Reputation : 2907
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 17/11/2014, 13:00

@Ange Tuteur wrote:I think there is either an error in your template or code because the first post is wrapping the next posts making them its children. That makes using :first or :eq(0) useless you write $('.post .post:first').before('content')
Ange because i will have a series of events on my forum, i would like the advertise box to be visible below all posts. So if i have to make some serious changes such as removing the wrapping bar i will do it.
I need to have everything ready to do that.
If you can please tell me what i have to do to achieve the wanted result!

Thank you!
avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 17/11/2014, 23:19

If you want it after every post use this :
Code:
$(function() {
  $('.post').after('content');
});

Just replace content with what you want.
avatar
Ange Tuteur
Forumaster

Male Posts : 13194
Reputation : 2907
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 17/11/2014, 23:31

Sorry for my wrong phrase. I meant that i want the ad box to be below the first post of all topics. If for example the topic has the author post only to be displayed below it and if it has 1 reply to also have it in between. If the topic has 2 replies then the ad box to be below the author post etc.

Thanks for your time.



avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 17/11/2014, 23:36

See if this works for your forum :
Code:
$(function() {
  $('.post > .postmain:eq(0)').after('content');
});
avatar
Ange Tuteur
Forumaster

Male Posts : 13194
Reputation : 2907
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 18/11/2014, 10:35

Yes it works!
How can i style it though?



avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 18/11/2014, 10:38

Wrap your content with a HTML tag that either has the classname or ID attribute. For example :
Code:
$(function() {
  $('.post > .postmain:eq(0)').after('<div class="addBox">content</div>');
});

Then css for style :
Code:
.addBox {
  background:#EEE;
  border:1px solid #CCC;
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13194
Reputation : 2907
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 18/11/2014, 11:17

Υeap! That's what i wanted! Thank you very much! Have a nice day!
Topic Solved!



avatar
Luffy
Manager
Manager

Male Posts : 5265
Reputation : 565
Language : Greek, English
Location : Greece

https://www.crossroadz.net

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 18/11/2014, 11:22

You're welcome !

Topic archived

You too ! Smile
avatar
Ange Tuteur
Forumaster

Male Posts : 13194
Reputation : 2907
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum