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.110 seconds

This is what you call a component builder. I was able to master using this in a very short time and the resulting component works like a charm. Not just a basic component builder but a fully working component builder with forms fields tables all ready to go. You can make the list and item views to display in the front and back end. Also there is a great forum just starting to evolve and I'm sure this will grow very rapidly when you all realise how good this tool is.
Kevin (JED)

         

Get Started