Q: Global content block limit? - Centralizing numerical values.

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
mrmut
Forum Members
Forum Members
Posts: 33
Joined: Sun Jun 01, 2008 8:42 pm

Q: Global content block limit? - Centralizing numerical values.

Post by mrmut »

Hi people,

  a question related to global content blocks.

  Scenario is next: I am about to build a site that will heavily rely on numerical values that will be used on several places in text, in tables, etc. It is extremely important that those values are always up to date, so it seems logical to me to have centralised store for them. Are Global content blocks a good solution for those (as there will be thousands of such values)? Or is there some other plug in that does that in a centralized way? - For example, call number 1123 that is actually a Value of Heat for Gesundheit for person Valiant with something like: {NumCall:VHG-Valiant}?


Thanks a lot.

Please understand that I am not a programmer but XHTML/CSS designer, so I struggle hard with such stuff. I got the basics of logic for CMSMS Smarty menus, but more from that I really know only peanuts. (That's the reason I use CMSMS, it is conceived so wonderfully beautiful and orientated especially towards web makers.)
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Q: Global content block limit? - Centralizing numerical values.

Post by kermit »

mrmut wrote: there will be thousands of such values
thousands?  may be better with a module or plugin (udt) that pulls the value you want out of a database, or perhaps a csv formatted file if it's small enough data. wading through a thousand global_content blocks to find the one in particular you want to edit would be a tedious nightmare.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
mrmut
Forum Members
Forum Members
Posts: 33
Joined: Sun Jun 01, 2008 8:42 pm

Re: Q: Global content block limit? - Centralizing numerical values.

Post by mrmut »

Thank you on a reply; do you know how many is "not much" for CSV (in thousands of values) to be used in conduction with some tool?

Also, - can you suggest whom I could ask to build me such a module/plugin?
viebig

Re: Q: Global content block limit? - Centralizing numerical values.

Post by viebig »

mrmut wrote: Thank you on a reply; do you know how many is "not much" for CSV (in thousands of values) to be used in conduction with some tool?

Also, - can you suggest whom I could ask to build me such a module/plugin?
ask me :>

i think csv can handle the thousands you need, and csv is easier to update than a database, you can just upload a new file or edit it

I can do it in 10 minutes, using a tag to parse a cvs and return the correct value like:

Code: Select all

{getnum 'phi'}/
would return 3.1416 with a csv like

Code: Select all

phi;3.1416
othervalue;50.135
just send me the relative url of the csv file, and dont forget to applaud me after its working  ;D
Last edited by viebig on Fri Jul 04, 2008 8:38 am, edited 1 time in total.
cyberman

Re: Q: Global content block limit? - Centralizing numerical values.

Post by cyberman »

mrmut wrote: can you suggest whom I could ask to build me such a module/plugin?
You need a plugin for viewing csv files?
mrmut
Forum Members
Forum Members
Posts: 33
Joined: Sun Jun 01, 2008 8:42 pm

Re: Q: Global content block limit? - Centralizing numerical values.

Post by mrmut »

WOW!

Thanks! :) I am writing you an email!



viebig wrote:
mrmut wrote: Thank you on a reply; do you know how many is "not much" for CSV (in thousands of values) to be used in conduction with some tool?

Also, - can you suggest whom I could ask to build me such a module/plugin?
ask me :>

i think csv can handle the thousands you need, and csv is easier to update than a database, you can just upload a new file or edit it

I can do it in 10 minutes, using a tag to parse a cvs and return the correct value like:

Code: Select all

{getnum 'phi'}/
would return 3.1416 with a csv like

Code: Select all

phi;3.1416
othervalue;50.135
just send me the relative url of the csv file, and dont forget to applaud me after its working  ;D
mrmut
Forum Members
Forum Members
Posts: 33
Joined: Sun Jun 01, 2008 8:42 pm

Re: Q: Global content block limit? - Centralizing numerical values.

Post by mrmut »

Will post when I will have more about this plugin, currently it seems that this little thingy works well.
viebig

Re: Q: Global content block limit? - Centralizing numerical values.

Post by viebig »

ok, I developed a new plugin to mrmut, it´s simple, for example:

a csv file like

Code: Select all

username, name, email, age
donk, Don Kiney, kiney@aol.com, 12
mario, Super Mario, mario@nintendo.com, 22
the values can be retrieved like:

Code: Select all

{getval element="donk" value="age"}
would return "12"

Code: Select all

{getval element="mario" value="email"}

would return "mario@nintendo.com"

Currently the CSV url is hardcoded into function.getval.php

If you guys think a plugin like that is interesting, I will publish a better version, that can suit many cases.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Q: Global content block limit? - Centralizing numerical values.

Post by kermit »

viebig wrote: Currently the CSV url is hardcoded into function.getval.php

If you guys think a plugin like that is interesting, I will publish a better version, that can suit many cases.
it would probably be of interest to some people here... suggestion for the hardcoding of the filename... if you make it a UDT, it would be editable from the back-end; and you could add a param for a filename to override that default.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
viebig

Re: Q: Global content block limit? - Centralizing numerical values.

Post by viebig »

kermit wrote:
viebig wrote: Currently the CSV url is hardcoded into function.getval.php

If you guys think a plugin like that is interesting, I will publish a better version, that can suit many cases.
it would probably be of interest to some people here... suggestion for the hardcoding of the filename... if you make it a UDT, it would be editable from the back-end; and you could add a param for a filename to override that default.
ok, I promise that I will make it when I finish http://www.qual-melhor.com.br , I´m really stuck on some issues!
mrmut
Forum Members
Forum Members
Posts: 33
Joined: Sun Jun 01, 2008 8:42 pm

Re: Q: Global content block limit? - Centralizing numerical values.

Post by mrmut »

Well, from what I can see the plugin works really well, on two different setups, and it seems to me that PHP reads CSV according to all the CSV file standards.

viebig really did a great job! :) Thanks a lot!

(OT: Also, that 12 strings guitar + strange violin video rocks!)


Now, how this thingy could be improved? - Well, the fact is this little thingy does work great this way anyhow, but the module version might be an improvement, from the user experience side.

What came to my mind is a simple module with an option to insert path to a CSV file + option to load CSV file in a simple text box so you can edit or view it.

What is also worth noticing, - the speed of the plugin is remarkable, the page time practically solely depends on the sole CMS speed. I still don't know how it will work in a real world, but we will see. I will try to post an example file soon.


Again, thanks a lot for your time viebig!  ;D
Last edited by mrmut on Fri Jul 11, 2008 1:14 pm, edited 1 time in total.
mrmut
Forum Members
Forum Members
Posts: 33
Joined: Sun Jun 01, 2008 8:42 pm

Re: Q: Global content block limit? - Centralizing numerical values.

Post by mrmut »

HUGE PERFOMANCE DROP!

I have created first beta of my outstandingly complex table, with 590 calls to Getval function, from CSV file with only portion of data filled in (size 4.33kb) which result in 9 seconds of content generation.


example: http://pse.pbf.hr/cms/
CSV:  http://www.pse.pbf.hr/val.csv


Now... The server is dual core dual CPU Opteron with 8GB of RAM, running on 10k SAS RAID 5EE array, and there are practically no memory limits for PHP.

The current state of the plugin is such that it can be used for content generation, or maybe called for a few values, but heavyweight usage is out of the question.

Is there a way to call CSV file only once into the array per page load?
viebig

Re: Q: Global content block limit? - Centralizing numerical values.

Post by viebig »

Well, I will think about sothing better, I´ll let you know!
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: Q: Global content block limit? - Centralizing numerical values.

Post by kermit »

i wasn't aware that you were going to use 'whatever-was-come-up-with' to fill-in a table that contains the *entire* csv, one bit of data (field) at a time, when i suggested csv as a possible solution...

...csv is still viable, but you need to cut down on how many times a tag is called that reads the csv... maybe by having a tag read the entire csv into array and then generate the whole (periodic) table in one shot...
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Post Reply

Return to “CMSMS Core”