Matt
Junior Member
Yep, I like making websites. Websites made: 5
Posts: 61
Matt said 0 great things
|
Post by Matt on Aug 4, 2009 1:33:07 GMT -8
Tested: FF and IE Placement: Global Header this code adds a row at the top of the page with a button in it that redirects to the rules of the fourm. <script> /*this code is copyritghted 2009 by Chook Central Main coder, Matt Wilko Do not Repost without permission*/
function NewRules(){ //************Edit below here************** MyRules=window.open("index.cgi?board=aar&action=display&thread=3&page=1#3")// copy the url of the rules page from "board=" and replace my url //************No more editing required ******************* } var user = pb_displayname var memberMessage = '<center>Hey, <a href="/index.cgi?action=viewprofile">'+user+'</a>. Check out the rules:<input type="button" VALUE="Rules" OnClick="NewRules()"></center>' var rulesBar = document.getElementsByTagName("table").insertRow(0) var rulesCell = rulesBar.insertCell(0) rulesCell.className="catbg" rulesCell.innerHTML = memberMessage </script>
Editing: follow the in code instructions preview: Click Me
|
|
Matt
Junior Member
Yep, I like making websites. Websites made: 5
Posts: 61
Matt said 0 great things
|
Post by Matt on Aug 5, 2009 1:51:05 GMT -8
Or you can use this code.
<script type="text/javascript"> <!-- /* This code is copyrighted 2009 by Chook Central Main coder, Matt Wilko Stream-Lined by SubDevo Do not Repost without permission */
var rulesURL="URL TO RULES THREAD";
var memberMessage='<center>Hey, <a href="/index.cgi?action=viewprofile">'+pb_displayname+'</a>. Check out the rules:<input type="button" value="Rules" onClick="window.open(rulesURL,\'mywin\')"></center>'; var rulesCell=document.getElementsByTagName("table")[0].insertRow(0).insertCell(0); with(rulesCell){className="catbg"; innerHTML=memberMessage;} // --> </script>
Editing: Put the URL to your rules in this area "var rulesURL="URL TO RULES THREAD";".
Edit: it has now been tested and works perfectly
|
|
Matt
Junior Member
Yep, I like making websites. Websites made: 5
Posts: 61
Matt said 0 great things
|
Post by Matt on Sept 21, 2009 21:03:57 GMT -8
Tested: FF & IE Description: Same as V1 but have changeable button IMG <script type="text/javascript"> <!-- /* This code is copyrighted 2009 by Chook Central Main coder, Matt Wilko Do not Repost without permission */
var rulesURL="YOUR URL FOR THE RULES"; var buttonIMG="http://i339.photobucket.com/albums/n460/wilko1995/rulesq.gif";
var rulesCell=document.getElementsByTagName("table")[0].insertRow(0).insertCell(0); with(rulesCell){className="catbg"; innerHTML='<center><a href="'+rulesURL+'"><img src="'+buttonIMG+'" alt="rules"></a></center>';} // --> </script> Preview: testmycodesmatt.proboards.com NOTE: on this preview it is at bottom of welcome table. to get that PM me
|
|
|
Post by DangerKart on Sept 21, 2009 22:33:08 GMT -8
Why when i click on the site link the url has an </a> at the end of it that causes an error, but when i went to modify it i didnt see it in the post?
|
|
|
Post by Wormopolis on Sept 21, 2009 23:13:41 GMT -8
There was a space in there it didnt like apparently. learn something new everyday.
|
|
|
Post by DangerKart on Sept 22, 2009 14:20:25 GMT -8
Indeed, never saw that before.
|
|
|
Post by Streamstrider on Oct 5, 2011 2:06:19 GMT -8
Just curious. Do you know if this code removes the message if the specified thread has already been viewed? Also, would it show back up if the specified thread/post was modified or had a reply? If not, and it's possible, I can create a separate thread for the request. If not possible, thank you for at least answering my questions. XD
|
|
|
Post by Wormopolis on Oct 5, 2011 23:41:45 GMT -8
does not have any provisions for checking if post has been read. it would require a cookie to store such a thing though, so that itself has disadvantages.
as for knowing if it was new or modified.... if that thread was the ONLY thread in a board, you could store the date of the last post in a cookie. if the last post date ever changed it would see it.. but I dont think the date of the last post changes on a modify. the main page only shows the original post date.
|
|
|
Post by Streamstrider on Oct 6, 2011 0:40:11 GMT -8
Thanks for that, Wormo! I might have something else, but my brain's a bit of mush right now. XD
|
|