My first DW Anything module
Ответ
Task
We need to display list of active users from Joomla! database.
Solution
Set the DW Anything module settings as follows.
Setting | Value | Description |
---|---|---|
SQL Query |
SELECT `id`, `name` FROM `#__users` WHERE NOT `block` |
Enter SQL query to retreive the list of user names from Joomla! users table. Note that you can use standard Joomla! '#_' prefix for database table names |
Header HTML |
<ul> |
Enter HTML code to display before the resulting list of data rows |
Template |
<li>User #{id}: {name}</li> |
Enter HTML code to display each data row returned by SQL query. To insert data field, type it's name enclosed within curly barckets ({}) |
Footer HTML |
</ul> |
Enter HTML code to display after the resulting list of data rows |
Result
- User #62: Administrator
- User #63: John
- User #64: Mary
Комментарии
select * from #_users
thanks¡¡
Please find an example of how to display MySQL query results in a table here.
Also, please remember to use the correct prefix for a table name in your SQL query which makes #__users (double underscores) in your case.
How do I modify for this to show records for the current user who is logged in? e.g.
Note: Not ALL logged in users, just the user who is currently viewing this query/result...
To get the list of users currently logged in, please look at the #__session table in your Joomla! database.
There is no way to get the list of users viewing particular page.
Example:(Does not work)
SELECT * FROM jos_orders WHERE 'email' = $email
Use the literal value instead:
SELECT * FROM `jos_orders` WHERE `email` = 'exampleexample.com'
Also, be sure to use correct quotes for column names and values (see the example above).
I have question.
How can I process the query:
SET @rows_count = NULL;#
SELECT Club, W + D + L AS Games_Played, W, D, L, W *3 + D *1 AS Points, @rows_count := IFNULL(@rows_co unt, 0) + 1 AS rank from score ORDER BY Points DESC, Games_Played
I have checked it in phpmyadmin, and the query is working, but is not working in DW Anything.
I guess it's the following line that is the problem:
SET @rows_count = NULL;#
Hope you can fix it?
Best regards,
Emil
Thanks for your interest in DW Anything module!
Unfortunately, the 1.01 version does not support multiple SQL queries, so the error will occur whenever the semicolon (;) character is found in SQL Query value.
I've put the feature to process multiple SQL queries in the request list, so it could be implemented in one of the future DW Anything versions.
To stay informed, subscribe to our Joomla! extensions news using the subscription form you'll find below.
To show line breaks, you have to replace the line break characters with HTML <br/> tags.
Example:
Код:
SELECT REPLACE(`text`, "\n", '<br/>') AS `text` FROM `_text_table`
I have the query like 'select * from users where id='.
I would like my users to click a URL link inside an article and onclick the DWAnything module will be invoked and the value of to be passed to the module to be used in the where clause.
Can this be done?
DW Anything v 1.01 does not support including the URL parameters in the SQL query.
This feature could be implemented in future versions.
To be informed, you can subscribe to our Joomla! extensions news. Please find the subscription form below.
Цитата: This way, you can access any scalar value passed through HTTP reuqest.
I would be very grateful for any advice you can give
DW Anything 2.x could cause errors on some Joomla! installations. Working to fix it.
If you get errors, please try installing DW Anything 1.x back.
I've been wanting to thank you and tell you this for some time, but dashed if I can get the right captcha, and getting the wrong one deletes my gratitude!
Your captcha is OK, your comment was just waiting for approvement.
To view DW Anything module results, you need to publish your module in any module position you like. No menu link required.
If you would like to include the module results in an article, you should look for some plugin to do this.
We cannot recommend you one or another, but http://extensions.joomla.org/extensions/core-enhancements/embed-a-include section at Joomla! Extensions Directory will be a good starting point for you.
E. g., according to description provided, Modules Anywhere plugin should fit for your needs.
is it possible to show just 1 entry randomly?
Thanks in adanve and
Best Regards
Yes, it is possible.
Add ORDER BY RAND() LIMIT 1 to your MySQL query.
Example:
SELECT `id`, `name` FROM `#__users` WHERE NOT `block` ORDER BY RAND() LIMIT 1
for example his name etc.
select 'name' from 'jos_users' where username=$this->get($this->username)
???????????
DW Anything version 1.02 cannot access current user data.
Цитата: This way, you can access any scalar property of JUser class object for the user currently logged in to Joomla! front end.
is it possible to add the result in an acticle with an macro and not inside an module?
You can include DW Anything (as well as any other module) in your article text using the {loadposition position_name} tag.
Just publish DW Anything in module position position_name and include the above tag anywhere in your article text.
Also, you may find helpful the comment above about the third-party extensions you can use to embed modules.
I created a blank article with only a query, so on the web page the actual query is being displayed and not the results.
Please help
You need to publish DW Anything on your site's page and set the query and template in module parameters.
You don't need to put any queries in your article!
Sorry for delay with reply.
{site}
{name}
Unfortunately, I cannot see your template code because comments on this site do not support HTML, but yes, DW Anything can be used with any HTML-tags icluding anchor.
Just be sure to use the correct column names as DW Anything fields in your template.
Sorry for delay with reply.
eicon jevdateiconmod" title="{event_s ummary}" href="/jevents.html"
i get this:
http://www.test.macrinc.com/index.php?option=com_jevents&task=icalrepeat.detail&evid=1240&Itemid=1&year=2016&month=01&day=18&title=testing-free-alert-newcentral&uid=d08394d9b92ad3dd8681429982c8418d
you'll notice that the & sign gets changed to & so the link won't work.
any chance you would fix this. i haven't bought the licensed version because i want to make sure it will work.
thanks,
Berni
I'm not sure what the issue is, maybe because the comments software stripped off the HTML entities and/or markup from your message.
Please contact me at http://factory.docwriter.ru/en/contact/ and describe the problem you've ran into just to be sure I get it right.
index.php?option=com_jevents&task=
in the url that is created from the component -
index.php?option=com_jevents&task=
it adds amp; to the url.
Sorry for the inconvenience.
Bernie
RSS лента комментариев этой записи