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

View previous topic View next topic Go down

Solved Advertisement under first post of all posts

Post by Luffy on 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...

Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Soul on November 14th 2014, 9:11 pm

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

Soul
Forumember

Male Posts : 673
Reputation : 79
Language : English
Location : United States

http://adminvortex.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 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.






Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Mati on 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
Active Poster

Posts : 1883
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://footballforums.forumotion.net/

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 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






Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on November 17th 2014, 12:45 am

Bumping time! Smile






Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by azwiz on 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
Forumember

Male Posts : 409
Reputation : 6
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 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.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 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!

Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on 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.






Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

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

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

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on November 18th 2014, 10:35 am

Yes it works!
How can i style it though?






Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Advertisement under first post of all posts

Post by Luffy on November 18th 2014, 11:17 am

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






Luffy
Manager
Manager

Male Posts : 4245
Reputation : 424
Language : Greek, English
Location : Greece

http://helpgr.forumgreek.com/forum

Back to top Go down

Solved Re: Advertisement under first post of all posts

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

You're welcome !

Topic archived

You too ! Smile

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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