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.


Wiki+ custom posts' fields - db structure

Login / Search

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

Fan in training

Hi,

I'm experimenting OcPortal and it is very interesting.

My question is: is it possible to make statistics out of Wiki+ custom posts' fields?

I added few custom post fields, I used "a value from a set of radio buttons" in the field type, the values are numbers/integers from 1 to 5. I would like to know where these values are stored in the database and if it possible to make some simple operations like adding all up and find an median value. If it is theoretically possible then I can try to find a way to do it.

Thanks in advance!
Giulio
Back to the top
 
Posted
Rating:
#103400
Avatar

Community saint

I would say this is very possible. I haven't played around much with the Wiki+ and haven't done anything with the custom post fields, so I'm not certain of where any custom info or references to custom info would be stored. I can tell you that the posts themselves are referenced in the seedy_posts table (Wiki+ use to be called CEDI, proncounced seedy). The seedy_posts table has a column labeled the_message which contains an ID number for the post. You can look up that ID number in the id column of the translate table to get the content of the Wiki+ post. I would imagine the custom post fields would be stored similarly.

Once you know where to get the numbers from, you'll need to code up the db queries and do the math. To display the numbers on your site, you could put the query code, math code, and display code in a simple block. Here is some documentation on writing a block for ocPortal: 

http://ocportal.com/docs/tut_hardcore_1.htm

Since this simple block executes the code each time it loads, you will probably want to use some method to limit how often the queries run by caching the data in a custom db table or in a file. Or, if you plan on doing many other similar customisations, I would recommend studying the other tutorials at the bottom of the page in the 'See also' section at the link above (particularly the framework and code book links) and use an existing block as a model to create your own block and leverage the power of the built-in templating system and ocPortal API.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: