| Author |
Message |
data_art
MD user level 5


Joined: June 27, 2004
Posts: 58
Member
|
 Posted:
Sep 20, 2005 - 06:18 AM |
|
|
Yes! I finally got the template module to work for me - now for the task of understanding it...
Although I'm quite familiar with the PHP Syntax I see in PHP books, the code in this module is far more Object-Oriented than what I normally see. It appears that all of the code displayed results from implementations of the pnHTML class.
So, at least two things are going on here: implementations of the pnHTML class are being used for the display of output, and the pnAPI is being used for database access/security/core MD-Pro functions. I don't see the places for custom uses of the API yet...still working on it. |
|
|
|
 |
Lobos
MD user level 3


Joined: Sep 22, 2003
Posts: 37
bannato
|
 Posted:
Sep 21, 2005 - 07:24 AM |
|
|
Hey man, did you try that module I made? It uses html templating instead of pnHTML - have a play with it and you will soon understand what is going on... |
|
|
|
 |
dmiranda
MD Staff


Joined: Dec 07, 2003
Posts: 768
Location: Kenya
bannato
|
 Posted:
Sep 21, 2005 - 07:39 AM |
|
|
|
|
 |
Lobos
MD user level 3


Joined: Sep 22, 2003
Posts: 37
bannato
|
 Posted:
Sep 22, 2005 - 02:41 PM |
|
|
Yes I did put the news as soon as I finished it, but it got lost - Max found it and posted though so it is there now.
-Lobos |
|
|
|
 |
dmiranda
MD Staff


Joined: Dec 07, 2003
Posts: 768
Location: Kenya
bannato
|
 Posted:
Sep 22, 2005 - 04:00 PM |
|
|
|
|
 |
data_art
MD user level 5


Joined: June 27, 2004
Posts: 58
bannato
|
 Posted:
Sep 23, 2005 - 02:09 AM |
|
| Post subject: Lobos! |
|
|
 |
PeteBest
MD user level 5


Joined: Oct 06, 2003
Posts: 4845
bannato
|
 Posted:
Sep 23, 2005 - 04:16 AM |
|
|
I don't think nvRender has any function for users. It's just a module generator and SmartyLite distribution, so only admin users need to be able to access it |
_________________ Retired from official MAXdev duties |
|
|
 |
data_art
MD user level 5


Joined: June 27, 2004
Posts: 58
bannato
|
 Posted:
Sep 23, 2005 - 04:22 AM |
|
| Post subject: Aahh... |
I get the same result as an admin. |
|
|
|
 |
PeteBest
MD user level 5


Joined: Oct 06, 2003
Posts: 4845
bannato
|
 Posted:
Sep 23, 2005 - 04:28 AM |
|
|
Check to make sure you uploaded it correctly. From the error above it looks like it can't find or access modules/nvRender/pnlibrary/smarty_lite/class.template.php may be exactly the same problem file with the admin area as well then
I've tested it with MD-Pro 1.0.74 and not experienced any problems |
_________________ Retired from official MAXdev duties |
|
|
 |
data_art
MD user level 5


Joined: June 27, 2004
Posts: 58
bannato
|
 Posted:
Sep 24, 2005 - 02:10 AM |
|
| Post subject: Thanks LOBOS!! |
This module now works. It's AWESOME. My mind is spinning as I contemplate the potential. |
|
|
|
 |
Lobos
MD user level 3


Joined: Sep 22, 2003
Posts: 37
bannato
|
 Posted:
Sep 25, 2005 - 03:08 AM |
|
|
@data_art, Glad you like it - it was made special for people like you, ie those that can do some php, but haven't got the time to learn the intricacies of getting a module to install, etc, etc. Man it took me so much trial and error just to understand how pnAPI compliant modules work... be glad that you don't have to go through this process too LOL
@Pete, thanks for testing - I haven't had much feedback on the mod, so I am hoping it works as it is supposed to - have you encountered any problems, any suggestions on how it could be better? This goes for you as well, @data_art - feel free to make some suggestions!
-Lobos |
|
|
|
 |
data_art
MD user level 5


Joined: June 27, 2004
Posts: 58
bannato
|
 Posted:
Sep 27, 2005 - 02:18 AM |
|
| Post subject: PHP Classes |
Lobos -
Do I apply my php classes to the template? For example:
class grid($rows, $cols) {
var $r = $rows;
$c = $cols;
function grid_function() {
// this is one of the grid functions
for($a; $a<($r+1); $a++) {
echo "<td>$a</td>";
}
}
return grid_function(return_value);
} |
|
|
|
 |
data_art
MD user level 5


Joined: June 27, 2004
Posts: 58
bannato
|
 Posted:
Sep 28, 2005 - 03:54 AM |
|
| Post subject: LOBOS! I'm SO CLOSE!! |
pnuserapi.php:
I added this function:
for($a=1; $a<9; $a++) {
$amortization = array($a => array('month' => $a, 'calculation' =>'123-1234')));
}
However, only $amortization[8] shows up on the output. How do I get this for loop (the iterated contents of the $amortization array) to show up on the output?
http://dougfranklin.com/index.php?module=DougModule2&func=main |
|
|
|
 |
data_art
MD user level 5


Joined: June 27, 2004
Posts: 58
bannato
|
 Posted:
Oct 01, 2005 - 02:06 AM |
|
| Post subject: Lobos' Module that makes modules... |
At first, I was skeptical. "Why would I want someone else's prefab module that doesn't necessarily do what I want?", I thought. Wow...was I wrong. This module is truly awesome.
Lobos, may I contribute to the documentation? |
|
|
|
 |
fabien
MD user level 1


Joined: Sep 16, 2005
Posts: 13
Location: Shanghai
bannato
|
 Posted:
Oct 04, 2005 - 06:26 PM |
|
|
Ok...
I'm nearly done with writting requirements so I have started to check on the technical part, that is to say MD-Pro module building.
To say it simply, for someone who does not come from the CMS world it is a bit hard.
What I understood is :
MD-Pro is a CMS. The goal of CMS is to build a common infrastructure to build on top of it in order to mainly share the same visual interface, share user database and other properties/behavior.
In order to do so people who want to build modules (additionnal CMS functionnalities) use functions from the API to properly interact with the "core", they can also use API functions for utility purpose.
In order to separate presentation from business logic the CMS use a template system. Templates embed business logic results inside of presentation code. Thanks to this layer the site can have a common presentation.
First question of course : Did I get it right ?
Then : What does the core really provide outside of user management ? (I didn't found any schema explaining that)
How to properly interact with the core ? (I think here also a nice schema with step by step interaction, like handshaking procedure, could REALLY help)
Why is there so many templating system out there ? Why don't we use XML/XSLT ? I mean regarding templating XSLT looks really powerful and adapted for me.
Is it a good idea to build the tables, business logic, etc... without thinking at all about MD-Pro then integrate this as a module later ? (if everything is done properly, meaning clean functions/class separation)
By the way I tried to play with Lobos nvRender module but I got this error :
Fatal error: TPL: [in line 0]: syntax error: file 'user_main.htm' does not exist in /hsphere/local/home/shanghai/shanghaiexpat.net/modules/nvRender/pnlibr ary/smarty_lite/class.template.php on line 457
I checked my ftp log and every files are there. I installed the module and everything went smoothly.
I am trying to acess it through http://shanghaiexpat.net/admin.php?module=nvRender
I tryed to check the module docs but all I could found was Smarty-light docs.
Also, do I need to use Smarty-light to "enjoy" nvRender or could I use something else like Bender (I don't really know why I should use this template thing instead of this one but it looks like my boss prefer this one...).
Ok so I think I cover a bit of everything here. Please DO answer with RTFM if the answer is in there but just point me to the right direction (i.e. use a link).
I understand if it's crystal clear for you but for a newcomer I have to say it's a bit messy  |
|
|
|
 |
|
|