The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Advertisement under first post of all posts

4 posters

Go down

Solved Advertisement under first post of all posts

Post by TheCrow November 14th 2014, 9:09 pm

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...
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Guest November 14th 2014, 9:11 pm

Hello MrMind,
Have you tried the following tutorial here at Forumotion English Support Forum?
https://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
avatar
Guest
Guest


Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by TheCrow November 14th 2014, 9:13 pm

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.


Advertisement under first post of all posts Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Mati November 14th 2014, 10:20 pm

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
Mati
Mati
Active Poster

Posts : 1932
Reputation : 333
Language : HTML, CSS & JavaScript
Location : Forum Services

https://fm-focus.forumotion.com/

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by TheCrow November 15th 2014, 1:36 pm

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


Advertisement under first post of all posts Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by TheCrow November 17th 2014, 12:45 am

Bumping time! Smile


Advertisement under first post of all posts Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur November 17th 2014, 1:33 am

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 Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by azwiz November 17th 2014, 7:52 am

.


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

Male Posts : 837
Reputation : 9
Language : english
Location : Apache Junction , Arizona USA

https://www.valleyofthesuncc.com/

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur November 17th 2014, 9:02 am

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. Advertisement under first post of all posts Halo10
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by TheCrow November 17th 2014, 1:00 pm

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!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur November 17th 2014, 11:19 pm

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

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

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by TheCrow November 17th 2014, 11:31 pm

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.


Advertisement under first post of all posts Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur November 17th 2014, 11:36 pm

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

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by TheCrow November 18th 2014, 10:35 am

Yes it works!
How can i style it though?


Advertisement under first post of all posts Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur November 18th 2014, 10:38 am

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;
}
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by TheCrow November 18th 2014, 11:17 am

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


Advertisement under first post of all posts Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur November 18th 2014, 11:22 am

You're welcome ! Advertisement under first post of all posts Halo10

Topic archived

You too ! Smile
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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