Chtěl jsem si to upravit na verzi 2.8.0. Dělal jsem to podle návodu - před mysql fce jsem doplnil "phprs_", ale vůbec se mi nezobrazí obsah stránky (jen logo a pod ním obdélník na obsah stránky). Je tu někde prosím chyba?:
<?
#############################################
# :: Plugin phpBB Forum blok 1.0.1 ::
# Created by: Gerhard
# web: [http://www.militaryzone.cz/]
#############################################
function dbconf()
{
//--[db server]-------------------------------------------------------
// adresa db serveru
$dbserverf="mysql.....cz"; //tvuj db server
// uzivatelske informace
$dbuserf="ph_......"; //tvoje db user
$dbpassf="......."; //tvoje db heslo
// jmeno databaze fora
$dbnamef="ph_......"; //nazev db s forem
@$spojenif=phprs_mysql_connect($dbserverf,$dbuserf,$dbpassf);
if (!$spojenif):
die('Spojeni se serverem nelze vytvorit!');
endif;
phprs_mysql_select_db($dbnamef,$spojenif);
return $spojenif;
}
//$phpbb_root_path = '../forum';
$dbspojenif=dbconf(); //pripadne spojeni s db
$GLOBALS["dbspojenif"]=&$dbspojenif; //jako global
$GLOBALS["predponafora"]=&$predponafora; //jako global
//==================================================================================================================
function Forum()
{
global $predponafora,$blonazev;
$dbspojenif = dbconf();
$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;
}
// various attributes - experiment!
$NUM_POSTS = 3; // Pocet zobrazovanych prispevku
$POST_IMAGE ="plugin/forum_blok/forum.gif"; // icon next to each item
$TEXT_ON = FALSE; //display some of the text of the post?
$TEXT_LEN = 30; //number of chars if above is true
$HIDE = true;//true or false - if true, do not show posts from certain forums - see below
$hide_level = 0;// display threshold 0=only show posts in forums open for guest reading,1= also registered, 2=also Mods only 3=show ALL posts even those froums for admins only
$fontheadersize="1";
$fontheadercolor="black";
$fontsize=1;
$fontcolor="#999999";
$fontsizetext=1;
$fontcolortext="#5695BA";
$fontheaderface="verdana";
$box_content = "";
$time=time();
$time=date("d M Y h:i a",$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 phpbb_posts a1, phpbb_posts_text a2, phpbb_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 = phprs_mysql_query($sqlxx) or die("Cannot query database");
if($resultxx){
$box_content .="<table cellpadding=\"0\" cellspacing = \"0\" width= \"100%\" border=\"0\">";
for($i=0;$i<$NUM_POSTS;$i++){
if($post = phprs_mysql_fetch_array($resultxx)){
$result3=phprs_mysql_query("SELECT username FROM phpbb_users WHERE user_id =" . $post["poster"]);
$author=phprs_mysql_fetch_array($result3);
$result4 = phprs_mysql_query("SELECT forum_name FROM phpbb_forums WHERE forum_id =" . $post["forum_id"]);
$forum=phprs_mysql_fetch_array($result4);
if(!$post["subject"]){
$result2=phprs_mysql_query("SELECT topic_title FROM phpbb_topics WHERE topic_id =" . $post["topic"]);
$replyto = phprs_mysql_fetch_array($result2);
$post["subject"]="RE: " . $replyto["topic_title"];
phprs_mysql_free_result($result2);
}
$box_content .="<tr><td ><font size=\"$fontsize\" color=\"$fontcolor\" face=\"$fontheaderface\"><img src=\"$POST_IMAGE \" width=\"16\" height=\"15\" ><a href=\"http://forum.militaryzone.cz/viewtopic.php?t=" .$post["topic"] . "\" title=\"Autor příspěvku: " . $author["username"]. " V tématu:" . $forum["forum_name"] . "\"> " . $post["subject"] . "</a><br> dne " . 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>";
//--------------funkce vypisu poctu registrovanych -----------------------------------------------------------------
$datauziv=phprs_mysql_query("select count(user_id) as uziv from phpbb_users");
$uziv=phprs_mysql_Result($datauziv,0,"uziv");
$celuziv="<i>Uživatelů:<b> ".$uziv."</b></i>";
//--------------konec funkce vypisu poctu registrovanych -----------------------------------------------------------------
//--------------funkce vypisu poctu témat -----------------------------------------------------------------
$datapocettemat=phprs_mysql_query("select count(topic_id) as pocettemat from phpbb_topics");
$pocettemat=phprs_mysql_Result($datapocettemat,0,"pocettemat");
$temata="<i>Témat:<b> ".$pocettemat."</b></i>";
//--------------konec funkce vypisu poctu témat -----------------------------------------------------------------
//--------------funkce vypisu poctu príspevku -----------------------------------------------------------------
$datapocetprisp=phprs_mysql_query("select count(post_id) as pocetprisp from phpbb_posts");
$pocetprisp=phprs_mysql_Result($datapocetprisp,0,"pocetprisp");
$prispevky="<i>Celkem příspěvků:<b> ".$pocetprisp."</b></i>";
//--------------konec funkce vypisu poctu prispevku -----------------------------------------------------------------
$retezec="
<table width=\"140\" class=\"z\">
<tr><td><center>Mnoho informací naleznete i na <a href=\"http://www.forum.militaryzone.cz\">Military fóru</a>.</center><hr color=\"666666\"></td></tr>
<tr><td>" . $box_title . "</td></tr>
<tr><td><font size=\"$fontsize\" color=\"$fontcolor\" face=\"$fontheaderface\"><center><b>Poslední $NUM_POSTS příspěvky:</b><br></center></font></td></tr>
<tr><td>" . $box_content . "</td></tr>
<tr><td><center><hr color=\"666666\"></center></td></tr>
<tr><td class=\"malemodre\"><center>Aktuální statistiky:</center></td></tr>
<tr><td class=\"malemodre\"><center>$celuziv</center></td></tr>
<tr><td class=\"malemodre\"><center>$temata</center></td></tr>
<tr><td class=\"malemodre\"><center>$prispevky</center></td></tr>
</table>";
// zobrazeni menu
switch ($GLOBALS["vzhledwebu"]->AktBlokTyp()):
case 1: Blok1($GLOBALS["vzhledwebu"]->AktBlokNazev(),$retezec); break;
case 2: Blok2($GLOBALS["vzhledwebu"]->AktBlokNazev(),$retezec); break;
case 3: Blok3($GLOBALS["vzhledwebu"]->AktBlokNazev(),$retezec); break;
case 4: Blok4($GLOBALS["vzhledwebu"]->AktBlokNazev(),$retezec); break;
case 5: Blok5($GLOBALS["vzhledwebu"]->AktBlokNazev(),$retezec); break;
default: Blok1($GLOBALS["vzhledwebu"]->AktBlokNazev(),$retezec); break;
endswitch;
}
?>
×××---×××
www.ava-plus44.com
www.blink-182.cz