| Zobrazit předchozí téma :: Zobrazit následující téma |
| Autor |
Zpráva |
Seege Účastník

Založen: 10.4.2005 Příspěvky: 22
|
Zaslal: 27 červen 2005 21:04 Předmět: Kam s forem |
|
|
Provozuji forum o velmi populární hře gta: san andreas na pípni, ovšem díky velké návštěvnosti fora a množství zasílání příspěvků byl překročen 100 GB traffic a byly jsme odpojeni,
zanechat forum na současném hostingu je sebevražda, nemáte někdo tip, kam bych mohl forum přemístit?
btw správce pípni mi napsal:
Dobry den,
muzete prosim neco udelat s vasi databazi u domeny gtasa.cz . Od
minuleho tydne se zvedl trafik mezi sql a www serverem na dvojnasobek.
Vase domena prenasi ve spicce mezi sql a www serverem 2MB/s , coz
nadmerne zatezuje oba servery,. Nejpise to delaji SELECTY typu : select
* from(bez vyjmenovani sloupcu) nebo dotazy ktere vraceji stovky az
tisice radku.
Nejspis eto del atento dotaz , ktery vraci 13tisic radku.
# Query_time: 3 Lock_time: 0 Rows_sent: 13111 Rows_examined:
52461
use
forum_gtasa_cz;
SELECT a1.post_id AS postid, a1.poster_id AS poster, a1.forum_id,
a1.topic_id AS topic, a1.post_time AS time, a2.post_subject AS sub
ject, a2.post_text AS text FROM phpbb_posts a1, phpbb_posts_text a2,
phpbb_forums a3 WHERE a1.post_id = a2.post_id AND a1.forum_id =
a3.forum_id AND a3.auth_view <= "0" ORDER BY a1.post_time DESC; _________________ Get on with it! |
|
| Návrat nahoru |
|
 |
hojko Profesionál


Založen: 25.2.2005 Příspěvky: 671 Bydliště: New Zeland
|
Zaslal: 28 červen 2005 00:18 Předmět: |
|
|
Skus websupport.sk alebo exohosting.sk  |
|
| Návrat nahoru |
|
 |
kryšpín Profesionál


Založen: 17.11.2004 Příspěvky: 1360 Bydliště: Doma
|
Zaslal: 28 červen 2005 12:36 Předmět: |
|
|
| 100 Gb traffic? To snad není možný. |
|
| Návrat nahoru |
|
 |
Seege Účastník

Založen: 10.4.2005 Příspěvky: 22
|
Zaslal: 28 červen 2005 13:17 Předmět: |
|
|
| kryšpín napsal: | | 100 Gb traffic? To snad není možný. |
asii to dělal tento script, který vypisoval 5 posledních příspěvků...
je to možné?
| kód: | <html>
<body bgcolor="9E8B63" style="margin: 0">
<style>
A:active { color: #AE583F; }
A:link { color: #6A3322; }
A:visited { color: #6A3322; }
A:hover { color: #AE583F; }
</style>
<?php
$phpbb_root_path = './';
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
Function replacebbcode($text){
$text = eregi_replace("\[b:.{0,10}\]", "<b>", $text);
$text = eregi_replace("\[\/b:.{0,10}\]", "</b>", $text);
$text = eregi_replace("\[u:.{0,10}\]", "<u>", $text);
$text = eregi_replace("\[\/u:.{0,10}\]", "</u>", $text);
$text = eregi_replace("\[i:.{0,10}\]", "<i>", $text);
$text = eregi_replace("\[\/i:.{0,10}\]", "</i>", $text);
$text = eregi_replace("\[url=http:.{1,80}\]"," ",$text);
$text = eregi_replace("\[\/url\]"," ",$text);
$text = eregi_replace("\[url\]"," ",$text);
$text = eregi_replace("\[.{1,10}:.{1,10}\]"," ",$text);
$text = eregi_replace("\[\/.{1,10}:.{1,10}\]"," ",$text);
$text = eregi_replace("\[\/.{1,20}\]"," ",$text);
$text = eregi_replace("\[.{1,20}\]"," ",$text);
Return $text;}
$NUM_POSTS = 5;
$POST_IMAGE ="templates/subSilver/images/icon_minipost.gif";
$TEXT_ON = false;
$TEXT_LEN = 30;
$HIDE = true;
$hide_level = 0;
$fontheadersize="1";
$fontheadercolor="black";
$fontsize=1;
$fontcolor="#000000";
$fontsizetext=1;
$fontcolortext="#000000";
$fontheaderface="verdana";
$box_content = "";
$time=time();
$time=date("d.m.Y - H:i",$time);
$sqlxx="SELECT a1.post_id AS postid, a1.poster_id AS poster, a1.forum_id, a1.topic_id AS topic, a1.post_time AS time, a2.post_subject AS subject, a2.post_text AS text FROM ".$table_prefix."posts a1, ".$table_prefix."posts_text a2, ".$table_prefix."forums a3 WHERE a1.post_id = a2.post_id AND a1.forum_id = a3.forum_id";
if($HIDE) $sqlxx .= " AND a3.auth_view <= \"" . $hide_level . "\"";
$sqlxx .= " ORDER BY a1.post_time DESC";
$resultxx = mysql_query($sqlxx) or die("Cannot query database");
if($resultxx){
$box_content .="<table cellpadding=\"0\" cellspacing = \"0\" width= \"117\" border=\"0\">";
for($i=0;$i<$NUM_POSTS;$i++){
if($post = mysql_fetch_array($resultxx)){
$result3=mysql_query("SELECT username FROM ".$table_prefix."users WHERE user_id =" . $post["poster"]);
$author=mysql_fetch_array($result3);
$result4 = mysql_query("SELECT forum_name FROM ".$table_prefix."forums WHERE forum_id =" . $post["forum_id"]);
$forum=mysql_fetch_array($result4);
if(!$post["subject"]){
$result2=mysql_query("SELECT topic_title FROM ".$table_prefix."topics WHERE topic_id =" . $post["topic"]);
$replyto = mysql_fetch_array($result2);
$post["subject"]="RE: " . $replyto["topic_title"];
mysql_free_result($result2);}
$box_content .="<tr><td ><font size=\"$fontsize\" color=\"$fontcolor\" face=\"$fontheaderface\"><img src=\"$POST_IMAGE \" width=\"12\" height=\"9\" ><a href=\"" . $phpbb_root_path . "viewtopic.php?t=" .$post["topic"] . "\" title=\"Poslal: " . $author["username"]. " Fórum:" . $forum["forum_name"] . "\" target=\"forum\"> " . $post["subject"] . "</a><br>" . date("d.m. y ", $post["time"]) . " - " . date("H:i", $post["time"]) . "</font></td></tr>";
if($TEXT_ON){
$post["text"] = replacebbcode($post["text"]);
$post["text"] = substr($post["text"],0,$TEXT_LEN);
$box_content .= "<tr><td cellpadding=\"0\"> <font color=\"$fontcolortext\" size=\"$fontsizetext\" face=\"$fontheaderface\">" . $post["text"] . "...</font></td></tr>";
}
}
}
$box_content .="</table>";}
print("<table width=\"117\"><tr><td>" . $box_title . "</td></tr><tr><td><font size=\"$fontsize\" color=\"$fontcolor\" face=\"$fontheaderface\">Posledních 5 postů:</font></td></tr><tr><td>" . $box_content . "</td></tr>
<tr><td></td></tr></table>");
?> |
_________________ Get on with it! |
|
| Návrat nahoru |
|
 |
Kozlík Profesionál


Založen: 30.3.2003 Příspěvky: 1267 Bydliště: Liberec
|
Zaslal: 28 červen 2005 15:28 Předmět: Re: Kam s forem |
|
|
A to je nazorna ukazka blbe napsanyho skriptu. doporucuji upravit nasledovne: | kód: | <html>
<body bgcolor="9E8B63" style="margin: 0">
<style>
A:active { color: #AE583F; }
A:link { color: #6A3322; }
A:visited { color: #6A3322; }
A:hover { color: #AE583F; }
</style>
<?php
$phpbb_root_path = './';
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
Function replacebbcode($text){
$text = eregi_replace("\[b:.{0,10}\]", "<b>", $text);
$text = eregi_replace("\[\/b:.{0,10}\]", "</b>", $text);
$text = eregi_replace("\[u:.{0,10}\]", "<u>", $text);
$text = eregi_replace("\[\/u:.{0,10}\]", "</u>", $text);
$text = eregi_replace("\[i:.{0,10}\]", "<i>", $text);
$text = eregi_replace("\[\/i:.{0,10}\]", "</i>", $text);
$text = eregi_replace("\[url=http:.{1,80}\]"," ",$text);
$text = eregi_replace("\[\/url\]"," ",$text);
$text = eregi_replace("\[url\]"," ",$text);
$text = eregi_replace("\[.{1,10}:.{1,10}\]"," ",$text);
$text = eregi_replace("\[\/.{1,10}:.{1,10}\]"," ",$text);
$text = eregi_replace("\[\/.{1,20}\]"," ",$text);
$text = eregi_replace("\[.{1,20}\]"," ",$text);
Return $text;}
$NUM_POSTS = 5;
$POST_IMAGE ="templates/subSilver/images/icon_minipost.gif";
$TEXT_ON = false;
$TEXT_LEN = 30;
$HIDE = true;
$hide_level = 0;
$fontheadersize="1";
$fontheadercolor="black";
$fontsize=1;
$fontcolor="#000000";
$fontsizetext=1;
$fontcolortext="#000000";
$fontheaderface="verdana";
$box_content = "";
$time=time();
$time=date("d.m.Y - H:i",$time);
$sqlxx="SELECT a1.post_id AS postid, a1.poster_id AS poster, a1.forum_id, a1.topic_id AS topic, a1.post_time AS time, a2.post_subject AS subject, a2.post_text AS text FROM ".$table_prefix."posts a1, ".$table_prefix."posts_text a2, ".$table_prefix."forums a3 WHERE a1.post_id = a2.post_id AND a1.forum_id = a3.forum_id";
if($HIDE) $sqlxx .= " AND a3.auth_view <= \"" . $hide_level . "\"";
$sqlxx .= " ORDER BY a1.post_time DESC";
$sqlxx .= "LIMIT ".$NUM_POSTS."";
$resultxx = mysql_query($sqlxx) or die("Cannot query database");
if($resultxx){
$box_content .="<table cellpadding=\"0\" cellspacing = \"0\" width= \"117\" border=\"0\">";
for($i=0;$i<$NUM_POSTS;$i++){
if($post = mysql_fetch_array($resultxx)){
$result3=mysql_query("SELECT username FROM ".$table_prefix."users WHERE user_id =" . $post["poster"] . " LIMIT ".$NUM_POSTS."");
$author=mysql_fetch_array($result3);
$result4 = mysql_query("SELECT forum_name FROM ".$table_prefix."forums WHERE forum_id =" . $post["forum_id"] . " LIMIT ".$NUM_POSTS."");
$forum=mysql_fetch_array($result4);
if(!$post["subject"]){
$result2=mysql_query("SELECT topic_title FROM ".$table_prefix."topics WHERE topic_id =" . $post["topic"] . " LIMIT ".$NUM_POSTS."");
$replyto = mysql_fetch_array($result2);
$post["subject"]="RE: " . $replyto["topic_title"];
mysql_free_result($result2);}
$box_content .="<tr><td ><font size=\"$fontsize\" color=\"$fontcolor\" face=\"$fontheaderface\"><img src=\"$POST_IMAGE \" width=\"12\" height=\"9\" ><a href=\"" . $phpbb_root_path . "viewtopic.php?t=" .$post["topic"] . "\" title=\"Poslal: " . $author["username"]. " Fórum:" . $forum["forum_name"] . "\" target=\"forum\"> " . $post["subject"] . "</a><br>" . date("d.m. y ", $post["time"]) . " - " . date("H:i", $post["time"]) . "</font></td></tr>";
if($TEXT_ON){
$post["text"] = replacebbcode($post["text"]);
$post["text"] = substr($post["text"],0,$TEXT_LEN);
$box_content .= "<tr><td cellpadding=\"0\"> <font color=\"$fontcolortext\" size=\"$fontsizetext\" face=\"$fontheaderface\">" . $post["text"] . "...</font></td></tr>";
}
}
}
$box_content .="</table>";}
print("<table width=\"117\"><tr><td>" . $box_title . "</td></tr><tr><td><font size=\"$fontsize\" color=\"$fontcolor\" face=\"$fontheaderface\">Posledních 5 postù:</font></td></tr><tr><td>" . $box_content . "</td></tr>
<tr><td></td></tr></table>");
?> |
Kdyby to blblo, tak dej vedet, je to jen tak nadhozeny a je mozny ze jsem tam nekde nechal chybku. Ale ted maj vsechny dotazy limit na pocet navracenych hodnot podle nastavene promenne $NUM_POSTS _________________ phpBB temlaty
Webkamery v ČR
Autorizovaný konzument GRAHAM'S SIX GRAPES |
|
| Návrat nahoru |
|
 |
Webhosting C4 - 2 GB, PHP, MySQL, administrační systém, 1.200 Kč na rok s doménou v ceně. Srubové domy, dřevostavby a víkendové sruby.
Bezproblémová instalace phpBB, Joomla, Drupal. Návody pro C4 - užitečné rady pro zákazníky. Nafukovací balonky s potiskem.
Výhodné sázkové kanceláře. značkové oblečení z USA, luxusní kabelky a také peněženky nabízí eshop usaboutique.cz.
Apartment in Prague - accommodation in Prag, prague apartments, luxusní anglické dýmky a kvalitní doutníky, značkové spodní prádlo a podprsenky
|  |
|
|
|
|
Nemůžete odesílat nové téma do tohoto fóra. Nemůžete odpovídat na témata v tomto fóru. Nemůžete upravovat své příspěvky v tomto fóru. Nemůžete mazat své příspěvky v tomto fóru. Nemůžete hlasovat v tomto fóru. Nemůžete připojovat soubory k příspěvkům Nemůžete stahovat ani prohlížet přiložené soubory
|
Powered by phpBB & phpBB SEO © 2001, 2005 phpBB Group Český překlad phpBB Czech - www.phpbbcz.com Optimalizoval JanoF - PCforum.sk
|