The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[New Posts | New Thread | Search] on Index page Details »» | |||||||||||||||||||||||||||
[New Posts | New Thread | Search] on Index page
Developer Last Online: Feb 2007
This adds forum section-specific New Posts, New Thread and Search links to the index page.
New Posts will only appear when there are new posts in that section and will only list new posts from the section. New Thread will start a new thread in that section. Search will start a search for only that section. A search did bring up something similar but it was neither as complete nor as aesthetically pleasing (to me). I apologise if this is duplicated. Open your forumhome_forumbit_level1/2_post template. FIND: Code:
<if condition="$show['forumdescription']"> <div class="smallfont">$forum[description]</div> </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&include=$forum[forumid]">$vbphrase[new_posts_nav]</a> | </if> <a href="newthread.php?$session[sessionurl]do=newthread&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> 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&include=$forum[forumid]">$vbphrase[new_posts_nav]</a> | </if> <a href="newthread.php?$session[sessionurl]do=newthread&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&f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></if> </if> 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. 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. Show Your Support
|
Comments |
#12
|
|||
|
|||
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&f=$forum[forumid]">New Thread</a> | <a href="search.php?$session[sessionurl]f=$forum[forumid]">$vbphrase[search]</a> </div> </if> |
#13
|
||||
|
||||
Quote:
|
#14
|
|||
|
|||
None. Not even a fairly large amount of conditionals will slow things down.
|
#15
|
||||
|
||||
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> 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> Code:
.tinyfont { font-size: 9px;} |
#16
|
|||
|
|||
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&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 --> |
#17
|
|||
|
|||
Quote:
|
#18
|
||||
|
||||
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 |
#19
|
|||
|
|||
Quote:
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. |
#20
|
|||
|
|||
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&include=f=$forum[forumid]">$vbphrase[new_posts_nav]</a> | </if> <a href="newthread.php?$session[sessionurl]do=newthread&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> - 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&include=f=$forum[forumid]">$vbphrase[new_posts_nav]</a> | </if> <a href="newthread.php?$session[sessionurl]do=newthread&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&f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></if> </if> - 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:
- Mine uses conditionals so is automatically adaptable. - Mine is phrased (admittedly that's barely possible, but I did what I could ) - 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. |
#21
|
|||
|
|||
great!
i will give it a shot tomorrow |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|