The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

last topics from different subforums

+2
Ange Tuteur
H.A.SS.A.N
6 posters

Page 1 of 2 1, 2  Next

Go down

Solved last topics from different subforums

Post by H.A.SS.A.N 30/9/2015, 08:59

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


Last edited by H.A.SS.A.N on 23/10/2015, 04:31; edited 1 time in total
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 30/9/2015, 12:05

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
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 1/10/2015, 09:39

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
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 1/10/2015, 09:55

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 :
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.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 1/10/2015, 12:08

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
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by darki 2/10/2015, 07:47

H.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
@Ange Tuteur
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).
avatar
darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 3/10/2015, 04:35

bump
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 3/10/2015, 12:09

please ???
no answer ??
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by SLGray 3/10/2015, 12:39

H.A.SS.A.N wrote:bump

H.A.SS.A.N wrote:please ???
no answer ??
Please don't double post. Your post needs to be separated by at least 24 hours before bumping. Please use the edit button instead!


last topics from different subforums Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51554
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 3/10/2015, 12:52

@H.A.SS.A.N, before I start, which version forum are you using ? phpbb2, phpbb3, punbb, or invision ?
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 4/10/2015, 07:33

@SLGray
I' so sorry ^_^
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 4/10/2015, 07:37

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
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 6/10/2015, 07:33

pumb
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 9/10/2015, 10:36

pumb
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by darki 10/10/2015, 03:50

Ange Tuteur wrote:@H.A.SS.A.N, before I start, which version forum are you using ? phpbb2, phpbb3, punbb, or invision ?
@Ange Tuteur I'm interested in this aswell and I'm using phpbb3.
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. Smile
avatar
darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: last topics from different subforums

Post by alla13 10/10/2015, 04:31

 I'm interested in this 
i hope you make it for phpp2
alla13
alla13
Forumember

Posts : 91
Reputation : 6
Language : Arab5/5 Eng3/5 Fr2/5

http://alla-omar.mo-rpg.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 11/10/2015, 10:27

pumb
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 12/10/2015, 06:40

Hi,

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 {

}
( that is for the container of each topic )

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. Wink
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 12/10/2015, 07:59

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
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 12/10/2015, 08:07

You can paste this as much as you want :
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. Wink
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 12/10/2015, 08:30

Ok , I will add the code and then I tell u with results
++ whats the maximum number of topics can I get it ???
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 12/10/2015, 08:38

However much you allow perpage on your forum. Wink

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. Neutral
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 12/10/2015, 08:46

ok , hhhhhhhhhh Thank u
Realy u are hero ^_^
but is this code only for phpbb3 or also phpbb2 ??
I noticed there is version=prosilver ??
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 12/10/2015, 08:50

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.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 12/10/2015, 09:17

if I modified the default tamplate will not work correctly???
not work with me ?
I think because I modified the tampates
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 14/10/2015, 07:43

pumb
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 14/10/2015, 07:44

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
What's the URL of the forum you're having problems on ?
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 14/10/2015, 09:24

H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Solved Re: last topics from different subforums

Post by Ange Tuteur 14/10/2015, 11:57

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);
    });
  }
};
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N 14/10/2015, 23:55

can edit the code for these topic http://www.a7la-anime.com/f196-montada
because I need it for blog topic
and Thank U
H.A.SS.A.N
H.A.SS.A.N
Forumember

Posts : 77
Reputation : 1
Language : Arabic

http://www.deve-net.com

Back to top Go down

Page 1 of 2 1, 2  Next

Back to top

- Similar topics

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