Good art is a taste, good design is an opinion.


Come as guest, stay as family.
Board Index

Come as guest, stay as family.


You are not connected. Please login or register

Foto

[Javascript] "Load more topics" query



View previous topic View next topic Go down Message [Page 1 of 1]

1
Offline

  Shadow

avatar
Administrator
Administrator


Tutorial: "Load more topics" query

With this tutorial you can quickly load another page of posts without page refresh or clicking on the page number.

Provided by @Daemon


--> Tutorials, tips and tricks <--
"Load more topics" query



- Javascript
Placement: In Subforums
Code:
[panda=js]   jQuery(function() {
    if(jQuery('a[onmousedown^="createPagination"]').length != -1) {
      jQuery('head').append(
      '<style type="text/css">' +
      '  #more_topics_bestSK {' +
      '    text-align: center;' +
      '    font-weight: bold;' +
      '  }' +
      '  #more_topics_bestSK a {' +
      '    display: block;' +
      '    padding: 10px 0;' +
      '  }' +
      '  #content_loaded {' +
      '    border-top: 2px solid #ddd;' +
      '  }' +
      '</style>'
      );
      jQuery('.statused:last').parent().after(
      '           <div id="more_topics_bestSK">' +
      '            <a href="#" id="load_more">Load more topics</a>' +
      '           </div>'
      );
      jQuery('.paging:first > b').next().addClass('load');
      jQuery('#load_more').click(function() {
       jQuery.get(jQuery('.load').attr('href'), function(d) {
         var _loaded = jQuery('.statused:last', d).html();
         if(_loaded && jQuery('.load').length) {
            jQuery('<tbody id="content_loaded" class="statused">' + _loaded + '</tbody>').insertAfter('.statused:last');
            jQuery('.load').removeClass('load').next('a:not(:has(img))').addClass('load');
         } else {
            alert("No more topics to be loaded");
         }
       });return false;
      });
    }
    });


- Preview





© PunBB Design


If you have any questions related to this topic create a topic with the following title:
"Load more topics" query

Powered by PunBB
Currently 0 users have thanked Shadow for this post:

2
Offline

  Destroya*

avatar
Punbb Senior
Punbb Senior
Didn't work for me..

Powered by PunBB
Currently 0 users have thanked Destroya* for this post:

3
Offline

  Shadow

avatar
Administrator
Administrator
@Destroya* wrote:[link="/t841-javascript-load-more-topics-query#5610"]Didn't work for me..
Since your forum is not Punbb, you have to replace on all places [ic].paging[/ic] to [ic].pagination[/ic] in the code.

Powered by PunBB
Currently 0 users have thanked Shadow for this post:

4
Offline

  Destroya*

avatar
Punbb Senior
Punbb Senior
@Rapid wrote:[link="/t841-javascript-load-more-topics-query#5612"]
@Destroya* wrote:[link="/t841-javascript-load-more-topics-query#5610"]Didn't work for me..
Since your forum is not Punbb, you have to replace on all places [ic].paging[/ic] to [ic].pagination[/ic] in the code.
Changed it the one time it happens, still doesn't work for Forumotion.

Powered by PunBB
Currently 0 users have thanked Destroya* for this post:

5
Offline

  Daemon


Punbb Rookie
Punbb Rookie
@Destroya* wrote:[link="/t841-javascript-load-more-topics-query#5621"]
@Rapid wrote:[link="/t841-javascript-load-more-topics-query#5612"]
@Destroya* wrote:[link="/t841-javascript-load-more-topics-query#5610"]Didn't work for me..
Since your forum is not Punbb, you have to replace on all places [ic].paging[/ic] to [ic].pagination[/ic] in the code.
Changed it the one time it happens, still doesn't work for Forumotion.
For now I just did a version for punBB .
Your forum is phpBB3.

Powered by PunBB
Currently 0 users have thanked Daemon for this post:

6
Offline

  Van-Helsing

avatar
★Moderator★
★Moderator★
Hello Daemon,
Nice Tutorial.

Best Regards,
Dark-Avenger

Powered by PunBB
Currently 0 users have thanked Van-Helsing for this post:

7
Offline

  Virus

avatar
★Moderator★
★Moderator★
Great tutorial. Good Job @Deamon.

Powered by PunBB
Currently 0 users have thanked Virus for this post:

8
Offline

  Destroya*

avatar
Punbb Senior
Punbb Senior
@Daemon wrote:[link="/t841-javascript-load-more-topics-query#5629"]
@Destroya* wrote:[link="/t841-javascript-load-more-topics-query#5621"]
@Rapid wrote:[link="/t841-javascript-load-more-topics-query#5612"]
@Destroya* wrote:[link="/t841-javascript-load-more-topics-query#5610"]Didn't work for me..
Since your forum is not Punbb, you have to replace on all places [ic].paging[/ic] to [ic].pagination[/ic] in the code.
Changed it the one time it happens, still doesn't work for Forumotion.
For now I just did a version for punBB .
Your forum is phpBB3.
I understand, thank you and let me know if you make one sometime Very Happy

Powered by PunBB
Currently 0 users have thanked Destroya* for this post:

9
Offline

  Delsin

avatar
Punbb Rookie
Punbb Rookie
Thanks

Powered by PunBB
Currently 0 users have thanked Delsin for this post:

10
Offline

  Srz

avatar
Punbb Rookie
Punbb Rookie
No me funciono... y Mi version es PunBB
Don't workme and my version is PunBB

Powered by PunBB
Currently 0 users have thanked Srz for this post:

11
Offline

  RoyalLand

avatar
Punbb Rookie
Punbb Rookie
its working punbb Smile

Powered by PunBB
Currently 0 users have thanked RoyalLand for this post:

12
Offline

  Lyam Stiles

avatar
Newbie
Newbie
Awesome! Thanks.

Powered by PunBB
Currently 0 users have thanked Lyam Stiles for this post:

View previous topic View next topic Back to top Message [Page 1 of 1]


Topic URL's

URL
BBcode
HTML" />

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