MyBB Community Forums

Full Version: Latest threads/posts on your site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
It has a fixed valua of showing the past ten threads
Hello I badly need this for my website.. But I'm having problem and getting lot's of error. I have some questions that might solve the error that I am getting. I'm not a coder and I'm new in making websites. So pls. guys bear with me if I am not getting it right.


Questions:

1.) Do I need to edit something on the class content?

2.) My forum files is in the the folder "forum" and I put the class content on the root directory where my main website is located. Did I placed the class content on the right folder?

3.) Here's the code that I put on my .php page


<?php
require_once('../MyBBLatest.class.php');
$mybb = new MyBBLatest('forum', 'http://www.mywebsite.com /forum/');
echo $mybb->threads();
echo $mybb->posts();
?>



*Note that this file where I put this code is in a folder called "php-IncludeFiles" where all my php inlclude files is located that's why you'll notice that the diretory in require_once is '../MyBBLatest.class.php'

Is my code correct??


Here is the error that I'm getting


Warning: require_once(../MyBBLatest.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/mydirectory/public_html/mywebsite.com/php-IncludeFiles/ContentRight.php on line 26

Fatal error: require_once() [function.require]: Failed opening required '../MyBBLatest.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydirectory/public_html/mywebsite.com/php-IncludeFiles/ContentRight.php on line 26




What do you think is the problem?
I'm using php5 and MyBB 1.4

thanks in advance!
Quote:No such file or directory
isn't it clear enough? :>
marines sorry.. I'm new to this..

Does it mean that my directory is wrong or class content should also be in "php-IncludeFiles" folder?
you linked to wrong path. you have to give relative path to class file.
Hmm so is should be

require_once('MyBBLatest.class.php');

Am I right marines? I will try this... Thanks!
marines I tried it already. The error is gone but nothing is showing up.

here's the code..

<?php
require_once('MyBBLatest.class.php');
$mybb = new MyBBLatest('forum', 'http://www.mywebsite.com/forum/');
echo $mybb->threads();
echo $mybb->posts();
?>


What do you think is the prob? I also tried putting the class content on the folder where the php pages is located.

Thanks!
Any help here guys?
Hi! This has been working great for my site up until a couple of days ago when it suddenly stopped updating although there have been new discussion at my forums. (site where the snippet is, forums). I'm wondering if this because I just upgraded MyBB and something has been changed that affects the code?
bugzy, it's quite hard to recognize the problem because i don't know the conditions in which the script is running.

Mervi, i've noticed one more occurence of a failure after upgrade to 1.4.6. i have to find out what's wrong.
marines do I need to edit something on the class content?
no, you don't.
Pages: 1 2 3 4 5 6 7