Q: Global content block limit? - Centralizing numerical values.
Q: Global content block limit? - Centralizing numerical values.
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.)
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.)
Re: Q: Global content block limit? - Centralizing numerical 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.mrmut wrote: there will be thousands of such values
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
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
Re: Q: Global content block limit? - Centralizing numerical values.
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?
Also, - can you suggest whom I could ask to build me such a module/plugin?
Re: Q: Global content block limit? - Centralizing numerical values.
ask me :>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?
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'}/
Code: Select all
phi;3.1416
othervalue;50.135

Last edited by viebig on Fri Jul 04, 2008 8:38 am, edited 1 time in total.
Re: Q: Global content block limit? - Centralizing numerical values.
You need a plugin for viewing csv files?mrmut wrote: can you suggest whom I could ask to build me such a module/plugin?
Re: Q: Global content block limit? - Centralizing numerical values.
WOW!
Thanks!
I am writing you an email!
Thanks!

viebig wrote:ask me :>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?
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:
would return 3.1416 with a csv likeCode: Select all
{getnum 'phi'}/
just send me the relative url of the csv file, and dont forget to applaud me after its workingCode: Select all
phi;3.1416 othervalue;50.135
![]()
Re: Q: Global content block limit? - Centralizing numerical values.
Will post when I will have more about this plugin, currently it seems that this little thingy works well.
Re: Q: Global content block limit? - Centralizing numerical values.
ok, I developed a new plugin to mrmut, it´s simple, for example:
a csv file like
the values can be retrieved like:
would return "12"
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.
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
Code: Select all
{getval element="donk" value="age"}
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.
Re: Q: Global content block limit? - Centralizing numerical values.
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.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.
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
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
Re: Q: Global content block limit? - Centralizing numerical values.
ok, I promise that I will make it when I finish http://www.qual-melhor.com.br , I´m really stuck on some issues!kermit wrote: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.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.
Re: Q: Global content block limit? - Centralizing numerical values.
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!
viebig really did a great job!

(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!

Last edited by mrmut on Fri Jul 11, 2008 1:14 pm, edited 1 time in total.
Re: Q: Global content block limit? - Centralizing numerical values.
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?
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?
Re: Q: Global content block limit? - Centralizing numerical values.
Well, I will think about sothing better, I´ll let you know!
Re: Q: Global content block limit? - Centralizing numerical values.
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...
...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
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