smcCal with Coranto with phpBB3 (php) -- Recipe for Disaster

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

smcCal with Coranto with phpBB3 (php) -- Recipe for Disaster

Postby Jackanape » Fri Jun 27, 2008 2:18 pm

OK, long story short, I've been utilizing Coranto and phpBB over for years, and while they have operated together, they have not ever actually interacted. NOW, I want to find a way to change that.

For more than one reason.

Firstly, it's good for me, but secondly, it's great for the Coranto community, to find a way to get Coranto interacting with a system like phpBB...

Here's the skinny:

I've a site that requires a monthly scheduling system, that then gets displayed on a "calendar list". Because there are dozens of events each month, I worked up a php script that does the following:

    1) it displays each day of the coming month, with options for TWO events per day.
    2) Each option contains a series of fields (mostly pulldowns) allowing for each event to be populated.
    3) Once submitted, all events are in an array, which is manipulated a few times, and the schedule does a few things:
      a) Posts a list of events in the phpBB3 forums
      b) Creates a flatfile list of events for a separate page (flatfile so I could later go in and edit the contents with Coranto, if need be, but that didn't quite work out--separate story)
      c) Sorts events into a set of three (or more) locations, and outputs them in CSV format--to be manually converted to XSL format for final review--a separate file for each location.


Now, I'm determined to change the way things are output there, to an actual calendar format. While there are many apps put there written for php, and many that interact with phpBB3 itself, this seems like an opportune time to utilize a calendar software I'm familiar with, smcCal, and Coranto.

My main stumbling block, though, is how to take my php array, and submit it as separate Coranto news items for use with the calendar?

OF COURSE, I could always just enter each event separately, but that is NOT an option. As I've mentioned, with dozens of events per month, that is extremely time consuming, and a step back for me.

Anyone with any ideas of where to begin?

I was considering taking a look at newsgen, to see how the random events were posted, but I'm really quite simple when it comes to perl...

In my search, I've come across serialize() for php, and this method of moving data back and forth:
http://hurring.com/scott/code/perl/serialize/

Not sure if this is the right direction, but if it is, this could be a good breakthorough...thoughts?
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby SrNupsen » Fri Jun 27, 2008 10:03 pm

Provided you know exactly what you're doing (which I presume you do), couldn't you just spit the array out in separate lines directly to newsdat.txt? Or am I misunderstanding your problem?
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Jackanape » Sat Jun 28, 2008 6:05 am

SrNupsen wrote:Provided you know exactly what you're doing

Well, that's a dream of mine, but it sometimes seems more distant than I'd like...
couldn't you just spit the array out in separate lines directly to newsdat.txt? Or am I misunderstanding your problem?

I hadn't considered this, and it is worth looking at...but how would I make sure it belongs to my calendar profile?

This actually brings to mind one of the difficulties I had with the script I mentioned above:
b) Creates a flatfile list of events for a separate page (flatfile so I could later go in and edit the contents with Coranto, if need be, but that didn't quite work out--separate story)

I was able to generate the flatfiles with php, but Coranto was reading them as whatever was entered via Coranto ONLY...but perhaps this was due to my NOT adding the data to newsdat.txt? hmmmm....
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Jackanape » Sat Jun 28, 2008 4:44 pm

Well, I took a stroll through my code today, and my suspicions above are verified.

It wasn't enough to create a flatfile dB with the php script, and then direct Coranto to the file for editing. (I'm not sure why this didn't occur to me when I was doing it, but there you have it.) Since the php script never inserted the same data as a Coranto news item into newsdat.txt, I COULDN'T edit the files in Coranto--without a long cut and paste procedure that defeated the whole concept.

So, as this all applies to my problem above, I need to figure out how to bridge this gap by inserting into/updating newsdat.txt with php. I think you had the right idea, Nupsen, in that writing directly to the file is the ultimate answer, but I would most certainly need to be able to generate the correct format to work with Coranto, and ultimately, the Calendar.


So, first:

1) Do I need to generate the newsid in any specific way, or will Coranto find it regardless, so long as I include it in both the profile.txt file, and newsdat.txt?

2) To dissect a news entry:
Main Site Menu``xJack_Benny``x``xEEAyAEyuppOkcssROh``x1196916400``xmain_menu``x80041114525448``x

obviously, "``x" is my delimiter, and the newsid is followed by the timestamp, followed by the category. What is the next set of numbers, before the news text itself?

3) Next, I'll need to be able to just replace a single line in newsdat, but that should be relatively easy...just need to alter a bit of what I already have there...

Any and all help always appreciated!
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby SrNupsen » Sun Jun 29, 2008 9:33 pm

1) Coranto will use whatever newsid you put into newsdat.txt. But beware: You are then responsible for making all newsid unique ones. If two of them should ever, ever be the same, I imagine you will get into some serious trouble.

2) Looks like a XMultisubmit profile ID to me. You should be able to track it down inside nsettings.cgi

3) Read it in, replace the line, write it out. No problem :D
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Customization

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests

cron