/    Sign up×
Community /Pin to ProfileBookmark

Looking for help with scripting project

first of all HI WEB DEVELOPER!

im trying to code a script for a forum i use very regularly to help me and other members out.

the problem is the forums get very big and when we need to change topic we have to scroll all the way up to the top just to click the button, especially at night time this can be a huge problem on the eyes.

i have a script atm, that works however some improvements need to be made in order to make this script better.

now i dont know if its easier to try to explain here or on msn or something, im sure the coding isnt very advanced its just a complete java noob like me doesnt understand what hes doing to put it bluntly.

ive read a few tutorials and stuff but putting the pieces together is a utter nightmare!

thanks in advance for anyone that is willing to help me.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@rnd_meDec 16.2008 — it's easier to advise you if we can see the script you refer to...

post some code.
Copy linkTweet thisAlerts:
@penfold1992authorDec 16.2008 — ok theres 2 scripts i kind of need to merge.

there are 2 themes for the website. one is white one is black. now i prefer to use both of them at different times of the day to help my eyes.

when its white, i need it white and black i need the nav bar black (no duh)

the first of the scripts is a standard white color and you have to add the links manually in the script when the website gets updated

the other script is pretty much perfect, it changes with theme and it looks like uses the current navbar so when the admin changes the links i think the bar would change automatically. The problem with this one is it overlaps the users and posts and doesnt use the "margin" that was left there when there are no plugins

Script 1:

[spoiler][CODE]// ==UserScript==

// @name Silkroad Forum Script BB3 - Side
// @namespace Silkroad Forum Script BB3 - Side
// @description A Little Script To Make Browsing SRF On PHPBB3 That Little Bit Easier by StealMySoda
// @include http://www.silkroadforums.com/*



// position:fixed means stay fixed even the page scrolls. z-index keeps your iframe on top.
// The remainder of the line smacks the panel into the bottom left corner, out of your way.
// Overflow (in combination with the setTimeout) ensures the iframe fits your entire panel.
var css = 'position:fixed; z-index:9999; border:1px solid gray; ' +
'bottom: 0 !important; left:5px; width:135px; height:335px; overflow:hidden;';

var iframe = document.createElement('iframe');
iframe.setAttribute('style', css);

// The about:blank page becomes a blank(!) canvas to modify
iframe.src = 'about:blank';

document.body.appendChild(iframe);

// Make sure Firefox initializes the DOM before we try to use it.
iframe.addEventListener("load", function() {
var doc = iframe.contentDocument;
doc.body.innerHTML = '<style type="text/css">' +
'a.slide:link { text-decoration: none; color : black; font-size:9px; font-family: verdana;}' +
'a.slide:visited { text-decoration: none; color : black; font-size:9px; font-family: verdana;}' +
'a.slide:hover { text-decoration: underline; color : blue; font-size:9px; font-family: verdana;}' +
'body { background-image:url(http://www.silkroadforums.com/images/navbackground.jpg); background-repeat:repeat;}</style><div style="' +
'line-height: 10pt;">' +
'<img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com">Forum Home</a><img src="http://www.silkroadforums.com/images/navspacer.gif" width="115px" height="18px"><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=1">Announcements</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=3">Technical Help</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=9">Site Discussion</a><br><img src="http://www.silkroadforums.com/images/navspacer.gif" width="115px" height="18px"><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=2">General Discussion</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=72">Exposed Botters</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=4">Characters Skills</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=5">Guides Tutorials</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=29">Questions Answers</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=7">The Marketplace</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=45">Other SRO Versions</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=66">Guilds &amp; Clans</a><br><img src="http://www.silkroadforums.com/images/navspacer.gif" width="115px" height="18px"><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=12">Off Topic Lounge</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=76">Other Games</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=11">Artists Corner</a><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.silkroadforums.com/viewforum.php?f=56">Sig Requests</a><br><img src="http://www.silkroadforums.com/images/navspacer.gif" width="115px" height="18px"><br><img src="http://www.silkroadforums.com/images/arrow1.gif"> <a class="slide" target="_parent" href="http://www.socialexiles.com/">Social Exiles</a><br></div>' ;
}, false);
// ==/UserScript==[/CODE]
[/spoiler]
Copy linkTweet thisAlerts:
@penfold1992authorDec 16.2008 — the second script, sorry for double post

[CODE]// ==UserScript==
// @name Silkroad Forums Skinny Fixed Nav Bar
// @namespace http://userscripts.org/users/23652
// @description Puts the nav bar in the bottom left and shrinks it
// @include http://www.silkroadforums.com/viewtopic.php*
// @copyright JoeSimmons
// ==/UserScript==

// OPTIONS ///////////////////////////
var skin_white = true; // True=White; False=Black
//////////////////////////////////////

// Delete id/node
function del(N) {
var n = (typeof N=="string") ? document.getElementById(n) : N;
if(typeof n!='undefined') n.parentNode.removeChild(n);
}

var i,
title1 = document.evaluate("//b[contains(text(), 'Silkroad Online')]", document, null, 9, null).singleNodeValue,
title2 = document.evaluate("//b[contains(text(), 'Silkroad Forums')]", document, null, 9, null).singleNodeValue,
title3 = document.evaluate("//b[contains(text(), 'Affiliates')]", document, null, 9, null).singleNodeValue,
navspacers = document.evaluate("//img[contains(@src, 'navspacer.gif')]", document, null, 6, null),
endspacer = document.evaluate("//a[@href='http://www.affordableit.com']", document, null, 9, null).singleNodeValue.parentNode.parentNode;

del(title1.parentNode.parentNode);
del(title2.parentNode.parentNode);
del(title3.parentNode.parentNode);
del(endspacer);
for(i=navspacers.snapshotLength-1; i>=0; i--) del(navspacers.snapshotItem(i));

if(skin_white) {
var css = 'table .navtable {position:fixed;bottom:0;left:0;width:auto;border-width:1px;border-style:solid;background:url("http://www.silkroadforums.com/images/navbackground.jpg");color:#000;border-color:#000;} a.navbar:link {color:#000;} td[style*="srf_header2"] {display:none;} .navmenu {padding:2px;}';
}
else {
var css = 'table .navtable {position:fixed;bottom:0;left:0;width:auto;border-width:1px;border-style:solid;background:url("http://i36.tinypic.com/2n8rhhh.gif");#EEE;border-color:#FFF;} a.navbar:link {color:#FFF;} td[style*="srf_header2"] {display:none;} .navmenu {padding:2px;}';
}

GM_addStyle(css.replace(/;/g, ' !important;'));[/CODE]
Copy linkTweet thisAlerts:
@penfold1992authorDec 16.2008 — is there no way to solve this problem? id like 2 speak to someone on msn, it may be easier
×

Success!

Help @penfold1992 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...