Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
AndyB
Worker
Worker



Joined: Jun 03, 2004
Posts: 231
Location: Torrevieja, Spain

PostPosted: Sat Apr 21, 2012 1:52 pm Reply with quote

Me again....... Embarassed

I need to add a LOT of articles to the archive on my site (about 2 years worth!)
When I submit the news, the date can be set to when it was released, but the homepage shows the news articles in the order they were submitted, as opposed to date.

Is it possible to change this, so they show by date order (the progaram story date)

Thanks.
 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Sat Apr 21, 2012 6:52 pm Reply with quote

Why not just put the story in a category other than articles and not publish it in home.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Sun Apr 22, 2012 8:09 am Reply with quote

Nuken's solution however will only work for when news is the module on the home page. The old articles block, last 5 articles etc. will still retrieve stories by the date they were posted. There is only one "time" field in the stories table and the field in there is a datetime field and it is calculated at the time the story is posted. There is no separate field for the "date of the story" as opposed to when it is submitted ... actually it is the date-time that it is posted that counts.

I'm not sure how you are adding these stories ... through the submit news or through add stories in news admin? If you have the old stories in a MYSQL table that's identical to nuke_stories and could write a conversion program that would preserve the old dates that would probably be the best approach.
 
View user's profile Send private message Visit poster's website
AndyB







PostPosted: Sun Apr 22, 2012 2:51 pm Reply with quote

through "submit news" in news admin. There was approximately 2 years when stuff wasn't added; I have "release dates" I can use to set the dates, so if I could add them and change the "publish from" date and get to order by that (considering the backlog) it would be advantageous. Yes, I could look into moving stuff into categories (everything is in articles with topics and it works ok for what I need) it would be great.....
 
fkelly







PostPosted: Sun Apr 22, 2012 3:19 pm Reply with quote

If you can just go into news administration (as opposed to submit news) and do "New Story" you will save yourself the hassle of going through submit news and then having to go into submissions and approve the article. Better yet, write a "batch program" to take your files and update the stories table. If you look at the postStory function in news/admin/index.php it has most of the logic you would need to update the stories table. You could extract that function to an ad hoc program and just loop through it once per story you want to add after filling the variables in the function parameter list from your input file. Of course, I would do this on a test version of the stories table first and make sure you have everything backed up.

If that's a bit much, you could put your stories in the way you are doing and use PHPmyadmin to adjust the date field on a story by story basis.
 
AndyB







PostPosted: Sun Apr 22, 2012 3:25 pm Reply with quote

Thanks. I do go into news administration (as opposed to submit news link) so it gives me more "control";

I didn't know if it was a "simple" change to the news module to show by "publish date" as opposed to submitted date, that was all Wink
 
fkelly







PostPosted: Sun Apr 22, 2012 4:09 pm Reply with quote

There is only one date and it is the publish date. It is calculated at the time the story is approved and posted. Really we should have several dates: the submitted date, the published date and the last-changed date in cases where the article is later edited.
 
AndyB







PostPosted: Sun Apr 22, 2012 4:14 pm Reply with quote

so, the date when the story is "released" so you can "plan" for a story to go "live"- which date is that?
 
fkelly







PostPosted: Sun Apr 22, 2012 4:39 pm Reply with quote

Quote:
so, the date when the story is "released" so you can "plan" for a story to go "live"- which date is that?


The only way to plan for a story to go live is through the autonews function. Stories that are "autonews" are put in the autonews table and have an effective date. Mainfile has a function named automated_news. It is constantly (on every page load) checking the autonews table. When the actual time equals or is less than the effective date in the autonews table, the story is posted to the stories table and deleted from the autonews table.

That is the only way that I know of to "release" a story and it is not available from submit news ... it is purely an administrative function.
 
AndyB







PostPosted: Sun Apr 22, 2012 4:56 pm Reply with quote

ah. OK. Understood.

So my options are; edit 500+ existing stories in "Articles" and place them in categories, then do all the "new" ones into categories also, only highlighting the most recent to show on the front page; (maybe editing their date in mysql to reflect)

OR upload all the "new" ones then change their dates in mysql...... a longer task than I anticipated!

Thanks for your feedback.

For a future version/ upgrade, is it possible to add a new column in the database and corresponding files for "publish date" that's different to existing set up? (I know that's not an easy task)

Just a thought....
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sun Apr 22, 2012 7:07 pm Reply with quote

I haven't looked at the News module for a while but it probably stores the date in UNIX timestamp, which isn't very human readable.
Another option might be to alter the 'edit' functions to make sure the SQL gets the data while it is grabbing the other data and populate a new form field with that. Then you would need to alter the save routine to update the timestamp. Probably pretty straightforward (he says with his fingers crossed) but not something I have the time to do right now.
 
View user's profile Send private message Send e-mail
fkelly







PostPosted: Sun Apr 22, 2012 8:20 pm Reply with quote

The field named "time" in the stories table is a datetime field. It shows in PHPmyadmin as for example "2004-09-14 11:50:48" so you could edit it there.

I am not sure this would work but you might look at the PHPmyadmin Import functions. I'm just thinking that if you had the stories you wanted to import in a spreadsheet and could edit the dates there you might be able to import them into your table.

Ummm ... well not exactly, looks like PHPmyadmin and MYSQL can import a CSV file. You might be able to export one out of a text editor or spreadsheet then import it that way (as CSV) into MYSQL. I'd definitely want to do this on a test system AND have a backup or even two of my "good" stories table before I had a run at this.
 
AndyB







PostPosted: Mon Apr 23, 2012 1:54 am Reply with quote

I've still got the test site I used to test the upgrade/ migration so I could always test it that way....

I'll have a think about it and decide the best option; one option (as suggested) is instead of using the articles category, create new categories (need to look into how categories/ topics/ etc. work and relate to each other)

I sometimes get the impression that the way I use *nuke* may differ to many others- I've not seen that many of late, other than "support" sites. (And Kudos/ thanks to everybody that does support the system- it's appreciated by many of us- and I'm guessing many aren't that "vocal") Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©