Current time: 07-24-2014, 05:04 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Displaying News on Homepage
10-13-2005, 02:10 PM
Post: #31
RE: Displaying News on Homepage
k776 Wrote:Hello. An update. I'm still working on this (not as fast as before). I got everything except badword filter and smilies working. Just need permission from Chris to release it now (since its redistributing a decompiled functions_post.php file).

Thats great I will keep checking for it.

Xbox 360 Forum
Visit this user's website Find all posts by this user
Quote this message in a reply
10-18-2005, 11:17 AM
Post: #32
RE: Displaying News on Homepage
Well I have tried that script and it shows but what I want is to get the latest 10 topics on only the forums , I have removed the fidid and now it shows all the forums latest topic so I was wondering how can I limit it ?

█ The Best Hosting Packages On The Web
█ KooshinDesigns.com ---Underconstruction

█ Your #1 Resource For Articles
Find all posts by this user
Quote this message in a reply
10-20-2005, 07:53 PM
Post: #33
RE: Displaying News on Homepage
any solutions guys?

█ The Best Hosting Packages On The Web
█ KooshinDesigns.com ---Underconstruction

█ Your #1 Resource For Articles
Find all posts by this user
Quote this message in a reply
10-25-2005, 12:18 PM (This post was last modified: 10-25-2005 09:41 PM by Simulationcity.)
Post: #34
RE:  Displaying News on Homepage
Excellent I don't remember which one I used but it works great. The one I use doesn't make smileys show up.

[Image: bannersimcity4bn.jpg]
Find all posts by this user
Quote this message in a reply
01-19-2006, 02:07 PM
Post: #35
RE: Displaying News on Homepage
How can I show my Active Topics like this:

[Image: naamloos0nn.th.gif]

Can you help me making a code?

Thanks a lot in advance.
Find all posts by this user
Quote this message in a reply
01-20-2006, 06:58 AM
Post: #36
RE: Displaying News on Homepage
Re: parsing message properly

some steps may not be neccessary due to the way my site was setup, might be different from yours (and yours can be simpler/more complicated)

here, i will assume your forum is in the folder called "mybb" and your site is in a folder parallel to that folder.

1) make a copy of "mybb/inc/init.php" and "mybb/global.php".
2) place them in the folder where your site is (i'm assuming your forums and main site are on different folders)
3) modify copied global so it links to the copied init.php
FROM: require "./inc/init.php";
TO: require "init.php";
4) modify copied init.php so it links to the old files located in the /mybb folder
FROM: require "./inc/class_core.php";
TO: require "../mybb/inc/class_core.php";

there are tons of this in this file, you will have to change them all.
5) now add these lines of code to your site
require_once ("global.php");
require_once("../mybb/inc/functions_post.php");

6) Do the database access codes given earlier in this thread. NOTE: now that you have included all those stuff, you can use mybb's DB wrapper class ($db)

7) before you echo the message, apply this function into it

$message[post] = postify($message[post], $allowhtml="yes", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0);

that should do it
Find all posts by this user
Quote this message in a reply
01-20-2006, 03:56 PM
Post: #37
RE: Displaying News on Homepage
I get this:


Warning: Cannot modify header information - headers already sent by (output started at /usr/local/psa/home/vhosts/owiosa1.nl/subdomains/fearless/httpdocs/forum.php:3) in /usr/local/psa/home/vhosts/owiosa1.nl/subdomains/fearless/httpdocs/forum/inc/functions.php on line 802
Find all posts by this user
Quote this message in a reply
01-21-2006, 10:34 PM
Post: #38
RE: Displaying News on Homepage
you need to do this

require_once ("global.php");
require_once("../mybb/inc/functions_post.php");

before you do any outputs on your own scripts/pages
so if you put it on the very top of your pages, you should be good.
Find all posts by this user
Quote this message in a reply
01-22-2006, 12:16 PM
Post: #39
RE: Displaying News on Homepage
PHP Code:
<?php
require_once ("global.php");
require_once(
"../mybb/inc/functions_post.php");


$mysqlhost "**";
$mysqlusername "**";
$mysqlpassword "**";
$mysqldbselect "mysql";
$prefix "mybb_";
$fid "2";

mysql_select_db($mysqldbselectmysql_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,t.uid,t.username,t.replies,p.message 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> | Posted by: <a href=\"./forum/member.php?action=profile&amp;uid=".$news['uid']."\">".$news['username']."</a> | Replies: <a href=\"./forum/showthread.php?tid=".$news['tid']."\">".$news['replies']."</a><hr />".$news['message']."<br /><br />";
}
?>

saved this as forum.php
opend it in firefox I get this:


Warning: main(): open_basedir restriction in effect. File(../mybb/inc/functions_post.php) is not within the allowed path(s): (/usr/local/psa/home/vhosts/owiosa1.nl/subdomains/fearless/httpdocs:/tmp) in /usr/local/psa/home/vhosts/owiosa1.nl/subdomains/fearless/httpdocs/forum.php on line 3

Warning: main(../mybb/inc/functions_post.php): failed to open stream: Operation not permitted in /usr/local/psa/home/vhosts/owiosa1.nl/subdomains/fearless/httpdocs/forum.php on line 3

Fatal error: main(): Failed opening required '../mybb/inc/functions_post.php' (include_path='.:/usr/local/psa/apache/share/pear') in /usr/local/psa/home/vhosts/owiosa1.nl/subdomains/fearless/httpdocs/forum.php on line 3
Find all posts by this user
Quote this message in a reply
01-22-2006, 08:31 PM (This post was last modified: 01-22-2006 08:33 PM by mike.cal.)
Post: #40
RE: Displaying News on Homepage
remember that the paths i used where just an example (../mybb/), you need to update it based on your folder structure relative to your script and the forum files.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication