Home
>
Outdated forums
>
Phorum 3 forums (READ ONLY)
>
Finished Mods and Plug-ins (READ ONLY)
>
Topic
>
Page 3
Hack to display last posts in another document
Posted by Rene
Re: Hack to display la.... for multiple forums. February 05, 2002 12:23AM |
For some reason, i've not been able to post the attachment - sorry!
(Is it Mozilla 0.9.7, Squid or Phorum?)
So I've put it on my Webserver:
[www.buchzik.de]
If you "accidently" surf over my homepage: It's in german, I appologize!
And please don't feel disturbed about the ugly Forum software (WBB 1.1.1 - full of bugs!!!!) installed: I've installed Phorum yesterday the first time and had absolutely no idea before, how nice it is! WBB will be replaced with Phorum in near future ;)
Greetings from Bayreuth - Germany,
Michael
(Is it Mozilla 0.9.7, Squid or Phorum?)
So I've put it on my Webserver:
[www.buchzik.de]
If you "accidently" surf over my homepage: It's in german, I appologize!
And please don't feel disturbed about the ugly Forum software (WBB 1.1.1 - full of bugs!!!!) installed: I've installed Phorum yesterday the first time and had absolutely no idea before, how nice it is! WBB will be replaced with Phorum in near future ;)
Greetings from Bayreuth - Germany,
Michael
Re: Hack to display la.... for multiple forums. April 16, 2002 01:39PM |
UPDATE: v0.2 of this Hack will now also show parental folder names!
Demo: [www.buchzik.de] (sorry, german language only!)
Download: [www.buchzik.de]
Questions: [www.buchzik.de] (english or german please)
Michael
Demo: [www.buchzik.de] (sorry, german language only!)
Download: [www.buchzik.de]
Questions: [www.buchzik.de] (english or german please)
Michael
Display a forum ERROR May 18, 2002 02:57PM |
Registered: 22 years ago Posts: 1 |
When trying to show a forums header on another page, I keep geting the following error message:
Warning: Cannot add header information - headers already sent by (output started at /home/noshorn/public_html/nya/index.php:15) in /home/noshorn/public_html/nya/forum/common.php on line 348
Now, I'm wondering... Why!? It would be grat if someone could help me... And, one more thing, I'm really a newbie... just starting to lurn a little what php is... So, pleas explain careful for little me... :)
Warning: Cannot add header information - headers already sent by (output started at /home/noshorn/public_html/nya/index.php:15) in /home/noshorn/public_html/nya/forum/common.php on line 348
Now, I'm wondering... Why!? It would be grat if someone could help me... And, one more thing, I'm really a newbie... just starting to lurn a little what php is... So, pleas explain careful for little me... :)
Re: Hack to display last posts in another document July 26, 2002 12:48AM |
Registered: 23 years ago Posts: 4 |
OK, I've tried different hacks for this before, couldn't get them working. All I want is the last three thread subjects (no date, author etc.) to show on my home page. Links would be great.
I tried Diana's hack above. I put her entire file into a file named quickforum.php. All I changed was:
$baseurl = "[barntowire.com];;
if (empty($limit)) {
$limit = 3; # default max number of threads to list
}
Then I included quickforum.php into the appropriate spot on the home page.
What I end up with is this:
[www.barntowire.com]
It is listing all posts, with the letters new after each link. About half way through it also starts adding authors.
It is picking up the "3" in the echo, but do I need to add that somewhere else as well?
I'm using Phorum 3.3.2a.
Thanks for any help!
Janine
I tried Diana's hack above. I put her entire file into a file named quickforum.php. All I changed was:
$baseurl = "[barntowire.com];;
if (empty($limit)) {
$limit = 3; # default max number of threads to list
}
Then I included quickforum.php into the appropriate spot on the home page.
What I end up with is this:
[www.barntowire.com]
It is listing all posts, with the letters new after each link. About half way through it also starts adding authors.
It is picking up the "3" in the echo, but do I need to add that somewhere else as well?
I'm using Phorum 3.3.2a.
Thanks for any help!
Janine
Re: Hack to display last posts in another document June 16, 2004 09:07AM |
hi, i succeded when i installed the hack which allows us to see the last 5 posts (for example) but now i want, if the title of the subject is to long (like hellohello hello hello hello), the title to be short, i mean like "hellohello..."
i know there is already a script (here, on the same page) but i can get it works! the only result of the script is to show "..." after each word!
so, do u have a solutions guys?
i know there is already a script (here, on the same page) but i can get it works! the only result of the script is to show "..." after each word!
so, do u have a solutions guys?
Re: Hack to display last posts in another document July 17, 2004 03:13PM |
Hi!
I'm using Rene´s modified hack and tried to incorporate the 15-letter limit.
Rene´s hack works great, but the 15-letter limit doesn't work, that is, nothing happens, not even any error msg.
the code is as follows:
Anyone here with two good php-eyes who could tell me what's wrong?
TIA
kbking
I'm using Rene´s modified hack and tried to incorporate the 15-letter limit.
Rene´s hack works great, but the 15-letter limit doesn't work, that is, nothing happens, not even any error msg.
the code is as follows:
<? // Original hack by Rene displays last 5 postings in forum 1. //This hack will show the last 3 posted headlines in each forum sectioned by folders if any chdir("../phorum/"); //again, don't forget to change this to suit your phorum dir. include_once("./common.php"); $curr_par = ""; $par = ""; $number=3; // number of messages to show. //omit or change the forum name for your test forums. // we select active forums tables that are not folders $sSQL="Select id, name, table_name, parent from ".$pho_main." where active=1 and folder='0' and name!='Test' order by parent"; $q->query($DB, $sSQL); $rec=$q->getrow(); if(is_array($rec)){ while(is_array($rec)){ //get folder name if ($rec[parent]>0) { $pSQL="Select name from ".$pho_main." where id=$rec[parent]"; $pq = new query($DB, $pSQL); $prec=$pq->getrow(); $par = $prec[name]; } $SQL="select id, thread, author, subject, datestamp from $rec[table_name] order by datestamp desc limit $number"; $nq = new query($DB, $SQL); $nrec=$nq->getrow(); if(is_array($nrec)) { if ($curr_par != $par) echo "<br><b>$par</b>"; $curr_par = $par; echo "<br><b><i>$rec[name]</i></b><br>\n"; while(is_array($nrec)){ $subject = explode (" ", $rec[subject]); $i = 0; while($subject[$i]) { if(strlen($subject[$i]) >= 15){ $subject[$i] = substr ($subject[$i], 0, 15)."..."; } $i++; } $subject = implode (" ", $subject); echo "$nrec[author] - <a href=\"$forum_url/$read_page.$ext?f=$rec[id]&i=$nrec[id]&t=$nrec[thread]\" target=\"_blank\"> $nrec[subject]</a><br>\n"; $nrec=$nq->getrow(); } } $rec=$q->getrow(); } } ?>
Anyone here with two good php-eyes who could tell me what's wrong?
TIA
kbking
Re: Hack to display last posts in another document July 18, 2004 02:39PM |
Re: Hack to display last posts in another document July 19, 2004 11:56AM |
include('connections/dbconnect.php');
$query = "SELECT * FROM `forum_messages` ORDER BY `modifystamp` DESC LIMIT 0,5";
$result = mysql_query($query);
include('connections/dbclose.php');
while($recent = mysql_fetch_assoc($result)){
$author=$recent['author'];
$datetime=$recent['datestamp'];
$id=$recent['forum_id'];
$thread=$recent['thread'];
$title = $recent['subject'];
if (strlen($title) > 28) {
$title = substr($title, 0, 28).'...';
}
echo'<tr>
<td><img src="images/icon.gif"> <a href="./forums/read.php?'.$id.','.$thread.'">'.$title.'</a></td>
</tr>
';
}
$query = "SELECT * FROM `forum_messages` ORDER BY `modifystamp` DESC LIMIT 0,5";
$result = mysql_query($query);
include('connections/dbclose.php');
while($recent = mysql_fetch_assoc($result)){
$author=$recent['author'];
$datetime=$recent['datestamp'];
$id=$recent['forum_id'];
$thread=$recent['thread'];
$title = $recent['subject'];
if (strlen($title) > 28) {
$title = substr($title, 0, 28).'...';
}
echo'<tr>
<td><img src="images/icon.gif"> <a href="./forums/read.php?'.$id.','.$thread.'">'.$title.'</a></td>
</tr>
';
}
Re: Hack to display last posts in another document October 24, 2004 10:04AM |
jetpeach
Re: Hack to display last posts in another document November 30, 2004 02:54PM |
Sorry, you do not have permission to post/reply in this forum.