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.
The forum of the forums
+2
Ange Tuteur
Van-Helsing
6 posters

    How can I make these HashTags Widgets?

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved How can I make these HashTags Widgets?

    Post by Van-Helsing March 31st 2015, 6:55 am

    Hello,
    How can I make these two hashtags widgets?

    Recent HashTags Widget:
    How can I make these HashTags Widgets? 9T5o39E

    Popular HashTags Widget:
    How can I make these HashTags Widgets? Wu5jO63
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: How can I make these HashTags Widgets?

    Post by Ange Tuteur March 31st 2015, 10:55 am

    LG is using an external server to store this data in an external database. You'd need a knowledge of PHP, MySQL, and JavaScript to achieve said effect. You could use the topic method of storing data as well.
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing March 31st 2015, 11:39 am

    Hello @Ange Tuteur,
    There are to methods to develop this, the one is with an external server which I can found easily a little server to host some scripts and a little MySql database, and other method which we tried at the past is pseudo-database which the hashtags will grabbing into a topic which it will use as database.

    I dont know how to grab the hashtags from the topic in second method and write them into pseudo-database. The first method has a lot of work in programming languages. I think the second method is more simple than the first.

    Now I think another method:
    a javascript field which it will displaying while posting something similar with "Reason for Editing" with the name "HashTags" and the user fill it before press the button "Send". Then the javascript writes the hashtags into pseudo-database.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: How can I make these HashTags Widgets?

    Post by Ange Tuteur March 31st 2015, 12:02 pm

    Identifying hashtags is rather trivial. There's two things to note :

    1. Hashtags and Mentions are the only links in posts to have a title, IF HTML is disabled.
    2. Hashtags always begin with a hash or pound

    So, this is a simple example of iterating all anchors on the page to find those which are a hashtag. It's spaced out for readability.
    Code:
    // start with a jQuery document ready event to execute code when the document is loaded
    $(function() {
     
      var a = document.getElementsByTagName('A'), // get all links in the document
          i = 0, // link index ; 0 is the first link, 1 is the second, and so on..
          j = a.length; // define link length so it doesn't need to be looked up after each iteration
     
     
      for (;
            i<j; // continues iteration until all links have been looped
            i++ // increments our index after each loop
          )
       
          {
       
            if (
                a[i].title // only hashtags and mentions have titles if HTML is disabled
                && // and
                /^#/.test(a[i].innerHTML) // hastags always begin with a pound or "hash"
                // if these two conditions are true, we can execute code specifically for them
              )
         
              {
         
                a[i].className += ' fa-hashtag'; // add classname .fa-hashtag
           
              }
       
          }
     
    });


    What can be done to store the hashtags is pretty simple as well. We make a query to the database after the iteration is complete with all hashtags that were found and the post ID which they were contained in. Basically there will be two columns for the database :

    1. Hashtag
    - The name of the hashtag

    2. Post ID array
    - A list of post id's where this hashtag occurred.

    A user may tag it more than once in a post, so we could add some brackets to the end of the post ID to hold the number of times it was tagged. e.g. t1p72[3]

    broken down :
    t1 // topic id
    p72 // post id
    [3] // number of times tagged in that post

    It sounds simple, but there is a lot more to this to make sure it succeeds. Furthermore, you have a character limit of 65,000, so this can hinder the amount of data you store via a post. At the moment, I've not had time to dedicate to developing something like this, but I've thought about it.
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing March 31st 2015, 12:29 pm

    To prevent the limit of 65,000 characters of post we can keep a specific number of the latest hashtags in the pseudo-database etc. 1000-5000 hashtags or any custom number of hashtags as records in pseudo-database by overwriting the oldest records.
    JScript
    JScript
    Forumember


    Male Posts : 741
    Reputation : 175
    Language : PT-BR, EN
    Location : Brazil

    Solved Re: How can I make these HashTags Widgets?

    Post by JScript March 31st 2015, 1:15 pm

    Ange Tuteur wrote:(...) you have a character limit of 65,000 (...)
    In practice the character limit is only 15,000!
    I have confirmed in my tests...

    JS
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing March 31st 2015, 4:02 pm

    JScript wrote:
    Ange Tuteur wrote:(...) you have a character limit of 65,000 (...)
    In practice the character limit is only 15,000!
    I have confirmed in my tests...

    JS
    How can happening this?
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 1st 2015, 4:05 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 2nd 2015, 5:36 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 3rd 2015, 6:10 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 4th 2015, 6:53 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 6th 2015, 9:14 am

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 7th 2015, 7:50 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 8th 2015, 8:59 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 10th 2015, 4:21 am

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 12th 2015, 10:54 am

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 13th 2015, 3:36 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 14th 2015, 7:11 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 15th 2015, 7:46 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 17th 2015, 8:15 am

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 18th 2015, 4:52 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 19th 2015, 6:32 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 22nd 2015, 9:22 pm

    bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 24th 2015, 9:24 am

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 25th 2015, 1:10 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 26th 2015, 7:30 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 29th 2015, 4:42 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing April 30th 2015, 4:47 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing May 1st 2015, 5:19 pm

    Bump
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make these HashTags Widgets?

    Post by Van-Helsing May 2nd 2015, 5:43 pm

    Bump

      Current date/time is November 11th 2024, 1:50 pm