NATION

PASSWORD

View posts by...

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
North Mack
Ambassador
 
Posts: 1213
Founded: Apr 27, 2005
Scandinavian Liberal Paradise

View posts by...

Postby North Mack » Sat Oct 02, 2010 11:03 am

So I thought up a semi-useful idea today (I KNOW, right? Frakkan weird) about an addition to nation pages. Add a "View all posts by this user" button or link or something, near the bottom (or anywhere really).

It could be a simple link that searches the forums for a specific author, i.e. http://forum.nationstates.net/search.php?author=North+Mack for my nation, or say http://forum.nationstates.net/search.php?author=Jenrak for jenrak.

The format is easily filled in with the nations name and simply returns an information page for users with 0 posts or with no forum account (as I don't know if forum accounts are creates the moment someone signs up for NS, or the first time they visit the forums. Either way the search doesn't break)

Example (Again using FT broski Jenrak)
Last edited by North Mack on Sat Oct 02, 2010 8:48 pm, edited 2 times in total.
T H E S T E L L A R R E P U B L I C O F N O R T H M A C K
Forged in Fire, Reforged in Blood
[ DeviantArt | NS FT Discord | The Local Cluster | FT Advice and Assistance Thread | The State of the Galaxy ]

User avatar
North Mack
Ambassador
 
Posts: 1213
Founded: Apr 27, 2005
Scandinavian Liberal Paradise

Postby North Mack » Sat Oct 02, 2010 8:48 pm

Nothing? Really? :/
T H E S T E L L A R R E P U B L I C O F N O R T H M A C K
Forged in Fire, Reforged in Blood
[ DeviantArt | NS FT Discord | The Local Cluster | FT Advice and Assistance Thread | The State of the Galaxy ]

User avatar
Ballotonia
Senior Admin
 
Posts: 5494
Founded: Antiquity
Liberal Democratic Socialists

Postby Ballotonia » Sun Oct 03, 2010 12:53 pm

How does this suggestion differ from clicking on the user name to see the profile page, and then on Search user’s posts?

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
North Mack
Ambassador
 
Posts: 1213
Founded: Apr 27, 2005
Scandinavian Liberal Paradise

Postby North Mack » Sun Oct 03, 2010 1:06 pm

Because it's intended for uses like, say someone new joins your region, and you want to see what kind of player they are on the forums. Instead of having to go to the forums, doing search, and searching on the users name, (a long process) you can just hit a single button. It's not intended for searching a users posts from the forum itself, but from the game
T H E S T E L L A R R E P U B L I C O F N O R T H M A C K
Forged in Fire, Reforged in Blood
[ DeviantArt | NS FT Discord | The Local Cluster | FT Advice and Assistance Thread | The State of the Galaxy ]

User avatar
Glen-Rhodes
Powerbroker
 
Posts: 9027
Founded: Jun 25, 2008
Ex-Nation

Postby Glen-Rhodes » Sun Oct 03, 2010 2:37 pm

If you want it that bad:
Code: Select all
// ==UserScript==
// @name           Get Posts Button
// @description    Adds a 'get posts' button
// @author         Glen-Rhodes
// @include        http://www.nationstates.net/nation=*
// @version        1.0
// ==/UserScript==
function getNation() {
  var uri = window.location.pathname.toString();
  var dirty = uri.substring(8);
  var clean = dirty.replace(/_/g, '+');
  return clean;
}
function getElementByClass(searchClass,node,tag) {
  var classElements = new Array();
  if ( node == null )
    node = document;
  if ( tag == null )
    tag = '*';
  var els = node.getElementsByTagName(tag);
  var elsLen = els.length;
  var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
  for (i = 0, j = 0; i < elsLen; i++) {
    if ( pattern.test(els[i].className) ) {
      classElements[j] = els[i];
      j++;
    }
  }
  return classElements[0];
}
function insertAfter(newElement,targetElement) {
  var parent = targetElement.parentNode;
  if(parent.lastchild == targetElement) {
    parent.appendChild(newElement);
  }
  else {
    parent.insertBefore(newElement, targetElement.nextSibling);
  }
}
function gotoposts() {
  window.location.href = 'http://forum.nationstates.net/search.php?author=' + getNation();
}

var gp_insert = document.getElementsByTagName('form')[0];
var gp_button = document.createElement('button');
    gp_button.style.backgroundColor = '#474';
    gp_button.style.color = 'white';
    gp_button.style.fontSize = '11px';
    gp_button.style.marginTop = '-10px';
    gp_button.style.marginLeft = '2px';
var gp_text = document.createTextNode('Get Posts');
gp_button.appendChild(gp_text);
gp_button.addEventListener('click', gotoposts, false);
insertAfter(gp_button, gp_insert);
Last edited by Glen-Rhodes on Sun Oct 03, 2010 2:57 pm, edited 1 time in total.

User avatar
North Mack
Ambassador
 
Posts: 1213
Founded: Apr 27, 2005
Scandinavian Liberal Paradise

Postby North Mack » Sun Oct 03, 2010 2:47 pm

1) It would be much easier (and accessible) as something built into the game rather than a third party script

2) your script has multiple failings, namely it won't handle special characters like hyphens (such as your name) or names with multiple spaces, that I found in the first 5 seconds of using it. Granted this can be overcome with modifications, but just saying.

3) It would further tie the forums to the game, a goal already being worked towards by things like self hosted forums, automatic account creation, etc etc.
Last edited by North Mack on Sun Oct 03, 2010 2:47 pm, edited 1 time in total.
T H E S T E L L A R R E P U B L I C O F N O R T H M A C K
Forged in Fire, Reforged in Blood
[ DeviantArt | NS FT Discord | The Local Cluster | FT Advice and Assistance Thread | The State of the Galaxy ]

User avatar
Glen-Rhodes
Powerbroker
 
Posts: 9027
Founded: Jun 25, 2008
Ex-Nation

Postby Glen-Rhodes » Sun Oct 03, 2010 2:56 pm

North Mack wrote:1) It would be much easier (and accessible) as something built into the game rather than a third party script

It would be pretty easy for admins to add it into the game. It's also pretty easy, for those of us who know anything about the internet, to use a userscript for minor website alterations, in the mean time.

North Mack wrote:2) your script has multiple failings, namely it won't handle special characters like hyphens (such as your name) or names with multiple spaces, that I found in the first 5 seconds of using it. Granted this can be overcome with modifications, but just saying.

Hyphens should work just fine. Multiple spaces works with the modified code above.

User avatar
Reploid Productions
Director of Moderation
 
Posts: 30507
Founded: Antiquity
Democratic Socialists

Postby Reploid Productions » Sun Oct 03, 2010 4:13 pm

I like the idea, I think its mainly a matter of dragging a codemonkey over to actually implement it. :P
Forum mod since May 8, 2003 -- Game mod since May 19, 2003 -- Nation turned 20 on March 23, 2023!
Sunset's DoGA FAQ - For those using DoGA to make their NS military and such.
One Stop Rules Shop -- Reppy's Sig Workshop -- Getting Help Page
[violet] wrote:Maybe we could power our new search engine from the sexual tension between you two.
Char Aznable/Giant Meteor 2024! - Forcing humanity to move into space and progress whether we goddamn want to or not!

User avatar
North Mack
Ambassador
 
Posts: 1213
Founded: Apr 27, 2005
Scandinavian Liberal Paradise

Postby North Mack » Sun Oct 03, 2010 8:44 pm

Glen-Rhodes wrote:
North Mack wrote:1) It would be much easier (and accessible) as something built into the game rather than a third party script

It would be pretty easy for admins to add it into the game. It's also pretty easy, for those of us who know anything about the internet, to use a userscript for minor website alterations, in the mean time.


Which still necessitates this thread to bring it to the attention of the admins.

Glen-Rhodes wrote:
North Mack wrote:2) your script has multiple failings, namely it won't handle special characters like hyphens (such as your name) or names with multiple spaces, that I found in the first 5 seconds of using it. Granted this can be overcome with modifications, but just saying.

Hyphens should work just fine. Multiple spaces works with the modified code above.


Well something in your name is screwing it up, as clicking the "View Posts" from your nation pages, it attempts to search for "odes"

Reploid Productions wrote:I like the idea, I think its mainly a matter of dragging a codemonkey over to actually implement it. :P


Whoo!I consider that as a seal of admin approval. I don't think it would be terribly much effort for the codemonkeys... I can lure them with tasty tasty energy drinks for at least a half hour. :)
Last edited by North Mack on Sun Oct 03, 2010 8:45 pm, edited 1 time in total.
T H E S T E L L A R R E P U B L I C O F N O R T H M A C K
Forged in Fire, Reforged in Blood
[ DeviantArt | NS FT Discord | The Local Cluster | FT Advice and Assistance Thread | The State of the Galaxy ]

User avatar
Glen-Rhodes
Powerbroker
 
Posts: 9027
Founded: Jun 25, 2008
Ex-Nation

Postby Glen-Rhodes » Mon Oct 04, 2010 7:24 am

North Mack wrote:Well something in your name is screwing it up, as clicking the "View Posts" from your nation pages, it attempts to search for "odes"

You're probably going to my page from my forum avatar. The script I wrote only works when going to a nation page from inside the game. (The forum avatar doesn't include 'nation=' in the URL, but the game links do.) I didn't think it would be necessary to account for that, since you could just click the nation name and then 'Search user's posts'.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Mon Oct 04, 2010 7:33 pm

Not a bad idea!

User avatar
Unibot
Senator
 
Posts: 4292
Founded: May 25, 2008
Ex-Nation

Postby Unibot » Mon Oct 04, 2010 7:41 pm

I'll add it to the list.

User avatar
North Mack
Ambassador
 
Posts: 1213
Founded: Apr 27, 2005
Scandinavian Liberal Paradise

Postby North Mack » Mon Oct 04, 2010 9:39 pm

[violet] wrote:Not a bad idea!
Unibot wrote:I'll add it to the list.

Thanks :­­D *feels validated in life*
T H E S T E L L A R R E P U B L I C O F N O R T H M A C K
Forged in Fire, Reforged in Blood
[ DeviantArt | NS FT Discord | The Local Cluster | FT Advice and Assistance Thread | The State of the Galaxy ]

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Mon Dec 13, 2010 3:38 pm


User avatar
Ballotonia
Senior Admin
 
Posts: 5494
Founded: Antiquity
Liberal Democratic Socialists

Postby Ballotonia » Mon Dec 13, 2010 4:32 pm



Gravedig! Gravedig! :p

Ok, cool beans. I like the button :)

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
North Mack
Ambassador
 
Posts: 1213
Founded: Apr 27, 2005
Scandinavian Liberal Paradise

Postby North Mack » Mon Dec 13, 2010 5:02 pm

:D yay! Thanks a million [violet]!
T H E S T E L L A R R E P U B L I C O F N O R T H M A C K
Forged in Fire, Reforged in Blood
[ DeviantArt | NS FT Discord | The Local Cluster | FT Advice and Assistance Thread | The State of the Galaxy ]

User avatar
Polar Nation
Political Columnist
 
Posts: 5
Founded: Dec 12, 2010
Ex-Nation

Postby Polar Nation » Mon Dec 13, 2010 5:08 pm



It's a conspiracy to force us all to use Century. And it works pretty well. :) Very kewl!

User avatar
Wopruthien
Chargé d'Affaires
 
Posts: 468
Founded: Dec 05, 2007
Democratic Socialists

Postby Wopruthien » Mon Dec 13, 2010 6:27 pm

What happens if we don't use the Century theme? Can we still have this feature?
Former Arch Chancellor of the The Founderless Regions Alliance
General of the Alliance
Founder of Mordor

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Mon Dec 13, 2010 8:15 pm

Wopruthien wrote:What happens if we don't use the Century theme? Can we still have this feature?

If/when Century becomes default, it will also exist in most other themes, like Liberal and Conservative. The current-default-then-to-be-called-Classic theme, however, I'm not sure about, because the point of that is to change nothing. I'll get people complaining that they liked the site before that stupid View Forum Posts link and now it's ugly.

It's easy to implement, though.


Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Anti Tokage, Khantin, Mavenu, Santiago AU, The Endless Eventide, Transnistria9, Trump Almighty

Advertisement

Remove ads