| Server IP : 198.244.165.102 / Your IP : 216.73.216.218 [ Web Server : nginx/1.24.0 System : Linux modovh-ub-01 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : colleary ( 1011) PHP Version : 8.3.23 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/johnhoban/hold_html/modules/ |
Upload File : |
<?php
/**
* @version $Id: mod_related_items.php,v 1.4 2005/01/06 01:13:32 eddieajau Exp $
* @package Mambo
* @copyright (C) 2000 - 2005 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$option = trim( mosGetParam( $_REQUEST, 'option', null ) );
$task = trim( mosGetParam( $_REQUEST, 'task', null ) );
$id = intval( mosGetParam( $_REQUEST, 'id', null ) );
$moduleclass_sfx = $params->get( 'moduleclass_sfx' );
if ($option == 'com_content' && $task == 'view' && $id) {
// select the meta keywords from the item
$query = "SELECT metakey FROM #__content WHERE id='$id'";
$database->setQuery( $query );
if ($metakey = trim( $database->loadResult() )) {
// explode the meta keys on a comma
$keys = explode( ',', $metakey );
$likes = array();
// assemble any non-blank word(s)
foreach ($keys as $key) {
$key = trim( $key );
if ($key) {
$likes[] = $database->getEscaped( $key );
}
}
if (count( $likes )) {
// select other items based on the metakey field 'like' the keys found
$query = "SELECT id, title"
. "\nFROM #__content"
. "\nWHERE id<>$id AND state=1 AND access <=$my->gid AND (metakey LIKE '%";
$query .= implode( "%' OR metakey LIKE '%", $likes );
$query .= "%')";
$database->setQuery( $query );
if ($related = $database->loadObjectList()) {
echo "<ul>\n";
foreach ($related as $item) {
if ($option="com_content" && $task="view") {
$Itemid = $mainframe->getItemid($item->id);
}
$href = sefRelToAbs( "index.php?option=com_content&task=view&id=$item->id&Itemid=$Itemid" );
echo " <li><a href=\"$href\">$item->title</a></li>\n";
}
echo "</ul>\n";
}
}
}
}
?>