Skip to Content Skip to Menu

MySQL Field Type Plugin

  • softforge
  • softforge
  • OFFLINE
  • Posts: 129
  • Thanks: 21
  • Karma: 12
15 years 2 weeks ago #111666 by softforge
MySQL Field Type Plugin was created by softforge
I have created a MySQL Field Type Plugin for Community Builder 1.2 which queries the database and displays the result of a MySQL statement. You can download it here:

www.softforge.co.uk/resource-area/documentation/cb-mysql-field-plugin

I hope you find this useful, all feedback welcome.


If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...
Attachments:
The following user(s) said Thank You: Vladicon

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

  • Camee
  • Camee
  • OFFLINE
  • Posts: 10
  • Thanks: 0
  • Karma: 8
14 years 11 months ago #113655 by Camee
Replied by Camee on topic Re:MySQL Field Type Plugin
Hello and thank you for this great plugin. But I have a little problem with it if I want to sort a user list based on this field type.

I use this plugin to show the amount of users Mosets Tree favourites in their profile. This works fine, many thanks. Now I created a user list and want to sort it by the amount of users favourites. This is the 500er error message I receive in debugging mode:

JDatabaseMySQL::query: 1054 - Unknown column 'cb_collected' in 'order clause' SQL=SELECT ue.*, u.*, '' AS 'NA' FROM jos_comprofiler ue, jos_users u WHERE u.block = 0 AND ue.approved = 1 AND ue.confirmed = 1 AND u.gid IN (18, 23, 24, 25) AND u.`id` = ue.`id` ORDER BY `cb_collected` DESC LIMIT 0, 50


It would be very kind if you could help me with this issue. Thanks in advance,

Camee

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

  • Camee
  • Camee
  • OFFLINE
  • Posts: 10
  • Thanks: 0
  • Karma: 8
14 years 11 months ago #113659 by Camee
Replied by Camee on topic Re:MySQL Field Type Plugin
Ok, now I know what this means:

It does not actually add a new field to the database


:)

What a pity! I thought, this plugin could be, what I was looking for.

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

  • softforge
  • softforge
  • OFFLINE
  • Posts: 129
  • Thanks: 21
  • Karma: 12
14 years 11 months ago #113664 by softforge
Replied by softforge on topic Re:MySQL Field Type Plugin
Hi Camee,

Thanks for trying my plugin. My needs for it is purely to display information, I hadn't considered sorting. By the looks of the error message, CB can only sort on a column that actually exists in jos_comprofiler, which makes sense.

I didn't actually want to store the result because my data is constantly changing so I wanted it to be dynamically calculated on each page load.

I'm sure it would be possible to modify the plugin to insert the result of the SQL query into a pre-existing CB field so that it could be used for sorting. It would still be dynamic but you would have an extra INSERT statement each time it is was used so for lists, that would be 1 per user displayed.

I hope this helps.

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

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

14 years 10 months ago #117197 by researchware
Replied by researchware on topic Re:MySQL Field Type Plugin
I'll also add my vote that this is a really great CB plug-in. I 'd love to be able to sort on a calculated field. Would you every consider creating a newer version of the plug-in with the ability to use this field type to sort on in lists?

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

  • softforge
  • softforge
  • OFFLINE
  • Posts: 129
  • Thanks: 21
  • Karma: 12
14 years 10 months ago #117209 by softforge
Replied by softforge on topic Re:MySQL Field Type Plugin
It would be nice to be able to sort on the calculated field but it does seems that CB can only sort on a 'real' field stored in jos_comprofiler.

The only way to do this would be as I described before but this would considerably increase the load on the system when displaying user lists.

If it becomes essential in the project I am using it for, I will add this feature and release a new version.

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

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

Moderators: beatnantkrileon
Powered by Kunena Forum