Page 1 of 1

[URGENT]:Displaying outside the forum!

Posted: Sat May 11, 2002 1:50 pm
by danielhalawi
Hi,

Can someone please tell me how I can display posts outside the fourm!

I want the latest post to be displayed on my website index page, and I want it in the following order:

Who it was posted by?
The posts title
and
a link to the thread!

Thanks for any help.

Danile

Posted: Sat May 11, 2002 4:33 pm
by Grez
I think that the easiest way to do that would be to read it directly from the database using scripting language of your choice.

If you use PHP for your main page then eloquent way to get the necessary settings for connecting the database would (imo) be including the config.php -file from the forum path.

Posted: Sat May 11, 2002 4:59 pm
by primedomain

Posted: Sat May 11, 2002 5:00 pm
by danielhalawi
There isn't anything in my config.php file, either on my local copy or the remote copy!

Posted: Sat May 11, 2002 5:10 pm
by zoid
If your config.php is empty, then your forum cant work at all, since it cannot find the configuration data.

Alexander

Posted: Sat May 11, 2002 6:07 pm
by danielhalawi
HELP ME!!!

I'm going crazy, how do I get rid of this error:

Warning: Cannot add header information - headers already sent by (output started at /homepages/27/d28531142/htdocs/vmplay/topinclude.php:7) in /homepages/27/d28531142/htdocs/vmplay/forum/phpBB2/includes/sessions.php on line 186

Warning: Cannot add header information - headers already sent by (output started at /homepages/27/d28531142/htdocs/vmplay/topinclude.php:7) in /homepages/27/d28531142/htdocs/vmplay/forum/phpBB2/includes/sessions.php on line 187

Welcome to the GENERAL DISCUSSIONS forum!
Posted by admin

I'm using the second choice on the page with the mods on!

Posted: Sat May 11, 2002 9:58 pm
by hawk
I've made my own code for this.

Code: Select all

<?
$URLPath = "http://www.main.com";
$PostNumber = "10";
$dbhost = "mysql.server.com";
$dbuser = "username";   
$dbpass = "password";
$database = "db";
$db = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($database, $db) or die("Unable to select database!");
$result=mysql_query("SELECT * FROM phpbb_topics where forum_id != '8' and forum_id != '11' ORDER BY topic_time DESC
limit $PostNumber"); \\ where forum_id !='8' and forum_id !='11' is private forums! Remove if you dont have any.

while ($row=mysql_fetch_array($result)) {
            $farge=0;
                $count = $count +1;
$farge=($count%2)?"#EDEDED":"#F9F9F9";
                print "<tr><td bgcolor=\"".$farge."\">";
                $j = str_replace("'", "`", stripslashes($row["topic_title"])); 
                $k = substr($j, 0, 16) . "..";
echo "<a href=\"$URLPath/viewtopic.php?topic=$row[topic_id]\" onMouseover=\"showtip(this,event,'".$j.")')\" onMouseout=\"hidetip()\$

echo "</TD></TR>";
}
?>
This script uses a tooltip script that displays the whole name of the topic in a tooltip. You have to add this script on your site to get this function to work:

Code: Select all

<script>
if (!document.layers&&!document.all&&!document.getElementById)
event="test"
function showtip(current,e,text){

if (document.all||document.getElementById){
thetitle=text.split('<br>')
if (thetitle.length>1){
thetitles=''
for (i=0;i<thetitle.length;i++)
thetitles+=thetitle[i]
current.title=thetitles
}
else
current.title=text
}

else if (document.layers){
document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
document.tooltip.document.close()
document.tooltip.left=e.pageX+5
document.tooltip.top=e.pageY+5
document.tooltip.visibility="show"
}
}
function hidetip(){
if (document.layers)
document.tooltip.visibility="hidden"
}

</script>
Warning: Cannot add header information - headers already sent by (output started at /homepages/27/d28531142/htdocs/vmplay/topinclude.php:7) in /homepages/27/d28531142/htdocs/vmplay/forum/phpBB2/includes/sessions.php on line 186

Warning: Cannot add header information - headers already sent by (output started at /homepages/27/d28531142/htdocs/vmplay/topinclude.php:7) in /homepages/27/d28531142/htdocs/vmplay/forum/phpBB2/includes/sessions.php on line 187

Try to remove a space in line 7 of topinclude.php

Posted: Sat May 11, 2002 10:32 pm
by danielhalawi
hawk wrote:
Warning: Cannot add header information - headers already sent by (output started at /homepages/27/d28531142/htdocs/vmplay/topinclude.php:7) in /homepages/27/d28531142/htdocs/vmplay/forum/phpBB2/includes/sessions.php on line 186

Warning: Cannot add header information - headers already sent by (output started at /homepages/27/d28531142/htdocs/vmplay/topinclude.php:7) in /homepages/27/d28531142/htdocs/vmplay/forum/phpBB2/includes/sessions.php on line 187

Try to remove a space in line 7 of topinclude.php


I can't line 7 is where a javascript starts!

Posted: Sun May 12, 2002 8:22 pm
by danielhalawi
What should I do!?

Posted: Mon May 13, 2002 3:51 am
by AL
sounds like something went wrong with the mod. make sure you followed the instructions exactly... and if you are still having trouble ask in the mods development forum as they can better help since they wrote the mod.