проблем с един скрипт...

svilkata12

Registered
Значи направих всичко от този урок:
http://web-tourist.net/login/login/view.php?st=616
обаче вместо да ми се появяват последните теми от форума ми се появава това:
option003.gif

а във форума ми няма такива теми.
Ето ми скрипта:
Код:
? 

//phpBB - last topics 
//Email: bobi@wthost.net 
//Name: Bobi Haidar 
// http://web-tourist.net 





$user="usera"; //DB user 
$pass="passa"; //DB pass 
$db="databazata mi"; //DB name 

$broi_temi="20"; // Колко последни теми да показва 
$broi_bukvi="35"; //До колко букви от заглавието на темата да показва 

mysql_connect(localhost,$user,$pass); 
mysql_select_db($db) or die( "Unable to select database"); 
$query="SELECT c.topic_time , c.topic_title,c.forum_id,c.topic_id, c.topic_replies,c.topic_type,f.forum_name FROM phpbb_topics c, phpbb_forums f WHERE c.forum_id=f.forum_id and f.auth_view like '0' ORDER BY c.topic_time "; 
$result=mysql_query($query); 
$num=mysql_num_rows($result); 
mysql_close(); 
$ii=$num-$broi_temi; 


for ($i=$num-1; $i>$ii;$i--) 
{ 
$tema=mysql_result($result,$i,"c.topic_title"); 
$id=mysql_result($result,$i,"c.forum_id"); 
$topic_broi=mysql_result($result,$i,"c.topic_replies"); 
$topic_id=mysql_result($result,$i,"c.topic_id"); 
$topic=mysql_result($result,$i,"c.topic_type"); 
$cat=mysql_result($result,$i,"f.forum_name"); 

if (strlen($tema)>$broi_bukvi) 
{$totchki='...';} 
else 
{$totchki='';} 

$tema=substr($tema,0 , $broi_bukvi); 
echo" » $cat: <a href='soft/forum/viewtopic.php?t=$topic_id' >$tema$totchki ($topic_broi)</a><br/>"; 
} 


?>
та как да си го направя да се появят последните теми от форума ми плсс помогнете ми! :(
 
<?php
//
// Basic Configuration
// Колко последни теми да показва?
$topicnumber = 10;
// накъде да скролира?
$scroll = "up";
// променте пътя до папката на форума ви
$urlPath = "http://твоя сайт.com/phpBB2/";

// Database Configuration (Където се намира вашият phpBB config.php файл
include 'phpBB2/config.php';

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "< id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"170\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='350'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#FFCC00\"><b><a href=\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" .
$row["username"] .
"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr></font>";
}
print "</table>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>

и си махни потребителя и паролата , че някой може да ти направи гадно !
 
значи стана обаче виж какво ми се появи горе:
option004.gif

а и ако може като цъкна на линка да не се променя цвета на линка да си стои син :)
 
<?php
//
// Basic Configuration
// Колко последни теми да показва?
$topicnumber = 10;
// накъде да скролира?
$scroll = "up";
// променте пътя до папката на форума ви
$urlPath = "http://твоя сайт.com/phpBB2/";

// Database Configuration (Където се намира вашият phpBB config.php файл
include 'phpBB2/config.php';

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "<\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"170\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='350'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#FFCC00\"><b><a href=\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" .
$row["username"] .
"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr></font>";
}
print "</table>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>
 
при това не трябва да имаш проблем ... този го използвам в моя сайт и от там го копнах


<?php
//
// Basic Configuration
// Êîëêî ïîñëåäíè òåìè äà ïîêàçâà?
$topicnumber = 10;
// íàêúäå äà ñêðîëèðà?
$scroll = "up";
// ïðîìåíòå ïúòÿ äî ïàïêàòà íà ôîðóìà âè
$urlPath = "http://free-zona.net/forum";

// Database Configuration (Êúäåòî ñå íàìèðà âàøèÿò phpBB config.php ôàéë
include 'forum/config.php';

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "<id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"170\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='350'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#FFCC00\"><b><a href=\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" .
$row["username"] .
"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#C0C0C0\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr></font>";
}
print "</table>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>
 
а мерси с това стана :) , а това с цвета на линковете как мога да го направя да не се променя като цъкна на него да стой само син плссс :(
 
<?php
//
// Basic Configuration
// Êîëêî ïîñëåäíè òåìè äà ïîêàçâà?
$topicnumber = 10;
// íàêúäå äà ñêðîëèðà?
$scroll = "up";
// ïðîìåíòå ïúòÿ äî ïàïêàòà íà ôîðóìà âè
$urlPath = "http://free-zona.net/forum";

// Database Configuration (Êúäåòî ñå íàìèðà âàøèÿò phpBB config.php ôàéë
include 'forum/config.php';

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "<id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"170\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='350'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b><a href=\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"> by: <a href=\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" .
$row["username"] .
"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr>";
}
print "</table>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>

пробвай така
 
djvato каза:
<?php
//
// Basic Configuration
// Êîëêî ïîñëåäíè òåìè äà ïîêàçâà?
$topicnumber = 10;
// íàêúäå äà ñêðîëèðà?
$scroll = "up";
// ïðîìåíòå ïúòÿ äî ïàïêàòà íà ôîðóìà âè
$urlPath = "http://free-zona.net/forum";

// Database Configuration (Êúäåòî ñå íàìèðà âàøèÿò phpBB config.php ôàéë
include 'forum/config.php';

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "<id="recent_topics" behavior="scroll" direction="$scroll" height="170" scrolldelay="100" scrollamount="2" onMouseOver="document.all.recent_topics.stop()" onMouseOut="document.all.recent_topics.start()">
<table cellpadding='3' cellSpacing='2' width='350'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]">" .
$row["topic_title"] .
"</a></td></b><td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> by: <a href="$urlPath/profile.php?mode=viewprofile&u=$row[user_id]">" .
$row["username"] .
"</td><td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr>";
}
print "</table>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>

пробвай така
пак се променя цвета :(
 
djvato каза:
svilkata12 каза:
кой сайт? Форума ли?
в сайта ... не в форума ... в сайта има ли вкаран css ?
ми кода си е в отделен файл а после искам да го слагам на началната страница на Joomla(сайта ми е с тая система).И ако може да те питам и как да го сложа там?
 
еми системата си има темплейти там в тия темплейти има .css файлове ... от там е ... ти трябва да си го нагласиш ...
 

Back
Горе