mallchin.com

mallchin.com header graphic
Home arrow Misc. Code arrow Joomla! arrow Joomla! - JoGadgets mambot
Joomla! - JoGadgets mambot PDF Print E-mail
Sunday, 24 December 2006

The replacement of the $row->title variable causing bugs in other mambots (ie sociotag)

By default $row->title contains a text string as defined by the title attribute. JoGadgets replaces this string with a tag rendering an image instead. This works fine for the header, but other mambots can rely on $row->title returning text not html.

The simplest solution is to duplicate the $row->title variable whilst it still contains a text string, then adjust other mambots to use the new variable instead. The following code sets a new variable, $row->title_text which we can use in our other mambots.

 You will need to manually edit mambots/content/jogadgets.php and adjust the following lines:

Old:

  1. //Imagetitles
  2. if($GLOBALS['confJG']['useimgtitle']==true){
  3.  
  4. $style= 'display:block;height:'.$GLOBALS['confJG']['imgtitle_height'];
  5.  
  6. // perform the replacement
  7. $row->title = '<div style="'.$style.';background:url(_jgfw_/image.php?text='.urlencode(strip_tags($row->title)).') no-repeat;">&nbsp;</div>';
  8.  
  9. }
 

New:

  1. //Imagetitles
  2. if($GLOBALS['confJG']['useimgtitle']==true){
  3.  
  4. // duplicate text string
  5. $row->title_text = urlencode(strip_tags($row->title));
  6.  
  7. $style= 'display:block;height:'.$GLOBALS['confJG']['imgtitle_height'];
  8.  
  9. // perform the replacement
  10. $row->title = '<div style="'.$style.';background:url(_jgfw_/image.php?text='.urlencode(strip_tags($row->title)).') no-repeat;">&nbsp;</div>';
  11.  
  12. }
 

You will then need to update other mambots and search for references to $row->title and replace them with $row->title_text.



  Tag it:blogmarksco.mmentsDeliciousdiggDiigo