Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Oct 19, 2013 5:33:54 GMT -8
imialatest3.proboards.comIs there a way to get information from my H/F and place it in my templates? I've customised my info centre to include an affiliate table, but I don't want to input all those affiliates in my template. I was thinking of having something like <div class="ID"></div> in the place in the template where the affiliate buttons are supposed to go, then in my H/F have the actual affiliate buttons HTML. Is that possible? If so, how?
|
|
inherit
I need a new CT, thinking.... [insert Jeopardy theme song here]
110769
0
Aug 21, 2021 0:07:21 GMT -8
Tumbleweed
20,825
September 2007
tumbleweed
|
Post by Tumbleweed on Oct 21, 2013 14:06:35 GMT -8
You could put something like this in your header or footer:
<script type="text/javascript">
$("document").ready(function(){
$("#my_affies").insertAfter(".shoutbox.container.full");
});
</script>
<div style="display:none;"> <div id="my_affies">
<a href="http://home.com"><img src="http:/image.png"></a>
<a href="http://home.com"><img src="http:/image.png"></a>
<a href="http://home.com"><img src="http:/image.png"></a>
</div></div>
For example, I have my shoutbox at the bottom of the forum so I set it to put the affiliates after the shoutbox so the .shoutbox.container.full class in the javascript code. You'd not need to put in any div's in the template itself if you know the class or id of the container it will go after.
Someone else may have some better ideas though.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Oct 21, 2013 15:32:43 GMT -8
I have my affiliates actually in the Info Centre template, could I just use the above code but without the "insert after" bit?
|
|
inherit
I need a new CT, thinking.... [insert Jeopardy theme song here]
110769
0
Aug 21, 2021 0:07:21 GMT -8
Tumbleweed
20,825
September 2007
tumbleweed
|
Post by Tumbleweed on Oct 21, 2013 18:47:10 GMT -8
I don't see any reason why you can't just stick a opening and closing div in the template area with a class or id name and put where you planned for the affiliates to go and then change the bolded part in the javascript to reflect that id/class.
This would go in the template where you want the affiliates to go. (technically putting the affiliates after that opening/closing div)
<div "id_or_class"></div>
And then change the bolded part to the above id.
<script type="text/javascript">
$("document").ready(function(){
$("#my_affies").insertAfter(".id_or_class");
}); </script>
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Oct 21, 2013 22:15:15 GMT -8
Thank you!
EDIT: I'm having trouble styling the affiliates in the div.
Right now my CSS is
and all the links in the H/F potion have the class 'affbutts'. however, the only thing that is working at the moment is the border-bottom: 0!important on hover, and the #my_affies class.
What am I doing wrong? I'm trying to get the padding around each affiliate image to be 5px, and to have an opacity of 0.5.
|
|
inherit
I need a new CT, thinking.... [insert Jeopardy theme song here]
110769
0
Aug 21, 2021 0:07:21 GMT -8
Tumbleweed
20,825
September 2007
tumbleweed
|
Post by Tumbleweed on Oct 22, 2013 20:02:17 GMT -8
Kami, Instead of having to put the class in each a link, just put a div around all your affiliates: <div id="my_affies"> <div class=" affbutts"> <a href="http://linktoplace.com"><img src="http://yourimage.png"></a> <a href="http://linktoplace.com"><img src="http://yourimage.png"></a> </div> </div> I do my css like this: (I just as a habit add in the a:visited because I just have better luck getting things to work) .affbutts a:links,.affbutts a:visited { padding: 20px;} .affbutts a:hover { border-bottom: 0px!important;opacity:0.4; filter:alpha(opacity=40); } Seems the padding still isn't working but if you add this to your style sheet it should: .affbutts img{padding: 10px;
}
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Oct 23, 2013 14:25:20 GMT -8
Thanks Tumbleweed! I do have another two problems though: a) is there a way to get it to show up on JUST the homepage? It's currently displaying on all pages; and b) for some reason the last line shows up misaligned [ here] even though there are equal numbers of images per row.
|
|
inherit
I need a new CT, thinking.... [insert Jeopardy theme song here]
110769
0
Aug 21, 2021 0:07:21 GMT -8
Tumbleweed
20,825
September 2007
tumbleweed
|
Post by Tumbleweed on Oct 23, 2013 17:19:53 GMT -8
Thanks Tumbleweed! I do have another two problems though: a) is there a way to get it to show up on JUST the homepage? It's currently displaying on all pages; and b) for some reason the last line shows up misaligned [ here] even though there are equal numbers of images per row. I just tested it out on my V5 test site just in case something you had elsewhere was messing things up and got the same thing. I put it in notepad to enlarge everything to look for errors and noticed you closed your images like this: /> I used the remove and replace tool in notepad to just close it with a > and that seemed to fix the gap. So your images look like this: <img src="http://i40.tinypic.com/2dmieyw.jpg" width="88" height="31" border="0" alt="The Avatar RP">I think moving the script and your affiliates into the main header/footer should just keep in on the main page and nowhere else.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Oct 23, 2013 17:24:33 GMT -8
I thought the /> closing was "proper" markup tho
And no, moving it to main h/f shows up on all non-posting pages (home, PMs, etc)
|
|
inherit
I need a new CT, thinking.... [insert Jeopardy theme song here]
110769
0
Aug 21, 2021 0:07:21 GMT -8
Tumbleweed
20,825
September 2007
tumbleweed
|
Post by Tumbleweed on Oct 23, 2013 17:40:16 GMT -8
That's weird, I put it in my main headers and it doesn't show on anything but the main page. Checked pm's, members list, admin, profile. I know it used to do that on V4.5. Maybe it has to do with having it in your info center as I'm not testing it there. As for the markup this is what they say: www.w3schools.com/html/html_images.aspI do know a lot of people were using /> to close their images and it really never caused an issue but in this case, removing them fixed it for me.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Oct 23, 2013 18:53:31 GMT -8
Hm maybe I just didn't refresh right, it's working now (for moving to main H/F).
I edited the images as you said but the spacing is still weird on the last row. =/
|
|
inherit
I need a new CT, thinking.... [insert Jeopardy theme song here]
110769
0
Aug 21, 2021 0:07:21 GMT -8
Tumbleweed
20,825
September 2007
tumbleweed
|
Post by Tumbleweed on Oct 23, 2013 20:15:57 GMT -8
Well, fooie. I'm staring at your coding and I see no obvious mistakes but when viewing your source, right where the problems start I see they are all bunched up together and not neat like all the others.
Screen shot of source:
http://i657./uu300/EliteList/source1_zpse1bd173e.gif
Maybe go through those and split them up so they are nice and tidy. If they look tidy in notepad, remove all spaces between them and then hit enter to put them on a separate line.
Or just delete that part and copy and paste the ones that are nice looking per my screen shot.
I don't know if that'll do the trick but that has fixed things for me more than once.
Another thing you might try is putting the affiliates part in your footer just to see if it does the same thing in other parts of your forum. One thing I noticed when editing templates is you may have one little mistake in the previous coding but it doesn't seem to have a logical place it messes up further down. At least not to me.
|
|