[URGENT]:Displaying outside the forum!

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
User avatar
danielhalawi
Registered User
Posts: 14
Joined: Sat May 11, 2002 1:47 pm
Location: London, UK
Contact:

[URGENT]:Displaying outside the forum!

Post 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
Grez
Registered User
Posts: 4
Joined: Sat Feb 09, 2002 2:17 pm
Location: Tampere, Finland, Europe, Earth

Post 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.
User avatar
primedomain
Former Team Member
Posts: 25944
Joined: Sat Dec 15, 2001 10:23 am

Post by primedomain »

User avatar
danielhalawi
Registered User
Posts: 14
Joined: Sat May 11, 2002 1:47 pm
Location: London, UK
Contact:

Post by danielhalawi »

There isn't anything in my config.php file, either on my local copy or the remote copy!
zoid
Registered User
Posts: 743
Joined: Fri Oct 12, 2001 6:29 am
Location: $SCRIPT_NAME
Contact:

Post by zoid »

If your config.php is empty, then your forum cant work at all, since it cannot find the configuration data.

Alexander
Whatever you want to know, please do a Image Search before asking :).

Run your own Chatcommunity
>> PINO - Client/Server Chat for Windows <<
User avatar
danielhalawi
Registered User
Posts: 14
Joined: Sat May 11, 2002 1:47 pm
Location: London, UK
Contact:

Post 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!
User avatar
hawk
Registered User
Posts: 44
Joined: Wed Nov 14, 2001 7:09 pm

Post 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
User avatar
danielhalawi
Registered User
Posts: 14
Joined: Sat May 11, 2002 1:47 pm
Location: London, UK
Contact:

Post 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!
User avatar
danielhalawi
Registered User
Posts: 14
Joined: Sat May 11, 2002 1:47 pm
Location: London, UK
Contact:

Post by danielhalawi »

What should I do!?
AL
Registered User
Posts: 442
Joined: Tue Jul 03, 2001 10:21 pm
Location: Texas Ya'll

Post 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.
"A nerd is someone whose life is focused on computers and technology, but a geek is someone whose life is focused on computers and technology and LIKES it that way."
Locked

Return to “2.0.x Support Forum”