Joomla and Extensions Hacks: Difference between revisions
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
// ORIG LINE $query = 'SELECT * from #__gmaps_config where site = "' . $mosConfig_live_site . '"'; | // ORIG LINE $query = 'SELECT * from #__gmaps_config where site = "' . $mosConfig_live_site . '"'; | ||
// NEW LINE $query = 'SELECT * from #__gmaps_config limit 1'; | // NEW LINE $query = 'SELECT * from #__gmaps_config limit 1'; | ||
The intent of the original code was to allow a single Joomla installation to | |||
support more than one site. The problem was that the URL isn't unique within a site. | |||
A better approach would have been to use the database prefix (jos_, for example), which is | |||
unique within sites in the same installation. This would not be a difficult modification if | |||
it becomes desireable to run multiple sites in a single installation. | |||
===Fixed problem in communitybuilderprofileadapter.class.php=== | ===Fixed problem in communitybuilderprofileadapter.class.php=== |
Revision as of 00:58, 18 February 2009
GMapsPro
Suppress map on user profile tab
joomla\components\com_comprofiler\plugin\user\plug_cbmapuser\mapnearbyuserstab.class.php;
Added:
return;
after the code block that does the geocoding right after the comment
// If the users profile needs to be geocoded and IF geocoding is enabled
The effect is to suppress the generation of the map on the user profile tab.
Fix problem with calls to www.sitename.org vs. sitename.org
// ORIG LINE $query = 'SELECT * from #__gmaps_config where site = "' . $mosConfig_live_site . '"'; // NEW LINE $query = 'SELECT * from #__gmaps_config limit 1';
The intent of the original code was to allow a single Joomla installation to support more than one site. The problem was that the URL isn't unique within a site. A better approach would have been to use the database prefix (jos_, for example), which is unique within sites in the same installation. This would not be a difficult modification if it becomes desireable to run multiple sites in a single installation.
Fixed problem in communitybuilderprofileadapter.class.php
Changed code to suppress second copy of avatar and to add View Profile link.
$desc = "<table><tr><td>" . $row["name"] . "<br/>" . $row["cb_address"] . "<br/>" . $row["cb_city"] . ", " . $row["cb_state"] . "<br/>" . "<a href='".$profile_path.$row["user_id"]."'>View Profile</a><br />" . "</td></tr> </table>";
CBMailer
Modified to recognize special list selection keywords
Added the following code in cbmailing.class.php immediately after $filterby is set from the database
// We modify the filter depending on keywords included in the filter // This code appears in haareunion.php and must be changed in both places!! // The only difference in the code is the definition of $HaaPrefix and the // use of $row->filterfields vs. $filterby $database->setQuery("SELECT params FROM #__comprofiler_plugin WHERE name='HAAReunion'"); $database->query(); $haaparams = $database->loadResult(); // In the form 'ActiveReunion=15' ereg('ActiveReunion=([0-9]+)', $haaparams, $arrYear); $actyear = (string)$arrYear[1]; if (strlen($actyear) == 1 ) {$actyear = '0'.$actyear;} $prioryear = (string)(((int)$arrYear[1]) - 5); if (strlen($prioryear) == 1 ) {$prioryear = '0'.$prioryear;} if (ereg('NoPlansActiveReunion|PlansToComeActiveReunion|IsRegisteredActiveReunion|NoPlansPriorReunion|PlansToComePriorReunion|IsRegisteredPriorReunion', $filterby)) { $HaaPrefix = "ue."; $HaaFilter = $filterby; $HaaFilter = ereg_replace('NoPlansActiveReunion', "(".$HaaPrefix."`cb_reunion".$actyear."` < '1' or ".$HaaPrefix."`cb_reunion".$actyear."` is null)", $HaaFilter); $HaaFilter = ereg_replace('PlansToComeActiveReunion', "(".$HaaPrefix."`cb_reunion".$actyear."` = '1')", $HaaFilter); $HaaFilter = ereg_replace('IsRegisteredActiveReunion', "(".$HaaPrefix."`cb_reunion".$actyear."` ='2')", $HaaFilter); $HaaFilter = ereg_replace('NoPlansPriorReunion', "(".$HaaPrefix."`cb_reunion".$prioryear."` < '1' or ".$HaaPrefix."`cb_reunion".$actyear."` is null)", $HaaFilter); $HaaFilter = ereg_replace('PlansToComePriorReunion', "(".$HaaPrefix."`cb_reunion".$prioryear."` ='1')", $HaaFilter); $HaaFilter = ereg_replace('IsRegisteredPriorReunion', "(".$HaaPrefix."`cb_reunion".$prioryear."` ='2')", $HaaFilter); $filterby = $HaaFilter; }
Fixed problem in Javascript in file
In the file admin.cbmailing.html.php commented out a closing brace (}) and added submitform(pressbutton); right before the final return. The syntax error was showing up in IE with debugging enabled. Once the brace was removed the form wasn't submitted without the call to submit form.
function messageForm( &$lists, &$config, $option ) { ?> <script language="javascript" type="text/javascript"> //function getSelectedValue( function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancel') { submitform( pressbutton ); return; } // do field validation if (form.mm_subject.value == ""){ alert( "<?php echo _CB_MAILING_FILLINSUBJECT ?>" ); return false; } else if (getSelectedValue('adminForm','mm_group') < 0){ alert( "<?php echo _CB_MAILING_SELECTAGROUP ?>" ); return false; } else if (form.mm_message.value == ""){ alert( "<?php echo _CB_MAILING_FILLINMESSAGE ?>" ); return false; } submitform(pressbutton); return true; } //}
A few lines further down added the line commented with WHB
// Get all users email $query = "SELECT email FROM #__users u, #__comprofiler ue WHERE u.id=ue.id AND ue.approved=1 AND ue.banned!=1 AND ue.confirmed=1"; $query .= " AND ue.cb_mailoptin = 1"; // WHB Modification to honor optin field if (! $this->cbMailingConfig["incBlocked"]) { $query .= " AND u.block!=1"; }
Supressed sending of blank email
in joomla\administrator\components\com_cbmailing\cbmailing.class.php Commented out the line calling mosMail in the following. It was trying to send an empty email, resulting in an error.
// MRCB DEBUG /* $result = mosMail( $this->cbMailingConfig["debugFromAddr"], $this->cbMailingConfig["debugFromDesc"], $this->cbMailingConfig["debugToAddr"], $this->cbMailingConfig["debugETitle"], $mailedDetails . $msg, 0); */ // Uncomment the following line to display the message - would need to comment out the mosRedirect //HTML_cbmailing::errorMessage( $mailedDetails . $msg, NULL );