FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

Recent Tutorials
Top posting users this month

Who is online?
In total there are 13 users online :: 0 Registered, 0 Hidden and 13 Guests :: 2 Bots

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

is there a way to add image above the post content first post only

View previous topic View next topic Go down

Michael_vx
Michael_vx

Gender : Male
Age : 32
Posts : 302
Points : 4097
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx Fri 19 Aug 2016, 20:36

is there a way to add image above the post content first post only
like this CSS
Code:
.hr {
background: url(http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png) no-repeat;
background-position: top;
text-align: center;
vertical-align: text-bottom;
padding: 0px 325px 210px;
line-height: normal;
}
but in the first post only
even with Java will do fine
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Fri 19 Aug 2016, 20:58

Hi @Michael_vx,

Your best bet is definitely javascript. Try using this script :
Code:
$(function() {
  $('.post').eq(0).find('.postbody').before('<div>CONTENT HERE</div>');
});

Replace
Code:
<div>CONTENT HERE</div>
with the content you want before the post content. Wink
Michael_vx
Michael_vx

Gender : Male
Age : 32
Posts : 302
Points : 4097
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx Sat 20 Aug 2016, 17:56

its working good but
its not inside the post content scratch
can it be just inside
i tried
Code:
$(function() {  $('.postbody').eq(0).prepend('<img alt=""
src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png"
style="width: 464px; height: 130px;" />');});
but its out side like the one you did
almost solved Smile
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 22 Aug 2016, 14:57

@Michael_vx try this instead :
Code:
$(function() {
  $('.post').eq(0).find('.postbody > div').prepend('<div>CONTENT HERE</div>');
});
Michael_vx
Michael_vx

Gender : Male
Age : 32
Posts : 302
Points : 4097
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx Tue 23 Aug 2016, 21:23

thats a way to go my friend
reflect
expect for it show dual images (repeat the image for 1 other time )
used like this

Code:
$(function() {
$('.post').eq(0).find('.postbody > div').prepend('<div><img src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png"></div>');
        });

and used like this

Code:
$(function() {
$('.post').eq(0).find('.postbody > div').prepend('<img src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png">');
        });

not sure why but that is 99% good and working
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Tue 23 Aug 2016, 21:28

If you want to use two images you can add them both in the same script like this :
Code:
$(function() {
  $('.post').eq(0).find('.postbody > div').prepend('<div><img src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png"><img src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png"></div>');
});

Although to make it more readable you can concat the string using "+" :
Code:
$(function() {
  $('.post').eq(0).find('.postbody > div').prepend(
  '<div>'+
    '<img src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png">'+
    '<img src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png">'+
  '</div>');
});

Basically you're just adding multiple strings together, like in math were you add numbers together. For example :
Code:
1 + 2 + 3; // 6
'Hello' + ' ' + 'world' + '!'; // "Hello world!"
Michael_vx
Michael_vx

Gender : Male
Age : 32
Posts : 302
Points : 4097
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx Tue 23 Aug 2016, 21:59

you missunderstand
its show 2 images but the link is 1 image :O
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 24 Aug 2016, 11:36

@Michael_vx ooooooooh ! It might be the selector, try changing
Code:
.postbody > div
into
Code:
.postbody > div:first-child
.
Michael_vx
Michael_vx

Gender : Male
Age : 32
Posts : 302
Points : 4097
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx Wed 24 Aug 2016, 22:28

yep but it worked this way
Code:
$(function() {
        $('.post').eq(0).find('.postbody > div:first').prepend('<div><img src="http://i63.servimg.com/u/f63/11/53/34/85/f3al_c10.png"></div>');
                });
so it should be
.postbody > div:first
not
.postbody > div:first-child
what make me a little confused is .postbody shoud be the tag for phpbb2 but the Script not working with it
but tag is working with phpbb3
is there a way to add image above the post content first post only 1f602 is there a way to add image above the post content first post only 1f602 is there a way to add image above the post content first post only 1f602 is there a way to add image above the post content first post only 1f602 is there a way to add image above the post content first post only 1f602 is there a way to add image above the post content first post only 1f602
thats sounds crazy but i think i may try to think about something for it
ـــــــــــــــــــ Edit ـــــــــــــــــــــــــــــــــــــــــــــــ
never mind
i get what i was missing
.post = phpbb3
tr.post = phpbb2
topic is solved Smile due i have the rest versions tags stored some where on my forum
thanks so much
you really did a great help
Anonymous
Guest
Guest

PostGuest Thu 25 Aug 2016, 01:50

*** Topic solved, locked and archived ***
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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