Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

D

[email protected]

@[email protected]
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

View Original

Posts

Recent Best Controversial

  • Caches used in NodeBB
    D [email protected]

    @baris

    1. I want to cache content for 10 minutes, so I set it like this, right?
    await cache.set(cacheKey, content, 600);
    
    

    However, this method doesn’t work

    1. But the following method works, though I’m not sure how long the cache lasts:
    await cache.set(cacheKey, content);
    

    How does the default cache duration work, and why doesn’t the first method work?

    Fediverse cache

  • How can I modify the DBsearch results page?
    D [email protected]

    @baris i finished for remove shortcode, but I don't see thumb when i debug data value

    filterSearchContentGetResult: async function (data) {
    		const posts = data.result.posts;
    		
    
    		for (let post of posts) {
    			post.content = post.content.replace(/^\[embed-iframe\].*$/gm, '');
    		}
    
    		return data;
    	},
    

    This is data value:

    {
        pid: 41238,
        tid: 41238,
        content: '<p dir="auto">content <br />\n' +
          '[embed-iframe] [{"name": "Video 1", "link": "https://www.youtube.com/embed/1cr_uPGOCeE?si=dc0ygHELF9Opgf9X"}]</p>\n',
        uid: 1,
        timestamp: 1735617649489,
        deleted: false,
        upvotes: 0,
        downvotes: 0,
        replies: 0,
        handle: undefined,
        votes: 0,
        timestampISO: '2024-12-31T04:00:49.489Z',
        user: {
          uid: 1,
          username: 'user',
          userslug: 'user',
          picture: null,
          status: 'online',
          uploadedpicture: undefined,
          lastonline: undefined,
          fullname: undefined,
          displayname: 'user',
          'icon:bgColor': '#673ab7',
          'icon:text': 'A',
          lastonlineISO: undefined
        },
        topic: {
          uid: 1,
          tid: 41238,
          title: 'embed logs',
          cid: 2,
          tags: [Array],
          slug: '41238/embed-logs',
          deleted: 0,
          scheduled: false,
          postcount: 1,
          mainPid: 41238,
          teaserPid: null,
          timestamp: 1735617649441,
          titleRaw: 'embed logs',
          timestampISO: '2024-12-31T04:00:49.441Z'
        },
        category: {
          cid: 2,
          name: 'General Discussion 5',
          icon: 'fa-comments-o',
          slug: '2/general-discussion-5',
          parentCid: 0,
          bgColor: '#59b3d0',
          color: '#ffffff',
          backgroundImage: '',
          imageClass: 'cover'
        },
        isMainPost: true
      },
    
    Tech

  • How can I modify the DBsearch results page?
    D [email protected]

    Anyone have idea for this case?

    Tech

  • How can I modify the DBsearch results page?
    D [email protected]

    Hi,

    I'm going to change something on dbsearch results page:

    1. How can I add topic's thumb in there?
      525c4fe4-343a-467b-80cb-bdbe81b4837f-image.png

    2. How can I remove this shortcode?

    [embed-iframe] [{"name": "Video 1", "link": "https://www.youtube.com/embed/1cr_uPGOCeE?si=dc0ygHELF9Opgf9X"}]
    
    Tech
  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups