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.

Where to Place This Code

Go down

Where to Place This Code Empty Where to Place This Code

Post by Rilee December 18th 2010, 10:22 pm

Hi There. I have been reading on this topic - Display USERNAME in Topic View - https://help.forumotion.com/script-code-problems-f43/display-username-in-topic-view-t80561.htm?highlight=bold+latest+topic+titles

I use PunBB and this code needs to be put in viewtopic_details:

<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>

Is there any other place that I can put it in my templates since I do not have viewtopic_details template for it to function properly?

Thanks and Happy Holidays!
avatar
Rilee
Forumember

Posts : 70
Reputation : 0
Language : English

Back to top Go down

Back to top

- Similar topics

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