Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Conditions plugin

  • ncghs
  • ncghs
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 2 weeks ago #26614 by ncghs
Replied by ncghs on topic Re:Conditions plugin
I installed the test_patch plugin in CB and it did not tell me that the patch was installed when I went to my registration page. I don't know what I'm doing wrong:
1. Install CB 1.0.2
2. Install conditions plugin
3. Configure tables in MySQL
4. Install test patch

Those are all the steps I've done so far. What "hacks" need to be applied to get this thing up? What is this stuff about comprofiler?

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

  • mediaguru
  • mediaguru
  • OFFLINE
  • Posts: 365
  • Thanks: 1
  • Karma: 70
18 years 1 week ago #27141 by mediaguru
Replied by mediaguru on topic Re:Conditions plugin
I've searched here for an hour and I CAN'T FIND THE HACK CODE! WHERE IS IT!!!!?????

CB/Joomla golf site: www.thegolfspace.com
Geek/joomla site: www.tkserver.com

Check out my Joomla/CB projects:

* LIKE thumbs up system for "liking" content items
* Karma - CB user rating system
* Golf Score Tracker
* Jitter - status update system. "What's on your mind?"
* CB Author Plug - Shows CB author link and avatar in content items. J1.5 compatible and very customizable!

Found on my web site or in the Joomlapolis Directory !

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

  • kaype
  • kaype
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 1 week ago #27248 by kaype
Replied by kaype on topic Re:Conditions plugin
Hello Mikko,

I downloaded the plugin, and spent about 2 hrs and I should admit that I was not able to make it work.

This is what I need - in my user reg. page, the user is shown different reg. details depending on the email domain. i.e. if the user enters user@abc.com they they are shown a reg page, but if they enter any other domain than abc.com then the are shown a different reg page.

Is this doable using conditions plugin? Or is there a simpler way to accomplish this?

If this has to be done only via conditions plugin, then I wish I had a idiots guide on how to use conditions plugin :unsure:


I use CB 1.0.1 on my production system but planning to upgrade to CB 1.0.2.

I tried it on a test system on CB 1.0.2, for some reason I uninstalled and tried to reinstall the conditions plugin it gives be the below error. I am not a CB/Joomla expert, but would appreciate if I can get some help to get me through this. Thanks in advance!

[code:1]
SQL Error DB function failed with error number 1060
Duplicate column name 'conditionid' SQL=ALTER TABLE `jos_comprofiler_field_values` ADD `conditionid` INT;
SQL =
ALTER TABLE `jos_comprofiler_field_values` ADD `conditionid` INT;
[/code:1]

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

  • mikko
  • mikko
  • OFFLINE
  • Posts: 703
  • Thanks: 0
  • Karma: 115
18 years 1 week ago #27271 by mikko
Replied by mikko on topic Re:Conditions plugin
Hack for cb 1.0.2 can be found for example here www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/catid,27/id,26454/

I wish there was a better way to post hacked files than using attachements to forum posts. (Even better would be if this little enhancement would make it to CB)

mikko

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

  • mikko
  • mikko
  • OFFLINE
  • Posts: 703
  • Thanks: 0
  • Karma: 115
18 years 1 week ago #27272 by mikko
Replied by mikko on topic Re:Conditions plugin
kaype wrote:

Hello Mikko,

I downloaded the plugin, and spent about 2 hrs and I should admit that I was not able to make it work.

This is what I need - in my user reg. page, the user is shown different reg. details depending on the email domain. i.e. if the user enters user@abc.com they they are shown a reg page, but if they enter any other domain than abc.com then the are shown a different reg page.

The plugin can handle only exact mathes. However, it should not be too hard to make it do regexp matching.

I tried it on a test system on CB 1.0.2, for some reason I uninstalled and tried to reinstall the conditions plugin it gives be the below error. I am not a CB/Joomla expert, but would appreciate if I can get some help to get me through this. Thanks in advance!
[code:1]
SQL Error DB function failed with error number 1060
Duplicate column name 'conditionid' SQL=ALTER TABLE `jos_comprofiler_field_values` ADD `conditionid` INT;
SQL =
ALTER TABLE `jos_comprofiler_field_values` ADD `conditionid` INT;
[/code:1]


This is a minor bug in the plugin. You can fix it by opening the zip-file and editing the xml file inside. Just remove the SQL lines which generate the errors. Unfortunately there is not a better solution for this at this point of time.

The reason for this problem is that the uninstaller does not remove the previously defined conditions (this is intentional), and then the installer tries to recreate the columns. The problem is that you cannot use "if not exists" with "alter table" in mysql.

mikko

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

  • mikko
  • mikko
  • OFFLINE
  • Posts: 703
  • Thanks: 0
  • Karma: 115
17 years 10 months ago #30547 by mikko
Replied by mikko on topic Re:Conditions plugin
mikko wrote:

kaype wrote:

Hello Mikko,

I downloaded the plugin, and spent about 2 hrs and I should admit that I was not able to make it work.

This is what I need - in my user reg. page, the user is shown different reg. details depending on the email domain. i.e. if the user enters user@abc.com they they are shown a reg page, but if they enter any other domain than abc.com then the are shown a different reg page.

The plugin can handle only exact mathes. However, it should not be too hard to make it do regexp matching.


To enable pattern mathing (with javascript regex) change this line in conditions.php

[code:1]
$ret.="\nshowHide(document.getElementsByName(prefix+'".($fields[$fieldN]->name).$fieldPostfix.
"')[0].parentNode.parentNode,node.value=='".$condition->value."');"
[/code:1]

to

[code:1]
$ret.="\nshowHide(document.getElementsByName(prefix+'".($fields[$fieldN]->name).$fieldPostfix.
"')[0].parentNode.parentNode,node.value.match('".$condition->value."')!=null);"
[/code:1]

See for example this link for more info about match function and what kinds of patters you can sepcify www.devguru.com/Technologies/ecmaScript/quickref/string_match.html

mikko

Post edited by: mikko, at: 2007/02/05 08:26

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

Moderators: beatnantkrileon
Powered by Kunena Forum