vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   [New Posts | New Thread | Search] on Index page (https://vborg.vbsupport.ru/showthread.php?t=122197)

ForumDog 08-17-2006 08:22 AM

Try replacing it with this:

Code:

<if condition="!$forum[statusicon] == 'new_lock' OR !$forum[statusicon] == 'old_lock' OR !$forum[statusicon] == 'link'">
<div class="smallfont">
<if condition="$forum[statusicon]=='new'">
<a href="search.php?$session[sessionurl]do=getnew&include=$forum[forumid]">$vbphrase[new_posts_nav]</a> |
</if>
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$forum[forumid]">New Thread</a> |
<a href="search.php?$session[sessionurl]f=$forum[forumid]">$vbphrase[search]</a>
</div>
</if>

That should (untested) mean that if the forum isn't locked or a link, display the links. Search is included in that, so if you want to allow people to search locked forums you'll have to move the </if> tag up so the Search link is outside it.

bada_bing 08-17-2006 12:02 PM

Quote:

Originally Posted by ForumDog
Try replacing it with this:

Code:

<if condition="!$forum[statusicon] == 'new_lock' OR !$forum[statusicon] == 'old_lock' OR !$forum[statusicon] == 'link'">
<div class="smallfont">
<if condition="$forum[statusicon]=='new'">
<a href="search.php?$session[sessionurl]do=getnew&include=$forum[forumid]">$vbphrase[new_posts_nav]</a> |
</if>
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$forum[forumid]">New Thread</a> |
<a href="search.php?$session[sessionurl]f=$forum[forumid]">$vbphrase[search]</a>
</div>
</if>

That should (untested) mean that if the forum isn't locked or a link, display the links. Search is included in that, so if you want to allow people to search locked forums you'll have to move the </if> tag up so the Search link is outside it.

I will try this... Do you know how many queries this gernerates on every page load?

ForumDog 08-17-2006 12:04 PM

None. Not even a fairly large amount of conditionals will slow things down.

Brandon Sheley 08-22-2006 04:14 AM

umm,,

http://forum.vbulletinsetup.com/f7/3...cribe-rss.html

I got this code from Keith Cohen months ago ;)
with his permission


[New Thread] - [Search] - [Subscribe] - [RSS]

if you like what we've added at vBulletin Setup and want it on your site here is your code..

Here's the code I use in forumbit level 1 and 2:

Code:

<if condition="$forum[link] == ''">
<span class="tinyfont">
 - [<a href="/forums/newthread.php?do=newthread&f=$forum[forumid]" title="Post a new thread in $forum[title]">New Thread</a>] - [<a href="/forums/search.php?forumid=$forum[forumid]" title="Search $forum[title]">Search</a>] - [<a href="/forums/subscription.php?do=addsubscription&f=$forum[forumid]" title="Subscribe to $forum[title]">Subscribe</a>] - [<a href="/forums/external.php?type=rss2&forumids=$forum[forumid]" target="_blank" title="RSS feed for $forum[title]">RSS</a>]
</span>
</if>

this assumes your vb is in a forums/ folder..

and like on our site, the forum home view don't allow new threads, so it was all useless and we just needed it on the forumdisplay page.. this is how to achieve that..

Code:

<if condition="THIS_SCRIPT == 'index'">
main forums page code
</if>


<if condition="THIS_SCRIPT == 'forumdisplay'">
forumsdisplay page code
</if>

and add this to your Additional CSS Definitions to make them small like on here

Code:

.tinyfont { font-size: 9px;}
btw, i just changed style, so i haven't added this code back.. but i did post this last month on the link above, and had it on an old site b4 that ;)

Avalon111 08-22-2006 05:11 AM

This is great!!!

i have just changed it a bit (hope you dont mind :) )

Code:

<!--  [View New Posts | Start New Thread | Search] on Index page by ForumDog -->

<div class="smallfont">
<if condition="$forum[statusicon]=='new'">
<a href="search.php?$session[sessionurl]do=getnew&include=$forum[forumid]">View New Posts</a> |
</if>
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$forum[forumid]">Start New Thread</a> |
<a href="search.php?$session[sessionurl]f=$forum[forumid]">Search Forum</a>
</div>

<!--  [View New Posts | Start New Thread | Search] on Index page by ForumDog -->


Avalon111 08-22-2006 05:26 AM

Quote:

Originally Posted by ForumDog
Try replacing it with this:

Code:

<if condition="!$forum[statusicon] == 'new_lock' OR !$forum[statusicon] == 'old_lock' OR !$forum[statusicon] == 'link'">
<div class="smallfont">
<if condition="$forum[statusicon]=='new'">
<a href="search.php?$session[sessionurl]do=getnew&include=$forum[forumid]">$vbphrase[new_posts_nav]</a> |
</if>
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$forum[forumid]">New Thread</a> |
<a href="search.php?$session[sessionurl]f=$forum[forumid]">$vbphrase[search]</a>
</div>
</if>

That should (untested) mean that if the forum isn't locked or a link, display the links. Search is included in that, so if you want to allow people to search locked forums you'll have to move the </if> tag up so the Search link is outside it.

tried this code, nothing showed up. no "New Posts, Thread or search"

Brandon Sheley 08-22-2006 04:13 PM

you can use the code i posted ;)
it works just fine..
if you still can't get it, give me a PM and I'll help ya out :)

Avalon111 08-23-2006 04:10 AM

Quote:

Originally Posted by Loco.M
you can use the code i posted ;)
it works just fine..
if you still can't get it, give me a PM and I'll help ya out :)

thanks for the offer :)

the code from the first post works like a charm it was just this 2nd posted code that has been posted that seems not to work.
the one that should not display [New Posts | New Thread | Search] for link forums ect.

ForumDog 08-23-2006 11:50 AM

Okee dokee, that'll teach me to post untested code! New version which is thoroughly tested and seems to work, if someone else gives it a whirl and it turns out to be the correct can they let me know so I can properly update.

Update:
- The conditional should now be correct so the links will only appear for open forums. It's up to you if you want to change that.
- The search link is now wrapped in a conditional so it doesn't appear when it's not wanted, most likely for Guests, New Thread is also now controlled as far as is possible by the statusicon conditional. Permission to start a new thread is only checked after clicking the link as far as I can tell, so it can't be done perfectly.
- Not a big deal, but added rel="nofollow" in a couple of places where the links aren't any use to search engines.

Code:

<if condition="$forum[statusicon]=='new' OR $forum[statusicon]=='old'">
    <div class="smallfont">
          <if condition="$forum[statusicon]=='new'"><a href="search.php?$session[sessionurl]do=getnew&amp;include=f=$forum[forumid]">$vbphrase[new_posts_nav]</a> | </if>
          <a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$forum[forumid]" rel="nofollow">New Thread</a>
          <if condition="$show['searchbuttons']">| <a href="search.php?$session[sessionurl]f=$forum[forumid]" rel="nofollow">$vbphrase[search]</a></if>
    </div>
</if>

Update: Optional extras:
- Subscription code for each feed type, all conditionals so they'll only appear if you've turned that type on.
- Unsubscribe moved to the linkfest since it seems to fit better there. Be sure to delete the very similar code which appears immediately below where this code is inserted, everything between <if condition="$show['forumsubscription']"> and </if>.

Code:

<if condition="$forum[statusicon]=='new' OR $forum[statusicon]=='old'">
    <div class="smallfont">
          <if condition="$forum[statusicon]=='new'"><a href="search.php?$session[sessionurl]do=getnew&amp;include=f=$forum[forumid]">$vbphrase[new_posts_nav]</a> | </if>
          <a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$forum[forumid]" rel="nofollow">New Thread</a>
          <if condition="$show['searchbuttons']">| <a href="search.php?$session[sessionurl]f=$forum[forumid]" rel="nofollow">$vbphrase[search]</a></if>
          <if condition="$vbulletin->options['externalrss']">| <a href="external.php?type=rss2&forumids=$forum[forumid]">RSS Feed</a></if>
          <if condition="$vbulletin->options['externalxml']">| <a href="external.php?type=xml&forumids=$forum[forumid]">XML Feed</a></if>
          <if condition="$vbulletin->options['externaljs']">| <a href="external.php?type=js&forumids=$forum[forumid]">JS Feed</a></if>
          <if condition="$show['forumsubscription']">| <a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></if>
</if>

Known Issues:
- If there is no permission to start a new thread or search and there are no new posts to view but the unsubscribe link or a feed link appears then the line will begin with a |. It could be solved with a loooooooot of conditionals but it's not worth it. Change the formatting (use of |) if it bothers you.

Quote:

Originally Posted by Loco.M
umm,,

http://forum.vbulletinsetup.com/f7/3...cribe-rss.html

Code:

<if condition="$forum[link] == ''">
<span class="tinyfont">
 - [<a href="/forums/newthread.php?do=newthread&f=$forum[forumid]" title="Post a new thread in $forum[title]">New Thread</a>] - [<a href="/forums/search.php?forumid=$forum[forumid]" title="Search $forum[title]">Search</a>] - [<a href="/forums/subscription.php?do=addsubscription&f=$forum[forumid]" title="Subscribe to $forum[title]">Subscribe</a>] - [<a href="/forums/external.php?type=rss2&forumids=$forum[forumid]" target="_blank" title="RSS feed for $forum[title]">RSS</a>]
</span>
</if>

...

Code:

<if condition="THIS_SCRIPT == 'index'">
main forums page code
</if>

<if condition="THIS_SCRIPT == 'forumdisplay'">
forumsdisplay page code
</if>


- My code uses session URLs as you are supposed to do, that code doesn't.
- Mine uses conditionals so is automatically adaptable.
- Mine is phrased (admittedly that's barely possible, but I did what I could :p)
- I know what the THIS_SCRIPT code does, I don't know what it's there for or even where it goes. But I don't think it should be used, it will prevent the links from showing up anywhere else, in the Subscribed Threads forumbit for instance. Come to that I'm not sure that $forum[link] is the correct conditional to use either...
- Mine will display as intended using the existing CSS.

So, as I guessed it had been done before but enough reason to use this one instead. :D

Avalon111 08-23-2006 01:48 PM

great!

i will give it a shot tomorrow :)


All times are GMT. The time now is 02:15 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.01167 seconds
  • Memory Usage 1,791KB
  • 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
  • (11)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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