SQL Plugin in action!

14 years 10 months ago #97351 by nant
Replied by nant on topic Re:SQL Plugin in action!
msrc wrote:

Hi

Forgot to mention that I tried to use the CB Fields, but it doesn't work. All it does is enter the what I put in to the value box, even when I select the Field=Field+Value option.

I am not sure why CB is so restrictive. I have been trying for months to find a way to automate our membership number generation but no luck. It is disappointing at the least that no one has a solution for me. Can't believe we can't accomplish this even which such costs involved in getting this product.

:angry:


I do not agree with your comment that CB is so restrictive.

Currently, each user has a unique id - the userid.

If you want, you can use this as a membership number.

You can even display it in a delimiter field like this:

[cb:userdata field="username" /] is # [cb:userdata field="user_id" /]

If you want to create some other unique id, you can create a cb fieldtype plugin or hire someone to do this for you.

Please Log in to join the conversation.

14 years 9 months ago #103335 by pochatcb
Replied by pochatcb on topic Re:SQL Plugin in action!
klp29 wrote:

Let me add to this:

We cosponsored the Moset Tree "Plugin" and we not only use if for publishing/unpublishing but also for registrering the price on the listing (because we sort after price, so the highest paid ads are on top).

Like this:

[code:1]UPDATE `#__mt_links` SET `price` = 2000.00 WHERE `user_id`
= [user_id][/code:1]


Hi KLP29,

This is a great idea,
Where do you enter this code?

thanks,

Please Log in to join the conversation.

14 years 8 months ago #106333 by Camee
Replied by Camee on topic Re:SQL Plugin in action!
Hello!

Can I restrict the publishing of Mosets Tree listings to specific plans? (Only members of Plan A can write a listing). Assigning members to specific categories would be great. And is it possible to set the amount of listings a member can write?

Please Log in to join the conversation.

14 years 8 months ago #106357 by krileon
Replied by krileon on topic Re:SQL Plugin in action!
Camee wrote:

Hello!

Can I restrict the publishing of Mosets Tree listings to specific plans? (Only members of Plan A can write a listing). Assigning members to specific categories would be great. And is it possible to set the amount of listings a member can write?


You can only manipulate what the component is capable of. Review mosets database and its features and build a query that can manipulate it to your needs. Such as adding a user to a group if mosets allows groups, etc...


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

14 years 7 months ago #107038 by Goldarm12
Replied by Goldarm12 on topic Re:SQL Plugin in action!
I've created a cb dropdown field named cb_vateams to use with this sql statement.
[code:1]UPDATE `jos_k2_users` SET `group` =
CASE
WHEN ([cb_vateams] = 'Cox High School' AND `userID` = [user_id])
THEN 5
WHEN ([cb_vateams] = 'Green Run High School' AND `userID` = [user_id])
THEN 17
WHEN ([cb_vateams] = 'Hertford High School' AND `userID` = [user_id])
THEN 4
END[/code:1]
It doesn't work, so my question is:
What do I have wrong in my syntax?

Any help will be greatly appreciated.

Thanks,
Don

Please Log in to join the conversation.

14 years 7 months ago #107062 by krileon
Replied by krileon on topic Re:SQL Plugin in action!
[cb_vateams] = 'Cox High School'

That doesn't look right. You're comparing a value to a value that is not query related inside of a query like an IF statement. I do not believe this will work and if this is to be used then you need to quote [cb_vateams].

'[cb_vateams]' = 'Cox High School'


Please try the following:
[code:1]
UPDATE `jos_k2_users` SET `group` =
CASE
WHEN ( '[cb_vateams]' = 'Cox High School' ) THEN 5
WHEN ( '[cb_vateams]' = 'Green Run High School' ) THEN 17
WHEN ( '[cb_vateams]' = 'Hertford High School' ) THEN 4
END
WHERE `userID` = [user_id]
[/code:1]

Post edited by: krileon, at: 2009/08/05 19:25


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.261 seconds