bonjour,
je suis en train de creer grace un script devolia un reseau social interne, cependant quand je place une url dans un commentaire ou meme mon statut il n'est pas cliquable, j'ai essayé cette methode mais ca ne fonctionne pas, j'ai bien l'url qui s'affiche mais elle n'est pas cliquable.
voici une partie du code :
// Get information on the owner of the news
$parms = array(
'mode' => 'by_id',
'id' => $this->concerned_id
);
$owner = new user($parms);
$html .= ' <img alt="photo_user" class="news_photo"
src="'.$config['site_url'].'devoliarsed-img.php?img='.$owner->get_photo_profil()
.'&width=60&height=60&mode=crop"/>';
$html .= "<div class='piece_news'>";
$html .= "<strong><a href=\"profil-".$owner->get_id().".html\">".$owner->get_firstname()." "
.$owner->get_name()."</a></strong> : ";
$size_pseudo = strlen($owner->get_firstname()." ".$owner->get_name()." : ");
$statut_resize = $this->correct_news(utf8_encode($this->content),65,$size_pseudo);
$html .= "<span class='piece_news_content'>".$statut_resize."</span>";
function url2link($statut_resize) {
$statut_resize = str_replace("&", "é", $statut_resize);
$statut_resize = eregi_replace("(http|mailto|news|ftp|https)://(([-éa-z0-9\/\.\?_=#@:~])*)", "<a href=\"\\1://\\2\">\\1://\\2</a>", $statut_resize);
return str_replace("é", "&", $statut_resize);
}
$html .= '<br/><br/><span class="piece_news_date">'.$this->get_delay($this->date).'</span>';
$html .= ' . <a
onclick="if (document.getElementById(\'comForm_'.$this->get_id().'\').style
.display == \'block\') {
document.getElementById(\'comForm_'.$this->get_id().'\').style.display = \'none\'; }
else {document.getElementById(\'comForm_'.$this->get_id().'\').style
.display = \'block\';
document.getElementById(\'idCom_'.$this->get_id().'\').focus()}">
Comment</a><br/>';
$html .= '<div id=com_'.$this->id.' style="display:inline-block;">'
.$this->get_comments_html().'</div>';
$html .= '<form id="comForm_'.$this->id.'" class="com_form">
<textarea id="idCom_'.$this->id.'" cols="68" rows="1"></textarea><br/>';
$html .= '<input type="button" value="'.$xml->comment_text.'"
onclick="send_com('.$this->id.',\''.$this->wall_type.'\')"/>
</form></div>';
$html .= '<div id="suppr_news_'.$this->id.'" class="supp_news">
<strong><a onclick="suppr_news('.$this->id.',\''.$this->wall_type.'\',
\''.$this->wall_owner.'\')">
<img src="'.$this->config['site_url'].
'devoliarsed-custom/themes/'.$this->config['theme'].'/images/close.png" alt="suppr"/>
</a></strong>
</div>';
$html .= "</div>";
$html .= "</div>";
break;
}
case 'GROUP' : {
$parms = array(
"mode" => "by_id",
"group_id" => $this->wall_owner
);
$group = new group($parms);
if (($user_ID == $this->concerned_id) || (in_array($user_ID, $group->get_admins())) ){
$html .= "<div class='news' id='news_".$this->id."'
onmouseover=\"document.getElementById('suppr_news_".$this->id
."').style.display='inline';\"
onmouseout=\"document.getElementById('suppr_news_".$this->id
."').style.display='none';\">";
} else {
$html .= "<div class='news' id='news_".$this->id."'>";
}
// Get information on the owner of the news
$parms = array(
'mode' => 'by_id',
'id' => $this->concerned_id
);
$owner = new user($parms);
$html .= ' <img alt="photo_user" class="news_photo"
src="'.$config['site_url'].'devoliarsed-img.php?img='.$owner->get_photo_profil()
.'&width=60&height=60&mode=crop"/>';
$html .= "<div class='piece_news'>";
$html .= "<strong><a href=\"profil-".$owner->get_id().".html\">".$owner->get_firstname()." "
.$owner->get_name()."</a></strong> : ";
$size_pseudo = strlen($owner->get_firstname()." ".$owner->get_name()." : ");
$statut_resize = $this->correct_news(utf8_encode($this->content),65,$size_pseudo);
$html .= "<span class='piece_news_content'>".$statut_resize."</span>";
function url2link($statut_resize) {
$statut_resize = str_replace("&", "é", $statut_resize);
$statut_resize = eregi_replace("(http|mailto|news|ftp|https)://(([-éa-z0-9\/\.\?_=#@:~])*)", "<a href=\"\\1://\\2\">\\1://\\2</a>", $statut_resize);
return str_replace("é", "&", $statut_resize);
}
$html .= '<br/><br/><span class="piece_news_date">'.$this->get_delay($this->date).'</span>';
$html .= ' . <a
onclick="if (document.getElementById(\'comForm_'.$this->get_id().'\').style
.display == \'block\') {
document.getElementById(\'comForm_'.$this->get_id().'\').style.display = \'none\'; }
else {document.getElementById(\'comForm_'.$this->get_id().'\').style
.display = \'block\';
document.getElementById(\'idCom_'.$this->get_id().'\').focus()}">
Comment</a><br/>';
$html .= '<div id=com_'.$this->id.' style="display:inline-block;">'
.$this->get_comments_html().'</div>';
$html .= '<form id="comForm_'.$this->id.'" class="com_form">
<textarea id="idCom_'.$this->id.'" cols="68" rows="1"></textarea><br/>';
$html .= '<input type="button" value="'.$xml->comment_text.'"
onclick="send_com('.$this->id.',\''.$this->wall_type.'\')"/>
</form></div>';
$html .= '<div id="suppr_news_'.$this->id.'" class="supp_news">
<strong><a onclick="suppr_news('.$this->id.',\''.$this->wall_type.'\',
\''.$this->wall_owner.'\')">
<img src="'.$this->config['site_url'].
'devoliarsed-custom/themes/'.$this->config['theme'].'/images/close.png" alt="suppr"/>
</a></strong>
</div>';
$html .= "</div>";
$html .= "</div>";
break;
}
merci
je suis en train de creer grace un script devolia un reseau social interne, cependant quand je place une url dans un commentaire ou meme mon statut il n'est pas cliquable, j'ai essayé cette methode mais ca ne fonctionne pas, j'ai bien l'url qui s'affiche mais elle n'est pas cliquable.
voici une partie du code :
// Get information on the owner of the news
$parms = array(
'mode' => 'by_id',
'id' => $this->concerned_id
);
$owner = new user($parms);
$html .= ' <img alt="photo_user" class="news_photo"
src="'.$config['site_url'].'devoliarsed-img.php?img='.$owner->get_photo_profil()
.'&width=60&height=60&mode=crop"/>';
$html .= "<div class='piece_news'>";
$html .= "<strong><a href=\"profil-".$owner->get_id().".html\">".$owner->get_firstname()." "
.$owner->get_name()."</a></strong> : ";
$size_pseudo = strlen($owner->get_firstname()." ".$owner->get_name()." : ");
$statut_resize = $this->correct_news(utf8_encode($this->content),65,$size_pseudo);
$html .= "<span class='piece_news_content'>".$statut_resize."</span>";
function url2link($statut_resize) {
$statut_resize = str_replace("&", "é", $statut_resize);
$statut_resize = eregi_replace("(http|mailto|news|ftp|https)://(([-éa-z0-9\/\.\?_=#@:~])*)", "<a href=\"\\1://\\2\">\\1://\\2</a>", $statut_resize);
return str_replace("é", "&", $statut_resize);
}
$html .= '<br/><br/><span class="piece_news_date">'.$this->get_delay($this->date).'</span>';
$html .= ' . <a
onclick="if (document.getElementById(\'comForm_'.$this->get_id().'\').style
.display == \'block\') {
document.getElementById(\'comForm_'.$this->get_id().'\').style.display = \'none\'; }
else {document.getElementById(\'comForm_'.$this->get_id().'\').style
.display = \'block\';
document.getElementById(\'idCom_'.$this->get_id().'\').focus()}">
Comment</a><br/>';
$html .= '<div id=com_'.$this->id.' style="display:inline-block;">'
.$this->get_comments_html().'</div>';
$html .= '<form id="comForm_'.$this->id.'" class="com_form">
<textarea id="idCom_'.$this->id.'" cols="68" rows="1"></textarea><br/>';
$html .= '<input type="button" value="'.$xml->comment_text.'"
onclick="send_com('.$this->id.',\''.$this->wall_type.'\')"/>
</form></div>';
$html .= '<div id="suppr_news_'.$this->id.'" class="supp_news">
<strong><a onclick="suppr_news('.$this->id.',\''.$this->wall_type.'\',
\''.$this->wall_owner.'\')">
<img src="'.$this->config['site_url'].
'devoliarsed-custom/themes/'.$this->config['theme'].'/images/close.png" alt="suppr"/>
</a></strong>
</div>';
$html .= "</div>";
$html .= "</div>";
break;
}
case 'GROUP' : {
$parms = array(
"mode" => "by_id",
"group_id" => $this->wall_owner
);
$group = new group($parms);
if (($user_ID == $this->concerned_id) || (in_array($user_ID, $group->get_admins())) ){
$html .= "<div class='news' id='news_".$this->id."'
onmouseover=\"document.getElementById('suppr_news_".$this->id
."').style.display='inline';\"
onmouseout=\"document.getElementById('suppr_news_".$this->id
."').style.display='none';\">";
} else {
$html .= "<div class='news' id='news_".$this->id."'>";
}
// Get information on the owner of the news
$parms = array(
'mode' => 'by_id',
'id' => $this->concerned_id
);
$owner = new user($parms);
$html .= ' <img alt="photo_user" class="news_photo"
src="'.$config['site_url'].'devoliarsed-img.php?img='.$owner->get_photo_profil()
.'&width=60&height=60&mode=crop"/>';
$html .= "<div class='piece_news'>";
$html .= "<strong><a href=\"profil-".$owner->get_id().".html\">".$owner->get_firstname()." "
.$owner->get_name()."</a></strong> : ";
$size_pseudo = strlen($owner->get_firstname()." ".$owner->get_name()." : ");
$statut_resize = $this->correct_news(utf8_encode($this->content),65,$size_pseudo);
$html .= "<span class='piece_news_content'>".$statut_resize."</span>";
function url2link($statut_resize) {
$statut_resize = str_replace("&", "é", $statut_resize);
$statut_resize = eregi_replace("(http|mailto|news|ftp|https)://(([-éa-z0-9\/\.\?_=#@:~])*)", "<a href=\"\\1://\\2\">\\1://\\2</a>", $statut_resize);
return str_replace("é", "&", $statut_resize);
}
$html .= '<br/><br/><span class="piece_news_date">'.$this->get_delay($this->date).'</span>';
$html .= ' . <a
onclick="if (document.getElementById(\'comForm_'.$this->get_id().'\').style
.display == \'block\') {
document.getElementById(\'comForm_'.$this->get_id().'\').style.display = \'none\'; }
else {document.getElementById(\'comForm_'.$this->get_id().'\').style
.display = \'block\';
document.getElementById(\'idCom_'.$this->get_id().'\').focus()}">
Comment</a><br/>';
$html .= '<div id=com_'.$this->id.' style="display:inline-block;">'
.$this->get_comments_html().'</div>';
$html .= '<form id="comForm_'.$this->id.'" class="com_form">
<textarea id="idCom_'.$this->id.'" cols="68" rows="1"></textarea><br/>';
$html .= '<input type="button" value="'.$xml->comment_text.'"
onclick="send_com('.$this->id.',\''.$this->wall_type.'\')"/>
</form></div>';
$html .= '<div id="suppr_news_'.$this->id.'" class="supp_news">
<strong><a onclick="suppr_news('.$this->id.',\''.$this->wall_type.'\',
\''.$this->wall_owner.'\')">
<img src="'.$this->config['site_url'].
'devoliarsed-custom/themes/'.$this->config['theme'].'/images/close.png" alt="suppr"/>
</a></strong>
</div>';
$html .= "</div>";
$html .= "</div>";
break;
}
merci