HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[solved] Error when posting to my new ocPortal Forum

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#81180 (In Topic #16551)
Avatar

Fan in action

PHP WARNING [2] Division by zero in sources/ocf_topicview.php on line 36

Greetings ocPortal Community,

I've just launched my new ocPortal forum on my site:

http://www.kbcsd.com/forum/index.php?page=start

Well I've just made my very first post and now I'm getting this error below.  I've already checked the forums to see if anyone else is having a similar issue.  However, my initial search results did not yield anything close to the error I am recieving.  I've also checked to see if this was on a list of confirmed bugs for ocPortal version 7.1.5, again nothing close.

Has anyone ever experienced this before on a new deployment of ocPortal forum?  Other than the custom CSS style I've made no other custom changes to the default forum install.

Could someone please point me in the right direction?

I would very much appreciated it!

Thank you.

An error has occurred

An error has occurred

PHP WARNING [2] Division by zero in sources/ocf_topicview.php on line 36 (version: 7.1.5, PHP version: 5.2.17, URL: /forum/index.php?page=topicview&type=findpost&id=4&redirected=1)

Here is the stack trace:

Below is a stack trace revealing the state the software was in when the error occurred. If this represents a bug in the unmodified software, you may want to check ocPortal website for a fix, and if there isn't one, report this as a bug. Please note that merely posting a stack trace is not sufficient for us to solve your problem; the stack trace is just an aid that presents us with additional information. We still need to know the error message, what you tried to do, how you tried to do it, version numbers, and any other appropriate information.
We apologise for this problem and if it's a bug we hope you will work with us so that we can fix it for you promptly.

File '/home6/kbcsdcom/public_html/sources/failure.php'
Line '674'
Function 'get_html_trace'
Args

File '/home6/kbcsdcom/public_html/sources/global2.php'
Line '969'
Function '_fatal_exit'
Args
'PHP WARNING [2] Division by zero in sources/ocf_topicview.php on line 36'


File '/home6/kbcsdcom/public_html/sources/failure.php'
Line '214'
Function 'fatal_exit'
Args
'PHP WARNING [2] Division by zero in sources/ocf_topicview.php on line 36'


File '/home6/kbcsdcom/public_html/sources/global2.php'
Line '843'
Function '_ocportal_error_handler'
Args
'warning'

2

'Division by zero'

'sources/ocf_topicview.php'

36


File '/home6/kbcsdcom/public_html/sources/ocf_topicview.php'
Line '36'
Function 'ocportal_error_handler'
Args
2

'Division by zero'

'/home6/kbcsdcom/public_html/sources/ocf_topicview.php'

36

array ( 'post_id' => 4, 'max' => 0, 'id' => 3, 'before' => 0, )


File '/home6/kbcsdcom/public_html/forum/pages/modules/topicview.php'
Line '79'
Function 'find_post_id_url'
Args
4


File '/home6/kbcsdcom/public_html/sources/zones.php'
Line '386'
Function 'run'
Class 'Module_topicview'
Type '->'
Object Module_topicview::__set_state(array( ))
Args

File '/home6/kbcsdcom/public_html/sources/site.php'
Line '970'
Function 'load_module_page'
Args
'forum/pages/modules/topicview.php'

'topicview'


File '/home6/kbcsdcom/public_html/sources/site.php'
Line '753'
Function 'request_page'
Args
'topicview'

true


File '/home6/kbcsdcom/public_html/forum/index.php'
Line '51'
Function 'do_site'
Args


Last edit: by luis
Back to the top
 
Posted
Item has a rating of 5 (Liked by luis)  
Rating:
#81181
Avatar

You've set the forum_posts_per_page option to zero in the configuration, which will cause this.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#81182
Avatar

Fan in action

Oh I see, thank you Chris!

I'm new to managing forums so what is a reasonable value to set "forum_page_per_posts"?

10, 100, ?

Thank you very much!
Back to the top
 
Posted
Item has a rating of 5 (Liked by luis)  
Rating:
#81185
Avatar

yes


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#81186
Avatar

Community saint

Hi luis, welcome to ocPortal.

Try this …

Admin Zone Setup Configuration Member and forum options
  • Posts per page - 20
  • Topics per page - 30

'Posts' will have several lines of text. 'Topics' will usually display as one or two lines.

If it doesn't look right to you, you can always adjust up or down at a later date.

Does that help?

 :thumbs:


Last edit: by Fletch

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#81190
Avatar

Fan in action

Fantastic, Fletch!  Yes, that dose help.  I'll try that and thank you for explaining that option.

Thank you Chris for your help and for the prompt replies!

I'm really starting to like all of these ocPortal features.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: