Code Generator > List Page: see only the records created by the user

14 posts by 3 authors in: Forums > CMS Builder
Last Post: June 24, 2023   (RSS)

By Deborah - June 12, 2023

Hi, Andreas.

I've not tried this myself, but the last post on the following forum thread might help.
https://www.interactivetools.com/forum/forum-posts.php?postNum=2245779#post2245779

Looks like basically this might do it:

'where' => mysql_escapef('createdByUserNum = ?', $CURRENT_USER['num']),

~ Deborah

By andreasml - June 12, 2023

Hi Deborah 

Thank you for your reply. 

It seems it works. 

  // load records from 'aortic_aneurysm_disease'
  list($aortic_aneurysm_diseaseRecords, $aortic_aneurysm_diseaseMetaData) = getRecords(array(
    'tableName'   => 'aortic_aneurysm_disease',
    'perPage'     => '10',
    'loadUploads' => false,
    'allowSearch' => true,
    'where' => mysql_escapef('createdByUserNum = ?', $CURRENT_USER['num']),
  ));

What about a search query to search within the file?

Kind regards, 

Andreas

By Deborah - June 13, 2023

Glad that worked for you, Andreas.

Depending on what you have in mind for search, one of these methods might work.

1) There's a variety of search methods in the CMS Builder documentation here:
https://www.interactivetools.com/docs/cmsbuilder/viewer_search.php

2) To search multiple tables on one page, you can try MultiSearch.php referred to in this forum post:
https://www.interactivetools.com/forum/forum-posts.php?postNum=2246137#post2246137
There's a download link to MultiSearch.php at the bottom of the second post.

Hope that helps!
~ Deborah

By andreasml - June 14, 2023

Thanks, Deborah

Unfortunately, I have not been able to manage it as I expected. I am thinking of adding some PHP code inside this list-page (already filtered to contain only records created by the logged in user) that will allow users to search within it using various criteria. Is there some code available?

Regards, 

Andreas

By Deborah - June 14, 2023

Andreas, I'm sorry to say I don't know of any pre-existing code.

Perhaps someone else reading this might have ideas or you could contact Interactive Tools consulting.

~ Deborah

By andreasml - June 14, 2023

Thanks anyway

By Dave - June 19, 2023

Andreas, 

There's some examples here for creating search fields: https://www.interactivetools.com/docs/cmsbuilder/viewer_search.php

What fields do you want to search on and what do you want it to look like? 

Dave Edis - Senior Developer
interactivetools.com

By andreasml - June 20, 2023

Hi Dave

Is there any available PHP code to make a simple search within my section list-page?

Regards, 

Andreas

By andreasml - June 20, 2023

Hi Dave

Is there any available PHP code to make a simple search within my section list-page?

Regards, 

Andreas