last topics from different subforums
+2
Ange Tuteur
H.A.SS.A.N
6 posters
Page 1 of 2
Page 1 of 2 • 1, 2
last topics from different subforums
hi friends
I need code for make wigdet to bring last topic from different subforums
at least 1 topic from each subforum when I selected by ID of these subforums
the code is similar to this http://fmdesign.forumotion.com/t229-add-news-topics-from-multiple-forums
but I need to maintain the orginal news-wigdet and make another wigdet contain news from other subforums
I hope to help me
thank u
I need code for make wigdet to bring last topic from different subforums
at least 1 topic from each subforum when I selected by ID of these subforums
the code is similar to this http://fmdesign.forumotion.com/t229-add-news-topics-from-multiple-forums
but I need to maintain the orginal news-wigdet and make another wigdet contain news from other subforums
I hope to help me
thank u
Last edited by H.A.SS.A.N on October 23rd 2015, 11:31 am; edited 1 time in total
Re: last topics from different subforums
Hi "H.A.SS.A.N",
Would this tutorial be similar to what you're looking for ?
https://help.forumotion.com/t129060-widget-recent-topics-of-a-specific-sub-forum#864372
Would this tutorial be similar to what you're looking for ?
https://help.forumotion.com/t129060-widget-recent-topics-of-a-specific-sub-forum#864372
Re: last topics from different subforums
Thank you "Ange Tuteur"
but I need the topics in the wigdet from different subforums (in one wigdet only) .
from each subforum only last topic and for other subforums also
mmmm I'm not sure if u understand what I want or not .
I'm waiting u
and Thank u
but I need the topics in the wigdet from different subforums (in one wigdet only) .
from each subforum only last topic and for other subforums also
mmmm I'm not sure if u understand what I want or not .
I'm waiting u
and Thank u
Re: last topics from different subforums
You should be able to do that with the tutorial I linked you. Instead of making multiple widgets, just make one with multiple news containers :
Then you just add the javascript to load the topics into each container :
For organization, you can add titles above each container.
- Code:
<div id="newsareal1" class="newsareal"> </div>
<div id="newsareal2" class="newsareal"> </div>
<div id="newsareal3" class="newsareal"> </div>
<div id="newsareal4" class="newsareal"> </div>
Then you just add the javascript to load the topics into each container :
- Code:
jQuery(document).ready(function(){
jQuery("#newsareal1").load("/f1- div.topic-title-container:lt(5)");
jQuery("#newsareal2").load("/f2- div.topic-title-container:lt(5)");
jQuery("#newsareal3").load("/f3- div.topic-title-container:lt(5)");
jQuery("#newsareal4").load("/f4- div.topic-title-container:lt(5)");
});
For organization, you can add titles above each container.
Re: last topics from different subforums
ok but can u add some edit on it please
1- I want only 10 topic form different subforums ,, when there is new topic will to disappear the last topic
in wigdet .
2- I need top display avater of writer of topic and name ecaxtly as this https://help.forumotion.com/t141465-latest-tutorials-widget
, I make some edit on it with css for my forum and make it as
https://i.servimg.com/u/f21/19/09/87/49/untitl11.png
I need it for show the last episodes add in some subforums
I'm waiting u , THANK U
1- I want only 10 topic form different subforums ,, when there is new topic will to disappear the last topic
in wigdet .
2- I need top display avater of writer of topic and name ecaxtly as this https://help.forumotion.com/t141465-latest-tutorials-widget
, I make some edit on it with css for my forum and make it as
https://i.servimg.com/u/f21/19/09/87/49/untitl11.png
I need it for show the last episodes add in some subforums
I'm waiting u , THANK U
Re: last topics from different subforums
@Ange TuteurH.A.SS.A.N wrote:2- I need top display avater of writer of topic and name ecaxtly as this https://help.forumotion.com/t141465-latest-tutorials-widget
I'm interested in this aswell.
Also it would be fantastic, if the author and date/time would appear (like in the normal widget for recent topics).
Re: last topics from different subforums
H.A.SS.A.N wrote:bump
Please don't double post. Your post needs to be separated by at least 24 hours before bumping. Please use the edit button instead!H.A.SS.A.N wrote:please ???
no answer ??
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: last topics from different subforums
@H.A.SS.A.N, before I start, which version forum are you using ? phpbb2, phpbb3, punbb, or invision ?
Re: last topics from different subforums
hello @"Ange Tuteur "
I need it for phpbb2 and phpbb3 also .
if u can't make one code for two version , u can make one code for every version ??
I'm waiting u
Thank u
I need it for phpbb2 and phpbb3 also .
if u can't make one code for two version , u can make one code for every version ??
I'm waiting u
Thank u
Re: last topics from different subforums
@Ange Tuteur I'm interested in this aswell and I'm using phpbb3.Ange Tuteur wrote:@H.A.SS.A.N, before I start, which version forum are you using ? phpbb2, phpbb3, punbb, or invision ?
Also it would be fantastic, if the author and date/time would appear (like in the normal widget for recent topics).
If that is not possible, an answer would great.
Re: last topics from different subforums
Hi,
Sorry for the wait, I've been busy. Add the following to your stylesheet :
Then go to Modules > JavaScript codes management and create a new script
Placement : In all the pages
After this, you can add the following to widget :
If you're going to have multiple boxes, make sure to replace the 1 in topicbox-1 by another number. At the bottom are some settings :
forum : The ID of the forum you want the topics from.
amount : The amount of topics you want to get.
node : The ID of the container you want to load the topics into.
To style any of the content, just use the following selector(s) :
If you have the avatars for lastposts enabled under Display > Structure and Hierarchy, the avatars will also display in this widget. The rest is up to you.
Sorry for the wait, I've been busy. Add the following to your stylesheet :
- Code:
.last-ajax-posts {
font-size:13px;
font-family:Arial, Verdana, Sans-serif;
}
Then go to Modules > JavaScript codes management and create a new script
Placement : In all the pages
- Code:
window._getNewest = function(o) {
if (!o.node) return false;
if (!o.forum) o.forum = 1;
if (!o.amount) o.amount = 5;
o.node = document.getElementById(o.node);
if (o.node) {
$.get('/f' + o.forum + '-?change_version=prosilver', function(d) {
var last = $('.row .lastpost:has(a[href^="/t"])', d), content = document.createElement('DIV'), i = 0;
for (; i < o.amount; i++) {
if (!last[i]) break;
else content.appendChild(last[i]);
}
o.node.appendChild(content);
});
}
};
After this, you can add the following to widget :
- Code:
<div id="topicbox-1" class="last-ajax-posts"></div>
<script type="text/javascript">
_getNewest({
forum : 1,
amount : 3,
node : 'topicbox-1'
});
</script>
If you're going to have multiple boxes, make sure to replace the 1 in topicbox-1 by another number. At the bottom are some settings :
forum : The ID of the forum you want the topics from.
amount : The amount of topics you want to get.
node : The ID of the container you want to load the topics into.
To style any of the content, just use the following selector(s) :
- Code:
.last-ajax-posts .lastpost {
}
If you have the avatars for lastposts enabled under Display > Structure and Hierarchy, the avatars will also display in this widget. The rest is up to you.
Re: last topics from different subforums
Firstly Thank u for your time ^_^
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
( o.forum = 1; + o.amount = 5; ) these only change or change ID number of forum in code of wigdet also ???
and what's the way for add more than one forum , I mean that I need only 10 last topics come from specific forums those I selected in code .
if this is possible in your code above give me the tip ^_^
AND thank u very much for your time and work
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
( o.forum = 1; + o.amount = 5; ) these only change or change ID number of forum in code of wigdet also ???
and what's the way for add more than one forum , I mean that I need only 10 last topics come from specific forums those I selected in code .
if this is possible in your code above give me the tip ^_^
AND thank u very much for your time and work
Re: last topics from different subforums
You can paste this as much as you want :
HOWEVER you need to change the values for each one. Firstly, you should change both the numbers for topicbox-1 to a number that isn't used by an existing widget. Then you modify the forum ID to change the forum where you get the topics from :
Those are the three things you should focus on editing.
- Code:
<div id="topicbox-1" class="last-ajax-posts"></div>
<script type="text/javascript">
_getNewest({
forum : 1,
amount : 3,
node : 'topicbox-1'
});
</script>
HOWEVER you need to change the values for each one. Firstly, you should change both the numbers for topicbox-1 to a number that isn't used by an existing widget. Then you modify the forum ID to change the forum where you get the topics from :
- Code:
forum : 1,
Those are the three things you should focus on editing.
Re: last topics from different subforums
Ok , I will add the code and then I tell u with results
++ whats the maximum number of topics can I get it ???
++ whats the maximum number of topics can I get it ???
Re: last topics from different subforums
However much you allow perpage on your forum.
You can see that via AP > General > Messages Config > Topics per page
Keep in mind that the more you get the longer it will take to load them all.
You can see that via AP > General > Messages Config > Topics per page
Keep in mind that the more you get the longer it will take to load them all.
Re: last topics from different subforums
ok , hhhhhhhhhh Thank u
Realy u are hero ^_^
but is this code only for phpbb3 or also phpbb2 ??
I noticed there is version=prosilver ??
Realy u are hero ^_^
but is this code only for phpbb3 or also phpbb2 ??
I noticed there is version=prosilver ??
Re: last topics from different subforums
It previews your forum in version phpbb3 when it sends the AJAX request, so the data returned is always accurate, regardless of version. The only difference is mostly in display.
Re: last topics from different subforums
if I modified the default tamplate will not work correctly???
not work with me ?
I think because I modified the tampates
not work with me ?
I think because I modified the tampates
Re: last topics from different subforums
What's the URL of the forum you're having problems on ?H.A.SS.A.N wrote:if I modified the default tamplate will not work correctly???
not work with me ?
I think because I modified the tampates
Re: last topics from different subforums
For that forum, try changing the script in JS codes management to this :
- Code:
window._getNewest = function(o) {
if (!o.node) return false;
if (!o.forum) o.forum = 1;
if (!o.amount) o.amount = 5;
o.node = document.getElementById(o.node);
if (o.node) {
$.get('/f' + o.forum + '-?change_version=prosilver', function(d) {
var last = $('.alt1:has(.lastpost-avatar)', d), content = document.createElement('DIV'), i = 0;
for (; i < o.amount; i++) {
if (!last[i]) break;
else content.appendChild(last[i]);
}
o.node.appendChild(content);
});
}
};
Re: last topics from different subforums
can edit the code for these topic http://www.a7la-anime.com/f196-montada
because I need it for blog topic
and Thank U
because I need it for blog topic
and Thank U
Page 1 of 2 • 1, 2
Similar topics
» Only Moderators name in SubForums
» Sorted topics in subforums
» Height of subforums
» How do I create subforums?
» subforums hide
» Sorted topics in subforums
» Height of subforums
» How do I create subforums?
» subforums hide
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum