Hi das mod_s4jrandomprofile für den CB nimmt ja irgendwie die Originalbilder , was dann teilweise irgendwo unnöig Traffic frisst! Jetzt habe ich mir mal das Modul angeschaut aber nirgendswo gefunde wo ich das ändern kann ! Im Endefekt muss ich ja nur ein tn vor dem Dateinamen stellen!
z.B.
tn1526_4764192b97aa0.jpg
statt
1526_4764192b97aa0.jpg
hier der Code vom Modul.
PHP-Code:<?php
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $mosConfig_absolute_path, $mosConfig_lang;
$subpath = "/modules/mod_s4jrandomprofile";
require_once( $mosConfig_absolute_path .$subpath."/helper.php" );
//Language definitions
if (file_exists($mosConfig_absolute_path.$subpath."/language/".$mosConfig_lang.".php")){
include($mosConfig_absolute_path.$subpath."/language/".$mosConfig_lang.".php");
} else {
include($mosConfig_absolute_path.$subpath."/language/english.php");
}
//if modul was copied, check the class
if( !class_exists("s4jRandomProfile") ) {
class s4jRandomProfile {
var $_s4j = null;
var $_db = null;
var $_params= null;
/**
* Construnctor
*/
function s4jRandomProfile( & $params ) {
global $database;
$this->_db = $database;
$this->_s4j = new s4jLibRandomProfile( $params, 2, "mod_s4jrandomprofile" );
$this->_params = & $params;
}
function GetDataRows() {
$max_user_shown = $this->_params->get('max_user_shown', 3);
$sql = "SELECT DISTINCT
u.id, u.username, u.name,
s.userid as s4jonline";
$sql .= $this->_s4j->GetFields();
$sql .= " FROM
( #__users u INNER JOIN #__comprofiler c ON u.id = c.user_id AND u.block =0 AND c.confirmed =1 AND c.approved =1 )
LEFT JOIN #__session s ON s.userid = u.id AND s.guest = 0";
$sql .= $this->_s4j->GetFilter("c", "u", "WHERE");
$sql .= " ORDER BY RAND()
LIMIT 0, " . $max_user_shown;
$this->_db->setQuery( $sql );
$rows = $this->_db->loadObjectList();
return $rows;
}
function Show() {
$columns_count = $this->_params->get('columns_count', 5);
$rows = $this->GetDataRows();
$tr = 1;
$ind = 0;
$rows_count = count($rows); //NOTE: Improve later
$result = "<table border='0'>"; // TODO: Change template
foreach ($rows as $row) {
if( $tr == 1)
$result .= "<tr>";
$result .= "<td valign='top'>".$this->_s4j->GetUser( $row )."</td>";
if($tr == $columns_count) {
$result .= "</tr>";
$tr=1;
} else if( $ind == $rows_count ) {
for($j = $tr; $j < $columns_count; $j++) {
$result .= "<td style='display:none;'> </td>";
}
$result .= "</tr>";
} else {
$tr++;
}
$ind++;
}
$result .= "</table>";
return $result;
}
}
function s4jRandomProfileCaching( &$params ){
$s4jRandomProfile = new s4jRandomProfile( $params );
echo $s4jRandomProfile->Show();
}
}
$enablecache = $params->get('enablecache', 0);
if( $enablecache == 1 ) {
$cache =& mosCache::getCache( 'mod_s4jrandomprofile' );
$cache->call( 's4jRandomProfileCaching', $params );
} else {
s4jRandomProfileCaching( $params );
}
?>


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen