File size: 4.18Kb
<?php
/*-----------------------------------------------------------------------------------------
mcGalleryPRO
All code is © 2003 Marc Cagninacci.
No files may be redistributed in whole or significant part.
----------------- mcgalleryPRO IS NOT FREE SOFTWARE -------------------
You should have receive a file called license.txt in this package
--------------------------------------------------------------------------------------------*/
function courte($tottext)
{
$chap = explode("<br />", $tottext);
while (list($key, $text) = each($chap))
{
$text = trim($text);
$tab_w = explode(" ", $text);
$nb_w = count($tab_w);
$nb_i = 0;
$string = "";
for ($i = 0; $i < $nb_w; $i++)
{
$tmp_w = strip_tags($tab_w[$i]);
$nb_i+= strlen($tmp_w);
if ($nb_i < 110)
{
$nb_i+= 1;
$string.= $tab_w[$i]." "; //
}
else
{
$string.= "<br>".$tab_w[$i]." "; //
$nb_i = strlen($tmp_w);
}
}
$out.= '<br>'.$string;
}
return $out;
}
include './header_pop.php';
include './admin/conf.inc.php';
include './lang/'.$lang_def;
include 'smilies.php';
$lecture = date("Y-m-d");
$connect= mysql_connect($host,$login,$pass);
mysql_select_db($base, $connect);
if ( $exp != 1 )
{
$query= "UPDATE mcgallery_card SET lecture='$lecture' WHERE id=$id AND nb='$nb'";
mysql_query($query);
}
$query= "SELECT * FROM mcgallery_card WHERE id=$id AND nb='$nb'";
$res = mysql_query($query);
$row = mysql_fetch_array($res);
if ($row['image'] == 'x') { $display = $l_deleted; }
elseif ( substr($row['image'], -3) == 'mpg') { $display = '<embed src="'.$row['image'].'" width="'.$flash_width.'" height="'.$flash_height.'" autostart="true" align="middle"></embed>'; }
elseif ( substr($row['image'], -3) == 'swf')
{
$display =
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'.$flash_width.'" height="'.$flash_height.'">
<param name="movie" value="'.$row['image'].'">
<param name="quality" value="high">
<embed src="'.$row['image'].'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'.$flash_width.'" height="'.$flash_height.'"></embed></object>';
}
else { $display = '<img src="markee.php?im='.$row['image'].'" border="0" alt="">'; }
echo '<table border="0" align="center" class="td1" cellpadding="0"><tr><td>';
echo '<table border="0" align="center" cellspacing="1" cellpadding="2"><tr>';
echo '<td class="td1" align="right"><font size="1">'.$l_Date.' : </font></td>';
echo '<td class="td2"><font size="2">'.$row['date'].'</font></td></tr>';
echo '<tr><td class="td1" align="right"><font size="1">'.$l_To.' : </font></td>';
echo '<td class="td2"><font size="2">'.$row['nom_dest'].'</font></td></tr>';
echo '<tr><td class="td1" align="right"><font size="1">'.$l_From.' : </font></td>';
echo '<td class="td2"><font size="2">'.$row['nom_exp'].' <a href="mailto:'.$row['email_exp'].'" class="lien1"><b>'.$row['email_exp'].'</b></a></font></td></tr>';
echo '<tr><td class="td1" align="right" valign="top"><font size="1">'.$l_Message.' : </font></td>';
$row['message'] = preg_replace('/([^ ]{50})/si','\\1 ', $row['message']);
$texte = courte(nl2br(htmlspecialchars(stripslashes($row['message']))));
$texte = str_replace($images, $smilies, $texte);
echo '<td class="td2"><font size="2">'.$texte.'</font></td></tr>';
echo '<tr><td class="td2" align="center" colspan="2">'.$display.'</td></tr>';
echo '<tr><td class="td1" align="right" colspan="2" height="3"></td></tr>';
echo '</table>';
echo '</td></tr></table>';
if ( $exp != 1 )
{
if ($mail_function == 1)
{
email("ecard",$row[email_exp],$l_subject_ecard,"$l_read1\n$row[nom_dest] ($row[email_dest])\n$l_read2\n$l_read3\n$site/viewcard.php?id=$row[id]&nb=$row[nb]&exp=1");
}
else
{
mail("$row[email_exp]",
"$l_subject_ecard",
"$l_read1\n$row[nom_dest] ($row[email_dest])\n$l_read2\n$l_read3\n$site/viewcard.php?id=$row[id]&nb=$row[nb]&exp=1",
"From: $email_admin");
}
}
?>
<br><br>
</body>
</html>