+ Reply to Thread
Results 1 to 10 of 10

Thread: how do I add "New Thread" button to SHOWTHREAD?

  1. #1
    vBulletin Team Andy Huang has a spectacular aura about Andy Huang has a spectacular aura about Andy Huang's Avatar
    Join Date
    Feb 2004
    Location
    Vancouver, British Columbia, Canada
    Age
    25
    Posts
    4,609
    Blog Entries
    1

    how do I add "New Thread" button to SHOWTHREAD?

    Hi guys,
    Ok, I am trying to add the "New Thread" button to SHOWTHREAD (see attached) because it makes creating new thread slightly easier; however, it doesn't seem to want to work with this below code:

    Code:
    	<if condition="$show['largereplybutton']">
    		<td class="smallfont"><if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if><a href="newreply.php?$session[sessionurl]do=newreply&amp;noquote=1&amp;p=$LASTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
    	<else />
    		<td class="smallfont"><if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if>&nbsp;</td>
    	</if>
    I basically added the two if clauses in both cases; and the added if clause is stolen from FORUMDISPLAY (where it checks if user can post new thread and give the button as needed). Can someone please check and let me know why the above doesn't work?

    Thanks in advance.
    Attached Images
    Last edited by Andy Huang; Tue 29th Mar '05 at 4:26pm.
    Best Regards,
    Andy Huang

    Please visit vBulletin-China for support in Chinese.

  2. #2
    Senior Member daemon is on a distinguished road daemon's Avatar
    Join Date
    Jun 2003
    Location
    California
    Age
    20
    Posts
    2,355
    Try using this code instead:

    HTML Code:
    	<if condition="$show['largereplybutton']">
    		<td class="smallfont"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a>&nbsp;<a href="newreply.php?$session[sessionurl]do=newreply&amp;noquote=1&amp;p=$LASTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
    	<else />
    		<td class="smallfont"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a></td>
    	</if>
    The $show['newthreadlink'] variable isn't set in showthread.php which is why it wasn't working.

  3. #3
    vBulletin Team Andy Huang has a spectacular aura about Andy Huang has a spectacular aura about Andy Huang's Avatar
    Join Date
    Feb 2004
    Location
    Vancouver, British Columbia, Canada
    Age
    25
    Posts
    4,609
    Blog Entries
    1
    Ok, that make sense, but is there a way to check whether or not the user have permission to post new thread in that forum and then show the button? Because with the code you provided, it'll always show that button and I'd rather it only show if the user have the permission to do it.

    I found a $forum array which is suppose to house some permission information; I wonder if I can directly access it from the template system, as well as what's in that array... I'll be poking around with it...

    Edit: Uhhg, $forum['permissions'] had some stuff in it which are not named (just number and more number), and I can't figure that out :/ it'd be great if any vb dev can shed some lights here... its only a template edit requiring knowledge about one variable... no code editing required...
    Last edited by Andy Huang; Tue 29th Mar '05 at 6:46pm.
    Best Regards,
    Andy Huang

    Please visit vBulletin-China for support in Chinese.

  4. #4
    vBulletin Team Andy Huang has a spectacular aura about Andy Huang has a spectacular aura about Andy Huang's Avatar
    Join Date
    Feb 2004
    Location
    Vancouver, British Columbia, Canada
    Age
    25
    Posts
    4,609
    Blog Entries
    1
    Not quite 24 hours yet... but I won't be around too much later today... so bumpy bumpy
    Best Regards,
    Andy Huang

    Please visit vBulletin-China for support in Chinese.

  5. #5
    vBulletin Team Andy Huang has a spectacular aura about Andy Huang has a spectacular aura about Andy Huang's Avatar
    Join Date
    Feb 2004
    Location
    Vancouver, British Columbia, Canada
    Age
    25
    Posts
    4,609
    Blog Entries
    1
    still nothing? bumpy bumpy... anyone familiar with using templates to access forum permissions?
    Best Regards,
    Andy Huang

    Please visit vBulletin-China for support in Chinese.

  6. #6
    Customer Support Manager Steve Machol is a name known to all Steve Machol is a name known to all Steve Machol is a name known to all Steve Machol is a name known to all Steve Machol is a name known to all Steve Machol is a name known to all Steve Machol's Avatar
    Join Date
    Jul 2000
    Location
    Jelsoft InterGalactic HQ
    Posts
    142,695
    Quote Originally Posted by Alfarin
    Ok, that make sense, but is there a way to check whether or not the user have permission to post new thread in that forum and then show the button?
    There is no function or conditional I am aware of to do this.
    Steve Machol, vBulletin Customer Support Manager
    "Have Copy, Will Paste" (when appropriate)

    Please do not email or PM me for vBulletin support. I will be more than glad to answer your questions on the vB Forums and in the support system.

    Just remember that what happens in localhost, stays in localhost.


  7. #7
    Senior Member Ace is on a distinguished road Ace's Avatar
    Join Date
    Apr 2004
    Location
    Auckland, New Zealand
    Posts
    589
    No...for some reason it's set per-forum, rather than per-usergroup.

    Thereby showing for Guests in a forum, when they can't actually post new threads.

    There's probably a logical reason..

  8. #8
    New Member fusioncreations is on a distinguished road
    Join Date
    Mar 2005
    Posts
    24
    I would like to do this as well.

  9. #9
    vBulletin Team Andy Huang has a spectacular aura about Andy Huang has a spectacular aura about Andy Huang's Avatar
    Join Date
    Feb 2004
    Location
    Vancouver, British Columbia, Canada
    Age
    25
    Posts
    4,609
    Blog Entries
    1
    if I write in template $forum['permissions'][$forumid] it'd give me a numeric string, I'm guessing its got something to do with the permission, does anyone know what defined word I should use to check whether or not the person can post new thread in this forum?
    Best Regards,
    Andy Huang

    Please visit vBulletin-China for support in Chinese.

  10. #10
    Senior Member Dennis Olson is on a distinguished road
    Join Date
    Oct 2002
    Posts
    2,759
    Use this EXACT CODE:

    Code:
    	<if condition="$show['largereplybutton']">
    		<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&amp;noquote=1&amp;p=$FIRSTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">
             <img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a></td>
    	<else />
    		<td class="smallfont">&nbsp;</td>
    	</if>

+ Reply to Thread

Similar Threads

  1. Problem : How to add the New Thread Button back to Showthread
    By cinq in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 2
    Last Post: Tue 11th May '04, 5:57am
  2. How To Add the New Thread Button back to Showthread
    By Zachery in forum vBulletin 3.0 Quick Tips and Customizations
    Replies: 0
    Last Post: Thu 8th Apr '04, 3:27pm
  3. How can I add a "button" called "home" in the navbar?
    By rickyram56 in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 7
    Last Post: Wed 3rd Mar '04, 5:35pm
  4. polls in v2 - do you miss the "post poll" button near the "post thread" one?
    By doron in forum vBulletin 2 Suggestions and Feedback
    Replies: 4
    Last Post: Tue 27th Feb '01, 5:00pm
  5. Thread Views on "showthread" Template?
    By VirtueTech in forum vBulletin 1.1.x Questions
    Replies: 14
    Last Post: Tue 20th Jun '00, 11:22pm

Bookmarks

Posting Permissions

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