PDA

View Full Version : disable new thread button in a forumid mod


troppodel
01-24-2009, 10:47 PM
Hi there
I'm not a coder
i know i can disable the new thread button with the usergroup permission.
But if i wanna disable the new thread button in a forum for all users but don't wanna change the permission because this group need to create new thread in other forums?

example i have create a forumid 126 and i wanna change the link for the new thread button of this forum, i changed my forumdisplay template (add blue text):

<if condition="$forumid <> 126">
<if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if></td>
<if condition="$pagenav"><td align="$stylevar[right]">$pagenav</td></if>
<else />
<if condition="$show['newthreadlink']"><a href="http://www.bobmarleymagazine.com/forum_bmwm/misc.php?do=form&fid=1" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if></td>
<if condition="$pagenav"><td align="$stylevar[right]">$pagenav</td></if>
</if>

the question is:
if i wanna create a simple mod where i go in the vbulletin option and select my mod (example "disable new thread button") and there i have a one simple line text field where i put the exclusion forumid and so change the variable in my condition above (note: without the change link button only for disable it) how can i do?


<if condition="$forumid <> variable of my mod">
<if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if></td>
<if condition="$pagenav"><td align="$stylevar[right]">$pagenav</td></if>
</if>

somebody can help me to create this little mod?

Lynne
01-24-2009, 11:04 PM
I'm stuck on this line:
But if i wanna disable the new thread button in a forum for all users but don't wanna change the permission because this group need to create new thread in other forums?

Why don't you just go to Forum Permissions > find the forum > select the usergroup > Can Post Threads > No ?

troppodel
01-25-2009, 12:13 PM
yes lynne thanks but if i wanna create this little mod for disable and change the link you can help me?

Lynne
01-25-2009, 02:58 PM
Well, OK....

You'd have to turn on debug mode to add the setting. Let's say you call it "yoursetting" and you put in a series of forumids, x,y,z. You now have an array which you will have to explode in a plugin to use:
$yourarray=$vbulletin->options[yoursetting];
$yourforums = explode(",", $yourarray);

Then you can use it in a conditional in your templates:
<if condition="in_array($threadinfo[forumid], $yourforums)">