![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 128 Pomógł: 0 Dołączył: 3.11.2014 Ostrzeżenie: (0%) ![]() ![]() |
Cześć, mam system newsow i automatyccznie dadaje newsa, ale jednak chcialbym, aby tekst był uciety. Dajmy na to do 150 znakow, a nastepnie na dole pojawia się Czytaj Więcej i przekierowywuje mnie na strone z pelnym artykulem, jak to zrobic ?
http://signweb.xaa.pl/skrypt/news.php |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 279 Pomógł: 58 Dołączył: 14.07.2012 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 128 Pomógł: 0 Dołączył: 3.11.2014 Ostrzeżenie: (0%) ![]() ![]() |
// strip tags to avoid breaking any html
$string = strip_tags($string); if (strlen($string) > 500) { // truncate string $stringCut = substr($string, 0, 500); // make sure it ends in a word so assassinate doesn't become ass... $string = substr($stringCut, 0, strrpos($stringCut, ' ')).'... <a href="/this/story">Read More</a>'; } echo $string; to w plik, ktory news wyswietla? |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 279 Pomógł: 58 Dołączył: 14.07.2012 Ostrzeżenie: (0%) ![]() ![]() |
Tak, $string to zmienna z treścią newsa.
|
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 128 Pomógł: 0 Dołączył: 3.11.2014 Ostrzeżenie: (0%) ![]() ![]() |
Troche nie rozumiem, móglby to ktos jasniej wytlumaczyc, co zrobic, zbey po kliknieciu czytaj dalej przenosilo na strone, ktora jest automatycznie tworzona razem z newsem?
Jak już dodalem ten kod co wyzej podalem, to co dlaej mam robic ? |
|
|
![]() ![]() |
![]() |
Aktualny czas: 8.10.2025 - 09:50 |