The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Display USERNAME in Topic View

View previous topic View next topic Go down

Solved Display USERNAME in Topic View

Post by me on October 30th 2010, 8:35 pm

I'm attempting to write a script to display the viewing user name next to or below the author info in the topic view.

Where should I put the script so that it is loaded on the topic view pages? Putting it in the homepage message section does not appear to load the script when a topic is being viewed.

The reason I would like to do this is that someone who has been banned has been copying material from our board without permission and I'd like to find out what user name(s) he is now using.

The forum is currently configured to use invision.

TIA

me
New Member

Posts : 8
Reputation : 0
Language : English

Back to top Go down

Solved Re: Display USERNAME in Topic View

Post by LilJur on October 31st 2010, 1:06 am

I think you wont be able to use the script in invision.
Well... to be honest, i'm not quiet sure if you will be able to use it at all...

Anyway, i don't really get your statement.
What are you actually trying to do? display the viewing username next to or below the author info in the topic view?
Can you explain it a bit better?

Oh and, if you would like to know his other usernames, it can be done easly.
Just go and see for the first username, in a post of him and track his IP
Then IP ban him from the forum.
This way he won't be able to acces it at all, no matter which login details he uses

LilJur
Forumember

Male Posts : 212
Reputation : 8
Language : xml, css, html, hex, english and dutch

Back to top Go down

Solved Re: Display USERNAME in Topic View

Post by me on October 31st 2010, 1:24 am

Lil-J wrote:I think you wont be able to use the script in invision.
Well... to be honest, i'm not quiet sure if you will be able to use it at all...
I'm still working to see where and what scripts can be used in invision.
Anyway, i don't really get your statement.
What are you actually trying to do? display the viewing username next to or below the author info in the topic view?
Can you explain it a bit better?
When a member is viewing a topic (eg. a thread) I want their username displayed somewhere in the header for each post so that when they copy and paste one or more posts their user name shows up in the copy.

Yes, I know that he could then paste it into an editor, edit his name out, then re-paste it; but, the more complicated I make it for him the more likely he'll just go away.

Oh and, if you would like to know his other usernames, it can be done easly.
Just go and see for the first username, in a post of him and track his IP
Then IP ban him from the forum.
This way he won't be able to acces it at all, no matter which login details he uses
IP banning won't work because he uses AOL dial-up, as do several legit users. Their IP addresses can and often do change each time they connect.

me
New Member

Posts : 8
Reputation : 0
Language : English

Back to top Go down

Solved Re: Display USERNAME in Topic View

Post by APE on October 31st 2010, 2:30 am

ban the Email address and ip and if it comes to it ban the ISP aswell then he will get he is banned the only other way he can get in then is to make a new Email address each time ... so if you do that he will get the hint sooner or later and go away ... EmaIl ban is the only way to ban if they have a rolling ip address.... or ban the isp but then you do that then all users with AOL will be abanned for a set time so that is some thing you may want to look at later in time ...

Ape





APE
Manager
Manager

Male Posts : 8309
Reputation : 716
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Display USERNAME in Topic View

Post by me on October 31st 2010, 1:43 pm

ape man wrote:ban the Email address and ip and if it comes to it ban the ISP aswell then he will get he is banned the only other way he can get in then is to make a new Email address each time ... so if you do that he will get the hint sooner or later and go away ... EmaIl ban is the only way to ban if they have a rolling ip address.... or ban the isp but then you do that then all users with AOL will be abanned for a set time so that is some thing you may want to look at later in time ...

Ape
I understand the whole ban thing. IP banning will not work without hurting too many good members. Free email addresses are easy to get so that doesn't stop him for long. I've been banning his email address each time, including using wild-cards to catch similar ones, but he's apparently using a very different email address this time. This has been going on for 2 months and I'm looking for more tools to use.

Back to topic, does anyone have a any script or config ideas to do what I want to do? I've been trying to get some simple test scripts to run on the main page and no dice so far. Any suggestions for a sample script that people KNOW run on invision?

me
New Member

Posts : 8
Reputation : 0
Language : English

Back to top Go down

Solved Re: Display USERNAME in Topic View

Post by me on November 3rd 2010, 9:00 pm

I finally figured out how to do this.

First, I switched the forum to a style that supports templates, phpbb2.

Next I added the viewing username and date to the site description. This had to go in the site description because "USERNAME" and "NOW" don't work in templates.
Code:
<whoiam>{+USERNAME+}</whoiam><wheniam>{+NOW+}</wheniam>
(remove the "+"s) Site descriptions do have a character limit so you may need to shorten you description text to add this.

I then used a CSS Style sheet (under Colors) to hid it
Code:
whoiam, wheniam {
    display:  none
}
Next I added "span" element of class "viewerdetails" to the General -> viewtopic_body template where I wanted the username and date to appear. I put it after the post date as show below.
Code:
<td><span class="postdetails"><img src="{postrow.displayed.MINI_POST_IMG}" alt="{postrow.displayed.L_MINI_POST_ALT}" title="{postrow.displayed.L_MINI_POST_ALT}" border="0" />{L_POST_SUBJECT}: {postrow.displayed.POST_SUBJECT}   <img src="{postrow.displayed.MINI_TIME_IMG}" alt="" border="0" />{postrow.displayed.POST_DATE}<span class="viewerdetails"> </span></span></td>
Then I added a script to the end of the viewtopic_details template to retrieve the username and date and insert it into the viewerdetails element for each post. This script has to go at the bottom of the template so the target elements are all created first.
Code:
<script type="text/javascript">
//<![CDATA[
var viewers=document.getElementsByTagName("whoiam");
var viewersT=document.getElementsByTagName("wheniam");
var viewer=viewers[0].childNodes[0];
var viewerT=viewersT[0].childNodes[0];
var vName=viewer.nodeValue;
var vTime=viewerT.nodeValue;


var spanElements=document.getElementsByTagName("span");
for (i=0;i<spanElements.length;i++)
{
   if (spanElements[i].className.match("viewerdetails"))
   {
      var viewerText=document.createTextNode(" "+vName+" "+vTime+" ");
      spanElements[i].appendChild(viewerText);
   }
}
//]]></script>
Not sure it's the cleanest code, but it works.

Finally, I used another CSS stylesheet to color the username and time the same color as the background and make it 2pt font.
Code:
.viewerdetails {
    font-size: 2px;
    color: #FCEACA;
}
Now if someone copies a post and includes the post subject and time, which will be included if they include the poster's name their own name and current date will be included. When copying it looks like a very small, easy to miss, dash after the post date, but when pasted the CSS style sheets do not come along so it shows up full sized. Even when pasted it sorta runs together with the post subject and date and could easily be missed.

Hope this is a help to someone else.

me
New Member

Posts : 8
Reputation : 0
Language : English

Back to top Go down

Solved Re: Display USERNAME in Topic View

Post by Sanket on November 4th 2010, 5:16 am

Since this thread is marked solved, I will lock this thread.


Sanket Smile


Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum