Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vB News Ticker - Your Blogs RSS Feeds and Forums in a Marquee Details »»
vB News Ticker - Your Blogs RSS Feeds and Forums in a Marquee
Version: 2.02, by davidw davidw is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.8.1 Rating:
Released: 03-04-2009 Last Update: 03-04-2009 Installs: 61
Uses Plugins Template Edits
 
No support by the author.

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=

Download Now

File Type: zip vBNewsTicker202.zip (264.6 KB, 484 views)

Screenshots

File Type: gif 1generaloptions.gif (51.2 KB, 0 views)
File Type: gif 2blogoptions.gif (51.6 KB, 0 views)
File Type: gif 3forumoptions.gif (50.1 KB, 0 views)
File Type: gif 4rssoptions.gif (49.8 KB, 0 views)
File Type: gif 5navbarCMPS.gif (18.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-04-2009, 01:41 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #13  
Old 05-13-2009, 09:51 AM
jaryx's Avatar
jaryx jaryx is offline
 
Join Date: May 2007
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #14  
Old 05-13-2009, 10:54 AM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #15  
Old 05-27-2009, 01:57 PM
Tboy_forum Tboy_forum is offline
 
Join Date: May 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #16  
Old 05-27-2009, 02:28 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 05-27-2009, 08:01 PM
Tboy_forum Tboy_forum is offline
 
Join Date: May 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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
Reply With Quote
  #18  
Old 05-27-2009, 11:47 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #19  
Old 05-28-2009, 07:25 AM
Tboy_forum Tboy_forum is offline
 
Join Date: May 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a stack - that works!!

Much obliged
Reply With Quote
  #20  
Old 06-01-2009, 03:35 PM
masterweb's Avatar
masterweb masterweb is offline
 
Join Date: Aug 2007
Location: Italy
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the demo CFodder
Reply With Quote
  #21  
Old 06-03-2009, 10:33 AM
nnStaff nnStaff is offline
 
Join Date: May 2009
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:26 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12609 seconds
  • Memory Usage 2,372KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete