vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - vB News Ticker - Your Blogs RSS Feeds and Forums in a Marquee (https://vborg.vbsupport.ru/showthread.php?t=207432)

davidw 03-04-2009 10:00 PM

vB News Ticker - Your Blogs RSS Feeds and Forums in a Marquee
 
1 Attachment(s)
What does this do?

It allows you to take your news from your forums (up to 10), blogs (up to 10), and/or RSS feeds (up to 10) and display them in a ticker (marquee).
You have a choice on how many you can pull from each forum as a whole or select your whole site, how fast you want the ticker to scroll, the length of the title of each news item, colors, etc. You can also add RSS feeds and the latest blogs.



Install Instructions

Step 1:
Fresh Install
If you intend to use the RSS features, upload the RSS folder to the root of your forums.
If you rename this folder or change the location, you MUST edit the path in the XML file for each of the require_once 'rss/rss_fetch.inc'; paths.
Go to your admin Control Panel => Plugin System => Manage Products => [Add/Import Product];
Click Browse and find product-davidw_vbnews_ticker.xml
Click Import

Upgrade Options:
Go to your admin Control Panel => Plugin System => Manage Products => [Add/Import Product];
Click Browse and find product-davidw_vbnews_ticker.xml
[If upgrading] Click the button next to Yes in Allow Overwrite
Click Import
You will probably want to revert any templates you have altered as most changes people have requested are now integrated.


Step 2:
Edit the admincp options
*** IMPORTANT ***
Make sure that if you do not enter an item in the forumIDs after the first one, the rest must be set to 0
- if it is not set to 0 or a forumid number, it will result in a database error.


Step 3:
Go to your admin Control Panel => Styles & Templates => Style Manager
Find your Master/Parent style or the style you wish to add this to and drop down the All Style Options menu dropdown and choose Edit Templates
Click Go if it does not redirect you
For your Forums Directory:

Open up your Forum Home Templates subdirectory and choose your FORUMHOME template

Find:
PHP Code:

<!-- main --> 

Add above:
PHP Code:

$vbnews_ticker 

Click Save & Reload

For all your web pages (Navigation Bar)
Open up your Navigation / Breadcrumb Templates subdirectory and choose Navbar template

Find:
PHP Code:

<!-- / nav buttons bar -->

<
br /> 

Add Below (You may want to remove the <br /> for aesthetics):
PHP Code:

$vbnews_ticker 

Click Save & Reload


Frequently Asked Questions

How do I add the news ticker to my vB Advanced?
To get the ticker in your vbadvanced, you need to add global output variables
Admin CP => vBa CMPS => Default Settings => Portal Output Global Variables and put vbnews_ticker in there.

How do I add the news ticker to the IBProArcade or Photoplog?
Thanks to Mark.B for his add - https://vborg.vbsupport.ru/showpost....&postcount=144

Why does this seem slow?
For a couple links or for a couple displayed items per link/news item, it should display fine, but as you add more (fill up) each potential slot and up the number of items to pull it will take longer to load. It it easy to add up fast. This uses anywhere from 1-30 queries depending on how many you use.

What is the forumid?
The forumid is the id of the forum you have created. Each forum has its own unique number assigned to it. When you click on a forum link you can see a number that is assigned to it. This will show up in the URL of the page you are browsing. Another way of seeing the forumid is to go to your admin control panel => Forums & Moderators => Forum Manager => Click on [Expand All] and then move your mouse over (hover) any of the forums you've created. Your status bar (bottom of screen) should display your forumid (number at the end of the link/url).

How do I change the colors?
It's an admincp option now :)
Ticker Background Color: If you leave this blank, it will stay your forum colors. If you put in a hex value, it will change to that color.
Please use 000000 - FFFFFF only.

Ticker Color: If you leave this blank, it will stay your forum colors. If you put in a hex value, it will change to that color.
Please use 000000 - FFFFFF only.

If you want alternating colors do this (You need to edit the plugin to make this work.):
Find:
PHP Code:

$ticker_titles             .= '<a href="showthread.php?t='$ticker['threadid'] .'" title="'$ticker['title'] .'" target="blank">'$ticker['title'] .'</a> '$ticksep.''

Replace With:
PHP Code:

$tick_color                = ($color 2) ? $color1 $color2;
                
$ticker_titles             .= '<a href="showthread.php?t='$ticker['threadid'] .'" title="'$ticker['title'] .'" target="blank"><font color="'$tick_color .'">'$ticker['title'] .'</font></a> '$ticksep .'';
                
$color++; 

How do I put in (absolute) links directly to the location rather than relative links?
In the plugin, find each instance of
showthread.php?t= (or whatever the page is)

and change part to a full url.
Example:
http://www.yoursite.com/showthread.php?t=

OblivionMage 03-05-2009 01:14 PM

Seems quite interesting, I'll test it out.

Jasem 03-05-2009 02:40 PM

installed

Good work, Thanks a lot

davidw 03-05-2009 03:05 PM

Don't forget to click install :)

y2krazy 03-06-2009 08:16 PM

Installed, however, when using an RSS feed, only about 20% of the news items actually have a link to the news item on the site I am getting the feed from. Why is this?

Also, if you are using a ticker separator, when the last item is reached it adds the seperator after the last item. It looks out of place.

How come you are not allowed to use each style's CSS? If I have more than 1 style, the colors do not match the 2nd style.

Thanks in advance. :)

Also, you should let people know that in the AdminCP, when setting a Ticker Prefix, you can use HTML to customize it. I used "<b><font color="#000000">Headlines:</font></b>". Looks good.

~ Sean

davidw 03-06-2009 09:03 PM

On some feeds, it depends on the source of the feed. Some sites format the feed correctly, while others do not, and yet others are hit and miss on which results are formatted correctly. I have this issue with vbulletin's own RSS integration for new threads from certain sites. Some sites won't work at all, some give me some results, and some give me all the results. I can't really explain other than that.

As for the ticker separator, I never did work on that further than the last one as the one I originally intended it for worked how it was meant to. It's been like that since its inception. For the CSS, it was intended for a global ticker (which is why you have adjustments in the admincp) and for non-vb pages as long as you can integrate them. I had it running on a non-vb page originally - but have made many changes since then. There was a lot I wanted to add (write in) on the admincp, but formatting breaks my HTML in the phrases, so I passed. I have given out similar suggestions to some in the earlier versions - before 3.8.x (I am unsure if it is in the thread or sent by PM) but yes, you cando that :)

I have a copy or two of an earlier version somewhere where I attempted to use the style-based CSS rather than admincp input and I might revive that but I have a few other projects I am working on for release.

masterweb 03-12-2009 06:36 PM

Seems really good, any online demo to se it in action ?.-

CFodder 04-04-2009 10:48 AM

Great mod thanks David, installed and working perfectly :). Can see it working HERE masterweb

Is there any way I could get it working so particular feeds on appear in certain forums?

davidw 04-04-2009 11:30 AM

You would probably have to create a new instance of a ticker - rename the variables and such. Another way might be to rewrite the ticker and create a template for each forumid.

CFodder 04-04-2009 12:04 PM

Thanks David, well I'm no coder, if you could point me in the direction of which variables I'd have to rename I'd appreciate it :).

Am using CMPS modules for the current ticker so wouldn't need the forumid ... at least I think not :s.

davidw 04-04-2009 01:41 PM

If you want the shorthand approach, you could essentially copy the product and rename it. Then open it with a text editor or what-not - rename every variable that has a $ before it and add a 1 or whatever after it. Also, every instance in the setting and phrase will need to have their names adjusted as well (phrase before the _desc and _title)
You will want to rename these or it will only overwrite the product
<product productid="davidw_vbnews_ticker" active="1">
<title>vB News Ticker</title>
<description>Latest News in a Ticker</description>

This should give you a starting point.

-or-


Another quicker way that might work is this:

Edit the xml and find instances of $ticker_titles
Edit that variable on the forumids that you want in the different forums.
Example:
Code:

                if (fid2) {
                        $gettickers2 = $db->query_read("
                                SELECT t.threadid, t.title, t.forumid, t.open, t.dateline, t.visible, t.firstpostid, t.prefixid
                                FROM " . TABLE_PREFIX . "forum f
                                INNER JOIN " . TABLE_PREFIX . "thread t ON t.forumid = f.forumid
                                WHERE t.forumid = " . $fid2 . "
                                ORDER BY dateline DESC
                                LIMIT " . $desclim . "
                        ");
               
                        while($ticker = $db->fetch_array($gettickers2))
                        {
                                $ticker['title']                = preg_replace('/\<[a-zA-Z0-9 \&lt;\<\,\&gt;\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $ticker['title']);
                                $ticker['title']                = fetch_trimmed_title(fetch_censored_text(unhtmlspecialchars($ticker['title'])), $titlelim);
                                $ticker['prefix_rich']        = $vbphrase["prefix_$ticker[prefixid]_title_rich"];
                                $ticker_titles                        .= '<a style="text-decoration:none" href="showthread.php?t='. $ticker['threadid'] .'" title="'. $ticker['title'] .'" target="blank"><font color="#'. $tickcolor .'">'. $ticker['prefix_rich'] .' '. $ticker['title'] .'</font></a> '. $ticksep.'';
                        }
                }

and change to
Code:

                if (fid2) {
                        $gettickers2 = $db->query_read("
                                SELECT t.threadid, t.title, t.forumid, t.open, t.dateline, t.visible, t.firstpostid, t.prefixid
                                FROM " . TABLE_PREFIX . "forum f
                                INNER JOIN " . TABLE_PREFIX . "thread t ON t.forumid = f.forumid
                                WHERE t.forumid = " . $fid2 . "
                                ORDER BY dateline DESC
                                LIMIT " . $desclim . "
                        ");
               
                        while($ticker = $db->fetch_array($gettickers2))
                        {
                                $ticker['title']                = preg_replace('/\<[a-zA-Z0-9 \&lt;\<\,\&gt;\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $ticker['title']);
                                $ticker['title']                = fetch_trimmed_title(fetch_censored_text(unhtmlspecialchars($ticker['title'])), $titlelim);
                                $ticker['prefix_rich']        = $vbphrase["prefix_$ticker[prefixid]_title_rich"];
                                $ticker_titles2                        .= '<a style="text-decoration:none" href="showthread.php?t='. $ticker['threadid'] .'" title="'. $ticker['title'] .'" target="blank"><font color="#'. $tickcolor .'">'. $ticker['prefix_rich'] .' '. $ticker['title'] .'</font></a> '. $ticksep.'';
                        }
                }

added the 2 after $ticker_titles
then duplicate the templates
from
Code:

        <templates>
                <template name="vbnews_ticker" templatetype="template" date="0" username="davidw" version="2.0.2"><![CDATA[<if condition="is_member_of($vbulletin->userinfo,$tickugp)"><div align="center" style="padding:2px; z-index: -1; background-color:#{$vboptions[tickbgcol]}; layer-background-color:#{$vboptions[tickbgcol]}";><marquee width="{$vboptions[tickwidth]}%" height="{$vboptions[tickheight]}" behavior=scroll scrollamount="{$vboptions[tickspeed]}" onmouseover="this.stop()" onmouseout="this.start()"><font color="#{$vboptions[tickcolor]}">$tickpre</font> $ticker_titles</marquee></div></if>]]></template>
        </templates>

to
Code:

        <templates>
                <template name="vbnews_ticker" templatetype="template" date="0" username="davidw" version="2.0.2"><![CDATA[<if condition="is_member_of($vbulletin->userinfo,$tickugp)"><div align="center" style="padding:2px; z-index: -1; background-color:#{$vboptions[tickbgcol]}; layer-background-color:#{$vboptions[tickbgcol]}";><marquee width="{$vboptions[tickwidth]}%" height="{$vboptions[tickheight]}" behavior=scroll scrollamount="{$vboptions[tickspeed]}" onmouseover="this.stop()" onmouseout="this.start()"><font color="#{$vboptions[tickcolor]}">$tickpre</font> $ticker_titles</marquee></div></if>]]></template>
                <template name="vbnews_ticker2" templatetype="template" date="0" username="davidw" version="2.0.2"><![CDATA[<if condition="is_member_of($vbulletin->userinfo,$tickugp)"><div align="center" style="padding:2px; z-index: -1; background-color:#{$vboptions[tickbgcol]}; layer-background-color:#{$vboptions[tickbgcol]}";><marquee width="{$vboptions[tickwidth]}%" height="{$vboptions[tickheight]}" behavior=scroll scrollamount="{$vboptions[tickspeed]}" onmouseover="this.stop()" onmouseout="this.start()"><font color="#{$vboptions[tickcolor]}">$tickpre</font> $ticker_titles2</marquee></div></if>]]></template>
        </templates>

Add this new template to the cache_templates plugin array
and then find this:
Code:

eval('$vbnews_ticker .= "' . fetch_template('vbnews_ticker') . '";');
copy this line and change your new line to reflect your new template. For example:
Code:

eval('$vbnews_ticker .= "' . fetch_template('vbnews_ticker') . '";');
eval('$vbnews_ticker2 .= "' . fetch_template('vbnews_ticker2') . '";');

I've not tested this, but something like this should work.

jaryx 05-13-2009 09:51 AM

Mod is great, but... when I enable it in the CPU time used by scripts PHP/CGI jump up by 100%.
I could do something bad, is it normal?

davidw 05-13-2009 10:54 AM

I'm not sure why this mod alone would cause 100% CPU usage but marquees have a tendency to increase the CPU usage of the page.

Tboy_forum 05-27-2009 01:57 PM

What is the selection criteria for each forum?

Lets say I have 2 forums with 3 news items selected - which threads from those forums are selected?

davidw 05-27-2009 02:28 PM

You have a limit that you set on the latest. They pertain to the latest (newest) created threads. If you set 3 as the limit for 2 forums, it would take the latest 3 created threads from those 2 forums.

Tboy_forum 05-27-2009 08:01 PM

Thanks for the info there - much appreciated

Our threads on the forum are ordered by last post

Is it possible to modify the code to select the last eg. 3 updated threads. Problem I am having is that for our events, threads were created a while back and get updated daily or every second day..

This means that although the thread is updated today ( and showing first on the forum list), its the older (events passed) links which are showing up on the ticker (according to your selection criteria) since their created date is newer than the last updated thread - hope that makes sense:p

In short I want to be able to select the last 3 posts which were updated - and not by thread creation date

Your help would be appreciated:D

davidw 05-27-2009 11:47 PM

Try something like this...

Code:

SELECT t.lastpost, t.threadid, t.title, t.forumid, t.open, t.dateline, t.visible, t.firstpostid, t.prefixid
                FROM " . TABLE_PREFIX . "forum f
                INNER JOIN " . TABLE_PREFIX . "thread t ON t.forumid = f.forumid
                LEFT OUTER JOIN " . TABLE_PREFIX . "post AS post ON post.postid = t.firstpostid WHERE t.forumid = " . $fidX . "
                ORDER BY lastpost DESC
                LIMIT " . $desclim . "

Amend where necessary ($fidX) This should give you results based on last post.

Also, if the variables are different, change them as I have not tested the script - only tested in phpmyadmin.

Tboy_forum 05-28-2009 07:25 AM

Thanks a stack - that works!!

Much obliged

masterweb 06-01-2009 03:35 PM

Thanks for the demo CFodder ;)

nnStaff 06-03-2009 10:33 AM

Nice; now if the users could select the feeds it'd be even better.

davidw 06-03-2009 01:32 PM

This is something that might be doable - but only if this option were the only option (kind of like how the forums option is either ALL forums or selected forums).

Mr Morningstarr 06-05-2009 07:34 PM

Is there a way of changing this from marquee to blinking?

davidw 06-06-2009 03:47 PM

Anything is possible - if you can get it to work. All you have to do is change the template. Find the marquee and change it to what you want. I have tried three or four different types but have had limited success, however, depending on what you want to do it may work. Edit the template and find the marquee - change that to blinking text (whichever you want to use).

alghazali 06-26-2009 01:35 PM

Does it display the post Icon as well? I want something that can do that.

davidw 06-26-2009 01:45 PM

No, not yet - but that is going to be part of one of the future updates.

ShadowAssassin1 06-26-2009 03:46 PM

Okay, here is an interesting question

Can you make it so that it refreshes every x seconds (Which I can specify :D)

Also, it won't refresh the whole page, just that particular thing :D

Thanks for this - installed!

tnedator 06-28-2009 08:57 PM

Does anyone know how I would need to mod this so that when you click on a ticker item it opens in the existing window, rather than a new one?

Edit: For clarification, I would only like the forum based ticker to open in the same window. If I add RSS ticker items, I would want them to open in a new window.

I tried modifying the plugin and tried changing to target = "self" and Target = "parent" in the thread ticker areas, but that didn't change it to open in the same window.

Code:

$ticker_titles                        .= '<a style="text-decoration:none" href="showthread.php?t='. $ticker['threadid'] .'" title="'. $ticker['title'] .'" target="parent"><font color="#'. $tickcolor .'">'. $ticker['prefix_rich'] .' '. $ticker['title'] .'</font></a> '. $ticksep.'';

zelnik 06-29-2009 01:40 PM

Hi David,

Every now and then my site will either crash or crawl so it is unusable.

Most of the time I have put it down to a server blip but I've just had one again and actually called my host and got them to diagnose it while I was on the phone.

They have emailed me with the following error:

Quote:

Our systems admin has had a look at your site and found that it is requesting some xml from

http://www.typicallyspanish.com/news.xml which is responding very slowly, it’s not a load problem with our servers.



poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])

sendto(7, "`\224\1\0\0\1\0\0\0\0\0\0\3www\20typicallyspanis" ..., 42, MSG_NOSIGNAL, NULL, 0) = 42

poll([{fd=7, events=POLLIN}], 1, 5000 <unfinished ...>



You will need to take a look at the code and change that if you want it to run quicker.

Does this mean anything to you? and if it is a problem retrieving a xml feed from a down or slow site is there any code within the plugin to timeout and forget about it until the next scheduled time it checks the feed?

Any advice would be greatly appreciated as ever.

Fynnon 06-29-2009 01:55 PM

I`m using this on vB 3.8.3 to display on index page the latest posts from a news site and it works great so far 10x

Only one little issue: the quotes(") are shown as question marks (?)

DEMO: http://bvlist.com

davidw 07-06-2009 11:20 AM

What kind of HTML Character Set are you using? You can find this information in your Language Manager under Languages & Phrases. Click edit on your language.

Don't forget to click install.

Fynnon 07-06-2009 12:03 PM

Quote:

Originally Posted by davidw (Post 1843696)
What kind of HTML Character Set are you using? You can find this information in your Language Manager under Languages & Phrases. Click edit on your language.

I`m using English (US) ISO-8859-1 because my forum is english only !
And the site from where i get the news is also an english only site !

I saw today this appears also as a ?

davidw 07-06-2009 01:33 PM

The reason I ask is that I also use ISO-8859-1 and in the default RSS feeds (vBulletin) I have the same issue. I am looking for a workaround on this.

zelnik 07-08-2009 01:20 PM

David, any help with this please?

https://vborg.vbsupport.ru/showpost....6&postcount=28

My site just this second started crawling and I disabled your plugin and the site sprung back to life, enabled it again and it's still working fine.

davidw 07-10-2009 01:33 PM

The main issue appears to be an issue with a feed you are trying to receive. This is beyond your control unless you use a different feed. Tickers (marquees) have a tendency from time to time cause a lag or crawling issue even from pulling from your own site (non-RSS) - this is normal. The only way to really speed it up is to possibly set up caching which you can do via the RSS feed manager. I don't have documentation on that but it is available out there.

marshal_ramdev 07-11-2009 07:09 AM

thanks

HappyPike 08-02-2009 01:05 AM

Thanks for making this nice addon! :)

When a link is clicked, it opens in new window. Can it be configurable to open in same or new window?

Alfa1 08-04-2009 10:48 PM

At last! I found the code for the typed ticker, frequently requested. It is a commercial code though. Can you make your hack work with this:
http://www.willmaster.com/software/attentionticker/

davidw 08-05-2009 10:58 AM

Quote:

Originally Posted by HappyPike (Post 1859859)
Thanks for making this nice addon! :)

When a link is clicked, it opens in new window. Can it be configurable to open in same or new window?

You could try altering/removing the
Code:

target="blank"
from each of the links in the plugin.



Quote:

Originally Posted by Alfa1 (Post 1861504)
At last! I found the code for the typed ticker, frequently requested. It is a commercial code though. Can you make your hack work with this:
http://www.willmaster.com/software/attentionticker/

I will ask them if they can allow me to demo their software to see if it will work, otherwise, it is $49 per person and cannot be distributed. This is a possibility.

animcentral 08-29-2009 07:10 AM

great mod but i have a better idea.
i need to moderators able to mark the thread as news and that news show in marquee in forumhome,would you please do this?

davidw 08-29-2009 10:58 AM

While this might be something to consider, it isn't feasible in its present form. It would take a rewrite of the script. I will consider this for a future update.


All times are GMT. The time now is 05:28 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01366 seconds
  • Memory Usage 1,884KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete