"New" icon code problem
5 posters
Page 1 of 1
"New" icon code problem
Hello, i used the below code but it is not working at all. I cannot find the error indeed. Here you see
To add this you must go to HTML & JAVASCRIPT -> Javascript codes management Create a new javascript and add this script
Placement: In all the pages
Then we must style it with css code
Remember to replace your Forum - New icons with yours this part <span style="color: #aa6709;background: #fff4e5;border: 1px solid #f9c479;padding: 0px .35em;border-radius: 2px;">[style*="https://i.servimg.com/u/f88/20/00/67/44/forum_11.gif"]</span>
Link to the post of problem below
https://forumservice.forumotion.com/t118-new-post-indicator
To add this you must go to HTML & JAVASCRIPT -> Javascript codes management Create a new javascript and add this script
Placement: In all the pages
- Code:
$(function() {
$('.forabg dl[style*="https://i.servimg.com/u/f88/20/00/67/44/forum_11.gif"]').find('a.forumtitle').append('<span class="new-post">NEW</span>');
});
Then we must style it with css code
- Code:
.new-post {
background: #84c754;
font-size: 12px;
margin-left: 10px;
border-radius: 3px;
color: #fff;
padding: 1px 5px;
}
Remember to replace your Forum - New icons with yours this part <span style="color: #aa6709;background: #fff4e5;border: 1px solid #f9c479;padding: 0px .35em;border-radius: 2px;">[style*="https://i.servimg.com/u/f88/20/00/67/44/forum_11.gif"]</span>
Link to the post of problem below
https://forumservice.forumotion.com/t118-new-post-indicator
Re: "New" icon code problem
I think it was about new post indicator when someone post new message then it shows "New" after the forums
Re: "New" icon code problem
No i meant where did you find that code ?
Not all codes are for all versions
Not all codes are for all versions
Re: "New" icon code problem
Yeah but @mati is busy right now. So i posted here for help about this issue. We have many coding experts here so that i can get help from them too
Re: "New" icon code problem
i do not understand
you mean you posted this also to Mati's forum and because he is busy you posted also here ?
you mean you posted this also to Mati's forum and because he is busy you posted also here ?
Re: "New" icon code problem
Why are you not just using the default system for the new icon?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: "New" icon code problem
Good afternoon!
AP - Display - Templates - General - topics_list_box
At the end of the template, insert the code
Save. Publish.
Your CSS code has not been changed
Result:
AP - Display - Templates - General - topics_list_box
At the end of the template, insert the code
- Code:
<script>
$(document).ready(function() {
let listOfTopics = $('div.forumbg.announcement div.inner ul.topiclist.topics.bg_none li dl dd[title="New posts"]');
for (let i = 0; i <= listOfTopics.length; i++) {
listOfTopics[i].querySelector('div').insertAdjacentHTML('afterend','<span class="new-post">NEW</span>');
};
});
</script>
Save. Publish.
Your CSS code has not been changed
Result:
Razor12345- Support Moderator
- Posts : 1584
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Niko and TonnyKamper like this post
Razor12345- Support Moderator
- Posts : 1584
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Re: "New" icon code problem
I thought this script was for topics in the forums.
Remove the code above.
For the forums themselves:
AP - Display - Templates - General - index_box
Insert the code at the end of the template:
Save. Publish.
Please note!
This uses a link to the forum image when there is a new post. Change it to your own.
2) AP - Display - Colors&CSS - CSS Stylesheet
Save.
To move the icon to the left or right, change this item to your liking:
Result:
Remove the code above.
For the forums themselves:
AP - Display - Templates - General - index_box
Insert the code at the end of the template:
- Code:
<script>
$(document).ready(function() {
let listOfForums = $('div.forabg div.inner ul.topiclist.forums li dl[style*="https://2img.net/i/fa/prosilver/forum_unread.gif"]');
for (let i = 0; i <= listOfForums.length; i++) {
listOfForums[i].querySelector('dd.dterm').insertAdjacentHTML('beforeend','<span class="new-post">NEW</span>');
};
});
</script>
Save. Publish.
Please note!
- Code:
[style*="https://2img.net/i/fa/prosilver/forum_unread.gif"]
This uses a link to the forum image when there is a new post. Change it to your own.
2) AP - Display - Colors&CSS - CSS Stylesheet
- Code:
.new-post {
background: #84c754;
font-size: 12px;
border-radius: 3px;
margin-left: 30%;
color: #fff;
padding: 1px 5px;
}
Save.
To move the icon to the left or right, change this item to your liking:
- Code:
margin-left: 30%;
Result:
Razor12345- Support Moderator
- Posts : 1584
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
TonnyKamper likes this post
Re: "New" icon code problem
Still not showing up. Could you please use my admin access to see the error?
Re: "New" icon code problem
Hello @Dipener (and @Razor12345),
You are using a custom template so you only need to replace
to
You are using a custom template so you only need to replace
|
|
TonnyKamper likes this post
Re: "New" icon code problem
Problem solved & topic archived.
|
Similar topics
» problem with icon code
» Topic Icon Code
» Topic Icon Space & spoiler/code color
» Improve reputation code application and change emoticon icon.
» Problem in this code
» Topic Icon Code
» Topic Icon Space & spoiler/code color
» Improve reputation code application and change emoticon icon.
» Problem in this code
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum