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 2 of 2 Previous  1, 2

Go down

Solved last topics from different subforums

Post by H.A.SS.A.N September 30th 2015, 3:59 pm

First topic message reminder :

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 October 23rd 2015, 11:31 am; 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 October 15th 2015, 11:54 am

Try changing it 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), tr:has(.a7lashare)', 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 October 15th 2015, 3:06 pm

still not working ???
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 October 15th 2015, 6:29 pm

What is it giving you ? It should return the necessary data unless it returned something you didn't want ?
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 October 15th 2015, 7:59 pm

on thing appear , I show wigdet on http://www.a7la-anime.com/forum is the last one
and I add this code

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), tr:has(.a7lashare)', 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);
    });
  }
};
in javascript

and this code

Code:

<div id="topicbox-1" class="last-ajax-posts">
                  
</div>
  <script type="text/javascript">
_getNewest({
  forum : 196,
  amount : 3,
  node : 'topicbox-1'
});
</script>                                                                 
in the wigdet
???
what's the problem ??
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 October 15th 2015, 10:05 pm

Hmm.. I think it might be due to the version change. In the script, remove ?change_version=prosilver. I'm fairly certain that's the cause. Plus it's not relevant anymore since your templates are modified. 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 October 23rd 2015, 11:29 am

@Ange Tuteur Thank u , Now the code work correctly
last topics from different subforums - Page 2 1f60d  last topics from different subforums - Page 2 1f60d  last topics from different subforums - Page 2 1f60d  last topics from different subforums - Page 2 1f60d
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 brandon_g October 23rd 2015, 12:40 pm

Topic solved and archived ~ brandon_g


last topics from different subforums - Page 2 Brando10
Remember to mark your topic last topics from different subforums - Page 2 Solved15 when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

last topics from different subforums - Page 2 Scre1476
Team Leader
Review Section Rules | Request A Review | Sticker Points
brandon_g
brandon_g
Manager
Manager

Male Posts : 10113
Reputation : 923
Language : English
Location : USA

https://www.broadcastingduo.com

Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top

- Similar topics

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