Tout d'abord ma question, est-ce qu'il est possible de faire apparaître les robots, dans la liste des utilisateurs connectés ?
Je n'ai pas trouvé de fonctions dans le code IPBSDK...
Ensuite :
Je rencontre un petit problème, j'essaye d'afficher l'image des rangs sous l'avatar dans l'affichage d'un post sur l'accueil de mon site, or il ne m'affiche pas l'image mais juste les mots "pip9.png" et ce quelque soit le rang du membre, qu'il est un pip0 ou un pip10...
Voici le code d'IPBSDK :
function get_member_pips($id = '') {
if (!$id) {
$id = $GLOBALS['ibforums']->member['id'];
}
if ($info = $this->get_advinfo($id)) {
// Grab Pips
$this->DB->query ('SELECT * FROM ibf_titles ORDER BY pips ASC');
$pips = '0';
// Loop through pip numbers checking which is good
while ($row = $this->DB->fetch_row()) {
if ($row['posts'] <= $info['posts']) {
$pips = $row['pips'];
}
}
return $pips;
} else {
$this->sdkerror($this->lang['sdk_badmemid']);
return FALSE;
}
}Autre chose, toujours pour le même post, je n'arrive pas à lui faire afficher le prefix/suffix groupe sur le pseudo, les tentatives que j'ai effectués me permettent juste d'obtenir un prefix/suffix du membre qui affiche la page : un invité affichera le prefix/suffix de son groupe, ainsi de suite...

Merci pour votre aide
[EDIT] Correction fautes [/EDIT]
<?
/*
+ ------------------------------------------------------------------------
+ IPB SDK Script - [SDK]IPBNews 4.2
+ Copyright © 2004 Timothy Yung (CTiga)
+ ------------------------------------------------------------------------
+ Export news from a Forum into your website.
+ ------------------------------------------------------------------------
*/
require_once "assets/includes/ipbsdk_class.inc.php"; // Include SDK Functions and Files
$time_offset = "0"; // Offset for news post date/time
$SDK =& new IPBSDK();
global $board_url;
if (!function_exists(News_Template)) {
function News_Template($news,$link,$desc,$edit,$logg) {
global $SDK;
$news['desc'] = ($desc == "0" ? '' : ', '.$news['desc']);
$link['edit'] = ($edit == "0" ? '' : '[<a href="'.$link['edit'].'">Edit</a>]');
$link['mail'] = ($logg == "0" ? '' : '[<a href="'.$link['mail'].'">Mail</a>]');
$link['add'] = ($logg == "0" ? '' : '· <a href="'.$link['add'].'">Add</a>');
echo
<<<EOD
<div class="maintitle_board_header">
<div class="maintitle_board_header1">
<div class="maintitle_board_header2">
<div class="maintitle_board_headertext">
{$news['title']}{$news['desc']}
</div>
</div>
</div>
</div>
<br clear="all"/>
<div class="posttableborder">
<table width='100%' border='0' cellspacing='1' cellpadding='3'>
<tr>
<td width="1%" valign="middle" class="row4" style="text-align: center;">
<a name='entry24'></a>
<span class='normalname'>
<a href="{$link['profile']}">{$news['prefix']}{$
news['author']}{$news['suffix']}</a>
</td>
<td class='row5' valign='top' width="99%">
<!-- POSTED DATE DIV -->
<div align='left' class='row4' style='float:left;padding-top:19px;'>
<span class='postdetails'><b>Écrit le </b>{$news['date']}</span>
</div>
</td>
</tr>
<tr>
<td valign='top' class='post2' width='20%' style="text-align: center;">
<span class='postdetails'>
{$news['avatar']}
<br />
{$news['pipsc']}
<br />
{$news['pips']}
<br />
</td>
<td width='80%' valign='top' class='post2' align='left'>
<!-- THE POST -->
<div class='postcolor'>{$news['post']}</div>
<br /><br />--------------------<br />
<div class='postcolor'>{$news['signature']}</div>
<!-- THE POST -->
</td>
</tr>
<tr>
<td align="center"></td>
<td nowrap="nowrap" align="left" class="darkrow3">
<div align="right">{$link['edit']}
</div>
</td>
</tr>
</table>
</div>
<div class="maintitlebottom">
<div class="maintitlebottom1">
<div class="maintitlebottom2">
</div>
</div>
</div>
<br clear="all"/>
<br />
<br />
EOD;
}
function Commenting_Area($comments,$news) {
return
<<<EOD
<tr>
<td align="left" bgcolor="#FEFEFE" colspan="2">
<b>Comments</b><br />
<ol>
{$comments}
</ol>
</td>
</tr>
EOD;
}
function Comment_Template($comment) {
return
<<<EOD
<li id="comment-{$comment['id']}">{$comment['comment']
}<br />
<i>Comment by {$comment['author']} -- {$comment['date']}</i></li><br />
<br />
EOD;
}
function News_Page_Bar($pagelinks,$location,$totalpages) {
if ($location == "top") {
echo
<<<EOD
<table cellpadding="4" cellspacing="1" border="0" width="100%" bgcolor="#000000" style="font-family:Verdana;font-size:11px">
<tr>
<td align="left" bgcolor="#CCCCCC" width="100%">Pages: {$pagelinks}</td>
</tr>
</table>
<br />
EOD;
}
elseif ($location == "bot") {
echo
<<<EOD
<table cellpadding="4" cellspacing="1" border="0" width="100%" bgcolor="#000000" style="font-family:Verdana;font-size:11px">
<tr>
<td align="left" bgcolor="#CCCCCC" width="100%">Pages: {$pagelinks}</td>
</tr>
</table>
EOD;
};
}
};
if (is_array($forumid)) {
$count = "0";
foreach($forumid as $id) {
$foruminfo = $SDK->get_forum_info($id);
$count += $foruminfo['topics'];
};
}
else {
$foruminfo = $SDK->get_forum_info($forumid);
$count = $foruminfo['topics'];
};
$news_order = ($news_order == "old" ? "asc" : "desc");
$topics = $SDK->list_forum_topics ($forumid, array("limit" => $count,
"start" => "0",
"order" => $news_order,
"orderby" => "start_date"
), "0");
if (!empty($auto_paging)) {
$shownews = (empty($shownews) ? 1 : $_GET['shownews']);
$lastpage = ceil($count / $newsamount);
$pagelink = "";
$pagelink = "";
for ($i = "1"; $i <= $lastpage; $i++) {
if ($i == $shownews) {
$pagelink .= '<b>['.$i.']</b> ';
}
elseif ($i < $shownews - 2) {
if (!isset($firstdone)) {
$newslink['firstpage'] = $_SERVER['PHP_SELF'].'?';
$newslink['firstpage'] .= 'shownews=1';
$pagelink .= '<a href="'.$newslink['firstpage'].'">« First</a> ...';
$firstdone = "1";
};
}
elseif ($i > $shownews + 2) {
$newslink['lastpage'] = $_SERVER['PHP_SELF'].'?';
$newslink['lastpage'] .= 'shownews='.$lastpage;
$pagelink .= '... <a href="'.$newslink['lastpage'].'">Last »</a>';
break;
}
else {
$newslink['page'] = $_SERVER['PHP_SELF'].'?';
$newslink['page'] .= 'shownews='.$i;
$pagelink .= '<a href="'.$newslink['page'].'">'.$i.'</a>&
nbsp';
}
}
$l = ($shownews - 1 == "0" ? 1 / $newsamount : $shownews - 1) * $newsamount - ($shownews - 1 == "0" ? 1 : 0);
$h = $shownews * $newsamount - 1;
}
else {
$l = 0;
$h = $newsamount - 1;
};
News_Page_Bar($pagelink,($auto_paging == "1" ? "top" : ""),$lastpage);
for ($n = $l; $n <= $h; $n++) {
if ($topics[$n]) {
if ($post_limit > "0" && str_word_count($SDK->html2bbcode($topics[$n]['post'])) > $post_limit) {
$pcontent = preg_split('/ /', $SDK->html2bbcode($topics[$n]['post']), -1, PREG_SPLIT_OFFSET_CAPTURE);
$topics[$n]['post'] = "";
for ($i = "0"; $i < $post_limit; $i++) {
$topics[$n]['post'] .= ltrim($SDK->bbcode2html($pcontent[$i]['0']));
};
$topics[$n]['post'] = rtrim($topics[$n]['post'])."...";
};
$replies = "";
if ($commenting == "1") {
$topicposts = $SDK->list_topic_posts($topics[$n]['tid']);
foreach($topicposts as $tposts) {
if ($tposts['pid'] != $topics[$n]['pid']) {
if ($comment_limit > "0" && str_word_count($SDK->html2bbcode($tposts['post'])) > $comment_limit) {
$ccontent = preg_split('/ /', $SDK->html2bbcode($tposts['post']), -1, PREG_SPLIT_OFFSET_CAPTURE);
$tposts['post'] = "";
for ($i = "0"; $i < $comment_limit; $i++) {
$tposts['post'] .= ltrim($SDK->bbcode2html($ccontent[$i]['0']));
};
$tposts['post'] = rtrim($tposts['post'])."...";
};
$comment = array( 'author' => $tposts['author_name'],
'date' => $SDK->sdk_date($topics[$n]['post_date'], "d.m.Y, H:i"),
'comment' => $tposts['post'],
'id' => $tposts['pid'],
);
$replies .= Comment_Template($comment)."\n";
};
};
};
$group = $SDK->get_groupinfo();
$minfo = $SDK->get_info();
$newslink = array( 'add' => $board_url.'/index.php?act=Post&CODE=02&f='.$forumid.'&t='.$
topics[$n]['tid'],
'edit' => $board_url.'/index.php?act=Post&CODE=08&f='.$forumid.'&t='.$
topics[$n]['tid'].'&p='.$topics[$n]['
pid'],
'mail' => $board_url.'/index.php?act=Forward&f='.$forumid.'&t='.$topics[
$n]['tid'],
'print' => $board_url.'/index.php?act=Print&client=printer&f='.$forumid.'&t='
.$topics[$n]['tid'],
'profile' => $board_url.'/index.php?act=Profile&CODE=03&MID='.$topics[$n][
'starter_id'],
'view' => $board_url.'/index.php?act=ST&f='.$forumid.'&t='.$topics[$
n]['tid'].'&view=getlastpost',
);
$newsinfo = array( 'author' => $topics[$n]['author_name'],
'prefix' => $group['prefix'],
'suffix' => $group['suffix'],
'avatar' => $SDK->get_avatar($topics[$n]['starter_id']),
'pipsc' => $SDK->get_member_icon($topics[$n]['starter_id']),
'pips' => $SDK->get_member_pips($topics[$n]['starter_id']),
'signature' =>$SDK->get_raw_sig($topics[$n]['starter_id']),
'comments' => $topics[$n]['posts'],
'desc' => $topics[$n]['description'],
'date' => $SDK->sdk_date($topics[$n]['start_date'] + ($time_offset * 3600), "d.m.Y, H:i"),
'mid' => $minfo['id'],
'post' => $topics[$n]['post'],
'sid' => $topics[$n]['starter_id'],
'tid' => $topics[$n]['tid'],
'title' => $topics[$n]['title'],
);
$newsinfo['comarea'] = !empty($replies) ? Commenting_Area($replies,$newsinfo) : "";
$newsdesc = (!empty($newsinfo['desc']) ? "1" : "0");
$newsedit = ($newsinfo['mid'] == $newsinfo['sid'] || $SDK->is_admin($newsinfo['mid']) ? "1" : "0");
$newslogg = ($SDK->is_loggedin() ? "1" : "0");
News_Template($newsinfo,$newslink,$newsdesc,$newsedit,$newslogg);
};
};
News_Page_Bar($pagelink,($auto_paging == "1" ? "bot" : ""),$lastpage);
?>
Ce message a été modifié par Tamplan - 02 juillet 2009 - 17:32.

Aide












