Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, April 18, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Formatting Question

phpMyEdit General     Formatting Question
Post new topic   Reply to topic    
 
Andrew     Joined: 11 Nov 2013   Posts: 5  
Post Posted: 2013-11-11 06:23
Back to top  Reply with quote     

I have a table generated by phpmyedit which is working fine. I have also developed a form that using a member's name, email and password (all items in the table), only that individual's record is displayed if the login entries are authenticated.

My question is that on the displayed page, there is an "X" visible right above the member's information that if clicked will display the contents of the entire table. How/where do I eliminate that "X" from being displayed. I have checked the css files, the table.php file and the phpmyedit.class.php file and have not been able to find out what generates the "X". Thanks in advance for your help.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2013-11-11 22:16
Back to top  Reply with quote     

see Special page elements
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.common-options.html#AEN179

Try this

$opts['display'] = array(
'query' => false,
'sort' => true,
'time' => true
);

 
Andrew     Joined: 11 Nov 2013   Posts: 5  
Post Posted: 2013-11-11 22:38
Back to top  Reply with quote     

doug wrote:
see Special page elements
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.common-options.html#AEN179

Try this

$opts['display'] = array(
'query' => false,
'sort' => true,
'time' => true
);


Thanks for the quick response Doug. Making the suggested change seems to work as the "X" is definitely eliminated.

In testing that, I now find that the "V" sign at the top of the display pulls up the search function and from there, the same "X" appears that displays the entire table if clicked. I don't know if any of the players would do that, but based on the information included, I don't want to take a chance. Do one of the display options you mention also cover this?

What I probably need is to eliminate the option to search from that screen as anyone would have access to pretty much everything if searched correctly.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2013-11-12 01:48
Back to top  Reply with quote     

Earlier I overlooked the fact that you need to make the user ID persistent between pages so the filter remains in effect. Use the Search feature to look for 'persist' examples. If the user ID (or email, etc.) associated with filter is not persistent then it's discarded if they click anything after their initial arrival.

// To persist one of *your* variables in GET/POST
// query strings, specify a key and a value as an array.

$opts['cgi']['persist'] = array('key' => $value);

// Persist $pageid

$opts['cgi']['persist'] = array('pageid' => $pageid);

// Persist 3 variables: $a, $b, and $c:

$opts['cgi']['persist'] = array('a' => $a, 'b' => $b, 'c' => $c);

// If your user session ID is set as $_SESSION['user_id'] then

if(!empty($_SESSION['user_id'])){

$opts['cgi']['persist'] = array('user_id' => $_SESSION['user_id']);

}

// Equivalent to the above, but using only 1 line.

$opts['cgi']['persist'] = isset($_SESSION['user_id']) ? array('user_id' => $_SESSION['user_id']) : array();

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2013-11-12 02:29
Back to top  Reply with quote     

In the example below, user levels are 0-9 and encoded. The principle may be applicable, not the code. Make adaptations for user ID instead of user level.

$user_level = base64_decode($_SESSION['user_level']);

switch($user_level)
{
Case 9: // super admin
$opts['options'] = 'ACPVDFL';
// no filter restriction
break;

Case 5: // website owner can't Add, coPy, or Delete records
$opts['options'] = 'CVFL';
$opts['filters'] .= ' AND PMEtable0.user_level <= "'.base64_decode($_SESSION['user_level']).'"';
break;

Case 0: // basic user
default:
$opts['cgi']['append']['PME_sys_fl'] = 0; // Search row OFF
$opts['filters'] .= ' AND PMEtable0.user_id = "'.base64_decode($_SESSION['user_id']).'" AND PMEtable0.active = "1"';
$opts['options'] = 'CV';
break;
}

 
Andrew     Joined: 11 Nov 2013   Posts: 5  
Post Posted: 2013-11-12 02:35
Back to top  Reply with quote     

doug wrote:
Earlier I overlooked the fact that you need to make the user ID persistent between pages so the filter remains in effect. Use the Search feature to look for 'persist' examples. If the user ID (or email, etc.) associated with filter is not persistent then it's discarded if they click anything after their initial arrival.

// To persist one of *your* variables in GET/POST
// query strings, specify a key and a value as an array.

$opts['cgi']['persist'] = array('key' => $value);

// Persist $pageid

$opts['cgi']['persist'] = array('pageid' => $pageid);

// Persist 3 variables: $a, $b, and $c:

$opts['cgi']['persist'] = array('a' => $a, 'b' => $b, 'c' => $c);

// If your user session ID is set as $_SESSION['user_id'] then

if(!empty($_SESSION['user_id'])){

$opts['cgi']['persist'] = array('user_id' => $_SESSION['user_id']);

}

// Equivalent to the above, but using only 1 line.

$opts['cgi']['persist'] = isset($_SESSION['user_id']) ? array('user_id' => $_SESSION['user_id']) : array();


I must have somehow given you the impression that I am much more knowledgeable about php than I am as I am pretty much lost in trying to figure out your suggestions Doug.

I did try to enter the session entry, but it did not change the display. Perhaps I am explaining myself incorrectly. As described in my first post, I have been able to pull information from a table for a specific person based on that person's name, email address and password included in the table. If you look at the image found at http://www.fredsfollies.com/phpmyedit/search.jpg you can see what is displayed right above the person's information and the "V" in the top left hand corner displays the image at http://www.fredsfollies.com/phpmyedit/search1.jpg when clicked. At that point, anyone clicking the "X" that is visible next to the "^" will display the contents of the entire table. What I need to do is eliminate the "V" in the left hand corner of image search.jpg. I have not been able to figure out if the suggestions you posted in your last post would fix this and if so how it is done.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2013-11-12 16:25
Back to top  Reply with quote     

If you want John Doe to see only records which belong to him, you need a log in system like that used by ecommerce sites. Users have an Id recorded in a session via session_start() ... Difficult for newbie to program. Users register, get assigned an I'd, their records are then filtered based on the Id looked up when they log in.

 
Andrew     Joined: 11 Nov 2013   Posts: 5  
Post Posted: 2013-11-12 17:44
Back to top  Reply with quote     

doug wrote:
If you want John Doe to see only records which belong to him, you need a log in system like that used by ecommerce sites. Users have an Id recorded in a session via session_start() ... Difficult for newbie to program. Users register, get assigned an I'd, their records are then filtered based on the Id looked up when they log in.


I've been able to do that...I can pull information for just one person. What I am trying to do is eliminate the buttons on the page that would allow that person to be able to see everyone's records.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2013-11-13 18:35
Back to top  Reply with quote     

There is no provision to eliminate buttons. If users are appropriately logged in *and* the filter implemented to restrict records by user id, user email address, etc, the buttons pose no problem. Post all related code, user login and session creation code and phpmyedit script. As you probably realize phpmyedit does not come with a user login system and this is something you must create yourself.

 
Andrew     Joined: 11 Nov 2013   Posts: 5  
Post Posted: 2013-11-13 19:31
Back to top  Reply with quote     

doug wrote:
There is no provision to eliminate buttons. If users are appropriately logged in *and* the filter implemented to restrict records by user id, user email address, etc, the buttons pose no problem. Post all related code, user login and session creation code and phpmyedit script. As you probably realize phpmyedit does not come with a user login system and this is something you must create yourself.


After all of this, I figured out how to accomplish what I wanted by merely eliminating the "F" from the $opts['options'] = 'ACVD'; and voila, the problem was resolved. I knew there was no way to eliminate the buttons, I just did not want them visible. Thanks for your help and what this did accomplish was that I know more about phpmyedit now than I did before I started this thread.

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy