Sponsored Content
Top Forums Web Development Update to Member List - New Click Options Post 303025986 by Neo on Friday 16th of November 2018 07:04:05 AM
Old 11-16-2018
Update:

I added this jQuery to the memberlist HTML page:

Code:
$(function() {
  $("a#memberlisttitle").click(function() {
    var n = localStorage.getItem("mlstate");
    if (n === null) {
      n = 0;
    }
    n++;
    if (n > 2) n = 0;
    localStorage.setItem("mlstate", n);
    if (n == 0)
      $("a#memberlisttitle").attr({
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30"
      });
    else if (n == 1)
      $("a#memberlisttitle").attr({
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30&showall=1"
      });
    else if (n == 2)
      $("a#memberlisttitle").attr({
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30&showall=2"
      });
  });
});

Originally tried doing this in view, but because the page reloads, it was easier to do in jQuery. If I changed the memberlist to load using AJAX and not reloading the page (maybe something to do in future), then Vue.js would have been the better choice.

Basically, you can click on the text in the top left corner of the list and cycle through 3 different views and if you have a view you particularly like, the value is stored in your browser localStorage so you will always have that view until you change it, even it you log out, close your browser, and log back in.

Image

This started out as a Vue.js project, but I ended up doing it in jQuery and not Vue, LOL
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Left click select,right click copy

Hi all, when i ssh into my linux machine, i can do a double left click and then right click to paste it anywhere i need. However, on the actual machine, in the terminal, i cannot do a double left click and right click to paste it. i need to right click and select Copy followed by click click... (1 Reply)
Discussion started by: new2ss
1 Replies

2. Shell Programming and Scripting

grep option to print the first match of each member of a list?

Hello, How to grep only the first match of each (unique) member of a list from the file? Say member.list contains: member1 member2 member3and table.tab which is sorted by the first 2nd and then 3rd column. member1 1.2 234 member1 1.1 234 member2 3.3 111 member2 2.3 222 member2 2.3 111... (5 Replies)
Discussion started by: yifangt
5 Replies

3. UNIX for Dummies Questions & Answers

List of 'if -f' options - AIX / Korn Shell

Hi all, Can someone point me in the right direction for a manual on the various statement options for 'if'. Basically I have a piece of code which says: if ] and I wondered what the -f was. I know the '!' means not equal.. As usual any help much appreciated.. (5 Replies)
Discussion started by: Grueben
5 Replies

4. What is on Your Mind?

Update to Navbar - Member Info and Avatars

Hey, I moved the user information in the top right on the navbar to side panel and replace it with a clickable avatar image. If you have an avatar, you will see your avatar and if you don't you will see some default one (will change it to something better later). If you have any notification... (53 Replies)
Discussion started by: Neo
53 Replies

5. What is on Your Mind?

Update to Posts - Member Info Icon and Badge

Hey, Upgrade (step 1) the posts, by putting a "user info" icon in the top right and making it so it toggles the user info. The user info icon has a badge which shows the number of posts. I will have to dig around in the code more to get the total posts thanks and other badges working; but... (22 Replies)
Discussion started by: Neo
22 Replies
wstring(3C)						   Standard C Library Functions 					       wstring(3C)

NAME
wstring, wscasecmp, wsncasecmp, wsdup, wscol - Process Code string operations SYNOPSIS
#include <widec.h> int wscasecmp(const wchar_t *s1, const wchar_t *s2); int wsncasecmp(const wchar_t *s1, const wchar_t *s2, int n); wchar_t *wsdup(const wchar_t *s); int wscol(const wchar_t *s); DESCRIPTION
These functions operate on Process Code strings terminated by wchar_t null characters. During appending or copying, these routines do not check for an overflow condition of the receiving string. In the following, s, s1, and s2 point to Process Code strings terminated by a wchar_t null. wscasecmp(), wsncasecmp() The wscasecmp() function compares its arguments, ignoring case, and returns an integer greater than, equal to, or less than 0, depending upon whether s1 is lexicographically greater than, equal to, or less than s2. It makes the same comparison but compares at most n Process Code characters. The four Extended Unix Code (EUC) codesets are ordered from lowest to highest as 0, 2, 3, 1 when characters from different codesets are compared. wsdup() The wsdup() function returns a pointer to a new Process Code string, which is a duplicate of the string pointed to by s. The space for the new string is obtained using malloc(3C). If the new string cannot be created, a null pointer is returned. wscol() The wscol() function returns the screen display width (in columns) of the Process Code string s. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------------------------------------+ |ATTRIBUTE TYPE ATTRIBUTE VALUE | |MT-Level MT-Safe | +-----------------------------------------------------------+ SEE ALSO
malloc(3C), string(3C), wcstring(3C), attributes(5) SunOS 5.11 29 Dec 1996 wstring(3C)
All times are GMT -4. The time now is 02:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy