1
ljmyers
Remove Attachent Option From NewBB
  • 2006/2/1 19:22

  • ljmyers

  • Just popping in

  • Posts: 44

  • Since: 2006/1/4 2


Is it possible to turn off the option to upload attachments or can I possibly remove some code thus removing that portion of the form all together.

My ultimate goal is to NOT allow attachemnts to be uploaded by anyone, whether they are registered or not. I would feel better if I could simply remove this part of the form completely. I have looked through the code but can only find one place that could accomplish this.

file:

newbb/include/forumform.inc.php

code:

$forum_form->addElement($options_tray);

if ($forum->getVar('allow_attachments') && $topic_handler->getPermission($forum, $topic_status, 'attach')) {
$forum_form->addElement(new XoopsFormFile(_MD_ATTACHMENT, 'userfile',''));
$forum_form->addElement(new XoopsFormLabel(_MD_ALLOWED_EXTENSIONS, "<i>".str_replace('|',' ',$forum->getVar('attach_ext'))."</i>"));
}

Would deleting this do it and the forum continue to work as it should ?
Smiles,
Lana
MyOnlineMagazine .net
L.J. Myers Company (My first website)

2
m0nty
Re: Remove Attachent Option From NewBB
  • 2006/2/1 19:31

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


why not just turn attachments off in the module preferences?

3
ljmyers
Re: Remove Attachent Option From NewBB
  • 2006/2/1 20:14

  • ljmyers

  • Just popping in

  • Posts: 44

  • Since: 2006/1/4 2


I looked for that option all through the module and in preferences >> newbb module something like 4 or 5 times but didn't see one.

I just double checked to make sure and still don't see anything. I'm assuming it should be in preferences >> newbb module?

I have an... Attachments physical path - uploads/newbb but that's all I see that has anything to do with attachements other than... Enable Media Features which I have tuned off.
Smiles,
Lana
MyOnlineMagazine .net
L.J. Myers Company (My first website)

4
Bender
Re: Remove Attachent Option From NewBB
  • 2006/2/1 20:52

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Which newBB version exactly are we talking about?

(not upgraded to cbb yet?)
Sorry, this signature is experiencing technical difficulties. We will return you to the sheduled signature as soon as possible ...

5
ljmyers
Re: Remove Attachent Option From NewBB
  • 2006/2/2 1:23

  • ljmyers

  • Just popping in

  • Posts: 44

  • Since: 2006/1/4 2


I'm using newbb 2.02 with upgrade of cbb 2.3 in XOOPS version 2.2.3a. I only installed the whole set up about 3 weeks ago and love it by the way but I admit that I am a newbie to XOOPS and portals in general.
Smiles,
Lana
MyOnlineMagazine .net
L.J. Myers Company (My first website)

6
Durator
Re: Remove Attachent Option From NewBB
  • 2006/2/2 22:41

  • Durator

  • Just popping in

  • Posts: 11

  • Since: 2004/4/11


I have had a look and not found it either. What you could do for the meantime is set the upload directory permissions to refuse anything at all.

7
ljmyers
Re: Remove Attachent Option From NewBB
  • 2006/2/2 22:53

  • ljmyers

  • Just popping in

  • Posts: 44

  • Since: 2006/1/4 2


Thanks Durator, now I know I'm not crazy. lol

Regarding your suggestion, would you mind pointing me in the right direction to set the upload directory permissions to refuse everything? I'll look for it myself in the meanwhile.


Edit:
I fixed it by going into that file name above and removed the allow_attachments from the line

if ($forum->getVar('allow_attachments') && $topic_handler->getPermission($forum, $topic_status, 'attach')) {

this removed the text box and browse button from the form completely.

--------------

I also did this for the popnupblog by removing the code . . .

// File upload By Yoshi.Sakai, bluemooninc.biz 2004/3/14
//
if (is_object($xoopsUser)){
echo "</td></tr><tr><td class='head' valign='top' nowrap='nowrap'>Upload File</td>\n";
echo "<td class='even'><INPUT TYPE='hidden' NAME='MAX_FILE_SIZE' VALUE='maxbyte'>";
if ($BlogCNF['maxbyte']>=1000000){
$maxbyte_str = sprintf("%d M",$BlogCNF['maxbyte']/1000000);
} elseif ($BlogCNF['maxbyte']>=1000){
$maxbyte_str = sprintf("%d K",$BlogCNF['maxbyte']/1000);
} else {
$maxbyte_str = sprintf("%d ",$BlogCNF['maxbyte']);
}
echo "<INPUT type='file' size='50' name='upfile'> Max".$maxbyte_str."Byte.";
}
// upload end.

from the file /popnupblog/edit.php

here is hoping that everything still works ok. lol It shouldn't create a problem though.
Smiles,
Lana
MyOnlineMagazine .net
L.J. Myers Company (My first website)

8
Durator
Re: Remove Attachent Option From NewBB
  • 2006/2/3 13:29

  • Durator

  • Just popping in

  • Posts: 11

  • Since: 2004/4/11


@ ljmyers.... but I did find that you can disallow Attachments in the Permissions Tab, you have to open the dropdown on the left and hey presto it works.

9
ljmyers
Re: Remove Attachent Option From NewBB
  • 2006/2/3 20:10

  • ljmyers

  • Just popping in

  • Posts: 44

  • Since: 2006/1/4 2


Hmmmmmm, I don't have a permissions tab. Not quite sure what's up with that Durator. Oh well. it seems everything is working fine as it so. Thanks for the reply though, maybe I'll reinstall soon.
Smiles,
Lana
MyOnlineMagazine .net
L.J. Myers Company (My first website)

10
m0nty
Re: Remove Attachent Option From NewBB
  • 2006/2/3 20:28

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


Quote:

if ($forum->getVar('allow_attachments')


this line alone assumes thewre is an option for it and that the value is set to true or 1. otherwise allow atacchments would always be false and you would never see the attachment part.

if you are running CBB then there is definitely an option for it..

you will find it in xoops_version.php modconfig allow_attachments

Login

Who's Online

77 user(s) are online (44 user(s) are browsing Support Forums)


Members: 0


Guests: 77


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits