Latest Posts on site home page

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
Locked
User avatar
damsprivate
Registered User
Posts: 461
Joined: Sun Aug 17, 2008 10:39 pm
Location: indonesia
Contact:

Re: Latest Posts on styl/template/ in a forum (f=3)

Post by damsprivate » Sat Nov 15, 2008 11:58 am

- edited wrong post sry -

is there any diffrence where latest post if i put it in my template folder ?
binus university 2009 .
"did u know that 17 august ( when i join this forum ) is at Indonesia independence day ? "

User avatar
naijababy
Registered User
Posts: 8
Joined: Tue Sep 16, 2008 5:09 am

Re: Latest Posts on site home page

Post by naijababy » Sat Nov 15, 2008 4:49 pm

Thanks for the mod but I can't get it to work. I tried the code posted on the first page and all I get is a box and code on my html. I'd like to post in on the left side of my main.html page. The page has css. do i need to modify that as well? Where and how do I post this exactly?

thanks for your help guys and gals.

Here's the site. http://www.eyecityfront.com/main.html

Bob_La_Londe
Registered User
Posts: 94
Joined: Sun Aug 17, 2008 5:08 pm

Re: Latest Posts on site home page

Post by Bob_La_Londe » Thu Nov 27, 2008 4:26 pm

Home page? You create a php file with the code listed. Then you use SSI to inlcude that file in the home page in the area you want.

phpaaa
Registered User
Posts: 168
Joined: Sun Dec 17, 2006 11:59 am

Re: Latest Posts on site home page

Post by phpaaa » Sat Jan 03, 2009 9:07 am

ahuraeian wrote:

Code: Select all

 <?php

    // How Many Topics you want to display?
    $topicnumber = 10;
    // Scrolling towards up or down?
    $scroll = "up";
    // Change this to your phpBB path
    $urlPath = "/forum";
 
    // Database Configuration (Where your phpBB config.php file is located)
    include 'config.php';
 
    $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");
 
    $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.forum_id != 4 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");									
 
    print "<marquee 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='100%'>";
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
 
    echo  "<tr valign='top'><td><font face=\"Tahoma\" size=\"1\"><font color=\"#FFCC00\"><b><a href=\"$urlPath/viewtopic.php?f=$row[forum_id]&t=$row[topic_id]&p=$row[post_id]#p$row[post_id]\" TARGET=\"_blank\">" .
    $row["topic_title"] .
    "</a></td></font></b><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/memberlist.php?mode=viewprofile&u=$row[user_id]\" TARGET=\"_blank\">" .
    $row["username"] .
    "</td><td><font face=\"tahoma\" size=\"1\"><font color=\"#C0C0C0\">" .
    date('F j, Y, g:i a', $row["post_time"]) .
    "</td></tr></font>";
    }
    print "</table></marquee>";
    mysql_free_result($result);
    mysql_close($link);
    ?>
I save the above code as a testing file "test.php" and put it to the root folder of my folder.
I type in http://www.mywebsite.com/forum/test.php and press enter

YES, i saw a white page with scrolling latest topics ... MY PROBLEM ARE

when my topic contain chinese character, they all become "???????"

another minor problem is when i run it by typing "forum.mywebsite.com/test.php" but not "www.mywebsite.com/forum/test.php", it will to directed to a wrong page ~~> forum.mywebsite.com/forum/viewtopic.php?f=2 ...

WELL, the most important PROBLEM is HOW could i use this code, for example i want to put this on the "right side" or "bottom" of a html page (with other contents in the same page), just like inserting a small image? OR insert it in the index page of my forum ? I saw many people ask u this question but saw no answers. COULD U please give me some code example ?

ANYWAY, thank for your post. I just switched to phpbb3 and spend days looking for a MOD which could display a scrolling 10 active topics on the index (i've installed such a MOD in my bb2 forum). Though i can't find any similiar MOD in bb3, i think your post might achieve simliar purpose. I look forward to your answer.

Many Thank again. :D

phpaaa
Registered User
Posts: 168
Joined: Sun Dec 17, 2006 11:59 am

Re: Latest Posts on site home page

Post by phpaaa » Sun Jan 04, 2009 4:20 am

anybody body here ?

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: Latest Posts on site home page

Post by katib » Mon Jan 05, 2009 9:30 pm

Hello
THank you very much wireaudio
I see no one
wireaudio wrote:Let's see if i understand right.

You want a latest 10 active topics, NOT POSTS.
Or do you want the latest "x" active topics for ALL forums combined?
Are there any "hidden" forums you do not want info shown from?
(
Yes I want the latest "x" active topics for ALL forums combined, with forum id=3 for moderators only
wireaudio wrote: Relative to the page you want the information on, where is the forum located?
Ex: If your page is in http://www.yoursite.com
and foum is in http://www.yoursite.com/forum/
the relative path would be "forum/"
(
I want it on overallheader on my forum
Also I want it scrolling form like news on TV !!
using <marquee> code

phpaaa
Registered User
Posts: 168
Joined: Sun Dec 17, 2006 11:59 am

Re: Latest Posts on site home page

Post by phpaaa » Wed Jan 07, 2009 3:03 am

???? how to solve the language problem ? all chinese, japanese ... non-english characters became " ?????????" :cry:

phpaaa
Registered User
Posts: 168
Joined: Sun Dec 17, 2006 11:59 am

Re: Latest Posts on site home page

Post by phpaaa » Sat Jan 10, 2009 9:30 am

THIS topic is closed ????? why nobody answer me ????? :cry: :evil:

mkursat
Registered User
Posts: 18
Joined: Thu Jan 10, 2008 11:12 pm

Re: Latest Posts on site home page

Post by mkursat » Sat Jan 10, 2009 10:36 pm

i think they used it at a phpbb forum at
http://www.maymuncuk.org joomla home page.

one with scrolling others from various topics.

mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Latest Posts on site home page

Post by mtrs » Sat Jan 10, 2009 11:30 pm

That is a joomla extension, different.
I abandoned all of my mods.

phpaaa
Registered User
Posts: 168
Joined: Sun Dec 17, 2006 11:59 am

Re: Latest Posts on site home page

Post by phpaaa » Tue Jan 13, 2009 5:28 am

[quote="phpaaa"]THIS topic is closed ????? why nobody answer me ????? :cry: :evil:[/quote]
:cry:

Chaos-Zero
Registered User
Posts: 55
Joined: Tue Jan 13, 2009 6:44 pm

Re: Latest Posts on site home page

Post by Chaos-Zero » Tue Jan 13, 2009 6:55 pm

I really need this code too. All of above codes didnt work for me. If i place them on to my website, my whole lay out will be messed up. Isnt there just a html code for this?

User avatar
grotevoet
Registered User
Posts: 32
Joined: Wed Apr 19, 2006 7:56 pm
Contact:

Re: Latest Posts on site home page

Post by grotevoet » Tue Jan 13, 2009 9:07 pm

"Just HTML" will not do, as you need to use something that understands permissions. And something that recognizes/processes non-Latin1 characters.

Someone mentioned NV recent topics at the beginning of this topic, and someone replied that you could not use that on your front page. But I did, so it can be done (and is not difficult!) - check http://www.nsu.nl/ for an example.

In the installation set of NV Recent Topics there is a contrib/Addons/add_any_page/ folder with instructions. You can use the ACP to configure it (turn on/off, configure number of topics).

Marc
Image

User avatar
marian0810
Former Team Member
Posts: 3011
Joined: Mon May 21, 2007 9:17 pm
Location: The Netherlands
Name: Marian
Contact:

Re: Latest Posts on site home page

Post by marian0810 » Wed Jan 14, 2009 1:19 am

Do you think it's possible to use that on more than one page, allowing different forum_ids to be shown for each page?
You and me, time and space. You watch us run!

phpaaa
Registered User
Posts: 168
Joined: Sun Dec 17, 2006 11:59 am

Re: Latest Posts on site home page

Post by phpaaa » Wed Jan 14, 2009 6:29 am

ooooh ... i finally fix the non-english character problem (have to add several new program lines) ...

i successfully inserted the php in a html page ... by using the following ...

<HTML>
<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><title> </title></head>
<body bgcolor=#000000 link="#000000" vlink="#000000" alink="000000">

testing TOPIC RESULT
<? include("test.php"); ?>

</body>
</html>


BUT i also want to insert this PHP in another (my friend's) website. It's not the place my forum is hosting ... i tried to change the folder location in my test.php to be "http://www.mywebsite.com/forum" and also the line in my html to be <? include("http://www.mywebsite.com/forum/test.php"); ?> ... it didn't work ... i just saw a blank page ... :cry:

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 20 guests