The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

last topics from different subforums

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

Solved last topics from different subforums

Post by H.A.SS.A.N on 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
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 on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N on October 15th 2015, 3:06 pm

still not working ???

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 on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N on 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
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 on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: last topics from different subforums

Post by H.A.SS.A.N on October 23rd 2015, 11:29 am

@Ange Tuteur Thank u , Now the code work correctly

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 on October 23rd 2015, 12:40 pm

Topic solved and archived ~ brandon_g


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5140
Reputation : 478
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


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