Jump to content
Sign in to follow this  
Titi Grand

Limitare Caractere

Recommended Posts

Cum pot limita caracterele si sa apara dupa ..... de ex: " Cine sunt eu? , Cine sun.... " acesta este codul

<?'.$rand['despre'].'
$sql = mysql_query('SELECT * FROM jocuri');
$sq2 = mysql_query('SELECT * FROM jocuri');
$totaliduri = mysql_num_rows($sql);
$totalfete = mysql_num_rows($sq2);
$rezultate_maxime_in_linie = 3;
$rezultate_maxime_in_jos = 7;
$result = mysql_query('SELECT * FROM jocuri');
$totale = mysql_num_rows($result);
if($totale == 0) echo '';
elseif(!isset($_GET['pagina'])) $pagina = 1;
else $pagina = $_GET['pagina'];
$cerereSQL = mysql_query('SELECT * FROM `jocuri` ORDER by `id` DESC LIMIT '.(($pagina * ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie)) - ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie)).', '.($rezultate_maxime_in_jos*$rezultate_maxime_in_linie).' ');
$pagini_totale = ceil($totale / ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie));
if($pagina > $pagini_totale) header('location: index.php');
elseif($pagini_totale > 0) {
$seteaza = 0;
$numar = ($pagina - 1) * ($rezultate_maxime_in_jos*$rezultate_maxime_in_linie);
$culoare_celula = '#FFE0B3';
       echo '';
while($rand = mysql_fetch_array($cerereSQL)) {
$numar++;
if($seteaza == $rezultate_maxime_in_linie) {
echo "</tr><tr>n";
$seteaza = 1;
if($culoare_celula == "#FFE0B3")  $culoare_celula = "#FFFFFF";
else $culoare_celula = "#FFE0B3";
} else $seteaza++;
// prescurtare nume
$nume_1 = substr($rand['nume'],0,12);
?>
<?php
echo '
     <div class="coloana">
               <ul class="lista-items">    <li>
<div> <a href="../joc.html?joaca='.$rand['joaca'].' ">
<img src="../upload/jocimg/'.$rand['linkpoza'].' "/></a></div>
 <a href="../joc.html?joaca='.$rand['joaca'].'  " title=" '.$rand['joaca'].' ">'.$rand['joaca'].'</a><br />
<span>'.$rand['despre'].'
</span><br />                  </li>
</ul>
?>

Share this post


Link to post
Share on other sites

poti folosi proprietatea CSS text-overflow ce poate avea valorile clip sau ellipsis.

 

Exemplu:

<style type="text/css">
div {
white-space:nowrap;
width:10em;
overflow:hidden;
border:1px solid #000000;
}
</style>
<div style="text-overflow:clip;">Acest text nu incape in element</div>
<div style="text-overflow:ellipsis;">Acest text nu incape in element</div>

 

Pune asta intr-o pagina noua html si vezi diferenta.


http://www.tutorialeweb.net

Tutoriale xHtml, CSS, JavaScript, PHp, MySql, AutoCAD

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...