1
toolsmythe
Re: Newbb Uploads Failing
  • 2007/6/2 16:11

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


OK, I have the upload of large files working.

For anyone that is interested, here's what you have to do:

First - and I'm not sure this was really a problem, but it's always a good idea - I upgraded to the latest stable release of CBB (as of this post, 3.08). This was not as easy as I had hoped. I have a cloned template set and for some reason the clone was broken after the upgrade, so it looked like all my forums were gone when I went to the forum page. I recall seeing something a long time ago on that topic and how to fix it, but I only have a couple of minor template changes so it was easier just to create a new clone and duplicate the changes.

Even after that, there was a CBB block missing on the main page. I had to de-activate and reactivate the block in Admin and it came back.

Next, each forum has a setting called "Max Size in kb`s". You will need to bump the size of that up to whatever you think is a reasonable limit. Be aware: this setting is stored in a table called xoops_bb_forums in a column called attach_maxkb. That column is defined as an unsigned smallint (a new change with v3.08). This means you have a limit on the value that field holds of 65535, which means you have a CBB imposed limit of just under 64 Meg. If for some insane reason that is not big enough for you, then you will have to alter the data type for that table to something large enough to suit your evil purposes.

You set the "Max Size in kb`s" at the individual Forum level, so you will find it by editing a Forum in the Admin. While you are in there, you should make sure that the allowed file extensions are suitable to your needs and adjust them if not. A '*' in this setting will remove all file extension restrictions.

I did all that, and I still couldn't get anything larger than 2M to upload; it would *LOOK* like it was uploading, but when the page finally refreshed, there was no attachment. And here is the final hurdle ....

Limits Defined in PHP.
The upload functionality in CBB uses a PHP function called move_uploaded_file(). If you go look at the discussion attached to the documentation on this function over at www.php.net, you will see that there are some settings in PHP that constrain file upload sizes. The two settings in particular that must change in this case are upload_max_filesize and post_max_size.

You probably *DON'T* want to change these in php.ini as this is a very specialized case and you probably want the default for these in most cases. But in this instance, the value for these settings are going to have to go up. These settings cannot be programtically overridden at runtime, so forget about hacking upload.php. You *CAN* however, override them with directives in an .htaccess file in your XOOPS directory. So, if you want to bump the limit up to 50 meg, you would create an .htaccess file (or add to an existing one) as follows:

<IfModule mod_php4.c>
php_value upload_max_filesize 50M
php_value post_max_size 50M
</IfModule>


The above assumes you are running PHP4 and will bump your limit up to 50 Meg.

I uploaded a 7 Meg file with no other mods than what I've outlined above. The discussion of move_uploaded_file() also talks about possibly having to bump up max_input_time and max_execution_time. My upload ran about 1.5 minutes and I did not have to touch either of those; your mileage may vary. There was also discussion about possibly needing to bump up memory_limit. I didn't have to for my 7 Meg file. There is not a whole lot of doc on php.net on memory_limit. I did find this. The default is 128M; be *VERY* careful messing with it.


There are probably dozens of reasons why none of this is a good idea, but if you have a limited number of users, control of your server and you really need it, well, there you go ......



2
toolsmythe
Re: Newbb Uploads Failing
  • 2007/5/29 15:10

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


Thanks for your response.

In this case, it's my server; I'm the host. The site is *VERY* restricted; I'm in a band and it is for use by band members only. The forum is for notes on the songs that we have in our repitoure. I'm trying to create a knowledge-base so that as band members come and go the band lives on. Hmmm. maybe an FAQ module is more appropriate.

Anyway, I've placed no restrictions on the type of file that may be uploaded (at least none that I'm aware of).

JP



3
toolsmythe
Newbb Uploads Failing
  • 2007/5/29 8:53

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


I'm trying to upload an mp3 file via the upload facility within newbb. I've set the valid file extensions to '*' and bumped the max file size to 9999999. When I try to upload the file, it spins its wheels for a while and eventually gives me this:

Thanks for your submission!

Errors Returned While Uploading
No file uploaded

If the page does not automatically reload, please click here


The upload directory specified for newbb id readable and writeable.

Any thoughts would be appreciated.

Thanks.

JP



4
toolsmythe
Re: Site Name With Contraction Truncated in Email Form
  • 2007/5/12 0:29

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


Sorry, in my original post the HTML code for a single quote was being rendered into a single quote when I posted (so it looked like I was replacing "'" with "'" which, of course, makes no sense.

I've fixed it now.

JP



5
toolsmythe
Re: Site Name With Contraction Truncated in Email Form
  • 2007/5/11 16:12

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


Rowdie -

Thanks for the response and the suggestion .

I considered your solution when I was looking at the issue. The problem I had with it is that it swaps one problem for another.

While it fixes "John's XOOPS Site", it now breaks "Murray "The K" Kaufman's XOOPS Site".

This is just a plain old limitation of HTML, and I don't see how it can be fixed save choosing if you are going to enclose values in single or double quotes and then doing a str_replace() for that character.

Thanks again, and thank you for escalating this; I didn't know where else to report it.

JP



6
toolsmythe
Site Name With Contraction Truncated in Email Form
  • 2007/5/11 4:16

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


This has been a bug in every version of XOOPS I've used.

If your site name has a single quote in it (i.e., John's XOOPS Site), the site name is truncated at the first occurence of the single quote on the mail form (so in the aforementioned example, the "From Name (email only)" field would read "John" and not "John's XOOPS Site").

I traced this problem to the render() function in /class/xoopsform/formtext.php. This function renders all the text boxes for the page and encloses the value parameter in - of course - single quotes. So, an embedded single quote causes a problem.

I tried the php urlencode() function, but render() is used for *ALL* the fields on the form so it was really mangeling things better left alone like email address. I finally decided that the best thing to do was just convert all single quotes to &#39; and not worry about anything else. Seems to work just fine, but I'd welcome a better solution if anyone else has one.

Here's the code out of the 2.0.16 codebase:

The file in question is /class/xoopsform/formtext.php. The problem is in the render() function .....

Original:

    function 
render(){
        return 
"<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />";
    }


My Hack:

    function 
render(){
// The following is a fix to resolve the issue that the site name was being truncated in forms if the site name contained a single quote.
// This was happening because the value parameter of the text box is enclosed in single quotes so any single quotes contained therein need to be
// replaced with their URL Encoded equivilant (single quote = &amp;#39;).  The original line is remains (commented out) for reference.
//        return "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />";
        
return "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".str_replace"'""&amp;#39;"$this->getValue() )."'".$this->getExtra()." />";
    }


JP



7
toolsmythe
HTML Block - Problem previewing when block contains HTML Comment
  • 2006/6/26 4:36

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


This is more of an annoyance than an actual bug.

I have an HTML block on my site that contains some JavaScript. The JavaScript, of course, is surrounded by html comment tags to avoid issues with older browsers.

When I try to peview this module, instead of it rendering in a pop-up I get a whole bunch of spooge at the bottom of the edit panel:

");win.document.writeln("");win.document.writeln("");win.document.writeln("  ");win.document.writeln("  ");win.document.writeln(" ");win.document.writeln("

.
.
.

");win.document.writeln(""); win.focus(); win.document.close(); //-->


I can save it and it renders just fine in the actual block. I just can't preview it.

As I recall, this previewed just fine under 2.0.9. Currently running 2.0.13.2.

jp



8
toolsmythe
Re: Playing Catch-up and Stubbed My Toe
  • 2006/6/25 17:59

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


Thanks!

Looks like GIJOE has combined that into a new module called altsys. He says he'll be supporting that instead of tplsadmin moving forward.

jp


Quote:

jdseymour wrote:
Also here is a great too by GIJOE, tplsadmin 1.01.

It is kind of a blocksadmin for templates.
It will visually show diffs in files and templates:

Quote:
SUMMARY:

A module should be replaced "template manager" in system module.

I've made this module for recovering the features should be gifted in original DB template system.

I recommend tplsadmin module to all xoopsers with confidence.



DESCRIPTION:

- No hacks needed
- Easy to see differences of templates wholely
- Show "diff" from default or file
- Easy to copy&delete from any DB-set/file to any DB-set
- Easy to find the name of the target template (HTML comment or div border)
- Easy to edit the template just click links named the template in front side
- Generate specifications for template's variables dynamically as Dreamweaver Extension
- You can preview the site just by edit the template files (mainfile patch needed)



9
toolsmythe
Re: Playing Catch-up and Stubbed My Toe
  • 2006/6/25 17:56

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


Got it. Thanks!!



10
toolsmythe
Re: Playing Catch-up and Stubbed My Toe
  • 2006/6/23 7:11

  • toolsmythe

  • Just popping in

  • Posts: 34

  • Since: 2004/11/27


I ran into a problem on my post-upgrade to version 2.0.13.2 that points out that there is still something about the upgrade process I don't understand.

I have a cloned template set that I use on my site. I noticed a few days ago that I could no longer register or unregister requests for notifications (like a request to be notified of a post to a forum).

I traced it to a call to $GLOBALS['xoopsSecurity']->check() returning "true" and redirecting the page before doing an update. This happens in notification_update.php.

Ultimately, the problem turned out to be that the system_notification_select.html template was changed as part of the upgrade to include a hidden field:

<input type="hidden" name="XOOPS_TOKEN_REQUEST" value="<{php}>echo $GLOBALS['xoopsSecurity']->createToken();<{/php}>" />


For some reason (and it may well be by design - here's where my ignorance comes in) these changes were not propagated to my clone set. I copied the template in question over to my clone set and now all is right as rain, but this has me concerned there may be other differences in other templates that didn't make it over.

Did I miss another step? I reviewed your tutorial yet again and I did everything there including generating the missing templates in my cloned set.

What did I miss?

JP




TopTop
(1) 2 3 4 »



Login

Who's Online

190 user(s) are online (134 user(s) are browsing Support Forums)


Members: 0


Guests: 190


more...

Donat-O-Meter

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

Latest GitHub Commits