Ganzzo Posted September 6, 2009 Report Share Posted September 6, 2009 Gribēju pajautātm kā ar css izveidot tā, ka caur IPB izvelkot piemēram kādu jaunumu, tas rāda konkrētu skaitu simbolus, nevis visu rakstu, kā piemēram gign.lv Mazliet lasāmvielas... kur rāda tikai pāris vārdus, tikai ieskatam. Respektīvi kas konkrēti jāraksta lai rādītu konkrētu skaitu simbolu. Vai ti var ar css? Atēļu piemēram man pārveido šādi, bet kā uzlikt ka vel rāda tikai noteiktu skaitu simb no jaunumu teksta? #news2 img { float: left; margin: 0 2px 1px 0; width: 48px; height: 48px; } #news2 .clear { clear: both; height: 0; font-size: 5; } paldies jau iepriekš. Link to comment Share on other sites More sharing options...
Kavacky Posted September 6, 2009 Report Share Posted September 6, 2009 Ar CSS nevar. Ar PHP un substr() var. Link to comment Share on other sites More sharing options...
Ganzzo Posted September 6, 2009 Author Report Share Posted September 6, 2009 <?php $forums = "--"; $limits = "10"; $forumaID = "22"; $host = "localhost"; //hosts $dbname = "forums"; //datubaze $dbuser = "root"; //mysql lietotajs $dbpass = "pw"; // mysql parole $limitss = "20"; // Cik simbolus radit.... $link = mysql_connect($host, $dbuser, $dbpass) or die("Nesanaaca piekontektities: " . mysql_error()); mysql_select_db($dbname) or die("Datubaaze neekstistee"); mysql_query("SET NAMES utf-8"); // dabuunam datus no DB $kverisdivi = mysql_query("SELECT * FROM ibf_topics WHERE forum_id=".$forumaID." ORDER BY start_date DESC LIMIT ".$limits.""); # while($row = mysql_fetch_array( $kverisdivi )) { $rowis = mysql_fetch_array( mysql_query("SELECT * FROM ibf_posts WHERE topic_id = ".$row['tid']." ORDER by post_date LIMIT ".$limits."")); $datums = $row['start_date']; $piev_datums = date("d/m/Y | H:i:s",$datums); echo " <a href=\"$forums/index.php?showtopic=".$row['tid']."\"><b>".$row['title']."</b></a></ br>"; echo "<div id=\"news2\"><font color=#534e6c>".$rowis['post']."</font></div></ br>"; echo "<div><strong><font color=black><h5> Komentari:</font> </strong>(<a href=\"$forums/index.php?showtopic=".$row['tid']."&view=getlastpost\">".$row['posts'].")</h5></a></div></ br>"; echo ""; } Vai vari parādīt kā tieši to subscr ievietot kodā? Link to comment Share on other sites More sharing options...
X ID Posted September 6, 2009 Report Share Posted September 6, 2009 Nevis subscr, bet substr. Ar css nevar griezt vārdus/burtus/utt, bet var ierobežot pieejamo laukumu, norādot elementam width, height un overflow: hidden; Link to comment Share on other sites More sharing options...
Ganzzo Posted September 8, 2009 Author Report Share Posted September 8, 2009 substr. Ar css nevar griezt vārdus/burtus/utt, bet var ierobežot pieejamo laukumu, norādot elementam width, height un overflow: hidden; diemžēl tik labi nezinu kā to izdarīt, vai vari palīdzēt izlabot kodu? Link to comment Share on other sites More sharing options...
worm Posted September 8, 2009 Report Share Posted September 8, 2009 ja tiek lietoti latviešu mīkstinājuma burti, vai arī krievu, tad iesaku lietot funkciju mb_substr nevis substr, citādi var sanākt visādi brīnumi... http://lv.php.net/manual/en/function.mb-substr.php Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now