IMPORTANT

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

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 09 Oct 2018, 11:34

» 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

» Numbering of messages in the topic
by SLGray Mon 04 Dec 2017, 22:40

Recent Tutorials
Top posting users this month
Who is online?
In total there are 11 users online :: 0 Registered, 0 Hidden and 11 Guests

None

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

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

View previous topic View next topic Go down

avatar
Michael_vx

Gender : Male
Age : 26
Posts : 302
Points : 2083
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on 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
avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4736
Points : 9977
Reputation : 2369
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Michael_vx

Gender : Male
Age : 26
Posts : 302
Points : 2083
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on 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
avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4736
Points : 9977
Reputation : 2369
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Mon 22 Aug 2016, 14:57

@Michael_vx try this instead :
Code:
$(function() {
  $('.post').eq(0).find('.postbody > div').prepend('<div>CONTENT HERE</div>');
});

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Michael_vx

Gender : Male
Age : 26
Posts : 302
Points : 2083
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on 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
avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4736
Points : 9977
Reputation : 2369
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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!"

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Michael_vx

Gender : Male
Age : 26
Posts : 302
Points : 2083
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on Tue 23 Aug 2016, 21:59

you missunderstand
its show 2 images but the link is 1 image :O
avatar
Ange Tuteur
Administrator
Gender : Male
Age : 22
Posts : 4736
Points : 9977
Reputation : 2369
Location : Macungie, PA
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on 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
.

--------

Ange Tuteur
Tips and TricksContact Me

avatar
Michael_vx

Gender : Male
Age : 26
Posts : 302
Points : 2083
Reputation : 76
Language : Arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : Other
View user profile http://miccsoft.net https://www.facebook.com/Michaelvx2008

PostMichael_vx on 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

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
avatar
Guest
Guest

PostGuest on 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