Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: [SOLVED] Future posting error  (Read 3984 times)

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
[SOLVED] Future posting error
« on: January 17, 2008, 04:43:09 pm »

Hi everybody,

When i post a new article and if i choose to enable the publish date (future posting) feature, then the article will appear on the articles content section, even if i have choosed a higher date than the current server time. The article is appearing only on the article content section, function center (), on the "Last posts" section will appear only at the righ time.

Please fix this bug. I am still working offline, my blog launch is very close.

Thanks :)
« Last Edit: January 18, 2008, 12:19:23 am by henrich »
Logged
By(e) Henrich :)
------------------------------
IT related blog

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: [BUG] Future posting error
« Reply #1 on: January 17, 2008, 08:38:54 pm »

Hmmm... you know... that's one function that I never really had any use for in the past. However... l did test it out (offline project installation) last week on one project... just setting the post-time for a couple minutes ahead... and it actually did wok. The article did not come visible until the exact future posting time... right to the second. Just to be sure... I tested it a few times... timed it with a stopwatch... and it worked every time.   :)

Has anyone else been using the "Future Posting Time" function with success... offline and/or online?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

stjepan

  • Full Member
  • ***
  • Karma: 3
  • Posts: 136
Re: [BUG] Future posting error
« Reply #2 on: January 17, 2008, 09:46:05 pm »

I use future posting every day for months now.  I usually write a story, two sometimes, a day before, set it to "Published" and set the date and time.  Last summer I had 10 stories on waiting and while I was enjoying the waves of the sea, every day one story was published. No problems at all.

I noticed a thing that I don't consider to be a bug: Sometimes when you edit an article that is already set for future posting, the "Publish article" become unchecked.  So, when I edit an "article of the future" I just check the box again. No big deal. 

Although I must admit that I didn't understand the problem perfectly...  It's my  #$%$%$#$  English....

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [BUG] Future posting error
« Reply #3 on: January 17, 2008, 09:57:46 pm »

Incredible :(

I'm going to be crazy :(

Here you have: http://img70.imageshack.us/img70/4536/timingjv3.gif

So, at 15:53 (server time), i posted that test article, enabling also the future posting feature to 15:55.

The article is appearing at the content, on the "newest posts" menu section not. Here will appear only at 15:55

My problem is that the article is appearing earlier on the normal homepage as it is planned with the enabled future posting.

Oh man :(
Logged
By(e) Henrich :)
------------------------------
IT related blog

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [BUG] Future posting error
« Reply #4 on: January 17, 2008, 09:59:42 pm »

Ah, one more thing, i like to build my sites from the minimal sNews for testing, this time i am working/building my blog, i started this time from the multilanguage package (ml.zip).
Logged
By(e) Henrich :)
------------------------------
IT related blog

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [BUG] Future posting error
« Reply #5 on: January 17, 2008, 11:19:24 pm »

FIXED:



Step 1. In the center() function find the next line:

Code: [Select]
$query_articles = "SELECT * FROM ".db('prefix')."articles WHERE $all AND SUBSTRING(position, 1, 1) != '2'";
Replace it to this:

Code: [Select]
$query_articles = "SELECT * FROM ".db('prefix')."articles WHERE published = 1 AND $all AND SUBSTRING(position, 1, 1) != '2'";
ADDED 2008 - 02 - 08
and add BEFORE it:

Code: [Select]
$all = $_SESSION[db('website').'Logged_In'] == token()?'published >= 0 ':'published = 1 ';
And if you are a dude like and building your site from sNews + ML created by Rui, then you need to change into this:

Code: [Select]
$query_articles = "SELECT * FROM ".db('prefix')."articles WHERE published = 1 AND $all AND SUBSTRING(position, 1, 1) != '2' AND lang='".$_SESSION[db('website').'lang']."'";
I am happy, happy, happy! After this day full with bugs.
« Last Edit: February 08, 2008, 10:02:45 am by henrich »
Logged
By(e) Henrich :)
------------------------------
IT related blog

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: [BUG] Future posting error
« Reply #6 on: January 17, 2008, 11:35:33 pm »

It's a pleasure to help you.

Congratulations for your first mod and your Ideia.

You deserve a karma
Logged
Need a Job on Europe. Linkdin - Facebook / Group

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [SOLVED] Future posting error
« Reply #7 on: January 18, 2008, 01:21:21 pm »

Rui, i have tested a lot even after the bug fix, and i find out that the articles in the content section are visible only if the user is logged in :) so i removed step 1, and the correct line will remain still the:

Code: [Select]
$all = $_SESSION[db('website').'Logged_In'] == token()?'published >= 0 ':'published = 1 ';
But the only one step above really fixes the problem. Thanks.
Logged
By(e) Henrich :)
------------------------------
IT related blog

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 381
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [SOLVED] Future posting error
« Reply #8 on: February 08, 2008, 10:03:53 am »

« Last Edit: February 08, 2008, 10:37:39 am by henrich »
Logged
By(e) Henrich :)
------------------------------
IT related blog