05/01/2012, 10:37:38
Hello,
Et merci pour ta réponse rapide !
Mais après modif, j'ai toujours le même message d'erreur (Fatal error: Call to a member function GetRow() on a non-object in /homez.309/orthodonr/www1/lib/classes/class.usertagoperations.inc.php(260) : eval()'d code on line 31)...
J'ai oublié quelque chose ?
Merci encore.
Et merci pour ta réponse rapide !
Mais après modif, j'ai toujours le même message d'erreur (Fatal error: Call to a member function GetRow() on a non-object in /homez.309/orthodonr/www1/lib/classes/class.usertagoperations.inc.php(260) : eval()'d code on line 31)...
Code :
[== Indéfini ==]
if (!function_exists('MyGetModuleInstance'))
{
function &MyGetModuleInstance($module)
{
$gCms = cmsms();
if (isset($gCms->modules[$module]) &&
$gCms->modules[$module]['installed'] == true &&
$gCms->modules[$module]['active'] == true)
{
return $gCms->modules[$module]['object'];
}
// Fix only variable references should be returned by reference
$tmp = FALSE;
return $tmp;
}
}
$gCms = cmsms();
$db = &$gCms->db;
$news = MyGetModuleInstance('News');
$pageid = ($_REQUEST['pageid']) ? $_REQUEST['pageid'] : $params['pageid'];
$currdate = $params['currdate'];
if(!$currdate) return;
// get all news articles PUBLISHED sorted by ascending date
$query_next = "SELECT news_id,news_title,news_url FROM ".cms_db_prefix()."module_news WHERE news_date > ? AND status = 'published' ORDER BY news_date ASC LIMIT 1";
$query_prev = "SELECT news_id,news_title,news_url FROM ".cms_db_prefix()."module_news WHERE news_date < ? AND status = 'published' ORDER BY news_date DESC LIMIT 1";
$query_uri = "SELECT news_id,news_title,news_url FROM ".cms_db_prefix()."module_news WHERE news_date = ? AND status = 'published' ";
$result_next = &$db->GetRow($query_next,array($currdate));
$result_prev = &$db->GetRow($query_prev,array($currdate));
$result_uri = &$db->GetRow($query_uri,array($currdate));
if($result_next['news_id']) {
if($result_next['news_url']) {
$prettyurl = $result_next["news_url"];
}else{
$aliased_title = munge_string_to_url($result_next['news_title']);
$prettyurl = 'news/' . $result_next["news_id"] .'/'.$pageid."/$aliased_title";}
$next_uri = $news->CreateLink('cntnt01', 'detail', $pageid, '', array('articleid' => $result_next["news_id"]) ,'', true, false, '', true, $prettyurl);
$next_text=$result_next["news_title"];
}else{
$next_uri = "";
}
if($result_prev['news_id']) {
if($result_prev['news_url']) {
$prettyurl = $result_prev["news_url"];
}else{
$aliased_title = munge_string_to_url($result_prev['news_title']);
$prettyurl = 'news/' . $result_prev["news_id"] .'/'.$pageid."/$aliased_title";}
$prev_uri = $news->CreateLink('cntnt02', 'detail', $pageid, '', array('articleid' => $result_prev["news_id"]) ,'', true, false, '', true, $prettyurl);
$prev_text=$result_prev["news_title"];
}else{
$prev_uri = "";
}
if($result_uri['news_id']) {
if($result_uri['news_url']) {
$uri_page= $result_uri["news_url"];
}else{
$aliased_title = munge_string_to_url($result_uri['news_title']);
$uri_page= 'news/' . $result_uri["news_id"] .'/'.$pageid."/$aliased_title";}
}else{
$uri_page = "";
}
$smarty->assign('news_next_url', $next_uri);
$smarty->assign('news_next_text', $next_text);
$smarty->assign('news_prev_url', $prev_uri);
$smarty->assign('news_prev_text', $prev_text);
$smarty->assign('news_uri_page', $uri_page);
J'ai oublié quelque chose ?
Merci encore.