A quick article on how to use the where clause in a joomla database query.
In response to a member, I use the old form where I can include the whole SQL statement:
- $db->query('SELECT * FROM #__myTable WHERE condition1=true or condition2=true')
Method #1 - chain:
Somebody said I could pay to get an export list of my Joomla users. I said Joomla is a FREE OpenSource system, why?
I want to move a client's list of Joomla users to a new system which allows the passwords to be in MD5. All I want is a quick bit of code to get all the users out of a Joomla CMS.
I could just type a query on the database and get the same result, but this script was more fun. Simply create a text file with the following code and upload it to the root of your Joomla website. Access the page from a browser and you should get all your users listed... For security reasons, delete the file after you have used it.
IT IS A SERIOUSLY BAD IDEA TO LEAVE THIS FILE ON YOUR WEBSITE FOR ANYONE TO ACCESS!!! DELETE IT AFTER USE.
- Joomla CMS v2.5.14
This article is a note on how I fixed an issue on a client site. The website had a redirect on the login which would go to a page accessible by "registered" users but only "Super Users" could actually login. "Registered" users would not be able to login, despite their status in the admin panel saying "enabled" and "activated" (not blocked).
If I used a test account, none of the Joomla groups, not even "Administrators" could login. However set the same test account to a "Super User" and they would be able to login. Was the problem authentication? Restricted access to a component? A load of blab on ACL managers?
In our case, the website had recently been migrated from Joomla 1.5.x to 2.5.x. I asked to examine the database and a quick scan in the assets table revealed 3 assets had the parent_id = 0. Only one asset can have that and that is "root".
This is a quick note on one reason you may get the above error in a Joomla CMS environment.
- Call to a member function mark() on a non-object in /public_html/index.php
Not really a solution here because this is indicating that the system can't find the core framework files. Yes the bad news is you have lost your site. The good news is that it's only the core files and component files. Here are some tips when restoring the site to return it to as it was.
I'm writing a Joomla 2.5.x component for logging time and projects and need a dropdown to have selectable options restricted to the logged-in user. This is specified in the XML file of the custom Joomla component and needs some SQL dependent on some dynamic variables.
In Joomla, the XML type of "sql" is extremely limited. The component I'm making has to ensure user's can only see their own projects and not everyone's:
- SELECT * FROM #__projects ORDER BY name
- -- yields all projects irrespective of which user is logged in
- SELECT * FROM #__projects WHERE user_id=<logged_in_user> ORDER BY name
Please Note: This article focuses on a front-end form dropdown. If you would like to see how to do modals for the admin panel, see my article Joomla article modal with clear button for Joomla article selection.
Thank You! :c)