2006-01-22, 08:34 PM
2006-01-23, 04:36 PM
I've stripped te code to:
It works fine now.
But I made it into an inline frame but when you click on the topic it is not opening in a new window how to fix it?
And I also would like to have a limit of 5 topics.
Thanx in advance.
<?php
require_once ("global.php");
require_once("./forum/inc/functions_post.php");
$mysqlhost = "***";
$mysqlusername = "***";
$mysqlpassword = "***";
$mysqldbselect = "***";
$prefix = "mybb_";
$fid = "2";
mysql_select_db($mysqldbselect, mysql_connect($mysqlhost,$mysqlusername,$mysqlpassword));
$message[post] = postify($message[post], $allowhtml="yes", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0);
$query = mysql_query("SELECT t.tid,t.subject FROM ".$prefix."threads t LEFT JOIN ".$prefix."posts p ON (t.tid = p.tid) WHERE t.fid='".$fid."' AND t.visible='1' AND t.closed NOT LIKE 'moved|%'") or die(mysql_error());
while($news = mysql_fetch_array($query))
{
echo "<a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['subject']."</a><a href=\"./forum/member.php?action=profile&uid=".$news['uid']."\">".$news['username']."</a><a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['replies']."</a>".$news['message']."<br /><br />";
}
?>
It works fine now.
But I made it into an inline frame but when you click on the topic it is not opening in a new window how to fix it?
And I also would like to have a limit of 5 topics.
Thanx in advance.
2006-01-23, 07:33 PM
Change:
while($news = mysql_fetch_array($query))
{
echo "<a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['subject']."</a><a href=\"./forum/member.php?action=profile&uid=".$news['uid']."\">".$news['username']."</a><a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['replies']."</a>".$news['message']."<br /><br />";
}
to:while($news = mysql_fetch_array($query))
{
echo "<a href=\"./forum/showthread.php?tid=".$news['tid']."\" target=\"_blank\">".$news['subject']."</a><a href=\"./forum/member.php?action=profile&uid=".$news['uid']."\">".$news['username']."</a><a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['replies']."</a>".$news['message']."<br /><br />";
}
2006-01-23, 07:37 PM
Thanx Peter
2006-01-23, 10:18 PM
where do i put this code. It will work for what I need, but do i put it in index.php?
2006-01-24, 07:23 AM
also, you gotta call "postify" within the while loop
_
based on your code, the while loop should look like this
also, i do believe you can reduce your code to this
_
based on your code, the while loop should look like this
while($news = mysql_fetch_array($query))
{
$news['message'] = postify($news['message'], $allowhtml="yes", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0);
echo "<a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['subject']."</a><a href=\"./forum/member.php?action=profile&uid=".$news['uid']."\">".$news['username']."</a><a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['replies']."</a>".$news['message']."<br /><br />";
}
also, i do believe you can reduce your code to this
<?php
require_once ("global.php");
require_once("./forum/inc/functions_post.php");
$prefix = "mybb_"; // forum prefix
$fid = "2"; // news forum id
$query = $db->query("SELECT t.tid,t.subject FROM ".$prefix."threads t LEFT JOIN ".$prefix."posts p ON (t.tid = p.tid) WHERE t.fid='".$fid."' AND t.visible='1' AND t.closed NOT LIKE 'moved|%'") or die(mysql_error());
while($news = mysql_fetch_array($query))
{
$news['message'] = postify($news['message'], $allowhtml="yes", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0);
echo "<a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['subject']."</a><a href=\"./forum/member.php?action=profile&uid=".$news['uid']."\">".$news['username']."</a><a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['replies']."</a>".$news['message']."<br /><br />";
}
?>
2006-01-24, 07:44 PM
I got this code:
But this:
Part isn't working
it shows like this:
Topic and no rollover
But is has to be:
Topic and rollover with: #F5F5F5
<?php
require_once ("global.php");
require_once("./forum/inc/functions_post.php");
$limit = "5"; // The amount of annoucements to show
$mysqlhost = "***";
$mysqlusername = "***";
$mysqlpassword = "***";
$mysqldbselect = "***";
$prefix = "mybb_";
$fid = "2";
mysql_select_db($mysqldbselect, mysql_connect($mysqlhost,$mysqlusername,$mysqlpassword));
$message[post] = postify($message[post], $allowhtml="yes", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0);
$query = mysql_query("SELECT t.tid,t.subject FROM ".$prefix."threads t LEFT JOIN ".$prefix."posts p ON (t.tid = p.tid) WHERE t.fid='".$fid."' AND t.visible='1' AND t.closed NOT LIKE 'moved|%'") or die(mysql_error());
while($news = mysql_fetch_array($query))
{
echo "<p style=\"padding-left: 25px; font-size: 9pt; font-family: Trebuchet MS; text-decoration: none; alink: #F5F5F5; link: #91E902; vlink: #F5F5F5;\"><a href=\"./forum/showthread.php?tid=".$news['tid']."\" target=\"_blank\">".$news['subject']."</a></p>";
}
?>
But this:
text-decoration: none; alink: #F5F5F5; link: #91E902; vlink: #F5F5F5
Part isn't working
it shows like this:
Topic and no rollover
But is has to be:
Topic and rollover with: #F5F5F5
2006-01-25, 11:18 AM
and it only shows the first 5 topic of the whole forum but it's has got te be te 5 latest.
2006-01-25, 03:35 PM
Dude, alink and vlink aren't css. Give them classes like <p class="result"> and use the following css in either an external style sheet or between the style tags:
That should get the effect you are looking for.
.result {
padding-left: 25px;
font-size: 9pt;
font-family: Trebuchet MS;
}
.result a {
color: #91E902;
text-decoration: none;
}
.result a:active {
color: #F5F5F5;
}
.result a:visited {
color: #F5F5F5;
}
That should get the effect you are looking for.
2006-01-25, 04:55 PM