Advertisement
NecromancerCoding

Modificación de información de último post en index_box

Jun 18th, 2024 (edited)
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.74 KB | None | 0 0
  1. $(function(){
  2. $('a.frlasttopic').each(function(){
  3. $(this).parents('.frlast').remove();
  4. });
  5. $('.frlastdata').each(function(){
  6. var string = $(this).html();
  7. var time = string.split('<br>')[0];
  8. if ($(this).find('a[href^="/u"]').length) {
  9. var userlink = $(this).find('a[href^="/u"]');
  10. } else {
  11. var userlink = $(this).find('span.color-groups');
  12. }
  13. if (userlink.length) {
  14. var userlinkHTML = userlink.prop('outerHTML');
  15. } else {
  16. var userlinkHTML = 'Invitado';
  17. }
  18. var lastLink = $(this).find('a.last-post-icon, a[href*="view=newest"]');
  19. var lastLinkHTML = lastLink.prop('outerHTML');
  20. $(this).replaceWith('<span class="frlastuser">'+userlinkHTML+'</span><span class="frlastdate">'+time+'</span><span class="frlastlink">'+lastLinkHTML+'</span>');
  21. });
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement