My first DW Anything module

Дата добавления:
29.01.2010
Последнее изменение:
03.09.2010
Хиты:
18573
Рейтинг:
 
Голосовать:
Хорошо - Плохо

Ответ

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

Категория

Комментарии   

 
+2 # how to make a tableGuest 25.03.2010 06:03
HELLO CAN YOU SEND AN EXAMPLE TEMPLATE TO DISPAY DE RESULTS LIKE A TABLE MY QUERY IS:
select * from #_users
thanks¡¡
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: how to make a tableAdministrator 25.03.2010 14:30
Hi Luis!

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 02.04.2010 07:35
Hi,
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...
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 02.04.2010 12:56
Hi, Pratik!

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # Not sureGuest 17.04.2010 04:39
How can I use a PHP variable in the MySQL Query.

Example:(Does not work)
SELECT * FROM jos_orders WHERE 'email' = $email
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: Not sureAdministrator 17.04.2010 07:18
You can't use PHP variables in MySQL query.

Use the literal value instead:

SELECT * FROM `jos_orders` WHERE `email` = ''

Also, be sure to use correct quotes for column names and values (see the example above).
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 08.06.2010 01:29
I can't seem to join the comprofiler and user tables using mysql syntax. Is this doable in this module?
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 08.06.2010 12:20
Yes, you can use MySQL joins in DW Anything SQL Query.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 08.08.2010 01:42
First, thank you so much for creating this plugin :)

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
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 08.08.2010 02:36
Hi 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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 08.08.2010 02:43
Wauw, that was a very fast reply, thanks :)
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 17.08.2010 15:17
Hi, I have a mediumtext field that has returns in it, however this are not displayed (i.e. no line returns), is there a way to correct this?
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 17.08.2010 15:39
Hi Matt,

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`
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 23.08.2010 10:02
Hi,
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?
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 25.08.2010 04:05
Hi,

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 15.01.2012 16:41
As of version 2.0, you can access URL parameters using special set of tags as follows:

Цитата:
select * from users where id={request.userid}
This way, you can access any scalar value passed through HTTP reuqest.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # Upgrade from 1.02 to 2.01Chris 05.09.2012 18:23
Thank you very much for this module. I had 1.02 working perfectly on Joomla 1.5 I installed 2.01 and now pages including existing and new modules using DW Anything fail with HTTP/1.1 500 Internal Server Error

I would be very grateful for any advice you can give
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: Upgrade from 1.02 to 2.01Administrator 28.11.2012 15:24
Hi Chris,

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: Upgrade from 1.02 to 2.01Chris 04.12.2012 22:41
Thank you Pratik. Although 2.x fails on Joomla 1.5 it works on 1.7
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: Upgrade from 1.02 to 2.01Chris 04.12.2012 22:42
Thank you Pratik. Although 2.x fails under Joomla 1.5 it succeeds under 1.7

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!
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: Upgrade from 1.02 to 2.01Administrator 04.12.2012 22:50
You're welcome, Chris!

Your captcha is OK, your comment was just waiting for approvement.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # Help !!Guest 05.12.2010 13:53
How can I display the results of the module ? Do I need to include it as a link on the menu ? if so what is the link ? or is there a recommended component to display the module in an article ?
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: Help !!Administrator 06.12.2010 20:15
Hi Barrie,

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # BosleGuest 03.03.2011 19:18
Hello,

is it possible to show just 1 entry randomly?

Thanks in adanve and

Best Regards
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: BosleAdministrator 04.03.2011 04:01
Hi Bosle,

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
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 25.04.2011 21:21
how i can display tha data of currently loged in user???
for example his name etc.
select 'name' from 'jos_users' where username=$this->get($this->username)
???????????
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 28.04.2011 11:01
Hi Jaffar,

DW Anything version 1.02 cannot access current user data.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: RE: My first DW Anything moduleAdministrator 15.01.2012 16:43
As of version 2.0, you can access user data using special set of tags as follows:

Цитата:
select `name` from `jos_users` where `username`='{user.username}'
This way, you can access any scalar property of JUser class object for the user currently logged in to Joomla! front end.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # -Mike 25.03.2012 23:50
Hello,
is it possible to add the result in an acticle with an macro and not inside an module?
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: -Administrator 26.03.2012 23:18
Hi Mike,

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleGuest 03.04.2012 04:41
hi how can I start using dw anything in joomla, to get data from database and display it in article.

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
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleAdministrator 28.11.2012 15:10
DW Anything is a module, not plugin!

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # interstormAnchor tags 31.05.2012 18:47
Hello - first off...great module!!! One thing I am trying to do but having problems with is using an anchor tag in the template. Below is the test version - it returns a table just fine. The issue is that the text referenced by {site} will not by a hyperlink. Can you confirm DWAnything supports anchor tags?




{site}


{name}
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: interstormAdministrator 28.11.2012 15:16
Thanks!

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # issue with & in url stringBernie markel 14.01.2016 18:33
If i use this:
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
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: issue with & in url stringИлья Вихарев 14.01.2016 18:45
Hi Bernie,

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.
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleBernie markel 15.01.2016 04:37
In the component -
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
Ответить | Ответить с цитатой | Цитировать
 
 
0 # RE: My first DW Anything moduleИлья Вихарев 15.01.2016 23:45
I've sent a reply to your e-mail.
Ответить | Ответить с цитатой | Цитировать
 

Добавить комментарий


Защитный код
Обновить

SEO by Artio