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.


"Posts Today" Question

Login / Search

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

Well-settled

It looks as if the "Posts Today" in the site stats is more like "Posts in the last 24 hours" instead of "Posts since 12:00am".  Is there any way to change this to the latter?

Thanks.


ModelerX.com - Post your models in the gallery and chat about 'em in the forums.  Building the largest online community of modelers with your help.

Back to the top
 
Posted
Rating:
#31211
Avatar

Community saint

you are correct it does do that.
I am not sure how to change it but I will look into it for you, If Chris gets back to you first as it might be a while then good.
:)

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#31212
Avatar

Hi,

Are you using OCF?

If so, try changing line 1141 of sources/forum/ocf.php from:

Code

      return $this->connection->query_value_null_ok_full('SELECT COUNT(*) FROM '.$this->connection->get_table_prefix().'f_posts WHERE p_time>'.strval(time()-60*60*24));
to:

Code

      return $this->connection->query_value_null_ok_full('SELECT COUNT(*) FROM '.$this->connection->get_table_prefix().'f_posts WHERE p_time>'.strval(mktime(0,0,0,intval(date('m')),intval(date('d')),intval(date('Y')))));


Last edit: by Chris Graham


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:
#31251
Avatar

Well-settled

I have to hold off on editing that until I figure out something that seems to have just come up dealing with the site stats.  The post count is not being incremented and it shows the incorrect "post today" count even if it was in the last 24 hours.  Looks like it broke just as the site hit 100 posts.  I cleared the cache but there was no change.  Any ideas?


ModelerX.com - Post your models in the gallery and chat about 'em in the forums.  Building the largest online community of modelers with your help.

Back to the top
 
Posted
Rating:
#31252
Avatar

That sounds strange. I suppose the first thing to do would be to go into phpMyAdmin and put in a query, and see what it says:

Code

SELECT COUNT(*) FROM ocp2_f_posts WHERE p_time>UNIX_TIMESTAMP()-60*60*24
If that's wrong, I'd try doing a repair on the ocp2_f_posts table from phpMyAdmin.


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:
#31311
Avatar

Well-settled

The post count is incrementing now, but it seems to take a long time for it to do so.  Quite strange behaviour.  

Back to the original post, after making the changes you mentioned the "post today" count stays at 0 even if there is a post today.


ModelerX.com - Post your models in the gallery and chat about 'em in the forums.  Building the largest online community of modelers with your help.

Back to the top
 
Posted
Rating:
#31312
Avatar

Hi,

I just re-read the change, and I accidentally missed out a 0,. My post has been edited.


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:
#31313
Avatar

Well-settled

K… I'll give that a try and see how it works out.  

Thanks.


ModelerX.com - Post your models in the gallery and chat about 'em in the forums.  Building the largest online community of modelers with your help.

Back to the top
 
Posted
Rating:
#31314
Avatar

Well-settled

Ok, so now it is reporting more posts than there really were.  I'm gonna give it a couple of days and see if it straightens out.


ModelerX.com - Post your models in the gallery and chat about 'em in the forums.  Building the largest online community of modelers with your help.

Back to the top
 
Posted
Rating:
#31324
Avatar

I've checked this myself now and I've seen there's a layer of cacheing in the way.
The cacheing isn't really necessary, so change line 340 of sources/forum_stub.php from:

Code

      $value=get_value_newer_than('num_new_forum_posts',time()-60*60*6);
to:

Code

      $value=NULL;//get_value_newer_than('num_new_forum_posts',time()-60*60*6);


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:
#31327
Avatar

Well-settled

Sorry.  No change.  It is still reporting 9 posts today and there has only been one.  I went ahead and posted another test thread and it is reporting 10, so at least it is going up.


ModelerX.com - Post your models in the gallery and chat about 'em in the forums.  Building the largest online community of modelers with your help.

Back to the top
 
Posted
Rating:
#31330
Avatar

Sorry about this - I've edited my code post yet again.


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:
#31342
Avatar

Well-settled

Brilliant!  Thanks so much for the help as always, Chris.


ModelerX.com - Post your models in the gallery and chat about 'em in the forums.  Building the largest online community of modelers with your help.

Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: