The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
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
Developer Last Online: Nov 2023
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:
PHP Code:
For all your web pages (Navigation Bar) Open up your Navigation / Breadcrumb Templates subdirectory and choose Navbar template Find: PHP Code:
PHP Code:
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:
PHP Code:
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
Screenshots
Show Your Support
|
Comments |
#12
|
||||
|
||||
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 \<\<\,\>\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $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.''; } } 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 \<\<\,\>\>\.\?\/\:\;\~\"\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $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.''; } } 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> 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> and then find this: Code:
eval('$vbnews_ticker .= "' . fetch_template('vbnews_ticker') . '";'); Code:
eval('$vbnews_ticker .= "' . fetch_template('vbnews_ticker') . '";'); eval('$vbnews_ticker2 .= "' . fetch_template('vbnews_ticker2') . '";'); |
#13
|
||||
|
||||
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? |
#14
|
||||
|
||||
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.
|
#15
|
|||
|
|||
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? |
#16
|
||||
|
||||
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.
|
#17
|
|||
|
|||
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 |
#18
|
||||
|
||||
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 . " Also, if the variables are different, change them as I have not tested the script - only tested in phpmyadmin. |
#19
|
|||
|
|||
Thanks a stack - that works!!
Much obliged |
#20
|
||||
|
||||
Thanks for the demo CFodder
|
#21
|
|||
|
|||
Nice; now if the users could select the feeds it'd be even better.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|