Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Show only selected records in FrontEnd Collection 26 Jan 2012 01:50 #1089

  • iconvisual
  • iconvisual's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
Is there a way to have a Front End Collection Layout that only displays selected records from the SQL Select..
i.e. Showing a list of Properties (houses) I only want to show the ones that belong to the currently logged in User (jos_user.id) = landlord_id ??

Am I asking the wrong question?

Thank you,

Edward
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.

Please Log in or Create an account to join the conversation.

Last edit: by iconvisual. Reason: Need Further Information Please

Re: Show only selected records in FrontEnd Collection 26 Jan 2012 11:06 #1094

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Let's write inside.

TODO :
view.html.php :
$model->addWhere("a.landlord_id = " . (int)$user->id);
Coding is now a piece of cake
The following user(s) said Thank You: iconvisual

Please Log in or Create an account to join the conversation.

Re: Show only selected records in FrontEnd Collection 26 Jan 2012 11:41 #1096

  • iconvisual
  • iconvisual's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
Thank you Jocelyn. I appreciate your level of commitment and support.

Kind Regards,

Edward.
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.

Please Log in or Create an account to join the conversation.

Re: Show only selected records in FrontEnd Collection 23 Feb 2012 01:25 #1437

  • iconvisual
  • iconvisual's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
Hi Jocelyn,

Ok, finally got around to properly looking into this.. and I'm in view.html.php for com_easypropmgr, in views for properties, and I tried to insert:
$model->addWhere("a.landlord_id = " . (int)$user->id);

in function display_propertieslist($tpl = null) to no avail. Output still listed all properties.

I've looked, banged my head, sharpened my scissors, and am lost. Are you able to point out a little more specifically where I should add the WHERE clause?

Thank you kindly,

Edward.
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.

Please Log in or Create an account to join the conversation.

Re: Show only selected records in FrontEnd Collection 23 Feb 2012 05:55 #1438

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 132
  • Thank you received: 19
at my site works this:

in model folder
. $this->addWhere('`my_user` = ' . (int)$user->id)

and do not forget to check this:
$user =& JFactory::getUser();
The following user(s) said Thank You: admin, iconvisual, BTB300, edwardcox

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.087 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started