function sendPhocaGuestbookMail($id, $post2, $url, $tmpl) { $app = JFactory::getApplication(); $db = JFactory::getDBO(); $sitename = $app->getCfg('sitename'); //get all super administrator $query = 'SELECT name, email, sendEmail' . ' FROM #__users' . ' WHERE id = ' . (int) $id; $db->setQuery($query); $rows = $db->loadObjectList(); if (isset($post2['title']) && $post2['title'] != '') { $subject = $sitename . ' (' . JText::_('COM_PHOCAGUESTBOOK_PG_NEW_POST') . '): ' . PhocaguestbookHelperFront::wordDelete($post2['title'], 25, '...'); $title = $post2['title']; } else { $subject = $sitename . " (" . JText::_('COM_PHOCAGUESTBOOK_PG_NEW_POST') . ')'; $title = $post2['title']; } if (isset($post2['username']) && $post2['username'] != '') { $fromname = $post2['username']; } else { $fromname = $tmpl['predefined_name']; } if (isset($post2['email']) && $post2['email'] != '') { $mailfrom = $post2['email']; } else { $mailfrom = $rows[0]->email; } if (isset($post2['content']) && $post2['content'] != '') { $content = $post2['content']; } else { $content = "..."; } $email = $rows[0]->email; $post2['content'] = str_replace("</p>", "\n", $post2['content']); $post2['content'] = strip_tags($post2['content']); $message = JText::_('COM_PHOCAGUESTBOOK_PG_NEW_POST_ADDED') . "\n\n" . JText::_('COM_PHOCAGUESTBOOK_WEBSITE') . ': ' . $sitename . "\n" . JText::_('COM_PHOCAGUESTBOOK_FROM') . ': ' . $fromname . "\n" . JText::_('COM_PHOCAGUESTBOOK_DATE') . ': ' . JHTML::_('date', gmdate('Y-m-d H:i:s'), JText::_('DATE_FORMAT_LC2')) . "\n\n" . JText::_('COM_PHOCAGUESTBOOK_SUBJECT') . ': ' . $title . "\n" . JText::_('COM_PHOCAGUESTBOOK_CONTENT') . ': ' . "\n" . "\n\n" . PhocaguestbookHelperFront::wordDelete($post2['content'], 400, '...') . "\n\n" . "\n\n" . JText::_('COM_PHOCAGUESTBOOK_CLICK_LINK') . "\n" . $url . "\n\n" . JText::_('COM_PHOCAGUESTBOOK_REGARDS') . ", \n" . $sitename . "\n"; $subject = html_entity_decode($subject, ENT_QUOTES); $message = html_entity_decode($message, ENT_QUOTES); JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message); return true; }
} } if ($values->title != '') { if ($sep == 1) { $gbPosts .= ': '; } $gbPosts .= PhocaguestbookHelperFront::wordDelete($values->title, 100, '...'); } if ($this->tmpl['display_website'] != 0) { if ($values->homesite != '') { if ($values->title == '' && $values->email == '' && $values->username == '') { $gbPosts .= ''; } else { $gbPosts .= ' <br />'; } $gbPosts .= ' <span><a href="' . $values->homesite . '">' . PhocaguestbookHelperFront::wordDelete($values->homesite, 50, '...') . '</a></span>'; } } $gbPosts .= '</h4>'; // SECURITY // Open a tag protection $a_count = substr_count(strtolower($values->content), "<a"); $a_end_count = substr_count(strtolower($values->content), "</a>"); $quote_count = substr_count(strtolower($values->content), "\""); if ($quote_count % 2 != 0) { $end_quote = "\""; // close the " if it is open } else { $end_quote = ""; } if ($a_count > $a_end_count) {