![]() |
Admin 2/26/2011 |
global keyword means you refer to the variable defined earlier. $strTableName is defined for each table page and you don't need to do anything else. |
E
|
electromotive 2/27/2011 |
I took this from the manual. I'm just trying to learn how to use Code Snippets. I'm only showing the part that's giving me trouble. On my Customer list page Edit Screen, I placed the following code snippet on the detail line. (I'm using PHPRunner 5.3 and Microsoft Access for this database.) global $dal, $strTableName; if ($_SESSION[$strTableName."_masterkey1"]) // This test always returns false. How can I make it true? My 1st Question: Do I need to set $strTableName to something like table "Customer" or should it already initialized to the List page Customer Table? My 2nd Question: Is _masterkey1 supposed to be substituted with my own key name like "CustomerNumber" or is it some kind of global substitute for my key already set for the current Session? The manual only says to replace table name in the example. It doesn't say anything about $strTableName or "_masterkey1". ANY help appreciated!
|
L
|
LarryM author 2/28/2011 |
$strTableName will always be defined as the table you are editing. You could just say $_SESSION["mytable_masterkey1"], however when you reused this code snippet for other tables, you'll have to change your statement. Using $strTableName makes this part of the snippet reusable. From the manual, $_SESSION[$strTableName."_masterkey1"] refers to the "Master table foreign key values". $_SESSION[$strTableName."_masterkey1"] will be defined if the table in this edit is being accessed as a detail table. So the if statement is saying - are you editing a detail table (via a detail link)? (Or directly editing the table.) There may be more than one master table in your schema. $_SESSION[$strTableName."_mastertable"], if defined, says which master is in effect. If the table in this edit will never be a detail table, then it will always be false and you don't need to use this.
|
![]() |
Admin 2/28/2011 |
You cannot access key values from code snippet. |
E
|
electromotive 3/1/2011 |
Thanks very much for your explanation. I'm starting to catch on a little BUT how does one go about finding out what values are set where? It would be so much simpler if I could see this. The manual doesn't give much help, at least I haven't found, that tells what variables I can use to access things except for the short code sippits. For example, I'm working in the Edit Screen on of a List page of My customer table. Say I want to retrieve the key of the current record being listed so that I can access another table to list some detail underneath the current Customer record line. How can I retrieve that key? (in a code snippet) I've tried $Data["CUSTOMERNUMBER"], $Values["CUSTOMERNUMER"]. Nothing seems to work. I even tried printing the $_SESSION["USERID"] thinking that would surely be initialized, but it wasn't. I did finally figure out from the manual that I could set USERID in the after login event. I know once I catch on to where stuff is set, I can figure out the rest. Do I look in the actual code to find this info? Can you tell me what area? Thanks!
|
L
|
LarryM author 3/2/2011 |
I would like to inform you that I am not a complete novice. I have been programming for many years. I am pretty new to and learning PHP, Java Script, CSS, JQuery, and web programming, (need to add AJAX soon) but I am very accustomed to working with queries, keys, pointers, APIs, other DLL objects, etc in 'C' and various versions of BASIC, 'Power Basic, Access Basic and a few other languages now outdated languages. |
E
|
electromotive 3/2/2011 |
Sorry about pitching my response too general, I was just thinking more about the dozens of others that will be reading this thread over the coming year. So please substitute my references to novice with "PHPR Newbie" <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=56838&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> |
L
|
LarryM author 3/2/2011 |
Agreed, I am a PHPR Newbie, and if you get that book put together, I'll put in my order now for the first copy! I would say it should bring about $125.00++ per copy! By the way, they could pull in some extra cash by putting out a printed copy of the current manual which should bring about $50.00 per copy. How about a poll? How many would buy a really good programmers manual for PHPR? |
![]() |
Admin 3/3/2011 |
If you need to access fields content on the List page set 'View as' type of one of those fields to 'Custom'. You can access any field value as $data["FieldName"]. Here are code samples: http://xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm |
L
|
LarryM author 3/3/2011 |
THANK YOU ! This is what I was looking for! |
E
|
electromotive 3/5/2011 |
Agreed, I am a PHPR Newbie, and if you get that book put together, I'll put in my order now for the first copy! I would say it should bring about $125.00++ per copy! By the way, they could pull in some extra cash by putting out a printed copy of the current manual which should bring about $50.00 per copy. How about a poll? How many would buy a really good programmers manual for PHPR? I think PHPR is a slick enough product to be considered by serious programmers, IF, they make the inner workings more understandable. Just look at Drupal, they appear to be doing okay. I've already purchased 3 of their books.
|
![]() |
Admin 3/6/2011 |
LarryM, electro rick, |
E
|
electromotive 3/6/2011 |
LarryM, electro rick, can you shed some light on what "Customizing PHPR - The Complete Guide with Examples" should cover? Is that a repackage of existing manual and tutorials or something totally new? Any practical examples or books we can check?
|
![]() |
Admin 3/10/2011 |
electro rick, |
E
|
electromotive 3/12/2011 |
electro rick, wow, I'm really impressed. I really like the way you think. I have a few thoughts about this. Writing this kind of book will require a real writer. Someone with technical experience, someone who can explain things the way most people would understand. Another thing - in web development world everything changes fast. PHPRunner changes fast. Its inevitable that some chapters become obsolete or need to be updated once PHPRunner 6 is released. This means some additional work on the way. It also needs to stay in sync with the manual, tutorials and other materials. I'm thinking about some kind of online book or well-structured wiki that everyone can edit and extend. It would make sense to create the initial set of charters/pages so people can start pasting stuff from the manual, forums, articles, blog etc. This way we can involve as many bright minds as possible and always have up to date guide. Does this make any sense?
|
D
|
dicksdo 4/14/2011 |
I read this thread following Sergey's emailed newsletter and as a potential customer for a printed PHP/ASP Runner book please permit me to make a few non technical observations. |
E
|
electromotive 4/16/2011 |
One of the things I really liked about many of the large PHP open source projects like Drupal and Coppermine, is that you could get your project running using just configuration, and then extend it using the extensive developer and third-party contributed plug-ins or add-on libraries which extended core functionality. They come with installation scripts, been deployed in just about every environment. Rarely any actual coding required, don't need to know what PHP, CSS or Javascript is in order to use these packages. |
P
|
procheck 4/18/2011 |
Here's my 2 cents. We're obviously dealing with people of varying experiences. I come from a mainframe world where nothing is easy and the manuals are worse. IBM will give you all the reference you can read but no examples. That's my impression of Wiki's. Too many links to this and that and you have an unusable manual because you can get so deep in the links that you don't know where you started or some real "good ones" that have you running around in circles. |
K
|
kenlyle 4/29/2011 |
Maybe the answer is a PHPR project based on the Members and Store templates. It should be possible for authors to sell subscriptions to their works...seems to solve a lot of the issues, and to serve as a way to push those two templates forward, as well as useful as a tutorial, if the actual development decisions are documented. |