751
deka87
profile/search.php dropdowns
  • 2008/12/25 20:18

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


hi,

i want to add a dropdown in the registration form so I choose teh "select" field type. but when i go to profile/search.php it doesn't show the dropdown for the created field but multiselect. how do i fix it?
Mind anchors



752
deka87
Re: Catads, a feature request..
  • 2008/12/24 14:16

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


I think an ability to add custom lines (text, check boxes, and dropdowns) like in efq_directory would be very useful for many of us...me in particular . I've added some by myself but it takes too long and im not sure what to do with dropdowns.
Mind anchors



753
deka87
Re: Module to play flv files & are there any alternative to smartfaq
  • 2008/12/23 11:11

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


there is a XOOPS faq original faq module:https://xoops.org/modules/repository/singlefile.php?cid=101&lid=1777. havent tried this one tho
Mind anchors



754
deka87
Re: Notifications based on criteria
  • 2008/12/22 13:20

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


i don't think so. it's just that i'd make the source and target language variables in the profile module like this: $source_language[i]. I'm not good in php but I thought it may be done this way. i'd also try to edit catads module scripts to make ads_lang1 and ads_lang2 dropdown too like ads_lang1[i].

isn't it gonna be something like this?

$user_handler =& xoops_gethandler('user');
$criteria = new CriteriaCompo(new Criteria('source_language[i]'$ads->getVar('ads_lang1[i]')));
$criteria->add(new Criteria('target_language[i]'$ads->getVar('ads_lang2[i]')));
$users $user_handler->getList($criteria);
unset(
$criteria);
$user_list array_keys($users);


or i have to do something with array.
Mind anchors



755
deka87
Re: Notifications based on criteria
  • 2008/12/22 4:23

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Trabis, in case I'd want to make it dropdown instead of a text box, what would the final code:

global $xoopsDB;
$sql "
SELECT * FROM "
.$xoopsDB->prefix('xoopsnotifications')."
LEFT JOIN "
.$xoopsDB->prefix('user_profile')."
 ON not_uid = profileid
WHERE
 not_modid = '"
.intVal($mod_id)."' AND
 not_itemid = '0' AND
 not_category = 'global' AND
 not_event = 'new_ads' AND
 source_language = "
.$xoopsDB->quoteString($ads->getVar('ads_lang1'))." AND
 target_language = "
.$xoopsDB->quoteString($ads->getVar('ads_lang2'));

$result $xoopsDB->query($sql);

$user_handler =& xoops_gethandler('user');
$criteria = new CriteriaCompo(new Criteria('source_language'$ads->getVar('ads_lang1')));
$criteria->add(new Criteria('target_language'$ads->getVar('ads_lang2')));
$users $user_handler->getList($criteria);
unset(
$criteria);
$user_list array_keys($users);


look like?
Mind anchors



756
deka87
Re: Notifications based on criteria
  • 2008/12/21 19:53

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


ok thank you. now i think the thread may be marked as solved
Mind anchors



757
deka87
Re: Notifications based on criteria
  • 2008/12/21 19:34

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


I've added the code in the registration form and registered a new user. but he didnt get notifications. i checked "notifications" tab and saw that he's got "Module: Jobs" event instead of "New job" and the category line was empty.

and i've got one more question about notifications based on criteria. is it done only for global or for every category too? i mean if a user decides to be notified about a new ad in some category (not global) will he still get proper notifications based on his languages?
Mind anchors



758
deka87
Re: Notifications based on criteria
  • 2008/12/21 17:08

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


$module_handler =& xoops_gethandler('module');
$module $module_handler->getByDirname('ads');//change ads to the name of the module
$module_id $module->getVar('mid');

$not_handler =& xoops_gethandler('notification');
$not_handler->subscribe($category$item_id$events$mode$module_id$user_id);


am i supposed to include this in profile/register.php? if yes then where exactly?
Mind anchors



759
deka87
Re: Notifications based on criteria
  • 2008/12/21 16:23

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


YAHOOO! It works now! Thanks guys, this is really awesome. Two more questions:

1. Does it send notifications when source and target languages are absolutely equal to ads_lang1 and ads_lang2, or source and target languages may just contain words from ads_lang1 and ads_lang2. Is it case sensitive?

2. Is it possible to set catads notifications checked by default for newly registered users? but still make it possible to unsubscribe whenever they want.
Mind anchors



760
deka87
Re: Notifications based on criteria
  • 2008/12/21 12:32

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Ok I have added this in adsmod.php:

global $xoopsDB;
$sql "
SELECT * FROM "
.$xoopsDB->prefix('xoopsnotifications')."
LEFT JOIN "
.$xoopsDB->prefix('user_profile')."
 ON not_uid = profileid
WHERE
 not_modid = '"
.intVal($mod_id)."' AND
 not_itemid = '0' AND
 not_category = 'global' AND
 not_event = 'new_ads' AND
 source_language = "
.$xoopsDB->quoteString($ads->getVar('ads_lang1'))." AND
 target_language = "
.$xoopsDB->quoteString($ads->getVar('ads_lang2'));

$result $xoopsDB->query($sql);

$user_list = array();
while(
$row $xoopsDB->fetchArray($result)){
   
$user_list[] = $row['not_uid'];
}

$notification_handler->triggerEvent('global'0'new_ads'$tags$user_list);


good news is that it doesn't cause a blank page and the script works just fine. the bad news is that you receive all the notifications anyways no matter what your source and target language are.
Mind anchors




TopTop
« 1 ... 73 74 75 (76) 77 78 79 ... 96 »



Login

Who's Online

135 user(s) are online (90 user(s) are browsing Support Forums)


Members: 0


Guests: 135


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits