Page 1 of 2
Q: Global content block limit? - Centralizing numerical values.
Posted: Thu Jul 03, 2008 9:28 pm
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.)
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Thu Jul 03, 2008 11:06 pm
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.
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Fri Jul 04, 2008 7:22 am
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?
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Fri Jul 04, 2008 8:28 am
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:
would return 3.1416 with a csv like
just send me the relative url of the csv file, and dont forget to applaud me after its working

Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Fri Jul 04, 2008 8:36 am
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?
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Fri Jul 04, 2008 2:42 pm
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:
would return 3.1416 with a csv like
just send me the relative url of the csv file, and dont forget to applaud me after its working
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Sun Jul 06, 2008 9:14 pm
by mrmut
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.
Posted: Mon Jul 07, 2008 11:29 am
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.
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Mon Jul 07, 2008 3:26 pm
by Pierre M.
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Mon Jul 07, 2008 6:53 pm
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.
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Tue Jul 08, 2008 12:21 am
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!
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Fri Jul 11, 2008 1:06 pm
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!

Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Tue Jul 22, 2008 11:05 pm
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?
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Tue Jul 22, 2008 11:41 pm
by viebig
Well, I will think about sothing better, I´ll let you know!
Re: Q: Global content block limit? - Centralizing numerical values.
Posted: Wed Jul 23, 2008 7:52 am
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...