vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Home Enhancements - Quick News V2 (https://vborg.vbsupport.ru/showthread.php?t=127008)

Adrian. 09-18-2006 10:00 PM

Quick News V2
 
Quick News v2
By Adrian at Development Chat
Tested on v3.6.1, should work on 3.6.0 and 3.5.x


Hey,

This is a very simple mod', it allows you to add news/important notes or announcements, on the homepage of your forum.
You can enable/disable or add news via the admin panel.
The "Quick News" box, matches your forum theme. Just so it doesn't look out of place. ;)

New in Version two.
  • Abilty to hide Quick News from guests
  • Abilty to show Quick News to admins only
  • Abilty to choose to show Quick News on everypage, or just forum home

Installation

Import the product-quicknews.xml
Go to vBulletion Options > Quick News (Read option descriptions before configuring)

Template Edit:

Open Forum Home Templates > FORUMHOME

Find:
HTML Code:

<!-- main -->
After Add:
HTML Code:

<if condition="$vboptions['qnews_enabled'] == 1">
                <if condition="$vboptions['qnews_forumhome'] == 1">
                        <if condition="$vboptions['qnews_guests'] == 1">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        <else />
                <if condition="$show['guest']">
        <!-- No message for guests -->
                </if>
                </if>
               
                                <if condition="$vboptions['qnews_admin'] == 1">
                                        <if condition="$bbuserinfo[usergroupid] == 6">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        <else />
                                                        <if condition="$vboptions['qnews_guests'] == 1">
                                                                <if condition="$bbuserinfo[usergroupid] == 1">
<!-- No message for guests, if admin view only is set to no, and guest view is also set to no -->
        </if>
       
        <else />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        </if>
                </if>
        </if>
       
                </if>
        </if>

Now open Navigation / Breadcrumb Templates > navbar

Add at the very bottom:
HTML Code:

<if condition="$vboptions['qnews_enabled'] == 1">
                <if condition="$vboptions['qnews_everypage'] == 1">
                        <if condition="$vboptions['qnews_guests'] == 1">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        <else />
                <if condition="$show['guest']">
        <!-- No message for guests -->
                </if>
                </if>
               
                                <if condition="$vboptions['qnews_admin'] == 1">
                                        <if condition="$bbuserinfo[usergroupid] == 6">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        <else />
                                                        <if condition="$vboptions['qnews_guests'] == 1">
                                                                <if condition="$bbuserinfo[usergroupid] == 1">
<!-- No message for guests, if admin view only is set to no, and guest view is also set to no -->
        </if>
       
        <else />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        </if>
                </if>
        </if>
       
                </if>
        </if>

Done. :)

Upgrading:
If you are upfrading from Quick News v1 to v2.
Do the following.

Import the new product-quicknews.xml (Overwriting old version)

Then, open up:
Forum Home Template > FORUMHOME (if you installed it in FORUMHOME)

Find:
HTML Code:

        <if condition="$vboptions['qnews_enabled'] == 1">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>

And replace it with:
HTML Code:

<if condition="$vboptions['qnews_enabled'] == 1">
                <if condition="$vboptions['qnews_forumhome'] == 1">
                        <if condition="$vboptions['qnews_guests'] == 1">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        <else />
                <if condition="$show['guest']">
        <!-- No message for guests -->
                </if>
                </if>
               
                                <if condition="$vboptions['qnews_admin'] == 1">
                                        <if condition="$bbuserinfo[usergroupid] == 6">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        <else />
                                                        <if condition="$vboptions['qnews_guests'] == 1">
                                                                <if condition="$bbuserinfo[usergroupid] == 1">
<!-- No message for guests, if admin view only is set to no, and guest view is also set to no -->
        </if>
       
        <else />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        </if>
                </if>
        </if>
       
                </if>
        </if>

If you added the code into Navigation / Breadcrumb Templates > navbar, do the following

Find:
HTML Code:

        <if condition="$vboptions['qnews_enabled'] == 1">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>

Replace it with:
HTML Code:

<if condition="$vboptions['qnews_enabled'] == 1">
                <if condition="$vboptions['qnews_everypage'] == 1">
                        <if condition="$vboptions['qnews_guests'] == 1">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        <else />
                <if condition="$show['guest']">
        <!-- No message for guests -->
                </if>
                </if>
               
                                <if condition="$vboptions['qnews_admin'] == 1">
                                        <if condition="$bbuserinfo[usergroupid] == 6">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        <else />
                                                        <if condition="$vboptions['qnews_guests'] == 1">
                                                                <if condition="$bbuserinfo[usergroupid] == 1">
<!-- No message for guests, if admin view only is set to no, and guest view is also set to no -->
        </if>
       
        <else />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">

<tr>
<td align="center" class="tcat">Quick News</td>
</tr>
<tr>
<td class="alt1">$vboptions[qnews_news]</td>
</tr>
</table>
<br>
        </if>
        </if>
                </if>
        </if>
       
                </if>
        </if>

Done.

Very easy to install mod', and quite useful. :)

Click install if you use it please. :)

Thanks.

Adrian

dougk 09-19-2006 09:15 AM

very nice simple mod.

Will be used

TCB 09-19-2006 09:50 AM

Seems like a great and handy mod. I guess it's shown to all visitors?

Adrian. 09-19-2006 09:54 AM

Quote:

Originally Posted by TCB
Seems like a great and handy mod. I guess it's shown to all visitors?

Yep.

Just after i released it, i thought, "Damn, why didn't i make a option for it to be hidden from guests, or only viewable by admins" :(

So, i'm doing that now.

Hopefully will update it tomorrow when i have time. :)

Harley77 09-19-2006 04:25 PM

Exellent addon. Simplicity is key. As a variation on this, how hard would it be to add multiple announcements that are pulled randomly?

My idea is a box exactly like you've created, but with "tips" or whatever you could put in. The title of the box could be "Did you know?" then each time the box is refreshed, it would display tips on forum use, features, etc. There was another mod that did this, but it pulled from a text file that was too cumbersome to add stuff to by multiple people.

bolly.beats 09-19-2006 06:04 PM

thank you nice :D and small

Josh1 09-20-2006 02:14 AM

Sweet, using it.

Gripemaster 09-20-2006 02:32 AM

*INSTALLED* Thanks!

Hornstar 09-20-2006 04:37 AM

maybe an option to use either bb code or html?

phpdevrus 09-20-2006 07:38 AM

wow nice. ;-) have some ideas for this. can be altered to use for network links, ads, ect like right or left column menu on forum index.

rezapci 09-20-2006 09:10 AM

thank you, nice Idea....

Adrian. 09-20-2006 09:58 AM

Updated to Quick News V2.

Add some more features, nothing big, it's still a small mod'. ;)

New in Version two.
Abilty to hide Quick News from guests
Abilty to show Quick News to admins only
Abilty to choose to show Quick News on everypage, or just forum home

Adrian

rezapci 09-20-2006 10:48 AM

hey adrian,

I don't know why I have two Quick news!

how could I fix this?

Adrian. 09-20-2006 11:02 AM

Quote:

Originally Posted by rezapci
hey adrian,

I don't know why I have two Quick news!

how could I fix this?

You most likely have set "Show on Forumhome only" and "Show on everypage" enabled. :)

Just set one to no. ;)

Adrian

rezapci 09-20-2006 11:08 AM

Quote:

Originally Posted by Adrian.
You most likely have set "Show on Forumhome only" and "Show on everypage" enabled. :)

Just set one to no. ;)

Adrian

still the seam thing! www.alshiatalk.com/vb take a look!

Adrian. 09-20-2006 11:12 AM

I'm only seeing one.

You will have the option "Show to admins only", enabled?

If you look at the descriptions carefully, it says

Quote:

Set this to yes to allow only admins to view Quick News. Note: You must set 'Allow guests to view Quick News' to no.
Be careful not to contridict it. :)

Just set the admin option to No, you should be fine. :)

rezapci 09-20-2006 11:29 AM

Quote:

Originally Posted by Adrian.
I'm only seeing one.

You will have the option "Show to admins only", enabled?

If you look at the descriptions carefully, it says



Be careful not to contridict it. :)

Just set the admin option to No, you should be fine. :)

Problem solved...

Thank youuuuu

Nice work ***** 10 STAR *****

rezapci 09-20-2006 11:57 AM

Quote:

Originally Posted by Adrian.
I'm only seeing one.

You will have the option "Show to admins only", enabled?

If you look at the descriptions carefully, it says



Be careful not to contridict it. :)

Just set the admin option to No, you should be fine. :)

look again, its shows two quick news between shoutbox!

one is upper and one is down of the shoutbox!

www.alshiatalk.com/vb

Adrian. 09-20-2006 12:11 PM

Odd, i tried those options on my forum,

It shows one news box if guest, admin or member.

Did you do the template edits correctly.

Eg, Navbar template in Navbar.

Forumhome in FORUMHOME?

rezapci 09-20-2006 12:50 PM

Quote:

Originally Posted by Adrian.
Odd, i tried those options on my forum,

It shows one news box if guest, admin or member.

Did you do the template edits correctly.

Eg, Navbar template in Navbar.

Forumhome in FORUMHOME?

problem solved...

was in FORUMHOME

thank you :)

Gizmo5h1t3 09-20-2006 03:26 PM

updated, and working a treat on 3.5

Adrian. 09-21-2006 08:30 AM

Great.

So it should work on v3.5.x

:D

kushal 09-22-2006 07:59 PM

Great mod. Thank You.

hal05 09-22-2006 08:52 PM

Works great, thank you!

category 09-23-2006 07:05 PM

fixed

Adrian. 09-24-2006 09:14 AM

I can't see why it's doing that, but could you specify a link to your forum please? :)

I tried the one in your profile, i just got a parking page.

Adrian

category 09-25-2006 01:57 AM

ahh i see

bandare 09-26-2006 11:56 AM

Brilliant... installed and working great.. thanks a lot....

www.173rd.org!

Alien 09-30-2006 01:11 PM

This is terrific, I'm going to use this..

I would recommend changing your <br> in your html to <br /> to maintain xhtml compliance.

I would also like to know, to cut down on processing time, if I will never change these two settings:
Allow Guests = Yes
Only Admins Can View = No

What code could I pull out safely that would always assume those 2 settings, thus cutting down on the extra if statements and processing time? That would be killer. :) Thanks!

smsmasters 10-01-2006 10:41 AM

By the way, the code in forumhome should be placed before: $forumbits if you want it to show at the top.

ymy 10-02-2006 01:20 AM

Adrian,:rolleyes:

installed and working great.. thanks a lot....

I Am SURE CLICK INSTALL!

Alien 10-02-2006 01:25 AM

Hey just a follow up.. I just installed this on a fresh site, made both template edits and no matter what when I turn off 'show to guests' it still shows it to them.. Any idea what's going on? Otherwise this works perfectly...

Lysithea 10-05-2006 03:07 PM

Great Mod! I installed this on my site and I am installing this on my other site as well. Very useful!

Snake 10-06-2006 01:17 AM

Wow thanks a lot. Could be much better as a product though. ;)

Alien 10-12-2006 04:17 AM

I noticed that the if tags are a mess on this.. If you try to use the w3c validator it says you have too many ending if tags?

AMG021 10-12-2006 05:15 PM

Why can i use html and bbcode? Please make it compatable..

Thanks in advance!

Ciciotti 10-14-2006 09:54 PM

I'm pretty sure I installed it correctly. I'm new to this and everything, though. So bare with me. I go to the settings and I'm not seeing any quick news on the drop down.

Adrian. 10-15-2006 08:54 AM

Quote:

Originally Posted by Ciciotti
I'm pretty sure I installed it correctly. I'm new to this and everything, though. So bare with me. I go to the settings and I'm not seeing any quick news on the drop down.

Hey,

Go to your Admin Panel.
On the left click "vBulletin Options" > "vBulletin Options"

On that page, there will be a big list of options, look towards the bottom for Quick News.

Double click it.

Done. :)

gazzak 10-16-2006 09:07 AM

I installed this MOD on my 3.62 forum to give the users information about new arcade tournaments when they're created. Works great, thanks.

oberheimhaven 10-16-2006 10:09 AM

Quote:

Originally Posted by Adrian.
You most likely have set "Show on Forumhome only" and "Show on everypage" enabled. :)

Just set one to no. ;)

Adrian

U have it installed twice in forumhome template i did the same thing m8!


All times are GMT. The time now is 02:54 AM.

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.01346 seconds
  • Memory Usage 1,891KB
  • 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
  • (7)bbcode_html_printable
  • (9)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