Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


View Your Own Posts (egosearch) Fix

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jun 18, 2016 5:45 pm    Post subject: View Your Own Posts (egosearch) Fix This post has 1 review(s) Reply with quote

Based on this thread.

Here is a script that will fix the forum links so that you can view your own posts (egosearch) and navigate all sub-pages correctly when viewing member posts.

EDIT:
Script updated. Credit goes to mgr.inz.Player for the sub-pages fix.

You may need a plugin for your browser to be able to run user scripts (e.g. greasemonkey, tampermonkey or one of the other monkeys).

Important:
You will need to replace my handle with your own, as shown below:

Code:
// ==UserScript==
// @name        CE Link Fixer
// @namespace   CE Link Fixer
// @include     *forum.cheatengine.org/*
// @version     1
// @grant       None
// ==/UserScript==

var lianks = document.evaluate(
"//a[contains(@href, 'search_id=egosearch')]",
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for (var i = 0; i < lianks.snapshotLength; i++) {
var link = lianks.snapshotItem(i);
link.href = link.href.replace("search_id=egosearch","search_author=%2B%2BMETHOS")   //Change %2B%2BMETHOS to your username.
}

//Credit goes to mgr.inz.Player for remaining code

(function () {
  var links = document.evaluate("//a[contains(@href, 'search_id')]", document, null,
                                XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

  var author = window.location.href.match(/search_author=(\S+)[$|\/|&]?/i)[1];

  for (var i=0; i < links.snapshotLength; i++)
  {
    var thisLink = links.snapshotItem(i);
    thisLink.href = thisLink.href.replace(/search_id=\d+/, "search_author="+author);
  }

}());


Last edited by ++METHOS on Sun Jun 19, 2016 2:40 am; edited 3 times in total
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Jun 18, 2016 6:14 pm    Post subject: This post has 1 review(s) Reply with quote

All scrunched up to run in your browser's address bar.
Code:
javascript:l=document.getElementsByTagName("a");for(i=0;i<l.length;++i)if(l[i].href.includes("search_id="))l[i].href=window.location.href+l[i].href.substring(l[i].href.lastIndexOf('&'));l=nil
Code:
l=document.getElementsByTagName("a")
for(i=0i<l.length;++i)
  if(l[i].href.includes("search_id="))
    l[i].href=window.location.href+l[i].href.substring(l[i].href.lastIndexOf('&'))
l=nil
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jun 18, 2016 6:26 pm    Post subject: Reply with quote

Thanks, Zanzer.

Did you test this, by chance?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Jun 18, 2016 7:14 pm    Post subject: Reply with quote

Not really. Just ran it once and saw it changed the links. Smile
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jun 19, 2016 2:04 am    Post subject: Reply with quote

Hmm. What browser are you using? It's not working on my end (firefox 47.0).

Thanks.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Jun 19, 2016 2:21 am    Post subject: This post has 1 review(s) Reply with quote

Some time ago:
http://userscripts-mirror.org/scripts/review/292542

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jun 19, 2016 2:29 am    Post subject: Reply with quote

That works! Very Happy

Thanks, mgr.inz.Player. Combining yours with mine fixes everything:

Code:
var lianks = document.evaluate(
"//a[contains(@href, 'search_id=egosearch')]",
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for (var i = 0; i < lianks.snapshotLength; i++) {
var link = lianks.snapshotItem(i);
link.href = link.href.replace("search_id=egosearch","search_author=%2B%2BMETHOS")   //Change %2B%2BMETHOS to your username.
}

(function () {
  var links = document.evaluate("//a[contains(@href, 'search_id')]", document, null,
                                XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

  var author = window.location.href.match(/search_author=(\S+)[$|\/|&]?/i)[1];

  for (var i=0; i < links.snapshotLength; i++)
  {
    var thisLink = links.snapshotItem(i);
    thisLink.href = thisLink.href.replace(/search_id=\d+/, "search_author="+author);
  }

}());


OP updated.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Jun 19, 2016 9:40 pm    Post subject: Reply with quote

Firefox likes to delete the beginning "javascript:" line when you paste into the address bar. Security "feature".
Also, you need to set a property to let it execute JavaScript from the address bar.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jun 19, 2016 9:46 pm    Post subject: Reply with quote

I noticed that. I also tested in Chrome Browser, after thinking that one of my blockers might've been interfering with it. I had no luck with that, also. But, I'm sure it was just my own stupidity that was the problem. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites