MyBB Community Forums

Full Version: Add Ticker To Theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Open news_ticker.php (from inc/plugins folder) and at line 143 add scrolldelay="150"

Quote: "template" => "<div class=\"news_ticker\"><marquee>\$content</marquee></div>",

Quote: "template" => "<div class=\"news_ticker\"><marquee scrolldelay=\"150\">\$content</marquee></div>",

Replace 150 with lower number if you want faster scrolling.Also you need do deactivate / activate that plugin to apply changes.
Thanks that worked perfect, i have added more rep.
All thats left for me to do is to make it stop when you hover over it and also one static image to the left of the ticker.

Is that possible?
On line 143 replace:

Quote:"template" => "<div class=\"news_ticker\"><marquee scrolldelay=\"150\">\$content</marquee></div>",

with:

Quote:"template" => "<div class=\"news_ticker\"><marquee scrolldelay=\"150\" onmouseover="\this.stop();\" onmouseout=\"this.start();\">\$content</marquee></div>",

Again you need to deactivate / activate that plugin to apply changes.

For static image on the left you can wrap marquee tag into another div tag and add background image (in global.css):

Quote:"template" => "<div class=\"news_ticker\"><div class=\"news_ticker_image\"><marquee scrolldelay=\"150\" onmouseover="\this.stop();\" onmouseout=\"this.start();\">\$content</marquee></div></div>",


In global.css add this:

Quote:.news_ticker_image {

background:url(.../path to your image/image.png/gif or jpg);
background-repeat:no-repeat;
background-position:left center;
padding-left:20px;

}
I have just done the first template change only and gone to my website and i am getting an error saying.

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /datasan/www/vhosts/wirraltalk.co.uk/httpdocs/inc/plugins/news_ticker.php on line 143

Parse error: syntax error, unexpected T_STRING, expecting ')' in /datasan/www/vhosts/wirraltalk.co.uk/httpdocs/inc/plugins/news_ticker.php on line 143
My bad.On line 143 replace existing content with following one:

Quote:"template" => "<div class=\"news_ticker\"><div class=\"news_ticker_image\"><marquee scrolldelay=\"150\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\">\$content</marquee></div></div>"
Sorry mate more errors.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /datasan/www/vhosts/wirraltalk.co.uk/httpdocs/inc/plugins/news_ticker.php on line 145
Add , at the end of line 143 (after </div>") and it should look like this :

Quote:"template" => "<div class=\"news_ticker\"><div class=\"news_ticker_image\"><marquee scrolldelay=\"150\" onmouseover=\"this.stop();\" onmouseout=\"this.start();\">\$content</marquee></div></div>",
No getting this error now.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /datasan/www/vhosts/wirraltalk.co.uk/httpdocs/inc/plugins/news_ticker.php on line 143
Above code is working on my localhost forum (post17).Download attachment news_ticker.php and repleace with your current one in inc/plugins folder.



Edit:news_ticker.php removed from attachment
Excellent that is now working.
There is one problem though, when the text from the ticker gets to the image it is going through the image and mingles with two together, take a look on my site please.
Its ok i have sorted it now, i just put the padding to 160
Thank you so much for all your help, it is very much appreciated.
Pages: 1 2