|
Трабла с разбитием на страницы....Обсуждение темы Трабла с разбитием на страницы.... в разделе HTML, CSS, JavaScript, часть категории ВЕБ-ПРОГРАММИРОВАНИЕ; Есть гостевая... Всё работает на ура... Но вот есть один бажок : Разбитие на страницы не работает У меня установлено 5 сообщений на ... |
|
Опции темы |
29.01.2004, 15:43 | #1 |
|
Есть гостевая...
Всё работает на ура... Но вот есть один бажок : Разбитие на страницы не работает У меня установлено 5 сообщений на 1-ну страницу А у меня 6 сообщений 5 из них на странице... А еще одно на 2-ой только вот эту самую 2-ую страничку посмотреть не возможно... т.к на неё не выдается ссылка... Вот посмотрите Подскажите где я мог набадяжить либо в шаблонах либо в скрипте -=otec=- добавил [date]1075380560[/date]: С шаблонами всё нормально... как видите номер 1-ой страницы показывается... А вот остальные нет. Переменныя которая указана в шаблоне на вывод страниц называется %line% |
|
29.01.2004, 16:50 | #2 |
|
Хм... а что за скрипт в целом?
|
|
29.01.2004, 17:09 | #3 |
|
Скрипт гостевой...
Вот код.... --------------------------------------- <? include("config.inc.php"); function p ($string){ $string = str_replace('\"','"',$string); $string = str_replace("\'",""",$string); $string = str_replace("\&","&",$string); return $string; } function vm($mail) { if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $mail)) { return true;} else { return false;} } function replace ($string){ $string = ereg_replace("<","<",$string); $string = ereg_replace(">",">",$string); $string = ereg_replace('\\\"',""",$string); $string = ereg_replace('\\"',""",$string); $string = ereg_replace("::","::",$string); $string = ereg_replace("!","!",$string); $string = ereg_replace("\r\n"," ",$string); $string = ereg_replace("\n"," ",$string); $string = ereg_replace("%","%",$string); $string = ereg_replace("^ +","",$string); $string = ereg_replace(" +$","",$string); $string = ereg_replace(" +"," ",$string); return $string; } if(empty($user_ip)){if (getenv('HTTP_X_FORWARDED_FOR')) {$user_ip=getenv('HTTP_X_FORWARDED_FOR'); } else{$user_ip=getenv('REMOTE_ADDR'); }} else{$user_ip=getenv('REMOTE_ADDR'); } if(15 < strlen($user_ip)){list($user_ip,$user_ip1,$user_ip 2,$user_ip3)=explode(", ", $user_ip);} $ip = $user_ip; if ($action == "gost") { include("config.inc.php"); $adres = "action=gost"; $t_mha = @file("$dtemplates/index_top.htm"); for($mha = 0 ; $mha < count($t_mha); $mha++){ $t_mha[$mha] = str_replace("%title%","Гостевая книга.",$t_mha[$mha]); echo "$t_mha[$mha]";} function error() { include ("config.inc.php"); $t_error = @file("$dtemplates/gost_error.htm"); $tmp = @file("$dlogs/gosterrors.tmp"); for ($tm = 0; $tm < count($tmp); $tm++) { list($er1,$er2,$er3,$er4,$er5,$er6,$er7,$er8,$er9) =explode("::", $tmp[$tm]); } for($e = 0 ; $e < count($t_error); $e++) { if ($er1 == "yes") { $t_error[$e] = str_replace("%error1%","<font color=$error_color>$e1</font>",$t_error[$e]); } if ($er1 == "") { $t_error[$e] = str_replace("%error1%",$e1,$t_error[$e]);} if ($er2 == "yes") { $t_error[$e] = str_replace("%error2%","<font color=$error_color>$e2</font>",$t_error[$e]); } if ($er2 == "") { $t_error[$e] = str_replace("%error2%",$e2,$t_error[$e]);} if ($er3 == "yes") { $t_error[$e] = str_replace("%error3%","<font color=$error_color>$e3</font>",$t_error[$e]); } if ($er3 == "") { $t_error[$e] = str_replace("%error3%",$e3,$t_error[$e]);} if ($er4 == "yes") { $t_error[$e] = str_replace("%error4%","<font color=$error_color>$e4</font>",$t_error[$e]); } if ($er4 == "") { $t_error[$e] = str_replace("%error4%",$e4,$t_error[$e]);} if ($er5 == "yes") { $t_error[$e] = str_replace("%error5%","<font color=$error_color>$e5</font>",$t_error[$e]); } if ($er5 == "") { $t_error[$e] = str_replace("%error5%",$e5,$t_error[$e]); } if ($er6 == "yes") { $t_error[$e] = str_replace("%error6%","<font color=$error_color>$e6</font>",$t_error[$e]); } if ($er6 == "") { $t_error[$e] = str_replace("%error6%",$e6,$t_error[$e]); } if ($er7 == "yes") { $t_error[$e] = str_replace("%error7%","<font color=$error_color>$e7</font>",$t_error[$e]); } if ($er7 == "") { $t_error[$e] = str_replace("%error7%",$e7,$t_error[$e]); } if ($er8 == "yes") { $t_error[$e] = str_replace("%error8%","<font color=$error_color>$e8</font>",$t_error[$e]); } if ($er8 == "") { $t_error[$e] = str_replace("%error8%",$e8,$t_error[$e]); } if ($er9 == "yes") { $t_error[$e] = str_replace("%error9%","<font color=$error_color>$e9</font>",$t_error[$e]); } if ($er9 == "") { $t_error[$e] = str_replace("%error9%",$e9,$t_error[$e]); } echo $t_error[$e];}} if ($add == "yes") { $t_form = @file("$dtemplates/gost_form.htm"); for($f = 0 ; $f < count($t_form); $f++){ $t_form[$f] = str_replace("%adres%",$adres,$t_form[$f]); $t_form[$f] = str_replace("%name%",$c_name,$t_form[$f]); $t_form[$f] = str_replace("%mail%",$c_mail,$t_form[$f]); $t_form[$f] = str_replace("%city%",$c_city,$t_form[$f]); $t_form[$f] = str_replace("%homepage%",$c_homepage,$t_form[$f]); $t_form[$f] = str_replace("%add_button%",$add_b,$t_form[$f]); echo $t_form[$f];}} if ($add == "$add_b"){ $name = replace($name);$message = replace($message);$mail = replace($mail);$city = replace($city);$homepage = replace($homepage); $date = time(); include ("config.inc.php"); if (strlen($name) > $mname) { $error = "yes"; $er2 = "yes"; } if (strlen($mail) > $mmail) { $error = "yes"; $er3 = "yes"; } if (strlen($city) > $mcity) { $error = "yes"; $er4 = "yes"; } if (strlen($homepage) > $mhomepage) { $error = "yes"; $er5 = "yes"; } if (strlen($message) > $mmessage) { $error = "yes"; $er6 = "yes"; } if ($mail != "") { if (vm($mail)) { } else { $error = "yes"; $er7 = "yes"; } } $autof = @file("$autochange"); for ($au=0; $au < count($autof); $au++) { list($autochange3,$autochange2)=explode("::", $autof[$au]); if ($auchname == "yes") { $name = eregi_replace("$autochange3","$autochange2","$name "); } if ($auchcity == "yes") { $city = eregi_replace("$autochange3","$autochange2","$city "); } if ($auchmail == "yes") { $mail = eregi_replace("$autochange3","$autochange2","$mail "); } if ($auchhomepage == "yes"){ $homepage = eregi_replace("$autochange3","$autochange2","$home page"); } if ($auchmessage == "yes") { $message = eregi_replace("$autochange3","$autochange2","$mess age"); } $name = eregi_replace("\n","","$name"); $city = eregi_replace("\n","","$city"); $mail = eregi_replace("\n","","$mail"); $homepage = eregi_replace("\n","","$homepage"); $message = eregi_replace("\n","","$message"); $name = eregi_replace("\r\n","","$name"); $city = eregi_replace("\r\n","","$city"); $mail = eregi_replace("\r\n","","$mail"); $homepage = eregi_replace("\r\n","","$homepage"); $message = eregi_replace("\r\n","","$message");} $general=@file($gostbase); $lines=count($general); $all_messages = $lines; $ban = @file("$banlist"); for ($fbo = 0; $fbo < count($ban); $fbo++){ $ban[$fbo] = ereg_replace("\n","",$ban[$fbo]); list($banip,$banmessage)= spliti ("\::",$ban[$fbo]); if (ereg("^$banip$",$ip)) { $error = "yes"; $er9 = "yes"; }} for ($i=0; $i < $lines; $i++){ list($t1,$messageold,$t2,$t3,$t4,$t5,$t6)=explode( "::", $general[$i]); if ($messageold == "$message") { $error = "yes"; $er8 = "yes"; }} if ($name == "" or $message == "") { $er1 = "yes"; } if ($name == "" or $message == "" or $error == "yes"){ $tmp_gb = @fopen("$dlogs/gosterrors.tmp","w+"); $er1 = replace($er1); $er2 = replace($er2); $er3 = replace($er3); $er4 = replace($er4); $er5 = replace($er5); $er6 = replace($er6); $er7 = replace($er7); $er8 = replace($er8); $er9 = replace($er9); @fputs ----------------------------------- Это первая половина -=otec=- добавил [date]1075385589[/date]: А вот вторая половина... -------------------------- ($tmp_gb,"$er1::$er2::$er3::$er4::$er5::$er6::$er7 ::$er8::$er9::\n"); @fclose ($tmp_gb); error(); $t_form = @file("$dtemplates/gost_form.htm"); for($f = 0 ; $f < count($t_form); $f++){ $t_form[$f] = str_replace("%adres%",$adres,$t_form[$f]); $t_form[$f] = str_replace("%name%",$name,$t_form[$f]); $t_form[$f] = str_replace("%mail%",$mail,$t_form[$f]); $t_form[$f] = str_replace("%city%",$city,$t_form[$f]); $t_form[$f] = str_replace("%homepage%",$homepage,$t_form[$f]); $t_form[$f] = str_replace("%add_button%",$add_b,$t_form[$f]); echo $t_form[$f];} $t_mha = @file("$dtemplates/index_end.htm"); for($mha = 0 ; $mha < count($t_mha); $mha++){ $t_mha[$mha] = str_replace("%mtime%",$mtime,$t_mha[$mha]); $t_mha[$mha] = str_replace("%c_name%",$c_name,$t_mha[$mha]); $t_mha[$mha] = str_replace("%c_mail%",$c_mail,$t_mha[$mha]); $t_mha[$mha] = str_replace("%host%",$host_stat_day,$t_mha[$mha]); $t_mha[$mha] = str_replace("%hit%",$hit_stat_day,$t_mha[$mha]); $t_mha[$mha] = str_replace("%user%",$user_online,$t_mha[$mha]); echo "$t_mha[$mha]";} exit;} if ($name != "" and $message != ""){ if ($iwe == "yes"){ $body = $nmig; $b_mail = $mail; $b_city = $city; $b_homepage = $homepage; $body = str_replace("%name%",$name,$body); if ($b_mail != "") { $body = str_replace("%mail%","<a href=\"mailto:$b_mail\">$b_mail</a>",$body); } if ($b_mail == "") { $body = str_replace("%mail%","none",$body); } if ($b_city != "") { $body = str_replace("%city%",$b_city,$body); } if ($b_city == "") { $body = str_replace("%city%","none",$body); } if ($b_homepage != ""){ $body = str_replace("%homepage%","<a href=\"http://$b_homepage\" target=\"_blank\">$b_homepage</a>",$body);} if ($b_homepage == ""){ $body = str_replace("%homepage%","none",$body); } $body = str_replace ("%date%","".date("d.m.Y",$date)."","$body"); $body = str_replace ("%message%","$message","$body"); $body = str_replace ("%ip%","$ip","$body"); $from="\"Гостевая книга\" <$noos>"; $headers="Content-Type: text/html; charset=windows-1251\n"; $headers.="From: $from"; $newm = "Новое сообщение в гостевой книге"; @mail($moa,$newm,$body,$headers); } if ($homepage != ""){ $homepage = eregi_replace("http:\/\/","",$homepage); $homepage = eregi_replace("www.","",$homepage); } $fp = @fopen($gostbase,"a"); @fputs ($fp,"$name::$message::$mail::$city::$homepage::$d ate::$ip::\n"); @fclose ($fp); }} if ($action="gost" and $add != "yes"){ $general=@file($gostbase); $lines=count($general); if ($lines == "0"){ $t_center = @file("$dtemplates/gost_center.htm"); for($c = 0 ; $c < count($t_center); $c++){ $t_center[$c] = str_replace("%adres%",$adres,$t_center[$c]); $t_center[$c] = str_replace("%line%",$line,$t_center[$c]); $t_center[$c] = str_replace("%page%",$page,$t_center[$c]); echo $t_center[$c];} include("$dtemplates/gost_empty.htm");} $all_messages = $lines; $pmessages = @file($gostbase); if ($page == "") { $page = 1; } $first = count($pmessages) - ($onlyg * ($page - 1)); $second = count($pmessages) - ($onlyg * $page) + 1; if ($second < 1) { $second = 1; } $pages = (int) ((count($pmessages) + $onlyg) / $onlyg); if ($addpage_abs == 0) {$addpage_abs = $addpage; } if ($adpage == yes) {$addpage_abs = $addpage_abs + $addpage;} if ($adpage == no) {$addpage_abs = $addpage_abs - $addpage;} $addpageno_abs = $addpage_abs - $addpage; $line = "Страницы: "; if ($addpageno_abs >= $addpage){ $line .= " <a href=\"gost.php?$adres&page=$addpageno_abs&adpage= no&addpage_abs=$addpage_abs&addpageno_abs=$addpage no_abs\" title=\"назад\"> << </a>";} $line .= "|"; for ($onlyg = 1; $onlyg <= $pages; $onlyg++) { if ($addpage_abs >= $onlyg and $addpageno_abs < $onlyg){ if ($onlyg != $page) { $line .= " <a href=\"gost.php?$adres&page=$onlyg&addpage_abs=$ad dpage_abs&addpageno_abs=$addpageno_abs\" title=\"$perp $onlyg\">$onlyg</a> |"; } if ($onlyg == $page) { $line .= " <font color=#FF0000>$onlyg</font> |"; }}} if ($addpage_abs < $onlyg-1){ $adp=$addpage_abs+1; $line .= " <a href=\"gost.php?$adres&page=$adp&adpage=yes&addpag e_abs=$addpage_abs&addpageno_abs=$addpageno_abs\" title=\"еще\"> еще>> </a>";} if ($all_messages != "0"){ if($all_messages <= $addpage){$line = "<font size=1>Страница: |<font color=FF0000> 1</font> |</font>";} else{$line = $line;} $t_center = @file("$dtemplates/gost_center.htm"); for($c = 0 ; $c < count($t_center); $c++){ $t_center[$c] = str_replace("%adres%",$adres,$t_center[$c]); $t_center[$c] = str_replace("%line%",$line,$t_center[$c]); $t_center[$c] = str_replace("%page%",$page,$t_center[$c]); echo $t_center[$c];}} for ( $i = $first-1; $i >= $second-1; $i--){ list($name,$message,$mail,$city,$homepage,$date,$i p,$answer)=explode("::", $general[$i]); $id = $i; $id++; $date = date("$mdate",$date); $t_mha = @file("$dtemplates/gost_message.htm"); $message = p($message); for($mha = 0 ; $mha < count($t_mha); $mha++){ $t_mha[$mha] = str_replace("%name%",$name,$t_mha[$mha]); if ($city != "") { $t_mha[$mha] = str_replace("%city%","$cp $city",$t_mha[$mha]); } if ($city == "") { $t_mha[$mha] = str_replace("%city%","",$t_mha[$mha]); } if ($mail != "") { $t_mha[$mha] = str_replace("%mail%","<a href=\"mailto:$mail\"><img border=0 src=\"img/email_forum.gif\" alt=\"написать письмо: $mail\" width=14 height=10></a>",$t_mha[$mha]);} else{ $t_mha[$mha] = str_replace("%mail%"," ",$t_mha[$mha]);} if ($homepage != ""){ $t_mha[$mha] = str_replace("%homepage%","<a href=\"http://www.$homepage\" target=\"_blank\"><img src=\"img/homepage.gif\" alt=\"перейти на страничку: $homepage\" border=0 width=14 height=15></a>",$t_mha[$mha]);} if ($homepage == ""){ $t_mha[$mha] = str_replace("%homepage%"," ",$t_mha[$mha]); } $t_mha[$mha] = str_replace("%message%",$message,$t_mha[$mha]); $t_mha[$mha] = str_replace("%date%",$date,$t_mha[$mha]); if (strlen($answer) != "1"){ $t_mha[$mha] = str_replace("%admin%","$yn:",$t_mha[$mha]); $t_mha[$mha] = str_replace("%answer%","$answer",$t_mha[$mha]);} if (strlen($answer) == "1"){ $t_mha[$mha] = str_replace("%admin%","",$t_mha[$mha]); $t_mha[$mha] = str_replace("%answer%","",$t_mha[$mha]);} $t_mha[$mha] = str_replace("%id%",$id,$t_mha[$mha]); echo $t_mha[$mha];}echo " ";} if ($all_messages != "0"){ $t_bottom = @file("$dtemplates/gost_bottom.htm"); for($b = 0 ; $b < count($t_bottom); $b++){ $t_bottom[$b] = str_replace("%line%",$line,$t_bottom[$b]); $t_bottom[$b] = str_replace("%page%",$page,$t_bottom[$b]); $t_bottom[$b] = str_replace("%all_messages%",$all_messages,$t_bott om[$b]); echo $t_bottom[$b];}}} $t_mha = @file("$dtemplates/index_end.htm"); for($mha = 0 ; $mha < count($t_mha); $mha++){ $t_mha[$mha] = str_replace("%mtime%",$mtime,$t_mha[$mha]); $t_mha[$mha] = str_replace("%c_name%",$c_name,$t_mha[$mha]); $t_mha[$mha] = str_replace("%c_mail%",$c_mail,$t_mha[$mha]); $t_mha[$mha] = str_replace("%host%",$host_stat_day,$t_mha[$mha]); $t_mha[$mha] = str_replace("%hit%",$hit_stat_day,$t_mha[$mha]); $t_mha[$mha] = str_replace("%user%",$user_online,$t_mha[$mha]); echo "$t_mha[$mha]";} exit;} ?> --------------------------- переменная в шаблоне на вывод разбивки %lines% |
|
30.01.2004, 01:00 | #4 |
|
Не фига ж себе скрипт... А в [PHP] его не закдючишь???
|
|
30.01.2004, 12:39 | #5 |
|
если ктонить найдёт ошибку тому - медаль
|
|
30.01.2004, 13:21 | #6 |
|
Я даже смотреть не буду у меня гостевуха раза в три как минимум меньше!!!
|
|
30.01.2004, 14:40 | #7 |
|
А причем тут твоя гостевая книга...
Я не про твою а про свою спросил... А если смотреть не хочеш чё зря оффтопить!!! >( |
|
30.01.2004, 15:13 | #8 |
|
Вроде все пашет ????
|
|
07.02.2004, 21:20 | #9 |
|
а принцип скрипта разбиения страниц кто-нибудь может сказать?
|
|
07.02.2004, 23:26 | #10 |
|
unhappy
Могу исходник подкинуть.. стучись в асю 79.31.31 |
|
|
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Помогите с CSS страницы ! | cashfile | HTML, CSS, JavaScript | 30 | 17.03.2010 00:42 |
Растворение страницы | anton | HTML, CSS, JavaScript | 2 | 23.04.2007 10:34 |
страницы | vik7878 | ASP, Perl, PHP и MySQL | 3 | 08.08.2006 16:33 |
Вес страницы | BESTIARI | Кальянная | 10 | 28.02.2005 22:42 |
Страницы... | Денисон | HTML, CSS, JavaScript | 3 | 02.09.2004 19:44 |
Реклама на форуме
Условия размещения рекламы
Биржа ссылок
Заработай на сайте!
|